Skip to content

Commit

Permalink
Merge pull request #4151 from Codeinwp/fix/e2e_tests
Browse files Browse the repository at this point in the history
Fix: E2E testing fix
  • Loading branch information
preda-bogdan authored Nov 24, 2023
2 parents bc242ca + b145a55 commit 541aacb
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/envs/cli-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ init_environment(){
wp --allow-root theme install --activate $NEVE_LOCATION
wp --allow-root option update fresh_site 0
echo "Installing Theme API Plugin"
wp --allow-root plugin install https://github.com/cristian-ungureanu/wp-thememods-api/archive/refs/heads/main.zip --force --activate
wp --allow-root plugin install https://github.com/codeinwp/wp-thememods-api/archive/refs/heads/main.zip --force --activate
}


Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
workers: process.env.CI ? 6 : undefined,
retries: 0,
timeout: parseInt(process.env.TIMEOUT || '', 10) || 100_000, // Defaults to 100 seconds.
timeout: parseInt(process.env.TIMEOUT || '', 10) || 150_000, // Defaults to 100 seconds.
fullyParallel: true,
projects: [
// Setup project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test.describe('Custom Global Color Control', () => {
await page.locator('.block-editor-rich-text__editable').first().click();
// use Background color control to open the color picker, available since WP 6.1
await page.getByRole('button', { name: 'Background' }).click();
await page.getByRole('button', { name: 'Color: Custom 1' }).click();
await page.getByRole('option', { name: 'Color: Custom 1' }).click();
await page
.locator('.block-editor-panel-color-gradient-settings__color-name')
.getByText('Text')
Expand Down Expand Up @@ -72,6 +72,6 @@ test.describe('Custom Global Color Control', () => {
await page.goto('/hello-world/?test_name=custom-global-colors');
await expect(
await page.locator('.nv-content-wrap p').first()
).toHaveClass(/has-custom-1-color/);
).toHaveClass(/has-custom-1-background-color/);
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions e2e-tests/specs/woo-visual-regression/checkout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ test.describe('Checkout page check', () => {
await page.goto('/product/album/');
await page.locator('.single_add_to_cart_button').click();
await page.goto('/checkout/');
await page.locator('#place_order').click();
await page.getByRole('button', { name: 'Place Order' }).click();
await page.waitForTimeout(1000);
await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 0.2 });
await page
.getByRole('heading', { name: 'Checkout' })
.scrollIntoViewIfNeeded();
await expect(page).toHaveScreenshot({
maxDiffPixelRatio: 0.2,
});
});

test('Check MyAccount errors', async ({ page }) => {
await page.goto('/my-account/edit-account/');
await page.locator('.woocommerce-Button').first().click();
await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 0.2 });
await expect(page).toHaveScreenshot({
maxDiffPixelRatio: 0.2,
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 541aacb

Please sign in to comment.