Skip to content

Commit

Permalink
[not verified] E2E tests: fix waitForResponse predicates (#28262)
Browse files Browse the repository at this point in the history
  • Loading branch information
adimoldovan authored and n3f committed Jan 11, 2023
1 parent 3ebe5d0 commit 98b772c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tools/e2e-commons/pages/wp-admin/blocks/simple-payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export default class SimplePaymentBlock extends PageActions {
}

async waitForResponse() {
const testUrl = /^https?:\/\/.*%2Fwp%2Fv2%2Fjp_pay_product/;

await this.page.waitForResponse( resp => testUrl.test( resp.url() ) );
await this.page.waitForResponse(
r => decodeURIComponent( r.url() ).match( /jp_pay_product/ ) && r.status() === 200
);
}

getSelector( selector ) {
Expand Down
6 changes: 3 additions & 3 deletions tools/e2e-commons/pages/wp-admin/blocks/tilled-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export default class TiledGallery extends PageActions {
}

async waitForResponse() {
const testUrl = /^https?:\/\/.*%2Fwp%2Fv2%2Fmedia/;

await this.page.waitForResponse( resp => testUrl.test( resp.url() ) );
await this.page.waitForResponse(
r => decodeURIComponent( r.url() ).match( /wp\/v2\/media/ ) && r.status() === 200
);
}

async linkToAttachment() {
Expand Down

0 comments on commit 98b772c

Please sign in to comment.