From f96fd36ecbdc4de68ba2dedd2f584675bf576c7e Mon Sep 17 00:00:00 2001 From: Charlotte Weaver Date: Tue, 12 Mar 2019 10:17:09 -0700 Subject: [PATCH] Update test ui names (#638) * Fixed changed testid * Added debug mode for running tests --- client/__tests__/e2e/e2e.test.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/client/__tests__/e2e/e2e.test.js b/client/__tests__/e2e/e2e.test.js index 514fe163..7442a94f 100644 --- a/client/__tests__/e2e/e2e.test.js +++ b/client/__tests__/e2e/e2e.test.js @@ -4,23 +4,29 @@ const jest_env = process.env.JEST_ENV || "dev"; const appPort = process.env.JEST_CXG_PORT || 3000; const appUrlBase = `http://localhost:${appPort}`; const DEV = jest_env === "dev"; +const DEBUG = jest_env === "debug"; let browser; let page; const browserViewport = { width: 1280, height: 960 }; +if (DEBUG) jest.setTimeout(100000); + beforeAll(async () => { const browser_params = DEV - ? { headless: false, slowMo: 100, devtools: true } + ? { headless: false, slowMo: 50 } + : DEBUG + ? { headless: false, slowMo: 200, devtools: true } : {}; browser = await puppeteer.launch(browser_params); page = await browser.newPage(); page.setViewport(browserViewport); - if (DEV) page.on("console", msg => console.log("PAGE LOG:", msg.text())); + if (DEV || DEBUG) + page.on("console", msg => console.log("PAGE LOG:", msg.text())); }); afterAll(() => { - if (!DEV) { + if (!DEBUG) { browser.close(); } }); @@ -72,7 +78,7 @@ describe("search for genes", () => { describe("select cells and diffexp", () => { test("selects cells from layout and adds to cell set 1", async () => { await page.goto(appUrlBase); - const layout = await page.waitForSelector("[data-testid='layout']"); + const layout = await page.waitForSelector("[data-testid='layout-graph']"); const size = await layout.boxModel(); const cellset1 = { start: { @@ -92,7 +98,7 @@ describe("select cells and diffexp", () => { test("selects cells from layout and adds to cell set 2", async () => { await page.goto(appUrlBase); - const layout = await page.waitForSelector("[data-testid='layout']"); + const layout = await page.waitForSelector("[data-testid='layout-graph']"); const size = await layout.boxModel(); const cellset2 = { start: { @@ -112,7 +118,7 @@ describe("select cells and diffexp", () => { test("selects cells, saves them and performs diffexp", async () => { await page.goto(appUrlBase); - const layout = await page.waitForSelector("[data-testid='layout']"); + const layout = await page.waitForSelector("[data-testid='layout-graph']"); const size = await layout.boxModel(); const cellset1 = { start: {