Skip to content

Commit

Permalink
fix: add env for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Mar 21, 2024
1 parent b52a504 commit c846297
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 25 deletions.
27 changes: 27 additions & 0 deletions .github/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
8 changes: 4 additions & 4 deletions apps/console-fb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"preview": "ORIGIN=https://console.traefik.me:4173 NEXTAUTH_URL=http://localhost:4173 dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite preview",
"sync": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- svelte-kit sync",
"test": "pnpm run test:integration && pnpm run test:unit",
"test:integration": "playwright test",
"test:unit": "vitest",
"test:unit:coverage": "vitest run --coverage",
"test:unit:ui": "vitest --ui"
"test:integration": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- playwright test",
"test:unit": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest",
"test:unit:coverage": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest run --coverage",
"test:unit:ui": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest --ui"
},
"dependencies": {
"cookie": "0.6.0"
Expand Down
4 changes: 3 additions & 1 deletion apps/console-fb/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
]
},
"preview": {},
"test:integration": {}
"test:integration": {
"dependsOn": ["build"]
}
}
}
10 changes: 7 additions & 3 deletions apps/console-sc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"dev": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite dev",
"dev:debug": "DEBUG=* dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v '.*' -u -- vite dev",
"dev:sw": "SW_DEV=true dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite dev",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"preview": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite preview",
"preview": "ORIGIN=https://console.traefik.me:4173 dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite preview",
"sync": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- svelte-kit sync",
"test": "pnpm run test:integration && pnpm run test:unit",
"test:integration": "playwright test",
"test:unit": "vitest"
"test:integration": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- playwright test",
"test:unit": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest",
"test:unit:coverage": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest run --coverage",
"test:unit:ui": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest --ui"
},
"devDependencies": {
"@fontsource-variable/inter": "5.0.17",
Expand Down
4 changes: 3 additions & 1 deletion apps/console-sc/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
]
},
"preview": {},
"test:integration": {}
"test:integration": {
"dependsOn": ["build"]
}
}
}
8 changes: 4 additions & 4 deletions apps/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"preview": "ORIGIN=https://console.traefik.me:4173 dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite preview",
"sync": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- svelte-kit sync",
"test": "pnpm run test:integration && pnpm run test:unit",
"test:integration": "playwright test",
"test:unit": "vitest",
"test:unit:coverage": "vitest run --coverage",
"test:unit:ui": "vitest --ui"
"test:integration": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- playwright test",
"test:unit": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest",
"test:unit:coverage": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest run --coverage",
"test:unit:ui": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest --ui"
},
"devDependencies": {
"@floating-ui/dom": "1.6.3",
Expand Down
18 changes: 18 additions & 0 deletions apps/console/tests/example.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');

// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();

// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});
4 changes: 3 additions & 1 deletion apps/console/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
]
},
"preview": {},
"test:integration": {},
"test:integration": {
"dependsOn": ["build"]
},
"lang:lint": {},
"lang:validate": {},
"lang:translate": {},
Expand Down
10 changes: 5 additions & 5 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"lang:translate": "pnpm inlang machine translate --project ./project.inlang -f",
"lang:validate": "pnpm inlang validate --project ./project.inlang",
"lint": "prettier --check . && eslint .",
"preview": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite preview",
"preview": "ORIGIN=https://console.traefik.me:4173 dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vite preview",
"sync": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- svelte-kit sync",
"test": "pnpm run test:integration && pnpm run test:unit",
"test:integration": "playwright test",
"test:unit": "vitest",
"test:unit:coverage": "vitest run --coverage",
"test:unit:ui": "vitest --ui"
"test:integration": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- playwright test",
"test:unit": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest",
"test:unit:coverage": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest run --coverage",
"test:unit:ui": "dotenv-run -f ../../.env -f ../../.secrets -f .env -f .secrets -v -- vitest --ui"
},
"devDependencies": {
"@floating-ui/dom": "1.6.3",
Expand Down
4 changes: 3 additions & 1 deletion apps/playground/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
]
},
"preview": {},
"test:integration": {},
"test:integration": {
"dependsOn": ["build"]
},
"lang:lint": {},
"lang:validate": {},
"lang:translate": {},
Expand Down
4 changes: 3 additions & 1 deletion apps/web/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
},
"astro": {},
"preview": {},
"test:integration": {}
"test:integration": {
"dependsOn": ["build"]
}
}
}
1 change: 0 additions & 1 deletion packages/skeleton-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"devDependencies": {
"@floating-ui/dom": "1.6.3",
"@fontsource-variable/inter": "5.0.17",
"@playwright/test": "1.42.1",
"@skeletonlabs/skeleton": "2.9.0",
"@skeletonlabs/tw-plugin": "0.3.1",
"@spectacular/eslint-config": "workspace:*",
Expand Down
13 changes: 10 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit c846297

Please sign in to comment.