From 7ad415260ebf3e271525038770e7fc9bb9beb81a Mon Sep 17 00:00:00 2001 From: Atharva Rane <41084525+atharvar28@users.noreply.github.com> Date: Mon, 22 Jul 2024 20:05:20 -0400 Subject: [PATCH 01/13] Update study registration tests (#1046) * update system pop handling * update the test --- services/portal/home/homeProps.js | 2 +- services/portal/home/homeTasks.js | 4 ++-- .../portal/studyRegistration/studyRegistrationTasks.js | 5 +++-- suites/portal/studyRegistrationTest.js | 10 +++++++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/services/portal/home/homeProps.js b/services/portal/home/homeProps.js index d7cd1ddc9..8af32e249 100644 --- a/services/portal/home/homeProps.js +++ b/services/portal/home/homeProps.js @@ -35,6 +35,6 @@ module.exports = { }, systemUseAcceptButton: { - xpath: '//div[@id="popup"]//button[contains(text(), "Accept")]', + xpath: '//div[@class="popup__foot"]//button[contains(text(), "Accept")]', }, }; 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(); From e53ac2ec81afb28aeba8649b626e766ec6b80405 Mon Sep 17 00:00:00 2001 From: Hara Prasad Date: Fri, 26 Jul 2024 10:10:58 -0700 Subject: [PATCH 02/13] Fix pfbExportTest (#1047) * Fix pfbExportTest * Update pfbExportTest.js * Update pfbExportTest.js --- suites/portal/pfbExportTest.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/suites/portal/pfbExportTest.js b/suites/portal/pfbExportTest.js index fea440e40..99b95ae7d 100644 --- a/suites/portal/pfbExportTest.js +++ b/suites/portal/pfbExportTest.js @@ -53,7 +53,7 @@ BeforeSuite(async ({ I }) => { // if this is running against an Anvil DD, sequencing must be used // TODO: Look into reusing the leafNode logic from jenkins-simulate-data.sh // eslint-disable-next-line no-nested-ternary - const targetMappingNode = I.cache.testedEnv.includes('anvil') ? 'sequencing' : I.cache.testedEnv.includes('vpodc') ? 'unaligned_reads_file' : 'submitted_unaligned_reads'; + const targetMappingNode = I.cache.testedEnv.includes('vpodc') ? 'unaligned_reads_file' : 'sequencing'; I.cache.targetMappingNode = targetMappingNode; @@ -415,7 +415,7 @@ Scenario('Install the latest pypfb CLI version and make sure we can parse the av // the previous test did not create it expect(files.fileExists(`./test_export_${I.cache.UNIQUE_NUM}.avro`), 'A "test_export_.avro" file should have been created by previous test').to.be.true; - const pyPfbInstallationOutput = await bash.runCommand(`python3.8 -m venv pfb_test && source pfb_test/bin/activate && pip install --upgrade pip && pip install pypfb && ${I.cache.WORKSPACE}/gen3-qa/pfb_test/bin/pfb`); + const pyPfbInstallationOutput = await bash.runCommand(`python3.9 -m venv pfb_test && source pfb_test/bin/activate && pip install --upgrade pip && pip install pypfb && ${I.cache.WORKSPACE}/gen3-qa/pfb_test/bin/pfb`); if (process.env.DEBUG === 'true') { console.log(`${new Date()}: pyPfbInstallationOutput = ${pyPfbInstallationOutput}`); } @@ -438,10 +438,6 @@ Scenario('Install the latest pypfb CLI version and make sure we can parse the av const itDDNodesSet = ddNodesSet.values(); expect(itDDNodesSet.next().value).to.equal('program'); expect(itDDNodesSet.next().value).to.equal('project'); - if (I.cache.testedEnv.includes('anvil')) { - expect(itDDNodesSet.next().value).to.equal('subject'); - } else { - expect(itDDNodesSet.next().value).to.equal('study'); - } + expect(itDDNodesSet.next().value).to.equal('subject'); // TODO: Refine cohort later and make sure the selected projects show up in the PFB file }).retry(2); From c34c03d1e9f9a5ea059be1802f1020ad09c26367 Mon Sep 17 00:00:00 2001 From: Atharva Rane <41084525+atharvar28@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:55:31 -0400 Subject: [PATCH 03/13] Chore/fix pfbexport test (#1048) * update pre-release numbering * Revert "update pre-release numbering" This reverts commit 91765834449663acf01ae812237684d660cd1add. * fix pfbExport test * update expect stmt * special handling for anvil manifest PRs --------- Co-authored-by: Hara Prasad Juvvala --- suites/portal/pfbExportTest.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/suites/portal/pfbExportTest.js b/suites/portal/pfbExportTest.js index 99b95ae7d..cf73eb678 100644 --- a/suites/portal/pfbExportTest.js +++ b/suites/portal/pfbExportTest.js @@ -53,7 +53,12 @@ BeforeSuite(async ({ I }) => { // if this is running against an Anvil DD, sequencing must be used // TODO: Look into reusing the leafNode logic from jenkins-simulate-data.sh // eslint-disable-next-line no-nested-ternary - const targetMappingNode = I.cache.testedEnv.includes('vpodc') ? 'unaligned_reads_file' : 'sequencing'; + let targetMappingNode; + if (process.env.REPO === 'cdis-manifest' || process.env.REPO === 'gitops-qa') { + targetMappingNode = I.cache.testedEnv.includes('anvil') ? 'sequencing' : I.cache.testedEnv.includes('vpodc') ? 'unaligned_reads_file' : 'submitted_unaligned_reads'; + } else { + targetMappingNode = I.cache.testedEnv.includes('vpodc') ? 'unaligned_reads_file' : 'sequencing'; + } I.cache.targetMappingNode = targetMappingNode; @@ -438,6 +443,16 @@ Scenario('Install the latest pypfb CLI version and make sure we can parse the av const itDDNodesSet = ddNodesSet.values(); expect(itDDNodesSet.next().value).to.equal('program'); expect(itDDNodesSet.next().value).to.equal('project'); - expect(itDDNodesSet.next().value).to.equal('subject'); + if (process.env.REPO === 'cdis-manifest' || process.env.REPO === 'gitops-qa') { + if (I.cache.testedEnv.includes('anvil')) { + expect(itDDNodesSet.next().value).to.equal('subject'); + } else { + expect(itDDNodesSet.next().value).to.equal('study'); + } + } else { + expect(itDDNodesSet.next().value).to.equal('subject'); + } + + // TODO: Refine cohort later and make sure the selected projects show up in the PFB file }).retry(2); From 42329af88ed8353c773745603af64ca662b7cc5c Mon Sep 17 00:00:00 2001 From: Hara Prasad Date: Wed, 7 Aug 2024 10:25:04 -0700 Subject: [PATCH 04/13] Fix/recreate automated copy img (#1050) * set github username and token when cloning the repo * fail jenkins job if any of the steps go wrong * git pull fast forward only * merge only --------- Co-authored-by: Marcelo Costa --- ...reate-testing-image-for-external-contributors.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/files/jenkins-job-create-testing-image-for-external-contributors.sh b/files/jenkins-job-create-testing-image-for-external-contributors.sh index 3a9206baa..51e7d5dcb 100644 --- a/files/jenkins-job-create-testing-image-for-external-contributors.sh +++ b/files/jenkins-job-create-testing-image-for-external-contributors.sh @@ -1,12 +1,16 @@ #!/bin/bash +set -x +set -e + # This automation is required so Gen3 Engineering can produce a copy of a branch from a forked-repo # and trigger a Quay image build that is utilized in our CI Pipeline. git config --global user.email "cdis@uchicago.edu" git config --global user.name "$GITHUB_USERNAME" -OUR_REMOTE_URL="https://github.com/uc-cdis/${OUR_GEN3_SERVICE_REPO_NAME}" +URL_PREFIX="https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/uc-cdis/" +OUR_REMOTE_URL="${URL_PREFIX}${OUR_GEN3_SERVICE_REPO_NAME}" echo "cloning $OUR_REMOTE_URL..." git clone $OUR_REMOTE_URL @@ -18,15 +22,19 @@ cd $OUR_GEN3_SERVICE_REPO_NAME ls -ilha +set +e # delete branch if it already exists branch_exists=$(git ls-remote --heads ${OUR_REMOTE_URL}.git automatedCopy-$NAME_OF_THE_BRANCH) +set -e if [[ -z $branch_exists ]]; then echo "git ls-remote output empty. The branch does not exist." else echo "WARN: git ls-remote output is NOT empty." echo " Deleting the existing automatedCopy branch to create a new copy based on new changes from the forked-repo branch..." + set +e git branch -D automatedCopy-$NAME_OF_THE_BRANCH + set -e git push origin --delete automatedCopy-$NAME_OF_THE_BRANCH fi @@ -37,10 +45,9 @@ echo "changing origin to pull changes from external repo: https://${EXTERNAL_REP git remote set-url origin https://${EXTERNAL_REPO_REMOTE_URL} echo "pulling changes from external branch $NAME_OF_THE_BRANCH" -git pull origin $NAME_OF_THE_BRANCH +git pull origin $NAME_OF_THE_BRANCH --no-rebase echo "restore original origin $OUR_REMOTE_URL" -URL_PREFIX="https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/uc-cdis/" git remote set-url origin ${URL_PREFIX}${OUR_GEN3_SERVICE_REPO_NAME}.git echo "finish branch cloning process but pushing local changes to our repo's branch." From 3d16fe445bebeb433ce5b1313fd5785feadeda55 Mon Sep 17 00:00:00 2001 From: Atharva Rane <41084525+atharvar28@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:31:00 -0400 Subject: [PATCH 05/13] do not skip pfbexport test if repo is gitops-qa (#1051) --- run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tests.sh b/run-tests.sh index ccb8bd0d3..92a93779b 100644 --- a/run-tests.sh +++ b/run-tests.sh @@ -527,7 +527,7 @@ elif ! (g3kubectl get pods --no-headers -l app=hatchery | grep hatchery) > /dev/ donot '@exportToWorkspacePortalHatchery' fi -if [[ "$service" == "pelican" || "$service" == "tube" || "$service" == "cdis-manifest" || "$service" == "gen3-qa" ]]; then +if [[ "$service" == "pelican" || "$service" == "tube" || "$service" == "cdis-manifest" || "$service" == "gen3-qa" || "$service" == "gitops-qa" ]]; then echo "Running pfbExportTest since repo is $service" else echo "Skipping pfbExportTest since repo is $service" From f8b57de4151c31db6b53185d8b2c7e0fa88a740e Mon Sep 17 00:00:00 2001 From: Hara Prasad Date: Wed, 7 Aug 2024 15:57:03 -0700 Subject: [PATCH 06/13] Run frontend-framework tests only in HEAL PRs (#1052) --- suites/portal/gen3ffLandingPageTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suites/portal/gen3ffLandingPageTest.js b/suites/portal/gen3ffLandingPageTest.js index 1f02d74bd..9e8dafab8 100644 --- a/suites/portal/gen3ffLandingPageTest.js +++ b/suites/portal/gen3ffLandingPageTest.js @@ -1,7 +1,7 @@ const I = actor(); I.cache = {}; -Feature('Gen3 FF Landing Page @requires-portal @requires-frontend-framework'); +Feature('Gen3 FF Landing Page @requires-portal @requires-frontend-framework @heal'); Scenario('Home page redirects to landing page', async ({ gen3ffLandingPage }) => { I.amOnPage('/'); From 715150b129bb5e18d197bbfbc3cb952ee7c63efa Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre <4224001+paulineribeyre@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:39:33 -0500 Subject: [PATCH 07/13] BIH-39 Fix submit tests for BIH (#1053) --- utils/nodes.js | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/utils/nodes.js b/utils/nodes.js index 26d57e9ee..ce989a9df 100644 --- a/utils/nodes.js +++ b/utils/nodes.js @@ -23,7 +23,6 @@ class Node { * @param {Object} props.data - JSON object of node data * @param {number} props.order - Sort index * @param {string} props.category - Category of the node (e.g. file, clinical, administrative...) - * @param {string[]} props.target - Array of names of nodes this node points to in graph * @param {Object} props.orig_props - Copy of props for cloning node properties */ constructor(props) { @@ -31,7 +30,6 @@ class Node { this.order = props.order; this.category = props.category; this.name = props.name; - this.target = props.target; this.orig_props = props; } @@ -77,7 +75,6 @@ const getAllNodes = function () { const nodesDict = {}; try { let order = 1; - let target = 'project'; // first node (project) is related to program for (const line of lines) { const parts = line.split('\t'); const nodeName = parts[0]; @@ -89,9 +86,7 @@ const getAllNodes = function () { order, category: parts[1], name: nodeName, - target, }); - target = nodeName; order += 1; } return nodesDict; @@ -117,27 +112,6 @@ const cloneNodes = function (originalNodes) { return newNodes; }; -/** - * Uses BFS to find a path to project node from given starting node - * @param {string} startNodeName - node to start search from - * @param {Object} allNodes - Nodes keyed by node name - */ -const nodePathToProject = function (startNodeName, allNodes) { - // BFS to find path to project from a starting node name - // returns a dict containing nodes keyed by name - const nodesInPath = {}; - let que = [startNodeName]; - while (que.length > 0) { - const s = que.pop(); - if (s === 'project') { - break; - } - nodesInPath[s] = allNodes[s]; - que = allNodes[s].target.concat(que); - } - return nodesInPath; -}; - /** * Finds a file node and gets a path to the project node * @param {Object} allNodes - Nodes keyed by node name @@ -145,7 +119,7 @@ const nodePathToProject = function (startNodeName, allNodes) { */ const getPathWithFileNode = function (allNodes) { const allNodesClone = cloneNodes(allNodes); - const fileNodeName = Object.keys(allNodesClone).find( + const fileNodeName = Object.keys(allNodesClone).findLast( (nodeName) => allNodesClone[nodeName].category.includes('_file'), ); const file = allNodesClone[fileNodeName].clone(); From a37f66363baaa7bab37d7ba4b25bd3edd81d37d8 Mon Sep 17 00:00:00 2001 From: Hara Prasad Date: Thu, 29 Aug 2024 09:04:51 -0500 Subject: [PATCH 08/13] Run indexing page tests for fence PRs (#1054) --- suites/portal/indexingPageTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suites/portal/indexingPageTest.js b/suites/portal/indexingPageTest.js index 32fc8bff3..37df586fb 100644 --- a/suites/portal/indexingPageTest.js +++ b/suites/portal/indexingPageTest.js @@ -6,7 +6,7 @@ within the sower config block (manifest-indexing & indexd-manifest) 3. The Indexing GUI is only available in data-portal >= 2.24.9 */ -Feature('Indexing GUI @requires-portal @requires-sower @requires-ssjdispatcher'); +Feature('Indexing GUI @requires-portal @requires-sower @requires-ssjdispatcher @requires-fence'); const { expect } = require('chai'); const { checkPod, sleepMS } = require('../../utils/apiUtil.js'); From 582f6db21fb1a6aa0d92c864499d99eb155c0e7d Mon Sep 17 00:00:00 2001 From: Krishna Agarwal <159047652+krishnaa05@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:46:13 -0500 Subject: [PATCH 09/13] GWAS Monthly Workflow Limit (#1055) * GWAS Monthly Workflow Limit * Update GWASUIAppTest.js * Update GWASUIAppTest.js --- suites/portal/GWASUIAppTest.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/suites/portal/GWASUIAppTest.js b/suites/portal/GWASUIAppTest.js index c5a0aa70c..c1b6b9c2f 100644 --- a/suites/portal/GWASUIAppTest.js +++ b/suites/portal/GWASUIAppTest.js @@ -276,3 +276,24 @@ Scenario('Unauthorized access to GWAS @GWASUI', async ({ gwas.do.goToAnalysisPage(); gwas.do.unauthorizedUserSelectTeamProject(); }); + + +// TODO : Add/Update existing test cases for "Monthly Workflow Limit" +// Test Case 1: On GWAS workflow submission, "Monthly Workflow Limit" increases by 1 +// 1. Log into application using main_account user. +// 2. Goto /analysis/GWASUIApp endpoint. +// 3. Submit the GWAS wokflow. +// 4. Validate the "Monthly Workflow Limit" is increased by 1. + +// Test Case 2: User fails to submit GWAS workflow once "Monthly Workflow Limit" is maxed out +// 1. Log into application using main_account user. +// 2. Goto /analysis/GWASUIApp endpoint. +// 3. Verify the "Monthly Workflow Limit" is maxed out. +// 4. Submit the GWAS wokflow. +// 5. Validate an the workflow submission fails. + +// Test Case 3: Validate the "Monthly Workflow Limit" on GWAS Apps is same as GWAS result +// 1. Log into application using main_account user. +// 2. Goto /analysis/GWASUIApp endpoint. +// 3. Submit the GWAS wokflow. +// 4. Validate the "Monthly Workflow Limit" is the same in GWAS result (/analysis/GWASResults endpoint) From b090194477794c168ddd3001d38d982c1eb45393 Mon Sep 17 00:00:00 2001 From: Krishna Agarwal <159047652+krishnaa05@users.noreply.github.com> Date: Tue, 8 Oct 2024 17:33:22 -0500 Subject: [PATCH 10/13] Update oidcClientTest.js (#1056) * Update oidcClientTest.js * import sleepms --------- Co-authored-by: Hara Prasad --- suites/apis/oidcClientTest.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/suites/apis/oidcClientTest.js b/suites/apis/oidcClientTest.js index 19e58aa50..6af01d446 100644 --- a/suites/apis/oidcClientTest.js +++ b/suites/apis/oidcClientTest.js @@ -4,6 +4,7 @@ const { expect } = require('chai'); const { Bash } = require('../../utils/bash.js'); const { checkPod, runUserSync, getAccessTokenHeader } = require('../../utils/apiUtil.js'); const { Client } = require('../../services/apis/fence/fenceProps.js'); +const { sleepMS } = require('../../utils/apiUtil.js'); const bash = new Bash(); @@ -87,6 +88,8 @@ Scenario('OIDC Client Rotation @clientRotation @requires-indexd', async ({ I, fe // to run usersync here now that the client has been created await runUserSync(); await checkPod(I, 'usersync', 'gen3job,job-name=usersync'); + // wait for 10secs after usersync + await sleepMS(10000); // check that both sets of credentials work: // - we can get an access token using the creds From f5129107ddf1e2fb09821d7e2144af93789576b4 Mon Sep 17 00:00:00 2001 From: Hara Prasad Date: Mon, 25 Nov 2024 16:45:18 -0600 Subject: [PATCH 11/13] Fix pfb export test for navbar changes (#1060) --- suites/portal/pfbExportTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suites/portal/pfbExportTest.js b/suites/portal/pfbExportTest.js index cf73eb678..12a3cefce 100644 --- a/suites/portal/pfbExportTest.js +++ b/suites/portal/pfbExportTest.js @@ -322,7 +322,7 @@ Scenario('Visit the Explorer page, select a cohort, export to PFB and download t login.complete.login(users.mainAcct); I.wait(5); I.saveScreenshot('before_checking_navbar.png'); - const navBarButtons = await I.grabTextFromAll({ xpath: 'xpath: //nav[@class=\'nav-bar__nav--items\']//div/a/descendant-or-self::*' }); + const navBarButtons = await I.grabTextFromAll({ xpath: 'xpath: //div[@class=\'nav-bar__nav--items\']//div/a/descendant-or-self::*' }); if (navBarButtons.includes('Exploration')) { I.amOnPage('explorer'); From 3df3ef735ee25943ad446ce2780bcf740c2751e1 Mon Sep 17 00:00:00 2001 From: Hara Prasad Date: Tue, 3 Dec 2024 09:50:44 -0600 Subject: [PATCH 12/13] Fix/discoverypagetestdata (#1061) * Fix discovery page test data * wait longer for study to show up on page * try waiting for 2 minutes before launching discovery page * fix data * retrying study lookup * fix retry * fix retry * fix * fix * fix data --- .../portal/discovery/discoveryQuestions.js | 25 +- suites/apis/aggMDSTest.js | 1 - suites/portal/discoveryPageTest.js | 16 +- test-data/aggMDSTest/study1.json | 9 +- test-data/aggMDSTest/study2.json | 329 +++++------------- test-data/aggMDSTest/study3.json | 158 --------- 6 files changed, 122 insertions(+), 416 deletions(-) delete mode 100644 test-data/aggMDSTest/study3.json diff --git a/services/portal/discovery/discoveryQuestions.js b/services/portal/discovery/discoveryQuestions.js index b23ca2edc..90240e4ab 100644 --- a/services/portal/discovery/discoveryQuestions.js +++ b/services/portal/discovery/discoveryQuestions.js @@ -1,4 +1,6 @@ +const { sleepMS } = require('../../../utils/apiUtil.js'); const props = require('./discoveryProps.js'); +const tasks = require('./discoveryTasks.js'); const I = actor(); @@ -11,7 +13,26 @@ module.exports = { I.seeElement(props.readyCue, 30); }, - isStudyFound(studyId) { - I.seeElement(props.studyLocator(studyId), 30); + async isStudyFound(studyId) { + const retries = 10; // Number of retries + const delayInMs = 30000; // Delay between retries in milliseconds + + for (let attempt = 1; attempt <= retries; attempt++) { + const visibleElements = await I.grabNumberOfVisibleElements(props.studyLocator(studyId)); + + if (visibleElements > 0) { + console.log(`Study found on attempt ${attempt}`); + return true; // Exit the loop if the element is found + } else { + console.log(`Attempt ${attempt} failed. Retrying in ${delayInMs / 1000} seconds...`); + if (attempt < retries) { + await sleepMS(delayInMs); // Wait before retrying + tasks.goToPage(); // Refresh discovery page + } else { + console.error('Study not found after maximum retries.'); + throw new Error('Study not found.'); + } + } + } }, }; diff --git a/suites/apis/aggMDSTest.js b/suites/apis/aggMDSTest.js index 5f91fd2b8..be9e078a8 100644 --- a/suites/apis/aggMDSTest.js +++ b/suites/apis/aggMDSTest.js @@ -21,7 +21,6 @@ I.cache = {}; const testDataFiles = new DataTable(['studyFilePath']); testDataFiles.add(['test-data/aggMDSTest/study1.json']); testDataFiles.add(['test-data/aggMDSTest/study2.json']); -testDataFiles.add(['test-data/aggMDSTest/study3.json']); Data(testDataFiles).Scenario('Create, edit and delete aggregate metadata record', async ({ mds, users, current, diff --git a/suites/portal/discoveryPageTest.js b/suites/portal/discoveryPageTest.js index 39f80b9f9..6f020dc83 100644 --- a/suites/portal/discoveryPageTest.js +++ b/suites/portal/discoveryPageTest.js @@ -4,6 +4,7 @@ const { expect } = require('chai'); const { output } = require('codeceptjs'); const { Bash } = require('../../utils/bash.js'); const fs = require('fs'); +const { sleepMS } = require('../../utils/apiUtil.js'); const bash = new Bash(); const I = actor(); @@ -86,7 +87,7 @@ Scenario('Publish a study, search and export to workspace @requires-indexd @requ output.print('--- Perform tag search'); discovery.do.tagSearch('TESTING', 'AUTOTEST Tag'); I.saveScreenshot('2_clicked_tag.png'); - discovery.ask.isStudyFound(I.cache.studyId); + await discovery.ask.isStudyFound(I.cache.studyId); // Advanced search // I.refreshPage(); @@ -100,24 +101,23 @@ Scenario('Publish a study, search and export to workspace @requires-indexd @requ I.wait(2); discovery.do.textSearch('[AUTOTEST Title]'); I.saveScreenshot('4_entered_text.png'); - discovery.ask.isStudyFound(I.cache.studyId); + await discovery.ask.isStudyFound(I.cache.studyId); output.print('--- Perform text search'); I.refreshPage(); I.wait(2); discovery.do.textSearch('[AUTOTEST Summary]'); I.saveScreenshot('5_entered_text.png'); - discovery.ask.isStudyFound(I.cache.studyId); + await discovery.ask.isStudyFound(I.cache.studyId); output.print('--- Open study in workspace'); discovery.do.openInWorkspace(I.cache.studyId); I.saveScreenshot('6_open_in_workspace.png'); I.waitInUrl('/workspace', 120); - // --- Disabled the validation since workspaces are failing to launch in jenkins envs --- - // await workspace.do.launchWorkspace('(Tutorial) Bacpac Synthetic Data Analysis Notebook'); + await workspace.do.launchWorkspace('(Tutorial) Bacpac Synthetic Data Analysis Notebook'); - // output.print('--- Run `gen3 drs-pull object` in a new Python3 notebook'); - // await workspace.do.runCommandinPythonNotebook(`!gen3 drs-pull object --object_id ${I.cache.did}`); - // I.saveScreenshot('7_run_drs_pull_in_notebook.png'); + output.print('--- Run `gen3 drs-pull object` in a new Python3 notebook'); + await workspace.do.runCommandinPythonNotebook(`!gen3 drs-pull object --object_id ${I.cache.did}`); + I.saveScreenshot('7_run_drs_pull_in_notebook.png'); }); diff --git a/test-data/aggMDSTest/study1.json b/test-data/aggMDSTest/study1.json index e2ac516d8..265c460ff 100644 --- a/test-data/aggMDSTest/study1.json +++ b/test-data/aggMDSTest/study1.json @@ -7,12 +7,11 @@ }], "authz": "/open", "sites": 3, - "summary": "[AUTOTEST Summary] The BACPAC Research Program, Data Integration, Algorithm Development, and Operations Management Center (DAC) will bring cohesion to research performed by the participating Mechanistic Research Centers, Technology Research Sites, and Phase 2 Clinical Trials Centers. DAC Investigators will share their vision and provide scientific leadership and organizational support to the BACPAC Consortium. The research plan consists of supporting design and conduct of clinical trials with precision interventions that focus on identifying the best treatments for individual patients. The DAC will enhance collaboration and research progress with experienced leadership, innovative design and analysis methodologies, comprehensive research operations support, a state-of-the-art data management and integration system, and superior administrative support. This integrated structure will set the stage for technology assessments, solicitation of patient input and utilities, and the evaluation of high-impact interventions through the innovative design and sound execution of clinical trials, leading to effective personalized treatment approaches for patients with chronic lower back pain.", + "summary": "[AUTOTEST Summary] Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim", "location": "Chapel Hill, Nc", "subjects": 150, "__manifest": [], "study_name": "BACPAC Research Consortium", - "study_type": "Other", "institutions": "University Of North Carolina Chapel Hill", "year_awarded": 2019, "investigators": "Love, Pascale", @@ -24,6 +23,12 @@ "key": "Research Focus Area", "value": "AUTOTEST Filter" }], + "minimal_info": { + "study_name": "[AUTOTEST Title] Testing Aggregate Metadata Service", + "study_description": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim", + "alternative_study_name": "Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu", + "alternative_study_description": "In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim." + }, "research_program": "Back Pain Consortium Research Program", "research_question": "To inform a precision medicine approach to cLBP.", "study_description": "Observational", diff --git a/test-data/aggMDSTest/study2.json b/test-data/aggMDSTest/study2.json index 868ee37f8..d48b2330e 100644 --- a/test-data/aggMDSTest/study2.json +++ b/test-data/aggMDSTest/study2.json @@ -1,247 +1,86 @@ { - "_guid_type": "discovery_metadata", - "gen3_discovery": { - "Data": { - "data_type": [], - "data_source": [], - "data_orientation": [], - "subject_data_level_available": [], - "subject_data_unit_of_analysis": [], - "subject_data_unit_of_collection": [], - "subject_geographic_data_level_available": [], - "subject_geographic_data_level_collected": [], - "subject_data_unit_of_analysis_expected_number": "", - "subject_data_unit_of_collection_expected_number": "" - }, - "tags": [ + "_guid_type": "discovery_metadata", + "gen3_discovery": { + "tags": [ { - "name": "Novel Medications", - "category": "Intervention/Treatment" - }, - { - "name": "Medication", - "category": "Other" - }, - { - "name": "Respiratory Depression", - "category": "Other" - }, - { - "name": "Opioid Use Disorder", - "category": "Substance Use" - }, - { - "name": "Craving", - "category": "Other" - }, - { - "name": "Medication Intervention", - "category": "Other" - }, - { - "name": "New Formulations Of Existing Interventions", - "category": "Other" - }, - { - "name": "Relapse", - "category": "Other" - }, - { - "name": "Overdose", - "category": "Substance Use" - }, - { - "name": "Chronic Use", - "category": "Substance Use" - }, - { - "name": "Opioid Use", - "category": "Substance Use" - }, - { - "name": "Withdrawal", - "category": "Substance Use" - } - ], - "authz": "", - "terms": "<5HT><5-Hydroxytryptamine><5-HT><4-methoxycarbonylfentanyl><4-methoxycarbonyl fentanyl><-OR>< opioid receptors><5-HT2A Receptor><5-HT(2A) Receptor><5-Hydroxytryptamine Receptor 2A Gene><5-Hydroxytryptamine Receptor 2A><5-Hydroxytryptamine (Serotonin) Receptor 2A Gene><5-HT2A><5-HT-2A Gene>", - "is_new": "False", - "appl_id": 9999009999, - "full_foa": "AAA-ZZ-00-999", - "phr_text": "Project Narrative. Intra-Cellular Therapies, Inc. (ITI), has a biotechnology platform that has enabled discovery of innovative. pharmaceutical therapies for CNS disorders based on intracellular signaling. In this project, we propose to. develop a novel, small molecule, ITI-333, as a safe, brain-penetrant drug targeting molecular pathways in the. brain implicated in the development of opioid-use disorders. Here, we present a clinical development plan. designed to advance ITI-333 through human clinical evaluation as a medication for the treatment of opioid. withdrawal and relapse and as an aid for the treatment of co-morbid symptoms of depression and anxiety in. individuals withdrawing from opioids.. PHS 398/2590 (Rev. 06/09) Page Continuation Format Page", - "cfda_code": "279", - "cong_dist": "NY-12", - "is_active": "False", - "Study Type": { - "study_stage": "", - "study_type_design": [], - "study_subject_type": [], - "study_primary_or_secondary": "", - "study_observational_or_experimental": "" - }, - "__manifest": [], - "award_type": "1", - "budget_end": "2021-06-30T12:06:00Z", - "date_added": "2019-01-05T07:01:48Z", - "pref_terms": "Acute;Adverse event;Affinity;Agonist;Animals;Anxiety;Binding;Biological Products;Biotechnology;Brain;Central Nervous System Diseases;Clinical;Clinical Paths;Clinical Research;Clinical Trials;Collaborations;Conduct Clinical Trials;Data;Development;Development Plans;Dopamine;Dopamine D1 Receptor;Dose;Dose-Limiting;Double-Blind Method;Drug Kinetics;Exhibits;Fentanyl;Formulation;Funding;Future;Goals;Grant;HTR2A gene;Heroin;Heroin Users;Human;Image;Individual;Inpatients;Maintenance;Maximum Tolerated Dose;Modeling;Morphine;National Institute of Drug Abuse;Opiate Addiction;Opioid;Opioid Antagonist;Opioid Receptor;Opioid agonist;Opioid user;Outcome;Overdose;Parents;Pathway interactions;Patients;Pharmaceutical Preparations;Pharmacologic Substance;Pharmacology;Phase;Placebos;Plasma;Positron;Precipitation;Principal Investigator;Regimen;Relapse;Research Personnel;Route;Safety;Serotonin;Serotonin Receptor 5-HT2A;Signal Transduction;Therapeutic;Therapeutic Index;Therapeutic Uses;Toxicology;Withdrawal;associated symptom;base;carfentanil;clinical development;depressive symptoms;design;effective therapy;first-in-human;healthy volunteer;illicit opioid;in vivo;innovation;molecular drug target;mu opioid receptors;novel;opioid abuse;opioid use;opioid use disorder;opioid withdrawal;phase 2 study;prescription opioid;prevent;programs;radioligand;receptor;research clinical testing;small molecule;symptom treatment;volunteer", - "repository": "", - "agency_code": "NIH", - "arra_funded": "N", - "Minimal Info": { - "alternative_study_name": "", - "alternative_study_description": "" - }, - "award_amount": "3249130", - "budget_start": "2019-01-01T12:01:00Z", - "institutions": "ICT INC.", - "year_awarded": "2019", - "abstract_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Massa eget egestas purus viverra. Rutrum quisque non tellus orci ac auctor augue mauris. Neque convallis a cras semper auctor neque. In hac habitasse platea dictumst. Integer enim neque volutpat ac. Vitae auctor eu augue ut lectus arcu. Morbi enim nunc faucibus a pellentesque. Purus gravida quis blandit turpis. Malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. At erat pellentesque adipiscing commodo elit at imperdiet dui accumsan. Consectetur lorem donec massa sapien. Aliquam nulla facilisi cras fermentum odio eu feugiat pretium nibh. Ullamcorper sit amet risus nullam eget. Netus et malesuada fames ac. Eros in cursus turpis massa tincidunt dui ut ornare. Faucibus vitae aliquet nec ullamcorper sit amet. Mauris a diam maecenas sed enim ut. Eget egestas purus viverra accumsan in nisl nisi. Nibh sed pulvinar proin gravida hendrerit. Placerat in egestas erat imperdiet sed euismod nisi. Dictum fusce ut placerat orci nulla pellentesque dignissim. Nunc non blandit massa enim nec dui nunc mattis. Venenatis urna cursus eget nunc. Proin fermentum leo vel orci porta non pulvinar neque laoreet. Viverra vitae congue eu consequat ac felis. Quis viverra nibh cras pulvinar. Iaculis nunc sed augue lacus viverra vitae congue eu. Tristique risus nec feugiat in. Libero justo laoreet sit amet. Urna porttitor rhoncus dolor purus non. Tristique nulla aliquet enim tortor at auctor urna nunc. Mauris nunc congue nisi vitae suscipit tellus mauris. Id semper risus in hendrerit gravida rutrum. Sed tempus urna et pharetra pharetra massa massa ultricies. Duis ut diam quam nulla porttitor massa id neque. Commodo ullamcorper a lacus vestibulum. Vitae aliquet nec ullamcorper sit amet risus nullam eget felis. Fermentum iaculis eu non diam phasellus vestibulum lorem sed. Maecenas accumsan lacus vel facilisis volutpat est velit egestas dui. Faucibus turpis in eu mi bibendum neque egestas. Dignissim enim sit amet venenatis urna cursus. Urna duis convallis convallis tellus id interdum velit laoreet id. Elit pellentesque habitant morbi tristique senectus et netus. Neque aliquam vestibulum morbi blandit cursus risus at. A iaculis at erat pellentesque adipiscing commodo elit. Convallis tellus id interdum velit laoreet id donec ultrices tincidunt. Elit duis tristique sollicitudin nibh sit amet. Vulputate enim nulla aliquet porttitor. Penatibus et magnis dis parturient montes nascetur. Sed id semper risus in hendrerit. Ullamcorper morbi tincidunt ornare massa eget egestas. Dictum sit amet justo donec enim diam vulputate ut pharetra. Velit aliquet sagittis id consectetur purus ut faucibus. Eu volutpat odio facilisis mauris sit. Sit amet consectetur adipiscing elit pellentesque habitant morbi tristique senectus. Sit amet nisl suscipit adipiscing bibendum est. Sed cras ornare arcu dui. Id consectetur purus ut faucibus pulvinar elementum. Montes nascetur ridiculus mus mauris vitae ultricies leo integer. Duis at tellus at urna condimentum. Eu turpis egestas pretium aenean pharetra magna ac placerat vestibulum. Libero nunc consequat interdum varius sit amet mattis vulputate. Non curabitur gravida arcu ac tortor dignissim convallis aenean et. Id interdum velit laoreet id donec ultrices. Tortor id aliquet lectus proin nibh nisl. Sit amet consectetur adipiscing elit pellentesque habitant morbi tristique senectus.", - "activity_code": "UG3", - "is_registered": true, - "project_title": "Eget arcu dictum varius duis. Rhoncus mattis rhoncus urna neque viverra justo. Ullamcorper malesuada proin libero nunc consequat interdum varius. Proin nibh nisl condimentum id venenatis a condimentum vitae. Pellentesque nec nam aliquam sem et. Felis bibendum ut tristique et egestas quis ipsum.", - "subproject_id": "", - "covid_response": "", - "dataset_1_type": "", - "dataset_2_type": "", - "dataset_3_type": "", - "dataset_4_type": "", - "dataset_5_type": "", - "contact_pi_name": "Ingram, Camille H.", - "dataset_1_title": "", - "dataset_2_title": "", - "dataset_3_title": "", - "dataset_4_title": "", - "dataset_5_title": "", - "direct_cost_amt": "3134280", - "administering_ic": "National Institute on Drug Abuse", - "advSearchFilters": [{ - "key": "Research Focus Area", - "value": "Novel Medication Options for Opioid Use Disorder and Overdose" - }, - { - "key": "Administering IC(s)", - "value": "NIDA" - }, - { - "key": "Year Grant Awarded", - "value": "2019" - } - ], - "core_project_num": "XX3YA047699", - "dataset_category": "", - "project_end_date": "2022-06-30T12:06:00Z", - "Data Availability": { - "produce_data": "", - "produce_other": "", - "data_available": "", - "data_restricted": "", - "data_release_status": "", - "data_collection_status": "", - "data_release_start_date": "", - "data_release_finish_date": "", - "data_collection_start_date": "", - "data_collection_finish_date": "" - }, - "Metadata Location": { - "other_study_websites": [] - }, - "award_notice_date": "2018-12-20T12:12:00Z", - "cedar_instance_id": "https://repo.metadatacenter.org/template-instances/62944e42-872a-4ad2-8de2-6fd6edf21787", - "data_availability": "not_available", - "funding_mechanism": "Non-SBIR/STTR", - "indirect_cost_amt": "114850", - "mechanism_code_dc": "RP", - "clinical_trials_id": "", - "investigators_name": "Wheeler, Barclay I; Ingram, Camille H; Dickerson, Barrett", - "project_detail_url": "https://project-site.com/project-details/9675407", - "project_serial_num": "YA047699", - "project_start_date": "2019-01-01T12:01:00Z", - "registration_authz": "/study/9675407", - "_second_search_flag": "", - "dataset_description": "", - "registrant_username": "0000-0000-0000-0000", - "research_focus_area": "Novel Therapeutic Options for Opioid Use Disorder and Overdose", - "spending_categories": "89; 108; 118; 176; 180; 240; 525; 4076; 3951; 817", - "agency_ic_admin.code": "DA", - "repository_study_ids": [], - "agency_ic_fundings.fy": "2019", - "dataset_1_description": "", - "dataset_2_description": "", - "dataset_3_description": "", - "dataset_4_description": "", - "dataset_5_description": "", - "organization.org_city": "NEW YORK", - "organization.org_duns": "112765909", - "organization.org_fips": "US", - "organization.org_ueis": "XX5XXXXXXDK7", - "organization.dept_type": "", - "organization.org_state": "NY", - "organization_type.code": "FP", - "organization_type.name": "", - "agency_ic_fundings.code": "DA", - "agency_ic_fundings.name": "National Institute on Drug Abuse", - "full_study_section.name": "Special Emphasis Panel[XXXX XXX-O (01)]", - "organization.org_country": "UNITED STATES", - "organization.org_zipcode": "100168367", - "organization.primary_uei": "XX5XXXXXXDK7", - "spending_categories_desc": "Behavioral and Social Science; Biotechnology; Brain Disorders; Clinical Research; Clinical Trials and Supportive Activities; Drug Abuse (NIDA only); Neurosciences; Opioid Misuse and Addiction; Opioids; Substance Abuse", - "Study Translational Focus": { - "study_translational_focus": "", - "study_translational_topic_grouping": [] - }, - "organization.org_ipf_code": "80000888", - "organization.primary_duns": "112765909", - "project_num_split.ic_code": "DA", - "study_description_summary": "Vulputate eu scelerisque felis imperdiet proin fermentum leo vel. Risus in hendrerit gravida rutrum quisque non tellus orci. In eu mi bibendum neque egestas congue. Mi in nulla posuere sollicitudin aliquam. Adipiscing diam donec adipiscing tristique risus nec feugiat in. Mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum. Viverra vitae congue eu consequat.", - "organization_type.is_other": "False", - "program_officers.full_name": "Sophia K. Brennan", - "program_officers.last_name": "Brennan", - "Human Subject Applicability": { - "age_applicability": [], - "gender_applicability": [], - "geographic_applicability": [], - "geographic_applicability1": [], - "sexual_identity_applicability": [], - "irb_vulnerability_conditions_applicability": [] - }, - "full_study_section.srg_code": "ZDA1", - "full_study_section.srg_flex": "", - "program_officers.first_name": "Sophia", - "agency_ic_admin.abbreviation": "NIDA", - "organization.external_org_id": "00000888", - "program_officers.middle_name": "L.", - "project_num_split.serial_num": "099999", - "Human Condition Applicability": { - "condition_category": [], - "all_other_condition": [], - "all_outcome_condition": [], - "pain_causal_condition": [], - "condition_investigation_stage_or_type": [], - "all_treatment_or_study_target_condition": [], - "pain_treatment_or_study_target_condition": [] - }, - "Human Treatment Applicability": { - "treatment_mode": [], - "treatment_type": [], - "treatment_novelty": [], - "treatment_application_level": [], - "treatment_investigation_stage_or_type": [] - }, - "agency_ic_fundings.total_cost": "3249130.0", - "full_study_section.group_code": "01", - "principal_investigators.title": "; EXECUTIVE DIRECTOR; ", - "project_num_split.suffix_code": "", - "project_num_split.support_year": "01", - "agency_ic_fundings.abbreviation": "NIDA", - "project_num_split.activity_code": "UG3", - "full_study_section.sra_flex_code": "O", - "project_num_split.appl_type_code": "1", - "principal_investigators.last_name": "Wheeler; Ingram; Dickerson", - "principal_investigators.first_name": "Barclay; Camille; Barrett", - "principal_investigators.profile_id": "9900999; 9009999; 0099999", - "principal_investigators.middle_name": "I; H; Barrett", - "project_num_split.full_support_year": "01", - "principal_investigators.is_contact_pi": "False; True; False", - "full_study_section.sra_designator_code": "XXX" - } -} + "name": "Back Pain Consortium Research Program", + "category": "Research Program" + } + ], + "authz": [ + "/open" + ], + "__manifest": [], + "institutions": "UNIV OF NORTH CAROLINA CHAPEL HILL", + "year_awarded": "2019", + "project_title": "[AUTOTEST Title] Testing Aggregate Metadata Service", + "data": { + "data_type": [ + "Imaging", + "Questionnaire/Survey/Assessment", + "Questionnaire/Survey/Assessment - validated instrument", + "Questionnaire/Survey/Assessment - unvalidated instrument", + "Biophysical", + "Genomic" + ], + "data_source": [ + "Researcher Collected/Measured", + "Patient-Reported", + "Administrative" + ], + "data_orientation": [ + "Quantitative" + ], + "subject_data_level_available": [ + "Individual - Unaggregated" + ], + "subject_data_unit_of_analysis": [ + "Individual" + ], + "subject_data_unit_of_collection": [ + "Individual" + ], + "subject_geographic_data_level_available": [ + "Zip code" + ], + "subject_geographic_data_level_collected": [ + "Exact location" + ] + }, + "findings": { + "primary_publications": [], + "primary_study_findings": [], + "secondary_publications": [] + }, + "minimal_info": { + "study_name": "[AUTOTEST Title] Testing Aggregate Metadata Service", + "study_description": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim", + "alternative_study_name": "Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu", + "alternative_study_description": "In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim." + }, + "dataset_1_title": "", + "dataset_2_title": "", + "dataset_3_title": "", + "dataset_4_title": "", + "dataset_5_title": "", + "doi_identifiers": "", + "related_studies": [], + "advSearchFilters": [ + { + "key": "Research Program", + "value": "Back Pain Consortium Research Program" + } + ], + "research_program": "Back Pain Consortium Research Program", + "investigators_name": [ + "Kevin J Anstrom", + "ANASTASIA IVANOVA", + "LISA LAVANGE" + ], + "registration_authz": "/study/9898044", + "registrant_username": "0000-0003-2570-1180", + "research_focus_area": "Clinical Research in Pain Management", + "time_of_registration": "", + "study_description_summary": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim" + } +} \ No newline at end of file diff --git a/test-data/aggMDSTest/study3.json b/test-data/aggMDSTest/study3.json deleted file mode 100644 index 492002d38..000000000 --- a/test-data/aggMDSTest/study3.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "_guid_type": "discovery_metadata", - "gen3_discovery": { - "tags": [{ - "name": "Opioid Use", - "category": "Substance Use" - }, - { - "name": "Practice", - "category": "Other" - }, - { - "name": "Clinical Training", - "category": "Other" - }, - { - "name": "National Drug Abuse Treatment Clinical Trials Network (CTN)", - "category": "Other" - }, - { - "name": "Existing Studies", - "category": "Other" - }, - { - "name": "New Studies", - "category": "Other" - }, - { - "name": "Research Training", - "category": "Other" - }, - { - "name": "Opioid Use Disorder", - "category": "Substance Use" - } - ], - "authz": "", - "terms": "
", - "is_new": "False", - "appl_id": 99990099, - "full_foa": "XXX-YY-99-009", - "phr_text": "PROJECT NARRATIVE. Ut aliquam purus sit amet luctus venenatis lectus magna. Donec pretium vulputate sapien nec. Vitae congue eu consequat ac felis donec et odio pellentesque. Sodales ut etiam sit amet. Et odio pellentesque diam volutpat commodo sed egestas egestas fringilla.", - "cfda_code": "090", - "cong_dist": "XX-00", - "is_active": "False", - "__manifest": [], - "award_type": "1", - "budget_end": "2020-02-29T12:02:00Z", - "date_added": "2019-06-01T07:06:09Z", - "pref_terms": "Acute Pain;Address;Adolescent;Alaska Native;Alcohol or Other Drugs use;American Indians;Behavior Therapy;Caring;Center for Translational Science Activities;Chronic;Clinic;Clinical;Clinical Research;Clinical Sciences;Clinical Trials;Clinical Trials Network;Communities;Community Health;Conduct Clinical Trials;Criminal Justice;Data Science;Development;Disease;Disulfiram;Education;Ensure;Epidemic;Evaluation;Evidence based practice;Geographic Locations;Goals;Harm Reduction;Health Personnel;Health Services;Heroin;Hispanic Americans;Hispanics;Informatics;Infrastructure;Institutes;Knowledge;Lead;Leadership;Link;Maternal and Child Health;Medical;Medicine;Methods;Minority;Modification;Morbidity - disease rate;Multi-Institutional Clinical Trial;National Institute of Drug Abuse;New Mexico;Outpatients;Overdose;Patients;Pharmacology;Play;Population;Population Heterogeneity;Poverty;Prevention;Prevention Research;Prevention strategy;Primary Health Care;Protocols documentation;Provider;Public Health;Randomized Controlled Trials;Research;Research Personnel;Role;Rural;Rural Population;Site;Substance Use Disorder;Translations;Underserved Population;Unemployment;Universities;Work;Workforce Development;Youth;addiction;base;behavioral health;behavioral health intervention;care providers;clinical care;clinical implementation;clinical practice;clinical research site;cocaine use;community center;disorder prevention;evidence base;experience;health care settings;health disparity;implementation research;implementation science;improved;improved outcome;innovation;knowledge base;learning network;medical specialties;medically underserved;methadone treatment;mortality;opioid epidemic;opioid misuse;opioid mortality;opioid use disorder;patient population;practice-based research network;prescription opioid;protocol development;recruit;research study;rural Hispanic;rural area;social;uptake;young adult", - "agency_code": "NIH", - "arra_funded": "N", - "award_amount": "2751799", - "budget_start": "2019-06-01T12:06:00Z", - "institutions": "UNIVERSITY OF NEW MEXICO HEALTH SCIS CTR", - "year_awarded": "2019", - "abstract_text": "ABSTRACT. Vel pharetra vel turpis nunc eget. Maecenas volutpat blandit aliquam etiam. Magna etiam tempor orci eu lobortis elementum nibh tellus. Praesent semper feugiat nibh sed pulvinar proin. Et netus et malesuada fames ac. Erat velit scelerisque in dictum. Congue quisque egestas diam in. Magna fermentum iaculis eu non diam phasellus. Sem integer vitae justo eget magna fermentum iaculis eu. In pellentesque massa placerat duis ultricies lacus sed. Duis at consectetur lorem donec massa sapien faucibus. Nunc eget lorem dolor sed viverra ipsum. A cras semper auctor neque vitae. Nam at lectus urna duis. Purus sit amet volutpat consequat mauris nunc. Vitae nunc sed velit dignissim sodales ut eu sem integer. Faucibus vitae aliquet nec ullamcorper sit amet risus nullam eget. Vivamus arcu felis bibendum ut tristique et. Felis eget velit aliquet sagittis id consectetur purus. Egestas sed sed risus pretium quam vulputate dignissim. Eget magna fermentum iaculis eu non. Tellus in hac habitasse platea dictumst vestibulum rhoncus. Suspendisse faucibus interdum posuere lorem ipsum dolor. Velit dignissim sodales ut eu sem integer vitae justo. Pulvinar neque laoreet suspendisse interdum. Neque convallis a cras semper auctor neque vitae. Posuere lorem ipsum dolor sit amet consectetur. Porttitor eget dolor morbi non arcu risus. Metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices. Duis tristique sollicitudin nibh sit amet commodo nulla. Molestie at elementum eu facilisis sed odio morbi quis. Viverra orci sagittis eu volutpat odio facilisis mauris sit amet. Nulla facilisi cras fermentum odio eu feugiat pretium nibh ipsum. Nisi quis eleifend quam adipiscing. Proin sed libero enim sed faucibus turpis. Faucibus nisl tincidunt eget nullam non. Integer quis auctor elit sed vulputate mi sit amet. Accumsan lacus vel facilisis volutpat est. Morbi blandit cursus risus at ultrices mi. Diam quis enim lobortis scelerisque fermentum dui faucibus in ornare. Nulla pharetra diam sit amet nisl suscipit adipiscing bibendum est. Morbi enim nunc faucibus a pellentesque sit amet porttitor. Quam elementum pulvinar etiam non quam lacus. In arcu cursus euismod quis viverra. Turpis tincidunt id aliquet risus feugiat. Adipiscing vitae proin sagittis nisl. Semper eget duis at tellus at urna condimentum mattis pellentesque. Pellentesque habitant morbi tristique senectus et. Aliquet bibendum enim facilisis gravida. Volutpat commodo sed egestas egestas fringilla. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Sagittis aliquam malesuada bibendum arcu. A iaculis at erat pellentesque adipiscing. Elementum pulvinar etiam non quam. Eget est lorem ipsum dolor sit amet consectetur. Posuere urna nec tincidunt praesent semper feugiat nibh sed pulvinar. Ligula ullamcorper malesuada proin libero nunc consequat interdum. Tincidunt arcu non sodales neque sodales ut etiam sit amet. Mauris rhoncus aenean vel elit scelerisque. Dictum sit amet justo donec enim diam vulputate ut pharetra. At risus viverra adipiscing at in tellus. Libero enim sed faucibus turpis in eu mi bibendum. Sed risus pretium quam vulputate dignissim suspendisse in. Dui accumsan sit amet nulla facilisi. Ultrices vitae auctor eu augue ut. Mi quis hendrerit dolor magna eget est lorem ipsum dolor. Fusce id velit ut tortor pretium viverra suspendisse potenti. Nunc mattis enim ut tellus elementum sagittis. Consequat mauris nunc congue nisi vitae suscipit tellus. Ac ut consequat semper viverra nam libero justo. Ut diam quam nulla porttitor massa id neque aliquam vestibulum. Adipiscing elit duis tristique sollicitudin nibh sit amet commodo. Aliquam sem et tortor consequat id porta nibh venenatis cras. Blandit massa enim nec dui nunc mattis enim ut tellus. Et malesuada fames ac turpis egestas. Vitae aliquet nec ullamcorper sit amet risus nullam. Arcu vitae elementum curabitur vitae nunc sed velit dignissim sodales. Quam pellentesque nec nam aliquam sem et.", - "activity_code": "UG1", - "project_title": "Arcu bibendum at varius vel pharetra vel turpis nunc. Morbi non arcu risus quis varius quam quisque.", - "subproject_id": "", - "covid_response": "", - "dataset_1_type": "", - "dataset_2_type": "", - "dataset_3_type": "", - "dataset_4_type": "", - "dataset_5_type": "", - "contact_pi_name": "Baker, Carly", - "dataset_1_title": "", - "dataset_2_title": "", - "dataset_3_title": "", - "dataset_4_title": "", - "dataset_5_title": "", - "direct_cost_amt": "9900999", - "administering_ic": "National Institute on Drug Abuse", - "advSearchFilters": [{ - "key": "Research Focus Area", - "value": "Translation of Research to Practice for the Treatment of Opioid Addiction" - }, - { - "key": "Administering IC(s)", - "value": "NIDA" - }, - { - "key": "Year Grant Awarded", - "value": "2019" - } - ], - "core_project_num": "XX0YYXX9900", - "dataset_category": "", - "project_end_date": "2024-02-29T12:02:00Z", - "award_notice_date": "2019-05-30T12:05:00Z", - "data_availability": "not_available", - "funding_mechanism": "Other Research-Related", - "indirect_cost_amt": "935430", - "mechanism_code_dc": "OR", - "investigators_name": "Baker, Carly", - "project_detail_url": "https://reporter.nih.gov/project-details/9839338", - "project_serial_num": "XX999009", - "project_start_date": "2019-06-01T12:06:00Z", - "registration_authz": "/study/99900099", - "_second_search_flag": "", - "dataset_description": "", - "research_focus_area": "Translation of Research to Practice for the Treatment of Opioid Addiction", - "spending_categories": "44; 89; 118; 176; 180; 187; 240; 3641; 298; 3584; 4076; 3951; 679; 683; 701; 770; 817", - "agency_ic_admin.code": "DA", - "agency_ic_fundings.fy": "2019", - "dataset_1_description": "", - "dataset_2_description": "", - "dataset_3_description": "", - "dataset_4_description": "", - "dataset_5_description": "", - "organization.org_city": "ALBUQUERQUE", - "organization.org_duns": "829868723", - "organization.org_fips": "US", - "organization.org_ueis": "X389XXXXXXX9", - "organization.dept_type": "INTERNAL MEDICINE/MEDICINE", - "organization.org_state": "NM", - "organization_type.code": "10", - "organization_type.name": "SCHOOLS OF MEDICINE", - "agency_ic_fundings.code": "DA", - "agency_ic_fundings.name": "National Institute on Drug Abuse", - "full_study_section.name": "Special Emphasis Panel[XXX XXX-X (99)]", - "organization.org_country": "UNITED STATES", - "organization.org_zipcode": "871310001", - "organization.primary_uei": "G389MFAYJNG9", - "spending_categories_desc": "American Indian or Alaska Native; Behavioral and Social Science; Brain Disorders; Clinical Research; Clinical Trials and Supportive Activities; Comparative Effectiveness Research; Drug Abuse (NIDA only); Health Disparities; Health Services; Minority Health; Opioid Misuse and Addiction; Opioids; Pediatric; Pediatric Research Initiative; Prevention; Rural Health; Substance Abuse", - "organization.org_ipf_code": "99999999", - "organization.primary_duns": "00000000", - "project_num_split.ic_code": "DA", - "study_description_summary": "New Mexico (NM) is an epicenter of the opioid crisis in the United States. Many challenging social determinants, including poverty and unemployment, contribute to high rates of opioid use disorder (OUD) in NM. The aims of the NM node are to (1) develop and maintain a highly efficient platform to conduct clinical trials that will inform evidence-based prevention and treatment of OUD; (2) collaborate on and lead research that addresses and improves outcomes across the OUD Cascade of Care (CoC); and (3) promote uptake of best practices in OUD prevention and care in NM and nationwide through effective dissemination of evidence-based innovations. NM node research will ensure the development of robust and generalizable methods for prevention, identification, and treatment of OUD, including evaluation and modification of the CoC to expand the local and national knowledge base.", - "organization_type.is_other": "False", - "program_officers.full_name": "Harrison, Shannon", - "program_officers.last_name": "Harrison", - "full_study_section.srg_code": "XXX9", - "full_study_section.srg_flex": "", - "program_officers.first_name": "Shannon", - "agency_ic_admin.abbreviation": "NIDA", - "organization.external_org_id": "99990099", - "program_officers.middle_name": "", - "project_num_split.serial_num": "990099", - "agency_ic_fundings.total_cost": "2751799.0", - "full_study_section.group_code": "19", - "principal_investigators.title": "PROFESSOR, INTERNAL MEDICINE", - "project_num_split.suffix_code": "", - "project_num_split.support_year": "01", - "agency_ic_fundings.abbreviation": "NIDA", - "project_num_split.activity_code": "UG1", - "full_study_section.sra_flex_code": "A", - "project_num_split.appl_type_code": "1", - "principal_investigators.last_name": "Baker", - "principal_investigators.first_name": "Carly", - "principal_investigators.profile_id": "9900999", - "principal_investigators.middle_name": "", - "project_num_split.full_support_year": "01", - "principal_investigators.is_contact_pi": "True", - "full_study_section.sra_designator_code": "YYY" - } -} From 4a8713fe790f9ac02826e0644381130eed7d45e6 Mon Sep 17 00:00:00 2001 From: Hara Prasad Date: Thu, 5 Dec 2024 16:52:47 -0600 Subject: [PATCH 13/13] Update pfbExportTest.js (#1062) * Update pfbExportTest.js * Update pfbExportTest.js * Update pfbExportTest.js * Update pfbExportTest.js * Update pfbExportTest.js --- suites/portal/pfbExportTest.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/suites/portal/pfbExportTest.js b/suites/portal/pfbExportTest.js index 12a3cefce..1328a2aab 100644 --- a/suites/portal/pfbExportTest.js +++ b/suites/portal/pfbExportTest.js @@ -322,8 +322,8 @@ Scenario('Visit the Explorer page, select a cohort, export to PFB and download t login.complete.login(users.mainAcct); I.wait(5); I.saveScreenshot('before_checking_navbar.png'); - const navBarButtons = await I.grabTextFromAll({ xpath: 'xpath: //div[@class=\'nav-bar__nav--items\']//div/a/descendant-or-self::*' }); - + const navBarButtons = await I.grabTextFromAll('.body-typo.nav-button'); + console.log(`### Nav bar buttons: ${navBarButtons}`); if (navBarButtons.includes('Exploration')) { I.amOnPage('explorer'); console.log('### I am on Exploration Page'); @@ -366,6 +366,7 @@ Scenario('Visit the Explorer page, select a cohort, export to PFB and download t } else { I.saveScreenshot('whatTheHellIsGoingOnWithTheNavBar.png'); console.log('WARN: This environment does not have any Explorer or Files button on the navigation bar. This test should not run here'); + throw new Error('Test failed: Navigation bar is missing both "Explorer" and "Files" buttons.'); } // Click on the Export to PFB button