Skip to content

Commit

Permalink
chore: add playwright job
Browse files Browse the repository at this point in the history
  • Loading branch information
pweyck committed May 23, 2024
1 parent 43474ee commit f173a91
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,24 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run lint

test:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
# TODO: docker install, composer up
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ x-service: &service
services:
database:
<<: *service
image: mysql:8
image: mysql:8.0
entrypoint:
[
"sh",
Expand All @@ -48,7 +48,7 @@ services:
shopware:
<<: *service
# TODO: build trunk tag
image: gitlab.shopware.com:5005/shopware/6/product/commercial/ci-e2e:512390
image: ghcr.io/shopware/shopware/ci-e2e:trunk
depends_on: [ database ]
ports:
- '8000:8000'
Expand Down
1 change: 1 addition & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default defineConfig({
command: 'docker compose up',
url: process.env['APP_URL'],
reuseExistingServer: true,
timeout: 120000,
},
projects: [
{
Expand Down
17 changes: 13 additions & 4 deletions tests/Fixtures.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { test, expect } from '../src/index';

test('Test all fixtures', async ({
test('All fixtures', async ({
AdminApiContext,
StoreApiContext,
DefaultSalesChannel,
AdminPage,
StorefrontPage,
IdProvider,

CartWithProductData,
PromotionWithCodeData,

MediaData,
// OrderData,
OrderData,
DigitalProductData,
ProductData,
PropertiesData,
Expand All @@ -21,4 +19,15 @@ test('Test all fixtures', async ({

await expect(id).toBeTruthy();
await expect(uuid).toBeTruthy();

await expect(AdminApiContext).toBeInstanceOf(Object);
await expect(StoreApiContext).toBeInstanceOf(Object);
await expect(DefaultSalesChannel).toBeInstanceOf(Object);
await expect(CartWithProductData).toBeInstanceOf(Object);
await expect(PromotionWithCodeData).toBeInstanceOf(Object);
await expect(MediaData).toBeInstanceOf(Object);
await expect(OrderData).toBeInstanceOf(Object);
await expect(DigitalProductData).toBeInstanceOf(Object);
await expect(ProductData).toBeInstanceOf(Object);
await expect(PropertiesData).toBeInstanceOf(Object);
});

0 comments on commit f173a91

Please sign in to comment.