No description
Find a file
2025-10-31 08:22:48 +01:00
tests add test 04 2025-10-31 08:22:48 +01:00
tests-examples task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
.editorconfig task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
.gitattributes task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
.gitignore task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
.yarnrc.yml task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
package-lock.json task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
package.json task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
playwright.config.ts task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
README.md task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00
yarn.lock task #46821 verua-e2e: setup playwright testing environment with first test cases 1,2,3. 2025-09-30 09:13:16 +02:00

verua-e2e

This repository contains testing specifications (specs) for VeruA application. The tests are written with Playwright. It is a tool that simulates various browsers (Chrome, Firefox, Safari) and executes tests that are written in test specs. It can create reports, can be triggered from git actions and run on a server as well.

Requirements

Setup

Clone the repo:

git clone https://code.verua.online/VeruA/verua-e2e.git
cd verua-e2e

Install dependencies with yarn:

yarn 

Usage

Usage with Visual Code / VS Codium

If you are using Visual Code (or as Open Source VS Codium) as editor, then you can install Playwright Extension from the marketplace and use it from within. It is recommnded because a lot of helpful videos exist, see Code Generation.

Usage from Command-Line

Inside that directory, you can run several commands:

  yarn playwright test
    Runs the end-to-end tests.

  yarn playwright test --ui
    Starts the interactive UI mode.

  yarn playwright test --project=chromium
    Runs the tests only on Desktop Chrome.

  yarn playwright test example
    Runs the tests in a specific file.

  yarn playwright test --debug
    Runs the tests in debug mode.

  yarn playwright codegen
    Auto generate tests with Codegen.

Code Generation

Playwright comes with helpful features that allow code generation by browser recording. Watch this video to understand how tests can be (partially) generated by recording your browser interactions. However, important parts such as checking the expectations have to be written from scratch.

Playwright Documentation about Codegen: https://playwright.dev/docs/codegen

Video aobut Playwright Codegen: https://www.youtube.com/watch?v=LM4yqrOzmFE

Hint: If the extension does not work, try reloading the windows through command palette or restart the editor.

Writing new tests

Tests are written based on Test Cases defined in https://nextcloud.verua.online/apps/files/files/1295007?dir=/Team_VeruA/Testing/Task-Ticket_45540.

The best procedure for writing new tests is:

  1. Open tests/verua.spec.ts
  2. Add a new test at the end of the spec
test('## - name your test', async ({ page }) => {
    // put your cursor here
})
  1. Start "Record at cursor" (a browser will open up)
  2. Disable recording and go to the page that you would like to test.
  3. Start recording and re-enter the URL so that it will be recorded.
  4. Interact with your browser and see how it will be recorded until you are finished.
  5. Add the expected resulted manually to the code.
  6. Run the test and see if it succeeds.

A new test should always be submitted as a PR on a new branch