From d1630f944c51383bb7e1b7a2a16271ea87ea96f9 Mon Sep 17 00:00:00 2001 From: Theo Sanderson Date: Thu, 12 Oct 2023 20:13:28 +0100 Subject: [PATCH] Integration test v2 (#546) --- .github/workflows/frontend-test.yml | 28 -------------------------- .github/workflows/integration_test.yml | 16 +++++++++++++++ .github/workflows/playwright.yml | 10 +++++---- taxonium_website/e2e/test-2.spec.ts | 26 ++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/frontend-test.yml create mode 100644 .github/workflows/integration_test.yml create mode 100644 taxonium_website/e2e/test-2.spec.ts diff --git a/.github/workflows/frontend-test.yml b/.github/workflows/frontend-test.yml deleted file mode 100644 index b5d07c0c..00000000 --- a/.github/workflows/frontend-test.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Frontend - -on: - workflow_call: - -jobs: - test: - env: - CI: false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: NPM build - run: | - cd taxonium_website - npm install -g yarn - yarn install - yarn build - cd build - - name: "Upload Artifact" - uses: actions/upload-artifact@v3 - with: - name: taxonium_website - path: taxonium_website/build - retention-days: 5 diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml new file mode 100644 index 00000000..bcff0860 --- /dev/null +++ b/.github/workflows/integration_test.yml @@ -0,0 +1,16 @@ +name: Integration Test + +on: + repository_dispatch: + workflow_dispatch: + push: + pull_request: + branches: [master] + schedule: + - cron: "0 0 * * *" +jobs: + python: + uses: ./.github/workflows/python-test.yml + playwright: + uses: ./.github/workflows/playwright.yml + needs: [python] diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 4b234af1..227d9baf 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,15 +1,17 @@ name: Playwright Tests on: - push: - branches: [main, master] - pull_request: - branches: [main, master] + repository_dispatch: + workflow_dispatch: jobs: playwright: timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: tfci-taxonium-config + path: ./data/ - uses: actions/setup-node@v3 with: node-version: 18 diff --git a/taxonium_website/e2e/test-2.spec.ts b/taxonium_website/e2e/test-2.spec.ts new file mode 100644 index 00000000..a9edce68 --- /dev/null +++ b/taxonium_website/e2e/test-2.spec.ts @@ -0,0 +1,26 @@ +import { test, expect } from "@playwright/test"; + +test("test", async ({ page }) => { + await page.goto("http://localhost:4173/"); + await page.locator('input[type="file"]').click(); + await page + .locator('input[type="file"]') + .setInputFiles("../../data/tfci-taxonium-chron.jsonl"); + await page.locator('input[name="treenomeEnabled"]').check(); + await page.locator('input[name="treenomeEnabled"]').uncheck(); + await page.getByLabel("Tree type:DistanceTime").selectOption("x_time"); + await page.getByLabel("Tree type:DistanceTime").selectOption("x_dist"); + await page.getByRole("textbox").click(); + await page.getByRole("textbox").fill("TFCI"); + await page.locator("#view-main").click(); + await page.locator("#view-main").click(); + await page.locator("#view-main").click(); + await page.getByRole("button", { name: "Zoom in vertically" }).click(); + await page.getByRole("button", { name: "Zoom in horizontally" }).click(); + await page.getByRole("button", { name: "Zoom out vertically" }).click(); + await page.getByRole("button", { name: "Zoom out horizontally" }).click(); + await page.getByRole("button", { name: "Settings" }).click(); + await page.getByRole("tab", { name: "Appearance" }).click(); + await page.getByRole("tab", { name: "Search" }).click(); + await page.getByRole("tab", { name: "Appearance" }).click(); +});