🎉 初始化项目
This commit is contained in:
22
web-app/tests/frontend/frontent-test-utils.js
Normal file
22
web-app/tests/frontend/frontent-test-utils.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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 });
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user