From c9c5fe56dc625d26ab464ef1712d1d284d971909 Mon Sep 17 00:00:00 2001 From: Jan Timpe Date: Fri, 20 Dec 2024 11:34:33 -0500 Subject: [PATCH] dynamic user id --- performance-tests/tests/data-files.js | 7 ++++--- performance-tests/utils.js | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/performance-tests/tests/data-files.js b/performance-tests/tests/data-files.js index 99d35650e..cd2e60554 100644 --- a/performance-tests/tests/data-files.js +++ b/performance-tests/tests/data-files.js @@ -43,7 +43,7 @@ const scenarios = { }, api: { exec: 'dataFileApiSubmission', - ...loadProfiles.ramping, + ...loadProfiles.unit, } } @@ -58,13 +58,14 @@ export const options = { }; export const dataFileApiSubmission = async () => { - login() + let res = login() + let userId = res.json().users[0].id const httpCookies = http.cookieJar().cookiesForURL(__ENV.BASE_URL) const body = { file: http.file(file, 'loadtest-file.txt'), original_filename: 'ADS.E2J.FTP2.TS06', - user: 'f94b3a2e-4ee5-4d4b-bab3-20147cb6f480', + user: userId, section: 'Closed Case Data', year: '2021', stt: 4, diff --git a/performance-tests/utils.js b/performance-tests/utils.js index 60ac7f30c..d124bc690 100644 --- a/performance-tests/utils.js +++ b/performance-tests/utils.js @@ -13,6 +13,8 @@ export const login = (username = 'cypress-admin@teamraft.com') => { JSON.stringify(body), { headers: { 'Content-Type': 'application/json' } }, ); + + return res } export const attachAuthCookiesToBrowser = (context) => {