diff --git a/services/portal/home/homeTasks.js b/services/portal/home/homeTasks.js index 067ba845b..92740a42b 100644 --- a/services/portal/home/homeTasks.js +++ b/services/portal/home/homeTasks.js @@ -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); diff --git a/services/portal/studyRegistration/studyRegistrationTasks.js b/services/portal/studyRegistration/studyRegistrationTasks.js index da46ed518..0b53983c8 100644 --- a/services/portal/studyRegistration/studyRegistrationTasks.js +++ b/services/portal/studyRegistration/studyRegistrationTasks.js @@ -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); @@ -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); diff --git a/suites/portal/studyRegistrationTest.js b/suites/portal/studyRegistrationTest.js index f38205e72..b8f856d3d 100644 --- a/suites/portal/studyRegistrationTest.js +++ b/suites/portal/studyRegistrationTest.js @@ -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 @@ -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); @@ -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();