Skip to content

Commit

Permalink
Update e2e-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed May 27, 2021
1 parent 42617db commit 7ebc85b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 60 deletions.
107 changes: 52 additions & 55 deletions end-to-end-test/local/specs/hide-download-controls.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var studyViewChartHoverHamburgerIcon = require('../../shared/specUtils')
var setServerConfiguration = require('../../shared/specUtils')
.setServerConfiguration;
var openGroupComparison = require('../../shared/specUtils').openGroupComparison;
var waitForNetworkQuiet = require('../../shared/specUtils').waitForNetworkQuiet;

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

Expand All @@ -22,15 +23,18 @@ const clipboardIcon = '.fa-clipboard';
describe('hide download controls feature', function() {
if (useExternalFrontend) {
describe('study query page', () => {
const expectedTabNames = ['Query'];

before(() => {
openAndSetProperty(CBIOPORTAL_URL, {
skin_hide_download_controls: true,
});
// browser.debug();
waitForStudyQueryPage();
waitForTabs(expectedTabNames.length);
});

it('covers all tabs with download control tests', () => {
const expectedTabNames = ['Query'];
const observedTabNames = $$('.tabAnchor')
.filter(a => a.isVisible())
.map(a => a.getText());
Expand Down Expand Up @@ -62,26 +66,27 @@ describe('hide download controls feature', function() {
});

describe('results view page', () => {
const expectedTabNames = [
'OncoPrint',
'Cancer Types Summary',
'Mutual Exclusivity',
'Plots',
'Mutations',
'Co-expression',
'Comparison/Survival',
'CN Segments',
'Pathways',
];
before(() => {
openAndSetProperty(
`${CBIOPORTAL_URL}/results/oncoprint?genetic_profile_ids_PROFILE_MUTATION_EXTENDED=study_es_0_mutations&genetic_profile_ids_PROFILE_COPY_NUMBER_ALTERATION=study_es_0_gistic&cancer_study_list=study_es_0&Z_SCORE_THRESHOLD=2.0&RPPA_SCORE_THRESHOLD=2.0&data_priority=0&profileFilter=0&case_set_id=study_es_0_cnaseq&gene_list=CREB3L1%2520RPS11%2520PNMA1%2520MMP2%2520ZHX3%2520ERCC5%2520TP53&geneset_list=%20&tab_index=tab_visualize&Action=Submit&comparison_subtab=mrna`,
{ skin_hide_download_controls: true }
);
waitForOncoprint();
waitForTabs(expectedTabNames.length);
});

it('covers all tabs with download control tests', () => {
const expectedTabNames = [
'OncoPrint',
'Cancer Types Summary',
'Mutual Exclusivity',
'Plots',
'Mutations',
'Co-expression',
'Comparison/Survival',
'CN Segments',
'Pathways',
];
const observedTabNames = $$('.tabAnchor')
.filter(a => a.isVisible())
.map(a => a.getText());
Expand Down Expand Up @@ -296,23 +301,24 @@ describe('hide download controls feature', function() {
});

describe('patient view', () => {
const expectedTabNames = [
'Summary',
'Pathways',
'Clinical Data',
'Files & Links',
'Tissue Image',
'Pathology Slide',
'Study Sponsors',
];
before(() => {
openAndSetProperty(
`${CBIOPORTAL_URL}/patient?studyId=study_es_0&caseId=TCGA-A1-A0SK`,
{ skin_hide_download_controls: true }
);
waitForPatientView();
waitForTabs(expectedTabNames.length);
});
it('covers all tabs with download control tests', () => {
const expectedTabNames = [
'Summary',
'Pathways',
'Clinical Data',
'Files & Links',
'Tissue Image',
'Pathology Slide',
'Study Sponsors',
];
const observedTabNames = $$('.tabAnchor')
.filter(a => a.isVisible())
.map(a => a.getText());
Expand Down Expand Up @@ -379,22 +385,23 @@ describe('hide download controls feature', function() {
});

describe('study view', () => {
const expectedTabNames = [
'Summary',
'Clinical Data',
'CN Segments',
'Files & Links',
'Study Sponsors',
];
before(() => {
openAndSetProperty(
`${CBIOPORTAL_URL}/study/summary?id=study_es_0`,
{ skin_hide_download_controls: true }
);
waitForStudyView();
waitForTabs(expectedTabNames.length);
});
describe('summary tab', () => {
it('covers all tabs with download control tests', () => {
const expectedTabNames = [
'Summary',
'Clinical Data',
'CN Segments',
'Files & Links',
'Study Sponsors',
];
const observedTabNames = $$('.tabAnchor')
.filter(a => a.isVisible())
.map(a => a.getText());
Expand Down Expand Up @@ -443,23 +450,6 @@ describe('hide download controls feature', function() {
1000
);
globalCheck();
studyViewChartHoverHamburgerIcon(
'chart-container-SAMPLE_COUNT',
1000
);
globalCheck();
studyViewChartHoverHamburgerIcon(
'chart-container-study_es_0_mutations',
1000
);
globalCheck();
});
it('does not show download option in chart-s', () => {
studyViewChartHoverHamburgerIcon(
'chart-container-SAMPLE_COUNT',
1000
);
globalCheck();
});
});
describe('clinical data tab', () => {
Expand Down Expand Up @@ -493,6 +483,16 @@ describe('hide download controls feature', function() {
});

describe('group comparison', () => {
const expectedTabNames = [
'Overlap',
'Survival',
'Clinical',
'Genomic Alterations',
'mRNA',
'DNA Methylation',
'Treatment Response',
'Mutational Signature',
];
before(() => {
openAndSetProperty(browser.getUrl(), {
skin_hide_download_controls: false,
Expand All @@ -506,18 +506,9 @@ describe('hide download controls feature', function() {
openAndSetProperty(browser.getUrl(), {
skin_hide_download_controls: true,
});
waitForTabs(expectedTabNames.length);
});
it('covers all tabs with download control tests', () => {
const expectedTabNames = [
'Overlap',
'Survival',
'Clinical',
'Genomic Alterations',
'mRNA',
'DNA Methylation',
'Treatment Response',
'Mutational Signature',
];
const observedTabNames = $$('.tabAnchor')
.filter(a => a.isVisible())
.map(a => a.getText());
Expand Down Expand Up @@ -646,3 +637,9 @@ const openAndSetProperty = (url, prop) => {
setServerConfiguration(prop);
goToUrlAndSetLocalStorage(url, true);
};

const waitForTabs = count => {
browser.waitUntil(() => {
return $$('.tabAnchor').length >= count;
}, 300000);
};
11 changes: 6 additions & 5 deletions src/pages/studyView/tabs/CNSegments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import WindowStore from 'shared/components/window/WindowStore';

import { StudyViewPageTabKeyEnum } from 'pages/studyView/StudyViewPageTabs';
import { StudyViewPageStore } from '../StudyViewPageStore';
import AppConfig from 'appConfig';

@observer
export default class CNSegments extends React.Component<
Expand Down Expand Up @@ -162,11 +163,11 @@ export default class CNSegments extends React.Component<
<span>{this.selectionInfo}</span>
{!this.hasNoSegmentData &&
!AppConfig.serverConfig.skin_hide_download_controls && (
<CNSegmentsDownloader
promise={this.activePromise!}
filename={this.filename}
/>
)}
<CNSegmentsDownloader
promise={this.activePromise!}
filename={this.filename}
/>
)}
</div>
<div
style={
Expand Down

0 comments on commit 7ebc85b

Please sign in to comment.