Skip to content

Commit

Permalink
Fork homepage query experience with new query and explore buttons bel…
Browse files Browse the repository at this point in the history
…ow study selector.
  • Loading branch information
alisman committed Jul 15, 2019
1 parent acf6791 commit b2fc773
Show file tree
Hide file tree
Showing 21 changed files with 889 additions and 614 deletions.
73 changes: 61 additions & 12 deletions end-to-end-tests/specs/core/home.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
var assert = require('assert');
var expect = require('chai').expect;
var waitForOncoprint = require('./../specUtils').waitForOncoprint;
var getTextInOncoprintLegend = require('./../specUtils').getTextInOncoprintLegend;
var setOncoprintMutationsMenuOpen = require('./../specUtils').setOncoprintMutationsMenuOpen;
var goToUrlAndSetLocalStorage = require('./../specUtils').goToUrlAndSetLocalStorage;
var useExternalFrontend = require('./../specUtils').useExternalFrontend;
var waitForNumberOfStudyCheckboxes = require('./../specUtils').waitForNumberOfStudyCheckboxes;
var setInputText = require('./../specUtils').setInputText;

var {
goToUrlAndSetLocalStorage,
clickQueryByGeneButton,
useExternalFrontend,
setInputText,
clickQueryByGeneButton,
waitForNumberOfStudyCheckboxes,
clickModifyStudySelectionButton
} = require('./../specUtils');


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

Expand All @@ -18,8 +22,6 @@ var searchInputSelector = ".autosuggest input[type=text]";

describe('homepage', function() {

this.retries(2);

before(()=>{
goToUrlAndSetLocalStorage(CBIOPORTAL_URL);
});
Expand Down Expand Up @@ -69,6 +71,8 @@ describe('homepage', function() {

browser.click('[data-test="StudySelect"]');

clickQueryByGeneButton();

var caseSetSelector = $(caseSetSelectorClass);
caseSetSelector.waitForExist(10000);

Expand All @@ -78,12 +82,16 @@ describe('homepage', function() {

it('should not allow submission if OQL contains EXP or PROT for multiple studies', ()=>{

goToUrlAndSetLocalStorage(CBIOPORTAL_URL);

setInputText(".autosuggest input[type=text]","breast -invasive");

browser.pause(500);
browser.waitForExist('[data-test="StudySelect"]', 10000);
browser.click('[data-test="selectAllStudies"]');

clickQueryByGeneButton();

var oqlEntrySel = 'textarea[data-test="geneSet"]';
setInputText(oqlEntrySel, 'PTEN: EXP>1');

Expand Down Expand Up @@ -227,6 +235,8 @@ describe('case set selection in front page query form', function(){
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

browser.waitForExist(selectedCaseSet_sel);
browser.waitUntil(()=>(browser.getText(selectedCaseSet_sel) === "Samples with mutation and CNA data (316)"), 5000);
});
Expand All @@ -240,11 +250,12 @@ describe('case set selection in front page query form', function(){
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

//browser.debug();
clickQueryByGeneButton();

browser.waitForExist(selectedCaseSet_sel);
browser.waitUntil(()=>(browser.getText(selectedCaseSet_sel) === "Samples with mutation data (160)"), 10000);

clickModifyStudySelectionButton();

// select Adrenocortical Carcinoma
browser.waitForExist(input, 10000);
Expand All @@ -253,12 +264,16 @@ describe('case set selection in front page query form', function(){
checkBox = $('[data-test="StudySelect"]');
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="M"]', 10000);
browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="C"]', 10000);

browser.waitForExist(selectedCaseSet_sel);
browser.waitUntil(()=>(browser.getText(selectedCaseSet_sel) === "All (252)"), 10000);

clickModifyStudySelectionButton();

// Deselect Ampullary Carcinoma
browser.waitForExist(input, 10000);
setInputText(input, 'ampullary baylor');
Expand All @@ -267,6 +282,8 @@ describe('case set selection in front page query form', function(){
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

browser.waitForExist(selectedCaseSet_sel);
browser.waitUntil(()=>(browser.getText(selectedCaseSet_sel) === "Samples with mutation and CNA data (88)"), 10000);
});
Expand All @@ -280,20 +297,28 @@ describe('case set selection in front page query form', function(){
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

browser.waitForExist(selectedCaseSet_sel);
browser.waitUntil(()=>(browser.getText(selectedCaseSet_sel) === "Samples with mutation data (160)"), 10000);

clickModifyStudySelectionButton();

// select all TCGA non-provisional
browser.waitForExist(input, 10000);
setInputText(input,'tcga -provisional');
browser.pause(500);
browser.click('div[data-test="cancerTypeListContainer"] input[data-test="selectAllStudies"]');

clickQueryByGeneButton();

browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="M"]', 10000);
browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="C"]', 10000);
browser.waitForExist(selectedCaseSet_sel, 10000);
browser.waitUntil(()=>(/All \(\d+\)/.test(browser.getText(selectedCaseSet_sel))), 10000); // since sample #s change across studies, dont depend this test on specific number

clickModifyStudySelectionButton();

// Deselect all tcga -provisional studies
browser.click('div[data-test="cancerTypeListContainer"] input[data-test="selectAllStudies"]');
browser.pause(100);
Expand All @@ -306,11 +331,15 @@ describe('case set selection in front page query form', function(){
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="M"]', 10000);
browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="C"]', 10000);
browser.waitForExist(selectedCaseSet_sel, 10000);
browser.waitUntil(()=>(browser.getText(selectedCaseSet_sel) === "All (252)"), 10000);

clickModifyStudySelectionButton();

// Deselect Ampullary Carcinoma
browser.waitForExist(input, 10000);
setInputText(input,'ampullary baylor');
Expand All @@ -319,6 +348,8 @@ describe('case set selection in front page query form', function(){
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

browser.waitForExist(selectedCaseSet_sel);
browser.waitUntil(()=>(browser.getText(selectedCaseSet_sel) === "Samples with mutation and CNA data (88)"), 10000);
});
Expand All @@ -340,13 +371,17 @@ describe('genetic profile selection in front page query form', ()=>{
browser.click('[data-test="StudySelect"] input');
browser.pause(200);

clickQueryByGeneButton();

// wait for profiles selector to load
browser.waitForExist('div[data-test="molecularProfileSelector"] input[type="checkbox"]', 3000);
browser.waitForExist('div[data-test="molecularProfileSelector"] input[type="checkbox"]', 6000);
// mutations, CNA should be selected
assert(browser.isSelected('div[data-test="molecularProfileSelector"] input[type="checkbox"][data-test="MUTATION_EXTENDED"]'), "mutation profile should be selected");
assert(browser.isSelected('div[data-test="molecularProfileSelector"] input[type="checkbox"][data-test="COPY_NUMBER_ALTERATION"]'), "cna profile should be selected");
assert(!browser.isSelected('div[data-test="molecularProfileSelector"] input[type="checkbox"][data-test="MRNA_EXPRESSION"]'), "mrna profile not selected");

clickModifyStudySelectionButton();

// select another study
browser.waitForExist(input, 10000);
setInputText(input, 'ampullary baylor');
Expand All @@ -355,38 +390,52 @@ describe('genetic profile selection in front page query form', ()=>{
checkBox.waitForExist(10000);
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

// wait for data type priority selector to load
browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="M"]', 10000);
browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="C"]', 10000);
assert(browser.isSelected('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="M"]'), "'Mutation' should be selected");
assert(browser.isSelected('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="C"]'), "'Copy number alterations' should be selected");

clickModifyStudySelectionButton();

//deselect other study
browser.click('[data-test="StudySelect"] input');

clickQueryByGeneButton();

// wait for profiles selector to load
browser.waitForExist('div[data-test="molecularProfileSelector"] input[type="checkbox"]', 3000);
// mutations, CNA should be selected
assert(browser.isSelected('div[data-test="molecularProfileSelector"] input[type="checkbox"][data-test="MUTATION_EXTENDED"]'), "mutation profile should be selected");
assert(browser.isSelected('div[data-test="molecularProfileSelector"] input[type="checkbox"][data-test="COPY_NUMBER_ALTERATION"]'), "cna profile should be selected");
assert(!browser.isSelected('div[data-test="molecularProfileSelector"] input[type="checkbox"][data-test="MRNA_EXPRESSION"]'), "mrna profile not selected");

clickModifyStudySelectionButton();

// select all tcga provisional
browser.waitForExist(input, 10000);
setInputText(input, 'tcga provisional');
browser.pause(500);
browser.click('div[data-test="cancerTypeListContainer"] input[data-test="selectAllStudies"]');

clickQueryByGeneButton();

// wait for data type priority selector to load
browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="M"]', 10000);
browser.waitForExist('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="C"]', 10000);
assert(browser.isSelected('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="M"]'), "'Mutation' should be selected");
assert(browser.isSelected('[data-test="dataTypePrioritySelector"] input[type="checkbox"][data-test="C"]'), "'Copy number alterations' should be selected");

clickModifyStudySelectionButton();

// Deselect all tcga provisional studies
browser.click('div[data-test="cancerTypeListContainer"] input[data-test="selectAllStudies"]');
browser.pause(100);

clickQueryByGeneButton();

// wait for profiles selector to load
browser.waitForExist('div[data-test="molecularProfileSelector"] input[type="checkbox"]', 3000);
// mutations, CNA should be selected
Expand Down
14 changes: 12 additions & 2 deletions end-to-end-tests/specs/core/oncoprint.screenshot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe("oncoprint screenshot tests", function() {
});

describe("sorting", function(){
this.retries(0);

function getNthTrackOptionsElements(n) {
// n is one-indexed

Expand Down Expand Up @@ -127,10 +127,15 @@ describe("sorting", function(){

browser.click('[data-test="StudySelect"] input');

browser.click('a=Query By Gene');

browser.pause(1000);

// query KRAS NRAS BRAF
$('[data-test="geneSet"]').setValue('KRAS NRAS BRAF');

browser.waitForEnabled('[data-test="queryButton"]', 30000);

browser.click('[data-test="queryButton"]');

waitForOncoprint(ONCOPRINT_TIMEOUT);
Expand Down Expand Up @@ -164,14 +169,19 @@ describe("sorting", function(){

var checkBox = $('[data-test="StudySelect"]');

checkBox.waitForExist(10000);
checkBox.waitForExist(500);

browser.click('[data-test="StudySelect"] input');

browser.click('a=Query By Gene');

//browser.pause(500);

// query KRAS NRAS BRAF
$('[data-test="geneSet"]').setValue('TP53 MDM2 MDM4');

browser.waitForEnabled('[data-test="queryButton"]', 30000);

browser.click('[data-test="queryButton"]');

waitForOncoprint(ONCOPRINT_TIMEOUT);
Expand Down
12 changes: 12 additions & 0 deletions end-to-end-tests/specs/core/oncoprint.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions end-to-end-tests/specs/core/results.logic.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var assert = require('assert');
var expect = require('chai').expect;
var waitForOncoprint = require('./../specUtils').waitForOncoprint;
var getTextInOncoprintLegend = require('./../specUtils').getTextInOncoprintLegend;
var setOncoprintMutationsMenuOpen = require('./../specUtils').setOncoprintMutationsMenuOpen;
var goToUrlAndSetLocalStorage = require('./../specUtils').goToUrlAndSetLocalStorage;
var useExternalFrontend = require('./../specUtils').useExternalFrontend;
var waitForNumberOfStudyCheckboxes = require('./../specUtils').waitForNumberOfStudyCheckboxes;

var {
clickQueryByGeneButton,
waitForNumberOfStudyCheckboxes,
waitForOncoprint,
goToUrlAndSetLocalStorage,
} = require('./../specUtils');

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

Expand All @@ -20,8 +20,6 @@ var searchInputSelector = ".autosuggest input[type=text]";

describe('cross cancer query', function() {

this.retries(2);

it('should show cross cancer bar chart with TP53 in title when selecting multiple studies and querying for TP53', function() {
goToUrlAndSetLocalStorage(`${CBIOPORTAL_URL}`);

Expand All @@ -35,9 +33,15 @@ describe('cross cancer query', function() {
}
});

clickQueryByGeneButton();

// query tp53
$('[data-test="geneSet"]').setValue('TP53');

browser.waitForEnabled('[data-test="queryButton"]', 30000);

browser.scroll(0,0);

browser.click('[data-test="queryButton"]');

// wait for cancer types summary to appear
Expand Down Expand Up @@ -71,6 +75,8 @@ describe('single study query', function() {

browser.click('[data-test="StudySelect"]');

clickQueryByGeneButton();

// query BRCA1 and BRCA2
$('[data-test="geneSet"]').setValue('BRCA1 BRCA2');

Expand Down
12 changes: 11 additions & 1 deletion end-to-end-tests/specs/specUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ function checkElementWithMouseDisabled(selector, pauseTime) {
return checkElementWithTemporaryClass(selector, selector, "disablePointerEvents", pauseTime || 0);
}

function clickQueryByGeneButton(){
browser.click('a=Query By Gene');
browser.scroll(0,0);
};

function clickModifyStudySelectionButton (){
browser.click('[data-test="modifyStudySelectionButton"]');
}

module.exports = {
waitForOncoprint: waitForOncoprint,
Expand All @@ -190,7 +198,9 @@ module.exports = {
checkOncoprintElement: checkOncoprintElement,
executeInBrowser: executeInBrowser,
checkElementWithTemporaryClass: checkElementWithTemporaryClass,
checkElementWithMouseDisabled: checkElementWithMouseDisabled
checkElementWithMouseDisabled: checkElementWithMouseDisabled,
clickQueryByGeneButton:clickQueryByGeneButton,
clickModifyStudySelectionButton: clickModifyStudySelectionButton
};


Loading

0 comments on commit b2fc773

Please sign in to comment.