Skip to content

Commit e674539

Browse files
committed
chore(ci): reenable e2e tests
1 parent 0d161c5 commit e674539

3 files changed

Lines changed: 39 additions & 8 deletions

File tree

.github/workflows/regression-tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
env:
88
VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
9+
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.deployment_status.target_url }}
@@ -42,3 +43,39 @@ jobs:
4243
name: unlighthouse-${{ matrix.device }}-report
4344
path: './.unlighthouse/'
4445
include-hidden-files: 'true'
46+
47+
ui-tests:
48+
name: Playwright UI Tests
49+
runs-on: ubuntu-latest
50+
if: ${{ contains(fromJson('["Production – catalyst-canary", "Preview – catalyst-canary"]'), github.event.deployment_status.environment) }}
51+
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
56+
- uses: pnpm/action-setup@v3
57+
58+
- name: Use Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version-file: '.nvmrc'
62+
cache: 'pnpm'
63+
64+
- name: Install dependencies
65+
run: pnpm install --frozen-lockfile
66+
67+
- name: Install Playwright Browsers
68+
run: |
69+
cd core
70+
pnpm playwright install --with-deps
71+
- name: Run Playwright tests
72+
run: |
73+
cd core
74+
pnpm playwright test tests/ui/e2e --project=tests-chromium
75+
76+
- uses: actions/upload-artifact@v4
77+
if: failure()
78+
with:
79+
name: playwright-report-ui
80+
path: core/.tests/test-results
81+
retention-days: 30

core/tests/fixtures/utils/api/customers/http.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,6 @@ export const customersHttpClient: CustomersApi = {
212212
throw new Error(`No customer found with the provided ID: ${customerId}`);
213213
}
214214

215-
if (customer.originChannelId !== (testEnv.BIGCOMMERCE_CHANNEL_ID ?? 1)) {
216-
throw new Error(
217-
`Customer ${customerId} is not from the correct channel. Expected ${
218-
testEnv.BIGCOMMERCE_CHANNEL_ID ?? 1
219-
}, got ${customer.originChannelId}.`,
220-
);
221-
}
222-
223215
return customer;
224216
},
225217
getByEmail: async (email: string, includeAddresses = false): Promise<Customer> => {

core/tests/ui/e2e/account/addresses.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ async function fillAddressForm(page: Page) {
2828
await page.getByLabel('Zip/postcode').fill(zipCode);
2929
await page.getByLabel('Country').click();
3030
await page.getByRole('option', { name: country }).first().click();
31+
await page.getByRole('radio', { name: 'Home' }).click();
3132

3233
return {
3334
firstName,
@@ -113,6 +114,7 @@ test(
113114
await expect(page.getByLabel('State/province')).toHaveValue(address.stateOrProvince ?? '');
114115
await expect(page.getByLabel('Zip/postcode')).toHaveValue(address.postalCode);
115116
await expect(page.getByRole('combobox', { name: 'Country' })).toHaveText(address.country);
117+
await page.getByRole('radio', { name: 'Home' }).click();
116118

117119
const newAddress = await fillAddressForm(page);
118120

0 commit comments

Comments
 (0)