Skip to content

Commit 771a8e9

Browse files
authored
Fix E2E setup error (#3336)
* Enable E2E setup DEBUG flag * Replace docker-compose with docker compose * Disable the E2E setup DEBUG flag * Add 2sec wait to SCA test as a temp measure to reduce flakiness
1 parent 5ca67d4 commit 771a8e9

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/e2e/bin/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if ! docker info > /dev/null 2>&1; then
3434
fi
3535

3636
step "Starting E2E docker containers"
37-
CWD="$CWD" E2E_ROOT="$E2E_ROOT" redirect_output docker-compose -p wcstripe-e2e -f "$E2E_ROOT"/env/docker-compose.yml up --build --force-recreate -d wordpress
37+
CWD="$CWD" E2E_ROOT="$E2E_ROOT" redirect_output docker compose -p wcstripe-e2e -f "$E2E_ROOT"/env/docker-compose.yml up --build --force-recreate -d wordpress
3838

3939
step "Configuring Wordpress"
4040
# Wait for containers to be started up before setup.

tests/e2e/tests/_legacy-experience/checkout/sca-card.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ test( 'customer can checkout with a SCA card @smoke', async ( { page } ) => {
3030
) {
3131
await page.waitForTimeout( 1000 );
3232
}
33+
// Not ideal, but the iframe body gets repalced after load, so a waitFor does not work here.
34+
await page.waitForTimeout( 2000 );
3335

3436
await page
3537
.frame( {
@@ -38,7 +40,7 @@ test( 'customer can checkout with a SCA card @smoke', async ( { page } ) => {
3840
.getByRole( 'button', { name: 'Complete' } )
3941
.click();
4042

41-
await page.waitForNavigation();
43+
await page.waitForURL( '**/checkout/order-received/**' );
4244

4345
await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
4446
'Order received'

tests/e2e/tests/checkout/blocks/sca-card.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ test( 'customer can checkout with a SCA card @smoke @blocks', async ( {
2929
) {
3030
await page.waitForTimeout( 1000 );
3131
}
32+
// Not ideal, but the iframe body gets repalced after load, so a waitFor does not work here.
33+
await page.waitForTimeout( 2000 );
3234

3335
await page
3436
.frame( {
@@ -37,7 +39,7 @@ test( 'customer can checkout with a SCA card @smoke @blocks', async ( {
3739
.getByRole( 'button', { name: 'Complete' } )
3840
.click();
3941

40-
await page.waitForNavigation();
42+
await page.waitForURL( '**/checkout/order-received/**' );
4143

4244
await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
4345
'Order received'

tests/e2e/tests/checkout/shortcode/sca-card.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ test( 'customer can checkout with a SCA card @smoke', async ( { page } ) => {
2727
) {
2828
await page.waitForTimeout( 1000 );
2929
}
30+
// Not ideal, but the iframe body gets repalced after load, so a waitFor does not work here.
31+
await page.waitForTimeout( 2000 );
3032

3133
await page
3234
.frame( {
@@ -35,7 +37,7 @@ test( 'customer can checkout with a SCA card @smoke', async ( { page } ) => {
3537
.getByRole( 'button', { name: 'Complete' } )
3638
.click();
3739

38-
await page.waitForNavigation();
40+
await page.waitForURL( '**/checkout/order-received/**' );
3941

4042
await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
4143
'Order received'

0 commit comments

Comments
 (0)