Skip to content

Commit

Permalink
test: improve test stability on slower backends
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Jul 11, 2024
1 parent 47337f8 commit ab68dde
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/cross.auto_refresh.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down
1 change: 1 addition & 0 deletions test/cross.basic_jwt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down
1 change: 1 addition & 0 deletions test/cross.cross_domain.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down
1 change: 1 addition & 0 deletions test/cross.disable_interception.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down
1 change: 1 addition & 0 deletions test/cross.resp_error.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down
1 change: 1 addition & 0 deletions test/cross.token_migration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down
1 change: 1 addition & 0 deletions test/cross.unauthorised_event.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down
4 changes: 3 additions & 1 deletion test/interception.basic1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 100));
} catch {}
}
Expand Down Expand Up @@ -218,7 +219,8 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
await page.goto(BASE_URL + "/index.html", { waitUntil: "load" });
await page.addScriptTag({ path: `./bundle/bundle.js`, type: "text/javascript" });
await page.evaluate(BASE_URL => (window.BASE_URL = BASE_URL), BASE_URL);
await new Promise(r => setTimeout(r, 100));
await page.waitForFunction(() => window.supertokens !== undefined);
await new Promise(r => setTimeout(r, 250));

await setup({
isInIframe: true
Expand Down

0 comments on commit ab68dde

Please sign in to comment.