mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-05 23:38:12 +08:00
FIX-test-target-closed: remove jestPuppeteer.resetBrowser() (#1592)
This commit is contained in:
@@ -149,7 +149,7 @@ describe("cell selection", () => {
|
|||||||
describe("gene entry", () => {
|
describe("gene entry", () => {
|
||||||
test("search for single gene", async () => {
|
test("search for single gene", async () => {
|
||||||
await goToPage(appUrlBase);
|
await goToPage(appUrlBase);
|
||||||
addGeneToSearch(data.genes.search);
|
await addGeneToSearch(data.genes.search);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("bulk add genes", async () => {
|
test("bulk add genes", async () => {
|
||||||
|
|||||||
@@ -17,25 +17,21 @@ setDefaultOptions({ timeout: 20 * 1000 });
|
|||||||
|
|
||||||
jest.retryTimes(ENV_DEFAULT.RETRY_ATTEMPTS);
|
jest.retryTimes(ENV_DEFAULT.RETRY_ATTEMPTS);
|
||||||
|
|
||||||
beforeEach(async () => {
|
(async () => {
|
||||||
await jestPuppeteer.resetBrowser();
|
|
||||||
|
|
||||||
const userAgent = await browser.userAgent();
|
const userAgent = await browser.userAgent();
|
||||||
await page.setUserAgent(`${userAgent}bot`);
|
await page.setUserAgent(`${userAgent}bot`);
|
||||||
|
|
||||||
await page._client.send("Animation.setPlaybackRate", { playbackRate: 12 });
|
await page._client.send("Animation.setPlaybackRate", { playbackRate: 12 });
|
||||||
|
|
||||||
|
page.on("pageerror", (err) => {
|
||||||
|
throw new Error(`Console error: ${err}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
page.on("error", (err) => {
|
||||||
|
throw new Error(`Console error: ${err}`);
|
||||||
|
});
|
||||||
|
|
||||||
page.on("console", async (msg) => {
|
page.on("console", async (msg) => {
|
||||||
page.on("pageerror", (err) => {
|
|
||||||
console.log(`PAGE LOG: ${msg.text()}`);
|
|
||||||
throw new Error(`Console error: ${err}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
page.on("error", (err) => {
|
|
||||||
console.log(`PAGE LOG: ${msg.text()}`);
|
|
||||||
throw new Error(`Console error: ${err}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (isDev || isDebug) {
|
if (isDev || isDebug) {
|
||||||
// If there is a console.error but an error is not thrown, this will ensure the test fails
|
// If there is a console.error but an error is not thrown, this will ensure the test fails
|
||||||
console.log(`PAGE LOG: ${msg.text()}`);
|
console.log(`PAGE LOG: ${msg.text()}`);
|
||||||
@@ -57,4 +53,4 @@ beforeEach(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user