Skip to content

Commit

Permalink
Fix E2E setup error (#3336)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
diegocurbelo authored Aug 2, 2024
1 parent 5ca67d4 commit 771a8e9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/e2e/bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if ! docker info > /dev/null 2>&1; then
fi

step "Starting E2E docker containers"
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
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

step "Configuring Wordpress"
# Wait for containers to be started up before setup.
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/tests/_legacy-experience/checkout/sca-card.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ test( 'customer can checkout with a SCA card @smoke', async ( { page } ) => {
) {
await page.waitForTimeout( 1000 );
}
// Not ideal, but the iframe body gets repalced after load, so a waitFor does not work here.
await page.waitForTimeout( 2000 );

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

await page.waitForNavigation();
await page.waitForURL( '**/checkout/order-received/**' );

await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
'Order received'
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/tests/checkout/blocks/sca-card.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ test( 'customer can checkout with a SCA card @smoke @blocks', async ( {
) {
await page.waitForTimeout( 1000 );
}
// Not ideal, but the iframe body gets repalced after load, so a waitFor does not work here.
await page.waitForTimeout( 2000 );

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

await page.waitForNavigation();
await page.waitForURL( '**/checkout/order-received/**' );

await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
'Order received'
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/tests/checkout/shortcode/sca-card.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ test( 'customer can checkout with a SCA card @smoke', async ( { page } ) => {
) {
await page.waitForTimeout( 1000 );
}
// Not ideal, but the iframe body gets repalced after load, so a waitFor does not work here.
await page.waitForTimeout( 2000 );

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

await page.waitForNavigation();
await page.waitForURL( '**/checkout/order-received/**' );

await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
'Order received'
Expand Down

0 comments on commit 771a8e9

Please sign in to comment.