Skip to content

Commit 9a2fa49

Browse files
author
jacekmalczyk
committed
test(LandingPage): Basic checks
1 parent 3d3f304 commit 9a2fa49

File tree

7 files changed

+6679
-6391
lines changed

7 files changed

+6679
-6391
lines changed

.github/workflows/playwright.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 16
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Install Playwright Browsers
19+
run: npx playwright install --with-deps
20+
- name: Run Playwright tests
21+
run: npx playwright test
22+
- uses: actions/upload-artifact@v3
23+
if: always()
24+
with:
25+
name: playwright-report
26+
path: playwright-report/
27+
retention-days: 30

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ node_modules
66

77
/prisma/dev.db
88
.env
9+
/test-results/
10+
/playwright-report/
11+
/playwright/.cache/

package-lock.json

+6,116-6,391
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"scripts": {
88
"build": "remix build",
99
"dev": "remix dev",
10+
"test": "npx playwright test",
1011
"start": "remix-serve build",
1112
"typecheck": "tsc"
1213
},
@@ -18,11 +19,13 @@
1819
"@remix-run/serve": "^1.14.3",
1920
"bcryptjs": "^2.4.3",
2021
"date-fns": "^2.29.3",
22+
"framer-motion": "^10.10.0",
2123
"isbot": "^3.6.5",
2224
"react": "^18.2.0",
2325
"react-dom": "^18.2.0"
2426
},
2527
"devDependencies": {
28+
"@playwright/test": "^1.32.2",
2629
"@remix-run/dev": "^1.14.3",
2730
"@remix-run/eslint-config": "^1.14.3",
2831
"@types/bcryptjs": "^2.4.2",

playwright.config.ts

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { defineConfig, devices } from "@playwright/test";
2+
3+
/**
4+
* Read environment variables from file.
5+
* https://github.com/motdotla/dotenv
6+
*/
7+
// require('dotenv').config();
8+
9+
/**
10+
* See https://playwright.dev/docs/test-configuration.
11+
*/
12+
export default defineConfig({
13+
testDir: "./tests",
14+
/* Run tests in files in parallel */
15+
fullyParallel: true,
16+
/* Fail the build on CI if you accidentally left test.only in the source code. */
17+
forbidOnly: !!process.env.CI,
18+
/* Retry on CI only */
19+
retries: process.env.CI ? 2 : 0,
20+
/* Opt out of parallel tests on CI. */
21+
workers: process.env.CI ? 1 : undefined,
22+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
23+
reporter: "html",
24+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
25+
use: {
26+
/* Base URL to use in actions like `await page.goto('/')`. */
27+
baseURL: "http://127.0.0.1:3000",
28+
29+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30+
trace: "on-first-retry",
31+
},
32+
33+
/* Configure projects for major browsers */
34+
projects: [
35+
{
36+
name: "chromium",
37+
use: { ...devices["Desktop Chrome"] },
38+
},
39+
40+
{
41+
name: "firefox",
42+
use: { ...devices["Desktop Firefox"] },
43+
},
44+
45+
{
46+
name: "webkit",
47+
use: { ...devices["Desktop Safari"] },
48+
},
49+
50+
/* Test against mobile viewports. */
51+
// {
52+
// name: 'Mobile Chrome',
53+
// use: { ...devices['Pixel 5'] },
54+
// },
55+
// {
56+
// name: 'Mobile Safari',
57+
// use: { ...devices['iPhone 12'] },
58+
// },
59+
60+
/* Test against branded browsers. */
61+
// {
62+
// name: 'Microsoft Edge',
63+
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
64+
// },
65+
// {
66+
// name: 'Google Chrome',
67+
// use: { ..devices['Desktop Chrome'], channel: 'chrome' },
68+
// },
69+
],
70+
71+
/* Run your local dev server before starting the tests */
72+
// webServer: {
73+
// command: 'npm run start',
74+
// url: 'http://127.0.0.1:3000',
75+
// reuseExistingServer: !process.env.CI,
76+
// },
77+
});

0 commit comments

Comments
 (0)