Update test ui names (#638)

* Fixed changed testid

* Added debug mode for running tests
This commit is contained in:
Charlotte Weaver
2019-03-12 10:17:09 -07:00
committed by GitHub
parent 495dc55144
commit f96fd36ecb
+12 -6
View File
@@ -4,23 +4,29 @@ const jest_env = process.env.JEST_ENV || "dev";
const appPort = process.env.JEST_CXG_PORT || 3000; const appPort = process.env.JEST_CXG_PORT || 3000;
const appUrlBase = `http://localhost:${appPort}`; const appUrlBase = `http://localhost:${appPort}`;
const DEV = jest_env === "dev"; const DEV = jest_env === "dev";
const DEBUG = jest_env === "debug";
let browser; let browser;
let page; let page;
const browserViewport = { width: 1280, height: 960 }; const browserViewport = { width: 1280, height: 960 };
if (DEBUG) jest.setTimeout(100000);
beforeAll(async () => { beforeAll(async () => {
const browser_params = DEV 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); browser = await puppeteer.launch(browser_params);
page = await browser.newPage(); page = await browser.newPage();
page.setViewport(browserViewport); 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(() => { afterAll(() => {
if (!DEV) { if (!DEBUG) {
browser.close(); browser.close();
} }
}); });
@@ -72,7 +78,7 @@ describe("search for genes", () => {
describe("select cells and diffexp", () => { describe("select cells and diffexp", () => {
test("selects cells from layout and adds to cell set 1", async () => { test("selects cells from layout and adds to cell set 1", async () => {
await page.goto(appUrlBase); 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 size = await layout.boxModel();
const cellset1 = { const cellset1 = {
start: { start: {
@@ -92,7 +98,7 @@ describe("select cells and diffexp", () => {
test("selects cells from layout and adds to cell set 2", async () => { test("selects cells from layout and adds to cell set 2", async () => {
await page.goto(appUrlBase); 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 size = await layout.boxModel();
const cellset2 = { const cellset2 = {
start: { start: {
@@ -112,7 +118,7 @@ describe("select cells and diffexp", () => {
test("selects cells, saves them and performs diffexp", async () => { test("selects cells, saves them and performs diffexp", async () => {
await page.goto(appUrlBase); 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 size = await layout.boxModel();
const cellset1 = { const cellset1 = {
start: { start: {