Brolendar
Find a file
yoshi 582d129e97
Some checks failed
Build, deploy, and test Brolendar / check_code (push) Failing after 3m5s
ci: Rename Jobs
Signed-off-by: yoshi <joshua.martius@rwth-aachen.de>

Update .forgejo/workflows/check_code.yml

Signed-off-by: yoshi <joshua.martius@rwth-aachen.de>

Update .forgejo/workflows/pr_playwright_check.yml

Signed-off-by: yoshi <joshua.martius@rwth-aachen.de>
2025-12-10 11:32:15 +01:00
.forgejo ci: Rename Jobs 2025-12-10 11:32:15 +01:00
.husky fix: pre-commit hook. Dont try to format deleted files 2025-09-19 18:10:46 +02:00
public/images feat(map): added custom map marker 2025-06-28 21:01:16 +02:00
src chore: move event prefetch logic into new function 2025-12-07 09:24:31 +01:00
tests chore: remove unused tests 2025-12-06 17:24:33 +01:00
.envrc feat: add flake.nix with yarn 2025-03-05 15:05:56 +01:00
.gitignore chore: updated gitignore 2025-10-23 11:10:08 +02:00
.yarnrc.yml chore: added yarn v4 files 2025-11-26 12:54:36 +01:00
eslint.config.js feat: altlogotext and ignore debuginfo 2025-11-27 15:12:48 +01:00
flake.lock chore: update nix env to match the general env 2025-12-06 17:17:43 +01:00
flake.nix chore: update nix env to match the general env 2025-12-06 17:17:43 +01:00
i18next.config.ts feat: updated config to find all errors 2025-11-27 15:12:48 +01:00
index.html feat(design): added logo 2025-06-25 20:45:29 +02:00
LICENSE Initial commit 2025-02-26 16:56:02 +01:00
package.json chore(deps): Update devDependencies 2025-12-07 20:06:59 +01:00
playwright.config.ts tests: set timeout to 5 minutes 2025-12-07 10:15:24 +01:00
README.md chore: add links to deployed instances to README 2025-12-07 20:20:26 +01:00
renovate.json feat(renovate): config edits 2025-12-07 11:43:11 +01:00
tsconfig.app.json development (#2) 2025-03-02 12:58:18 +01:00
tsconfig.json fix: removed electron from tsconfig 2025-10-15 18:58:55 +02:00
tsconfig.node.json style: apply Prettier style 2025-05-22 18:41:42 +02:00
vite.config.ts fix: include node modules 2025-10-18 13:31:46 +02:00
yarn.lock chore(deps): Update react-router-dom to v7.10.0 2025-12-10 05:01:03 +00:00

Brolendar

Its gonna be great

Deployed Instances

Tests

Implement Tests

General

  • Tests are implemented with playwright
  • Tests are stored in tests/<name>.spec.ts
  • Configs for playwright are stored in playwright.config.ts (you probably don't need to touch this)

Writing A New Test

  • Create a new file in tests/ called <name>.spec.ts

  • Take inspiration by one of the existing tests, for example calendar.spec.ts:

    • You can mostly copy the imports from the top
    • Below that are environment variable imports that define, for example, backend and frontend urls
    • If you want to run some logic before each test, define a test.beforeEach( async ({ page }) => {})
    • In test.describe you can define a number of tests like test("description", async ({ page }) => {})
  • Find more information at playwright!

Test Structure

The structure of how tests are grouped is not yet final and might change in the future.

Framework

Fixtures

A fixtures is a page in a specific state. For example, the brolendarPage fixture is logged in with Brolendar and DAV credentials with all events cleared. It uses the Brolendar class for moving between pages and clicking on common buttons.

New fixtures can be added in tests/fixtures/fixtures.ts.

Brolendar Class

The BrolendarClass is defined in /tests/fixtures/brolendar.ts and implements common actions in Brolendar. This includes common selectors and workflows. For example, the login functions loads the /welcome page, enters credentials loaded from .env and loads /calendar.

Any common action a user could do in Brolendar should be implemented here.

Network Calls to Backend

The brolendarPage fixture intercepts all network calls and blocks them by default. Therefore, any calls have to be specified in the test with the intendet status code and body.

Add the following code before the corresponding backend calls to enable the /caldav/sync, /caldav/calendars, and /caldav/events endpoints.

brolendarPage.page.route('**/caldav/sync', route => route.fulfill(
  {
    status: 200,
    body: JSON.stringify({ success: true })
  }
))
brolendarPage.page.route('**/caldav/calendars', route => route.fulfill(
  {
    status: 200,
    headers: headers,
    body: JSON.stringify({
      success: true,
      data: [
        {
          id: "personal",
          writable: true,
          name: "Personal",
          color:"#2F2F2F"
        }
      ]
    })
  }
))

brolendarPage.page.route('**/caldav/events?*', route => route.fulfill(
  {
    status: 200,
    headers: headers,
    body: []
  }
))

The above can also be enabled using brolendarPage.enableDefaultCaldavResponse()

More info can be found here.

Run Tests

With GUI During Implementation

  • Run yarn playwright test --ui
  • At the top left, click on Projects and activate setup plus at least of of chromium and firefox
  • The setup function is cached, meaning you can disable the setup project after the first run. The page state after the login is then restored for each test run

Headless

  • Run yarn playwright test --reporter=list
  • The reporter is the output format