Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration of local tests from sync to async (#4) #5011

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 30 additions & 31 deletions end-to-end-test/local/specs/SurvivalChart.screenshot.spec.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
var goToUrlAndSetLocalStorage = require('../../shared/specUtils')
.goToUrlAndSetLocalStorage;
var waitForNetworkQuiet = require('../../shared/specUtils').waitForNetworkQuiet;
var openGroupComparison = require('../../shared/specUtils').openGroupComparison;
var assertScreenShotMatch = require('../../shared/lib/testUtils')
.assertScreenShotMatch;
var setInputText = require('../../shared/specUtils').setInputText;
var {
setDropdownOpen,
selectClinicalTabPlotType,
getElementByTestHandle,
const { assertScreenShotMatch } = require('../../shared/lib/testUtils');
const {
openGroupComparison,
setInputText,
setCheckboxChecked,
} = require('../../shared/specUtils');
clickElement,
getElement,
} = require('../../shared/specUtils_Async');

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

describe('Screenshot test for extend survival chart (feature flag)', function() {
this.retries(0);

before(function() {
openGroupComparison(
before(async function() {
await openGroupComparison(
`${CBIOPORTAL_URL}/study/summary?id=lgg_ucsf_2014_test_generic_assay&featureFlags=SURVIVAL_PLOT_EXTENDED`,
'chart-container-OS_STATUS',
100000
);
$('.tabAnchor_survival').click();
$('[data-test="ComparisonPageSurvivalTabDiv"]').waitForExist({
await clickElement('.tabAnchor_survival');
await getElement('[data-test="ComparisonPageSurvivalTabDiv"]', {
timeout: 20000,
});
});
it('Survival chart with landmark event and hazard ratio disabled', function() {
var res = browser.checkElement('div[data-test=SurvivalChart]');
it('Survival chart with landmark event and hazard ratio disabled', async () => {
const res = await browser.checkElement('div[data-test=SurvivalChart]');
assertScreenShotMatch(res);
});
it('Survival chart with landmark event at time point 20', function() {
setCheckboxChecked(true, 'input[data-test=landmarkLines]');
setInputText('input[data-test=landmarkValues]', '20');
var res = browser.checkElement('div[data-test=SurvivalChart]');
it('Survival chart with landmark event at time point 20', async () => {
await setCheckboxChecked(true, 'input[data-test=landmarkLines]');
await setInputText('input[data-test=landmarkValues]', '20');
const res = await browser.checkElement('div[data-test=SurvivalChart]');
assertScreenShotMatch(res);
});
it('Survival chart with hazard ratio table', function() {
setCheckboxChecked(false, 'input[data-test=landmarkLines]');
setCheckboxChecked(true, 'input[data-test=hazardRatioCheckbox]');
var res = browser.checkElement('div[data-test=survivalTabView]');
it('Survival chart with hazard ratio table', async () => {
await setCheckboxChecked(false, 'input[data-test=landmarkLines]');
await setCheckboxChecked(true, 'input[data-test=hazardRatioCheckbox]');
const res = await browser.checkElement(
'div[data-test=survivalTabView]'
);
assertScreenShotMatch(res);
});
it('Survival chart with hazard ratio table and landmark line', function() {
setCheckboxChecked(true, 'input[data-test=landmarkLines]');
setInputText('input[data-test=landmarkValues]', '20');
setCheckboxChecked(true, 'input[data-test=hazardRatioCheckbox]');
var res = browser.checkElement('div[data-test=survivalTabView]');
it('Survival chart with hazard ratio table and landmark line', async () => {
await setCheckboxChecked(true, 'input[data-test=landmarkLines]');
await setInputText('input[data-test=landmarkValues]', '20');
await setCheckboxChecked(true, 'input[data-test=hazardRatioCheckbox]');
const res = await browser.checkElement(
'div[data-test=survivalTabView]'
);
assertScreenShotMatch(res);
});
});
Loading
Loading