mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 20:57:56 +08:00
Update test ui names (#638)
* Fixed changed testid * Added debug mode for running tests
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user