Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qae 222 #37

Open
wants to merge 53 commits into
base: rpmstats
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
321052e
Merge pull request #35 from tidepool-org/rpmstats
brian-tidepool Aug 6, 2024
fdf2c3f
add try catch suppressednotifaction
brian-tidepool Aug 6, 2024
4a8c625
add waitForElementVisible for dateselector
brian-tidepool Aug 7, 2024
0a1cdc4
add idletimeout to prdchrome section nightwatchconf.js
brian-tidepool Aug 7, 2024
cc79a17
troubleshoot timeout 1
brian-tidepool Aug 7, 2024
f4fe1f3
add try catch file exists
brian-tidepool Aug 7, 2024
7b37b5e
return error checkfileexists
brian-tidepool Aug 7, 2024
6b8831a
troubleshoot2
brian-tidepool Aug 7, 2024
c2f9005
increase idle timeout
brian-tidepool Aug 7, 2024
2faf95f
test access custodial user and checks landing page for upload and res…
brian-tidepool Aug 16, 2024
3ab984c
Merge branch 'supressednotificationstest' into qae-222
brian-tidepool Aug 16, 2024
3d3bbf8
add browser quit in catch statement
brian-tidepool Aug 16, 2024
47eaedc
troubleshoot
brian-tidepool Aug 16, 2024
331a0f8
troubleshoot
brian-tidepool Aug 16, 2024
73a3829
fix timeout error
brian-tidepool Aug 16, 2024
80ccd6f
Updated config.yml
brian-tidepool Aug 16, 2024
5260fe3
merge previous changes
brian-tidepool Aug 19, 2024
413cae2
tests for profile page - profile section
brian-tidepool Aug 20, 2024
3f53b41
update profile editing tests
brian-tidepool Aug 20, 2024
a986f76
rename test to include section name profile
brian-tidepool Aug 20, 2024
a5c055a
update accessCustodialUser tests
brian-tidepool Aug 20, 2024
9619963
add assertion for Clinician User Logs in with Existing Credentials
brian-tidepool Aug 20, 2024
86fd865
revert 1200 to 300 timeout
brian-tidepool Aug 20, 2024
a96e129
fix assertion error
brian-tidepool Aug 20, 2024
5fe1caf
function checkFile added to module and imported into rpmstats tests
brian-tidepool Aug 21, 2024
8fbb7be
merge previous changes
brian-tidepool Aug 19, 2024
3cda7e3
tests for profile page - profile section
brian-tidepool Aug 20, 2024
e524b59
update profile editing tests
brian-tidepool Aug 20, 2024
06689ef
rename test to include section name profile
brian-tidepool Aug 20, 2024
c0e38a9
update editcustodialuserprofile tests
brian-tidepool Aug 21, 2024
db7377c
Merge branch 'qae-223' of https://github.com/tidepool-org/WebUITests …
brian-tidepool Aug 21, 2024
3765646
add addtional edit/save steps to ensure new values are checked after …
brian-tidepool Aug 21, 2024
4184268
update bio
brian-tidepool Aug 21, 2024
33d8ee6
update documentation/utilFile function name
brian-tidepool Aug 21, 2024
ce26fd7
update checkfile to checkfileexistence function call
brian-tidepool Aug 21, 2024
5027c9a
update checkfile to checkfileexistence function call
brian-tidepool Aug 21, 2024
86c67da
update documentation/utilFile function name
brian-tidepool Aug 21, 2024
ad1db1b
add await to checkFileExistence callls
brian-tidepool Aug 23, 2024
7f002e6
Update modules/utilFile.js
brian-tidepool Aug 23, 2024
269a314
Merge branch 'qae-222' into qae-223
brian-tidepool Aug 23, 2024
f291027
move assert into callback
brian-tidepool Aug 24, 2024
3d973f8
delete extra empty line
brian-tidepool Aug 24, 2024
c6813ad
fix checkfileexistence fail on first attempt
brian-tidepool Aug 24, 2024
215cff6
debug attempts checkfile
brian-tidepool Aug 24, 2024
0b4887e
debug open file error
brian-tidepool Aug 24, 2024
7541f49
debug error
brian-tidepool Aug 24, 2024
d515ed4
This reverts commit f291027664d15e789451767fbeeff1016b835ac1.
brian-tidepool Aug 24, 2024
02d1f8c
fix errors
brian-tidepool Aug 24, 2024
b8edd6f
add back prdchrome
brian-tidepool Aug 24, 2024
c5bd6fb
add command selectDiagnosesAs
brian-tidepool Aug 25, 2024
b6b1f89
fix selectdiagnoseas error
brian-tidepool Aug 25, 2024
7d1886e
fix edit missing and add implicit waits to prevent not saving values
brian-tidepool Aug 25, 2024
d40f84f
add implicit wait saving too fast
brian-tidepool Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- run:
name: Run Parallel Tests on Chosen Environments
command: npm run << pipeline.parameters.testEnvironment >>
no_output_timeout: 20m
- run:
name: Consolidate Test Report
command: npm run merge-reports
Expand Down
1 change: 1 addition & 0 deletions custom_commands/checkFileContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = class checkFileContents {
resolve(await getFile(fileName));
} catch (error) {
console.error('Error:', error);
browser.quit();
}
}

Expand Down
1 change: 1 addition & 0 deletions custom_commands/checkRPMExportSufficiency.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ module.exports = class checkRPMReportSufficiency {
resolve(await checkSufficiencyResult(filePath));
} catch (error) {
console.error('Error:', error);
browser.quit();
}
}

Expand Down
51 changes: 28 additions & 23 deletions custom_commands/checkSuppressedNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,35 @@ module.exports = class checkSuppressedNotification {
*/
const clinicData = async () => {
const token = await getToken();
const response = await axios.get(`${environment}/v1/clinicians/${clinicianId}/clinics`, {
try {
const response = await axios.get(`${environment}/v1/clinicians/${clinicianId}/clinics`, {

params: {
limit: '1000',
offset: '0',
},
headers: {
authority: this.api.browser_url,
accept: '*/*',
'accept-language': 'en-US,en;q=0.9',
cookie: '_ga=GA1.1.516068539.1692684735; _ga_RWXQ3R57PB=GS1.1.1694192507.4.0.1694192507.0.0.0',
referer: this.api.browser_url,
'sec-ch-ua': '"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
'x-tidepool-session-token': token,
'x-tidepool-trace-session': '92df086f-917e-4df5-b32d-cb30d15df795',
},
});
return response.data;
params: {
limit: '1000',
offset: '0',
},
headers: {
authority: this.api.browser_url,
accept: '*/*',
'accept-language': 'en-US,en;q=0.9',
cookie: '_ga=GA1.1.516068539.1692684735; _ga_RWXQ3R57PB=GS1.1.1694192507.4.0.1694192507.0.0.0',
referer: this.api.browser_url,
'sec-ch-ua': '"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
'x-tidepool-session-token': token,
'x-tidepool-trace-session': '92df086f-917e-4df5-b32d-cb30d15df795',
},
});
return response.data;
} catch (error) {
browser.quit();
return console.error(error);
}
};
/**
* function calls asynchronous function clinicData and awaits for result
Expand Down
1 change: 1 addition & 0 deletions custom_commands/setSuppressedNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = class setSuppressedNotifcation {
);
return response.status;
} catch (error) {
browser.quit();
return console.error(error);
}
};
Expand Down
3 changes: 2 additions & 1 deletion nightwatch.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module.exports = {
resolution: '1366x768',
buildName: `QA2_CHROME ${dayjs().format('YYYY-MM-DD')} JIRA: ${process.env.TEST_EXECUTION_KEY}`,
local: 'false',
idleTimeout: 300,
idleTimeout: 1200,
},
},
},
Expand Down Expand Up @@ -198,6 +198,7 @@ module.exports = {
resolution: '1366x768',
buildName: `PRD_CHROME ${dayjs().format('YYYY-MM-DD')} JIRA: ${process.env.TEST_EXECUTION_KEY}`,
local: 'false',
idleTimeout: 1200,
},
},
},
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
"testqa2ChromeClinician": "nightwatch --env qa2chrome --tag clinician",
"testqa2ChromeNotifications": "nightwatch --env qa2chrome --tag notifications",
"testqa2ChromeRpm": "nightwatch --env qa2chrome --tag rpm2",
"testprdChromeNotifications": "nightwatch --env prd --tag notifications",
"testprdChromeRpm": "nightwatch --env prdchrome --tag rpm2",
"testprdChromeNotifications": "nightwatch --env prdchrome --tag notifications",
"testqa2ChromeTag": "nightwatch --env qa2chrome --tag clinician",
"testCustodial": "nightwatch --env prdchrome,qa2chrome --tag qae222",
"testqa2ChromeCustodial": "nightwatch --env qa2chrome --tag qae222",
"eslint": "eslint .",
"eslint:fix": "eslint . --fix"
},
Expand Down
13 changes: 13 additions & 0 deletions pageobjects/clinicPatientListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ module.exports = {
selector: '//button[@id="timeInRangeFilterConfirm"]',
locateStrategy: 'xpath',
},
row0PatientName: {
selector: '//*[@id="peopleTable-row-0"]//div',
locateStrategy: 'xpath',
},
uploadButton: {
selector: '//*[@class="patientcard-actions-upload" and contains(text(),"Upload")]',
locateStrategy: 'xpath',
},
resendVerificationEmailButton: {
selector: '//button[contains(text(),"RESEND VERIFICATION EMAIL")]',
locateStrategy: 'xpath',
},

},
commands: [{
Expand Down Expand Up @@ -242,6 +254,7 @@ module.exports = {
.click('@rpmReportButton')
.click('@rpmClearDates')
.click('@rpmReportStartDate')
.waitForElementVisible('xpath', `//*[contains(@aria-label,'${date}')]`, browser.globals.elementTimeout)
.click('xpath', `//*[contains(@aria-label,'${date}')]`)
.waitForElementVisible('@rpmReportConfirm', browser.globals.elementTimeout)
.click('@rpmReportConfirm');
Expand Down
29 changes: 29 additions & 0 deletions tests/e2e/accessCustodialUser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-disable linebreak-style */
require('../../utilities/seleniumKeepAlive');

module.exports = {
'@tags': ['qae222', 'clinician', 'parallel'],
'Clinician User Logs in with Existing Credentials'(browser) {
const loginPage = browser.page.loginPage();
const clinicianUsername = browser.globals.clinicianUsername;
const clinicianPassword = browser.globals.clinicianPassword;
loginPage.loadPage();
loginPage.userLogin(clinicianUsername, clinicianPassword);
},
'Clinic workspace selection'(browser) {
const clinicWorkspacePage = browser.page.clinicWorkspacePage();
const clinicWorkspace = clinicWorkspacePage.section.clinicWorkspace;
clinicWorkspace.waitForElementVisible('@title', browser.globals.elementTimeout);
clinicWorkspace.click('@goToWorkspace');
},
'Clinic workspace search custodial user and click patient name'(browser) {
const clinicPatientListPage = browser.page.clinicPatientListPage();
const clinicPatientList = clinicPatientListPage.section.patientList;
clinicPatientList.patientFilterSearch('custodial user');
clinicPatientList.waitForElementVisible('@row0PatientName', browser.globals.elementTimeout);
clinicPatientList.click('@row0PatientName');
clinicPatientList.expect.element('@uploadButton').to.be.present.before(browser.globals.elementTimeout);
clinicPatientList.expect.element('@resendVerificationEmailButton').to.be.present.before(browser.globals.elementTimeout);
},

};
4 changes: 4 additions & 0 deletions tests/e2e/rpmStatsFunctionalityLastUploadFilterAllRanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const written = await browser.checkFileContents(fileName);
Expand Down Expand Up @@ -93,6 +94,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -126,6 +128,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -158,6 +161,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/rpmStatsFunctionalityLastUploadFilterLast14Days.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const written = await browser.checkFileContents(fileName);
Expand Down Expand Up @@ -91,6 +92,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -124,6 +126,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -156,6 +159,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/rpmStatsFunctionalityLastUploadFilterLast2Days.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const written = await browser.checkFileContents(fileName);
Expand Down Expand Up @@ -91,6 +92,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -124,6 +126,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -156,6 +159,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/rpmStatsFunctionalityLastUploadFilterLast30days.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const written = await browser.checkFileContents(fileName);
Expand Down Expand Up @@ -91,6 +92,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -124,6 +126,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -156,6 +159,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/rpmStatsFunctionalityLastUploadFilterToday.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module.exports = {
({
startDate, endDate, startDateFile, endDatefile, fileName,
} = await browser.createDatesLong(start, end));
console.log(`startDate${startDate}`);
console.log(`startDateFile${startDateFile}`);
const attemptsCheckFileExists = 10;
const filePath = './rpm.csv';

Expand All @@ -50,6 +52,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const written = await browser.checkFileContents(fileName);
Expand Down Expand Up @@ -90,6 +93,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -123,6 +127,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down Expand Up @@ -155,6 +160,7 @@ module.exports = {
browser.assert.strictEqual(exists, true, 'exported rpm csv file exists ');
} catch (error) {
console.log(error);
browser.quit();
browser.assert.strictEqual(false, true, 'exported rpm csv file exists ');
}
const sufficient = await browser.checkRPMExportSufficiency(filePath);
Expand Down