Skip to content
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
7 changes: 5 additions & 2 deletions .github/workflows/buildAndDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
workflow_dispatch: {}
workflow_dispatch: { }

jobs:
build_and_deploy:
Expand All @@ -13,6 +13,9 @@ jobs:
group: build-and-deploy
cancel-in-progress: true
runs-on: ubuntu-24.04
env:
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -43,7 +46,7 @@ jobs:
run: npx playwright install --with-deps

- name: Run e2e tests
run: npm run test:e2e
run: PLAYWRIGHT_USE_BUILD=1 npm run test:e2e

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/checkPullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Check Pull Requests"

on:
pull_request:
types: ["opened", "edited", "reopened", "synchronize"]
types: [ "opened", "edited", "reopened", "synchronize" ]

jobs:
check_pull_request:
Expand All @@ -11,6 +11,9 @@ jobs:
group: ${{ github.head_ref }}
cancel-in-progress: true
runs-on: ubuntu-24.04
env:
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -38,4 +41,4 @@ jobs:
run: npx playwright install --with-deps

- name: Run e2e tests
run: PLAYWRIGHT_DEV_SERVER=1 npm run test:e2e
run: npm run test:e2e
7 changes: 5 additions & 2 deletions .github/workflows/makeArtifactWithTestScreenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
make_artifact_with_test_screenshots:
name: Make artifact with Test Screenshots
runs-on: ubuntu-24.04
env:
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
steps:
- uses: actions/checkout@v3

Expand All @@ -20,8 +23,8 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run e2e tests
run: PLAYWRIGHT_DEV_SERVER=1 npm run test:e2e:update-snapshots
- name: Run e2e tests with snapshots update
run: npm run test:e2e:update-snapshots

- name: Upload test screenshots
uses: actions/upload-artifact@v4
Expand Down
44 changes: 3 additions & 41 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();
const useExistedBuild = !!process.env.PLAYWRIGHT_USE_BUILD;

/**
* See https://playwright.dev/docs/test-configuration.
Expand Down Expand Up @@ -63,52 +59,18 @@ const config: PlaywrightTestConfig = {
...devices["Desktop Safari"],
},
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: {
// ...devices['Pixel 5'],
// },
// },
// {
// name: 'Mobile Safari',
// use: {
// ...devices['iPhone 12'],
// },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: {
// channel: 'msedge',
// },
// },
// {
// name: 'Google Chrome',
// use: {
// channel: 'chrome',
// },
// },
],

/* Folder for test artifacts such as screenshots, videos, traces, etc. */
// outputDir: 'test-results/',

/* Run your local dev server before starting the tests */
webServer: {
/**
* Use the dev server by default for faster feedback loop.
* Use the preview server on CI for more realistic testing.
Playwright will re-use the local server if there is already a dev-server running.
*/
command:
process.env.CI && !process.env.PLAYWRIGHT_DEV_SERVER
? "vite preview --port 5173"
: "vite dev",
command: useExistedBuild ? "vite preview --port 5173" : "vite dev",
port: 5173,
reuseExistingServer: !process.env.CI || !!process.env.PLAYWRIGHT_DEV_SERVER,
reuseExistingServer: useExistedBuild,
},
};

Expand Down
2 changes: 1 addition & 1 deletion vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
outlierSupport: ["vue"],
},
policy: {
"style-src": ["'unsafe-inline'"], // todo remove when naive-ui will be fixed
"style-src": ["'self'", "'unsafe-inline'"], // todo remove when naive-ui will be fixed
"style-src-elem": ["'unsafe-inline'"], // todo remove when naive-ui will be fixed
"img-src": ["data:", "blob:"],
"script-src": ["'wasm-unsafe-eval'"],
Expand Down
Loading