From ca59e94575965e4c0fbc5f2fb2bfdf2be84cef85 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:06:03 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/playwright.yml | 42 +++++++++++++-------------- taxonium_website/e2e/example.spec.js | 10 ++----- taxonium_website/playwright.config.js | 25 ++++++++-------- 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index fbdd9ff6..2d7023b3 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,30 +1,30 @@ name: Playwright Tests on: push: - branches: [ main, master ] + branches: [main, master] pull_request: - branches: [ main, master ] + branches: [main, master] jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install dependencies - run: yarn install - working-directory: ./taxonium_website - - name: Install Playwright Browsers - run: npx playwright install --with-deps - working-directory: ./taxonium_website - - name: Run Playwright tests - run: npx playwright test - working-directory: ./taxonium_website - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: ./taxonium_website/playwright-report/ - retention-days: 30 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: yarn install + working-directory: ./taxonium_website + - name: Install Playwright Browsers + run: npx playwright install --with-deps + working-directory: ./taxonium_website + - name: Run Playwright tests + run: npx playwright test + working-directory: ./taxonium_website + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: ./taxonium_website/playwright-report/ + retention-days: 30 diff --git a/taxonium_website/e2e/example.spec.js b/taxonium_website/e2e/example.spec.js index 9c00e1dc..6713f46f 100644 --- a/taxonium_website/e2e/example.spec.js +++ b/taxonium_website/e2e/example.spec.js @@ -1,14 +1,10 @@ // @ts-check -import { test, expect } from '@playwright/test'; +import { test, expect } from "@playwright/test"; -test('has title', async ({ page }) => { - - await page.goto('//localhost:4173'); +test("has title", async ({ page }) => { + await page.goto("//localhost:4173"); // wait a few seconds - // Expect a title "to contain" a substring. await expect(page).toHaveTitle(/Taxonium/); }); - - diff --git a/taxonium_website/playwright.config.js b/taxonium_website/playwright.config.js index aed1da1b..425a168d 100644 --- a/taxonium_website/playwright.config.js +++ b/taxonium_website/playwright.config.js @@ -1,5 +1,5 @@ // @ts-check -import { defineConfig, devices } from '@playwright/test'; +import { defineConfig, devices } from "@playwright/test"; /** * Read environment variables from file. @@ -11,7 +11,7 @@ import { defineConfig, devices } from '@playwright/test'; * @see https://playwright.dev/docs/test-configuration */ export default defineConfig({ - testDir: './e2e', + testDir: "./e2e", /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ @@ -21,31 +21,31 @@ export default defineConfig({ /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', + reporter: "html", /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: 'http://127.0.0.1:4173', + baseURL: "http://127.0.0.1:4173", /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', + trace: "on-first-retry", }, /* Configure projects for major browsers */ projects: [ { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, + name: "chromium", + use: { ...devices["Desktop Chrome"] }, }, { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, + name: "firefox", + use: { ...devices["Desktop Firefox"] }, }, { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, + name: "webkit", + use: { ...devices["Desktop Safari"] }, }, /* Test against mobile viewports. */ @@ -70,9 +70,8 @@ export default defineConfig({ ], webServer: { - command: 'yarn preview', + command: "yarn preview", reuseExistingServer: !process.env.CI, port: 4173, }, }); -