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