Skip to content

Commit

Permalink
Fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alisman committed Oct 17, 2022
1 parent 0b5cb10 commit 6f8edb9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 47 deletions.
33 changes: 11 additions & 22 deletions end-to-end-test/remote/specs/core/patient.logic.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
var assert = require('assert');
const {
getElByTestHandle,

var {
goToUrlAndSetLocalStorage,
getElementsByTestHandle,
} = require('../../../shared/specUtils.jsm');
var goToUrlAndSetLocalStorage = require('../../../shared/specUtils')
.goToUrlAndSetLocalStorage;
} = require('../../../shared/specUtils');

const CBIOPORTAL_URL = process.env.CBIOPORTAL_URL.replace(/\/$/, '');

Expand All @@ -13,23 +12,13 @@ describe('patient page', function() {
goToUrlAndSetLocalStorage(CBIOPORTAL_URL);
});

// it('should show all samples button for single sample view of multi sample patient', function() {
//
// this.retries(2);
//
// goToUrlAndSetLocalStorage(
// `${CBIOPORTAL_URL}/patient?studyId=lgg_ucsf_2014&tab=summaryTab&sampleId=P04_Pri`
// );
//
// $('.//*[text()[contains(.,"Show all")]]').waitForExist();
//
// assert.equal(
// $('.//*[text()[contains(.,"Show all")]]')
// .getText()
// .toLowerCase(),
// 'show all 4 samples'.toLowerCase()
// );
// });
it('should show "all samples button" for single sample view of multi sample patient', function() {
goToUrlAndSetLocalStorage(
`${CBIOPORTAL_URL}/patient?studyId=lgg_ucsf_2014&tab=summaryTab&sampleId=P04_Pri`
);

$('button=Show all 4 samples').waitForExist();
});

it('show appropriate messaging when a patient has only some profiled samples', async () => {
goToUrlAndSetLocalStorage(
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-test/remote/specs/core/screenshot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ describe('results page pathways tab with unprofiled genes', function() {
});

it(`results page pathwaymapper tab with unprofiled genes`, function() {
$('#cy').waitForDisplayed({ timeout: 15000 });
$('#cy').waitForDisplayed({ timeout: 30000 });

waitForNetworkQuiet(15000);

Expand Down
5 changes: 5 additions & 0 deletions end-to-end-test/shared/specUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ function setSettingsMenuOpen(open, buttonId = 'GlobalSettingsButton') {
);
}

function getElementByTestHandle(handle) {
return $(`[data-test=${handle}]`);
}

function setOncoprintMutationsMenuOpen(open) {
const mutationColorMenuButton = '#mutationColorDropdown';
const mutationColorMenuDropdown =
Expand Down Expand Up @@ -753,4 +757,5 @@ module.exports = {
jq,
setServerConfiguration,
selectClinicalTabPlotType,
getElementByTestHandle,
};
7 changes: 0 additions & 7 deletions end-to-end-test/shared/specUtils.jsm

This file was deleted.

18 changes: 1 addition & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,7 @@
resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5"
integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==

"@testing-library/dom@^8.0.0", "@testing-library/dom@^8.5.0":
"@testing-library/dom@^8.0.0":
version "8.18.1"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.18.1.tgz#80f91be02bc171fe5a3a7003f88207be31ac2cf3"
integrity sha512-oEvsm2B/WtcHKE+IcEeeCqNU/ltFGaVyGbpcm4g/2ytuT49jrlH9x5qRKL/H3A6yfM4YAbSbC0ceT5+9CEXnLg==
Expand All @@ -2450,15 +2450,6 @@
"@testing-library/dom" "^8.0.0"
"@types/react-dom" "<18.0.0"

"@testing-library/react@^13.4.0":
version "13.4.0"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-13.4.0.tgz#6a31e3bf5951615593ad984e96b9e5e2d9380966"
integrity sha512-sXOGON+WNTh3MLE9rve97ftaZukN3oNf2KjDy7YTx6hcTO2uuLHuCGynMDhFwGw/jYf4OJ2Qk0i4i79qMNNkyw==
dependencies:
"@babel/runtime" "^7.12.5"
"@testing-library/dom" "^8.5.0"
"@types/react-dom" "^18.0.0"

"@tootallnate/once@1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
Expand Down Expand Up @@ -4103,13 +4094,6 @@
dependencies:
"@types/react" "*"

"@types/react-dom@^18.0.0":
version "18.0.6"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.6.tgz#36652900024842b74607a17786b6662dd1e103a1"
integrity sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==
dependencies:
"@types/react" "*"

"@types/react-fontawesome@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@types/react-fontawesome/-/react-fontawesome-1.5.0.tgz#8d10931e2eb593565b1db7b106e6f6bc1d2a2346"
Expand Down

0 comments on commit 6f8edb9

Please sign in to comment.