Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frontend end-to-end testing #43

Closed
juliaogris opened this issue Jan 1, 2024 · 1 comment
Closed

Add frontend end-to-end testing #43

juliaogris opened this issue Jan 1, 2024 · 1 comment

Comments

@juliaogris
Copy link
Member

juliaogris commented Jan 1, 2024

Investigate different options for browser tests that can be run against localhost, PR preview URL and https://evystage.dev / https://evy.dev

Candidates:

  • node/puppeteer/ava-testlibrary
  • node/playwright
  • deno/astral
@juliaogris juliaogris added this to evy Jan 1, 2024
@juliaogris juliaogris converted this from a draft issue Jan 1, 2024
@juliaogris juliaogris added this to the 🚸 Learn v0.2.0 milestone Jan 1, 2024
@juliaogris juliaogris moved this to In Progress in evy Jan 9, 2024
juliaogris added a commit to evylang/evy that referenced this issue Jan 9, 2024
Initialize end to end testing in top level directory e2e. Everything related
to end to end testing will be in this directory. Initialize node package
with

    echo '{"private": true}' > e2e/package.json
    npm install --save-dev --prefix e2e playwright
    npm install --save-dev --prefix e2e @playwright/test@latest

Add `node_modules/` to .gitignore.

Setup basic playwright test config that will allow to parametrize the baseURL
of tests.

Add a minimal index.test.js test file that loads the Evy playground index.html
page. It runs two tests on it:

- ensure the title is "Evy | Playground"
- execute `Run` and ensure the console output contains expected test.

Issue: evylang/todo#43
juliaogris added a commit to evylang/evy that referenced this issue Jan 9, 2024
Initialize end to end testing in top level directory e2e. 

**On CI e2 testing runs against https://evy.dev at the moment!**

Initialize `e2e` node package with

    echo '{"private": true}' > e2e/package.json
    npm install --save-dev --prefix e2e playwright
    npm install --save-dev --prefix e2e @playwright/test@latest

Add `node_modules/` to .gitignore.

Add a minimal `index.test.js` test file that loads the Evy playground `index.html`
page. It runs two tests on it:

- ensure the title is `"Evy | Playground"`
- execute `Run` and ensure the console output contains expected contents.

Setup basic playwright test config that will allow to parametrize the `baseURL`
for tests - it expects a `BASEURL` environment variable and falls back to `https://localhost:8080` by default. For local development run

    SERVEDIR_PORT=8080 make serve
 
and in other terminal

    cd e2e; npx playwright test [--ui]

Add `e2e` target to make file, triggered by `ci` target.
If `BASEURL` environment variable is not set, make will set it to `https://evy.dev` 
for now. This allows us to prototype e2e testing until we can extract the per-PR 
preview deployment URL from the firebase-deploy run. 
We will add this in a follow up PR.

Despite concerns it seems that the CI runtime has increased by only less than 30 seconds at this stage.

Part 1/2 for evylang/todo#43

Pull-Request: #238
@juliaogris
Copy link
Member Author

Again, an ongoing project, but mostly done by evylang/evy#243 and evylang/evy#238

@github-project-automation github-project-automation bot moved this from In Progress to Done in evy Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant