diff --git a/.github/workflows/run-playwright-tests-anvil-catalog.yml b/.github/workflows/run-playwright-tests-anvil-catalog.yml new file mode 100644 index 000000000..a46060008 --- /dev/null +++ b/.github/workflows/run-playwright-tests-anvil-catalog.yml @@ -0,0 +1,39 @@ +name: Playwright Tests anvil-catalog +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "20.10.0" + - name: Install dependencies + run: | + cd explorer + npm ci + - name: Install Playwright Browsers + run: | + cd explorer + npx playwright install --with-deps + - name: Build AnVIL-catalog database + run: | + cd ./explorer/files + npm ci + mkdir ./anvil-catalog/out + npm run build-anvil-db + - name: Run Playwright tests + run: | + cd explorer + npm run test:anvil-catalog + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: explorer/playwright-report/ + retention-days: 30 \ No newline at end of file diff --git a/explorer/e2e/anvil-catalog/anvilcatalog-sort.spec.ts b/explorer/e2e/anvil-catalog/anvilcatalog-sort.spec.ts index 1d261d32d..bd2a12ff1 100644 --- a/explorer/e2e/anvil-catalog/anvilcatalog-sort.spec.ts +++ b/explorer/e2e/anvil-catalog/anvilcatalog-sort.spec.ts @@ -4,21 +4,18 @@ import { anvilcatalogTabs } from "./anvilcatalog-tabs"; test.describe.configure({ mode: "parallel" }); -test.setTimeout(120000); test("On the Consortia tab, expect clicking the column header (the sort button) to keep the first element of the column visible", async ({ page, }) => { await testSortCatalog(page, anvilcatalogTabs.consortia); }); -test.setTimeout(120000); test("On the Studies tab, expect clicking the column header (the sort button) to keep the first element of the column visible", async ({ page, }) => { await testSortCatalog(page, anvilcatalogTabs.studies); }); -test.setTimeout(120000); test("On the Workspaces tab, expect clicking the column header (the sort button) to keep the first element of the column visible", async ({ page, }) => { diff --git a/explorer/playwright_anvil-catalog.config.ts b/explorer/playwright_anvil-catalog.config.ts index acbf475cd..19bf82642 100644 --- a/explorer/playwright_anvil-catalog.config.ts +++ b/explorer/playwright_anvil-catalog.config.ts @@ -3,7 +3,7 @@ import { devices } from "@playwright/test"; const config: PlaywrightTestConfig = { expect: { - timeout: 20 * 1000, + timeout: 15 * 1000, }, outputDir: "playwright-report/", projects: [ @@ -27,9 +27,10 @@ const config: PlaywrightTestConfig = { screenshot: "only-on-failure", }, webServer: { - command: "npm run dev:anvil-catalog", + command: + "npm run build-dev:anvil-catalog && mv ./out/ ./out_temp && mkdir ./out && mv ./out_temp ./out/data && npm start", reuseExistingServer: !process.env.CI, - timeout: 120 * 1000, + timeout: 240 * 1000, url: "http://localhost:3000/data", }, };