Browse Source

test(playwright): try 30s timeout in waitForResponse

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
08dc9c5e3f
  1. 9
      tests/playwright/pages/Base.ts

9
tests/playwright/pages/Base.ts

@ -28,7 +28,8 @@ export default abstract class BasePage {
httpMethodsToMatch?: string[];
responseJsonMatcher?: ResponseSelector;
}) {
const waitForResponsePromise = this.rootPage.waitForResponse(res => {
const waitForResponsePromise = this.rootPage.waitForResponse(
res => {
let isResJsonMatched = true;
if (responseJsonMatcher) {
try {
@ -43,7 +44,11 @@ export default abstract class BasePage {
httpMethodsToMatch.includes(res.request().method()) &&
isResJsonMatched
);
});
},
{
timeout: 30000,
}
);
await uiAction();
await waitForResponsePromise;

Loading…
Cancel
Save