1c1f25b5c6
* Backported `/tests` from `macros-2.0`. * Added `eslint-plugin-playwright` * Improve formatting --------- Co-authored-by: user <user@exmaple.com> Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
23 lines
796 B
JavaScript
23 lines
796 B
JavaScript
export const testSetup = {
|
|
/**
|
|
* Navigates to the home page without waiting for SillyTavern to load.
|
|
* @param {Object} params
|
|
* @param {import('@playwright/test').Page} params.page
|
|
*/
|
|
goST: async ({ page }) => {
|
|
await page.goto('/');
|
|
},
|
|
|
|
/**
|
|
* Waits for SillyTavern to fully load by navigating to the home page and waiting for the preloader to disappear.
|
|
* @param {Object} params
|
|
* @param {import('@playwright/test').Page} params.page
|
|
*/
|
|
awaitST: async ({ page }) => {
|
|
await page.goto('/');
|
|
await page.click('#userList .userSelect:last-child');
|
|
await page.waitForURL('http://127.0.0.1:8000');
|
|
await page.waitForFunction('document.getElementById("preloader") === null', { timeout: 0 });
|
|
},
|
|
};
|