Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaofei Zhao committed Jun 6, 2022
1 parent 9183bbd commit 01610fe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
10 changes: 9 additions & 1 deletion end-to-end-test/local/specs/treatment.screenshot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ var goToTreatmentTab = require('./treatment.spec').goToTreatmentTab;
var selectTreamentsBothAxes = require('./treatment.spec')
.selectTreamentsBothAxes;

const TREATMENT_EC50_PROFILE_NAME =
'EC50 values of compounds on cellular phenotype readout';
const GENERIC_ASSAY_ENTITY_SELECTOR =
'[data-test="GenericAssayEntitySelection"]';
const GENERIC_ASSAY_PROFILE_SELECTOR =
'[data-test="GenericAssayProfileSelection"]';

describe('treatment feature', () => {
describe('oncoprint tab', () => {
Expand All @@ -25,8 +29,12 @@ describe('treatment feature', () => {
waitForOncoprint();
});

it('shows treatment profile heatmap track for treatment', () => {
it.only('shows treatment profile heatmap track for treatment', () => {
goToTreatmentTab();
// change profile to EC50
$(GENERIC_ASSAY_PROFILE_SELECTOR).click();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).click();
$(GENERIC_ASSAY_ENTITY_SELECTOR).click();
$('[data-test="GenericAssayEntitySelection"] input').setValue(
'17-AAG'
Expand Down
27 changes: 17 additions & 10 deletions end-to-end-test/local/specs/treatment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const TREATMENT_IC50_PROFILE_NAME =
'IC50 values of compounds on cellular phenotype readout';
const TREATMENT_EC50_PROFILE_NAME =
'EC50 values of compounds on cellular phenotype readout';
const GENERIC_ASSAY_PROFILE_SELECTOR =
'[data-test="GenericAssayProfileSelection"]';
const GENERIC_ASSAY_ENTITY_SELECTOR =
'[data-test="GenericAssayEntitySelection"]';

Expand All @@ -36,26 +38,26 @@ describe('treatment feature', function() {

it('shows treatment data type option in heatmap menu', () => {
goToTreatmentTab();
// change profile to IC50
selectElementByText(TREATMENT_EC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).click();
// open treatment profile selection menu
$(GENERIC_ASSAY_PROFILE_SELECTOR).click();
selectElementByText(TREATMENT_IC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_IC50_PROFILE_NAME).click();
assert($(`//*[text()="${TREATMENT_IC50_PROFILE_NAME}"]`));
// change profile to EC50
selectElementByText(TREATMENT_IC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_IC50_PROFILE_NAME).click();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).click();
assert($(`//*[text()="${TREATMENT_EC50_PROFILE_NAME}"]`));
});

it('shows treatment selection box in heatmap menu when treatment data type is selected', () => {
goToTreatmentTab();
// open profile dropdown menu
// change profile to IC50
$(GENERIC_ASSAY_PROFILE_SELECTOR).click();
selectElementByText(TREATMENT_IC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_IC50_PROFILE_NAME).click();
assert($(`//*[text()="${TREATMENT_IC50_PROFILE_NAME}"]`));
// change profile to EC50
$(GENERIC_ASSAY_PROFILE_SELECTOR).click();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).click();
assert($(`//*[text()="${TREATMENT_IC50_PROFILE_NAME}"]`));
assert($(`//*[text()="${TREATMENT_EC50_PROFILE_NAME}"]`));
});

it('shows all treatments in generic assay selector', () => {
Expand Down Expand Up @@ -155,6 +157,11 @@ describe('treatment feature', function() {

it('sets `generic_assay_groups` URL parameter', () => {
goToTreatmentTab();
// Select treatment profile
$(GENERIC_ASSAY_PROFILE_SELECTOR).click();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).waitForExist();
selectElementByText(TREATMENT_EC50_PROFILE_NAME).click();
// Select treatments
$(GENERIC_ASSAY_ENTITY_SELECTOR).click();
$('[data-test="GenericAssayEntitySelection"] input').setValue(
'17-AAG'
Expand Down

0 comments on commit 01610fe

Please sign in to comment.