Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: E2E testing fix #4151

Merged
merged 7 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading