Skip to content

Commit

Permalink
update the test
Browse files Browse the repository at this point in the history
  • Loading branch information
atharvar28 committed Jul 19, 2024
1 parent 0dc723a commit 9df1558
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions services/portal/home/homeTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ module.exports = {
portal.seeProp(homeProps.ready_cue, 60);
},

async handleSystemUsePopup() {
I.saveScreenshot('SystemUsePopup.png');
async handleSystemUsePopup() {;
const acceptButtonExists = await tryTo(() => I.waitForElement(homeProps.systemUseAcceptButton, 5));
output.debug(`Accept button found: ${acceptButtonExists}`);
I.saveScreenshot('SystemUsePopup.png')
if (acceptButtonExists) {
output.debug('Handling popup');
I.scrollIntoView(homeProps.systemUseAcceptButton);
Expand Down
5 changes: 3 additions & 2 deletions services/portal/studyRegistration/studyRegistrationTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = {

fillRequestAccessForm(email, projectTitle) {
I.amOnPage(studyRegistrationProps.requestPath);
I.wait(10)
I.saveScreenshot('FormPage.png');
I.seeElement(studyRegistrationProps.formPage);
I.waitForValue(studyRegistrationProps.projectTitle, projectTitle, 5);
Expand All @@ -77,14 +78,14 @@ module.exports = {
I.click(studyRegistrationProps.registerStudyButton);
},

async fillRegistrationForm(uuid, studyName) {
async fillRegistrationForm(uuid, studyTitle) {
I.amOnPage(studyRegistrationProps.registerPath);
I.seeElement(studyRegistrationProps.registerForm);
const study = await I.grabAttributeFrom(studyRegistrationProps.studyTitle, 'title');
if (process.env.DEBUG === 'true') {
console.log(`### StudyTitle Retrieved: ${study}`);
}
expect(study).to.be.equal(studyName);
expect(study).to.be.equal(studyTitle);
I.fillField(studyRegistrationProps.cedarUUID, uuid);
I.saveScreenshot('registerCedarID.png');
I.click(studyRegistrationProps.registerSubmitButton);
Expand Down
10 changes: 7 additions & 3 deletions suites/portal/studyRegistrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ Scenario('Register a new study registration', async ({ I, mds, users, home, disc
// updating the studyMetadata with values
studyMetadata.gen3_discovery.appl_id = I.cache.applicationID;
studyMetadata.gen3_discovery[UIDFieldName] = I.cache.applicationID;
const nihApplID = studyMetadata.gen3_discovery.study_metadata.metadata_location.nih_application_id
const projectTitle = studyMetadata.gen3_discovery.project_title;
const projectNumber = studyMetadata.gen3_discovery.project_number;
const studyName = studyMetadata.gen3_discovery.study_metadata.minimal_info.study_name;

const accessProjectTitle = `${studyName} - ${projectNumber}`

// step 1 : create a dummy metadata record
// create a metadata record
Expand Down Expand Up @@ -89,7 +93,7 @@ Scenario('Register a new study registration', async ({ I, mds, users, home, disc
// request access to register study by filling the registration form
studyRegistration.do.searchStudy(I.cache.applicationID);
I.click(studyRegistration.props.requestAccessButton);
await studyRegistration.do.fillRequestAccessForm(users.user2.username, projectTitle);
await studyRegistration.do.fillRequestAccessForm(users.user2.username, accessProjectTitle);
// I.click(studyRegistration.props.goToDiscoverPageButton);
// get request ID by sending request to requestor end point
I.cache.requestID = await studyRegistration.do.getRequestId(users.user2.accessTokenHeader);
Expand All @@ -114,8 +118,8 @@ Scenario('Register a new study registration', async ({ I, mds, users, home, disc
if (process.env.DEBUG === 'true') {
console.log(`###CEDAR UUID: ${cedarUUID}`);
};
const studyName = `${projectNumber} : ${projectTitle} : ${I.cache.applicationID}`;
await studyRegistration.do.fillRegistrationForm(cedarUUID, studyName);
const studyTitle = `${projectNumber} : TEST : ${nihApplID}`;
await studyRegistration.do.fillRegistrationForm(cedarUUID, studyTitle);

// run aggMDS sync job after sending CEDAR request
await mds.do.reSyncAggregateMetadata();
Expand Down

0 comments on commit 9df1558

Please sign in to comment.