fix: optimize test timeouts and wait conditions for better stability
This commit is contained in:
@@ -22,6 +22,12 @@ export type TestFixtures = {
|
||||
};
|
||||
|
||||
export const test = base.extend<TestFixtures>({
|
||||
page: async ({ page }, use) => {
|
||||
page.setDefaultTimeout(45000);
|
||||
page.setDefaultNavigationTimeout(90000);
|
||||
await use(page);
|
||||
},
|
||||
|
||||
homePage: async ({ page }, use) => {
|
||||
const homePage = new HomePage(page);
|
||||
await use(homePage);
|
||||
|
||||
@@ -68,9 +68,9 @@ export class HomePage extends BasePage {
|
||||
}
|
||||
|
||||
async waitForPageLoad(): Promise<void> {
|
||||
await this.waitForLoadState('networkidle');
|
||||
await this.header.waitFor({ state: 'visible' });
|
||||
await this.heroSection.waitFor({ state: 'visible' });
|
||||
await this.waitForLoadState('domcontentloaded');
|
||||
await this.header.waitFor({ state: 'visible', timeout: 15000 });
|
||||
await this.heroSection.waitFor({ state: 'visible', timeout: 15000 });
|
||||
}
|
||||
|
||||
async getNavigationItems(): Promise<Locator[]> {
|
||||
|
||||
Reference in New Issue
Block a user