Skip to content

ci: add testRigor Web E2E suite - #8970

Open
amandassa-tR wants to merge 1 commit into
AppFlowy-IO:mainfrom
amandassa-tR:testrigor-ci
Open

amandassa-tR wants to merge 1 commit into
AppFlowy-IO:mainfrom
amandassa-tR:testrigor-ci

Conversation

@amandassa-tR

@amandassa-tR amandassa-tR commented Aug 25, 2026

Copy link
Copy Markdown

Feature Preview

Adds a testRigor plain-English E2E suite for AppFlowy Web, plus a GitHub Actions workflow to run it from CI.

Covered flows (under testRigor/):

  • Document create / edit / delete / restore / publish
  • Rich text blocks & slash menu
  • Grid sort & filter
  • Board (Kanban) cards, groups, and fields
  • Favorites & sub-pages
  • Global Search / Quick-find
  • Invite new user and accept workspace invite
  • Sign up / create workspace / delete account
  • Shared reusable rules (login, sign up, delete account, etc.)

Description

This introduces tests-as-code for AppFlowy Web using testRigor so contributors and maintainers can keep E2E coverage next to the product code.

The workflow installs testrigor-cli and runs the suite with --explicit-mutations, so the files in testRigor/testcases and testRigor/rules are the source of truth for what executes.

CI setup required on the repo (or fork) that runs the workflow:

  • Secret TESTRIGOR_API_KEY (PAT from testRigor → username → API Tokens); optional fallback TESTRIGOR_AUTH_TOKEN
  • Variable TESTRIGOR_TEST_SUITE_ID
  • Optional variable APPFLOWY_WEB_URL (defaults to https://appflowy.com/app)

Triggers: workflow_dispatch, and push to non-main branches when testRigor/** or the workflow file change.


PR Checklist

  • My code adheres to AppFlowy's Conventions (commit messages use type: subject)
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Test plan

  • Confirm required secrets/vars are set on the fork/org that should run CI
  • Run workflow via workflow_dispatch (or push a change under testRigor/)
  • Verify the suite finishes green and the JUnit artifact uploads
  • Spot-check a couple of cases locally with testrigor test-suite run against the suite ID

Summary by Sourcery

Introduce testRigor Web E2E coverage and automate its execution through GitHub Actions.

New Features:

  • Add comprehensive testRigor Web E2E coverage for document lifecycle, rich text, grids, boards, favorites, search, invitations, and account/workspace flows.

Enhancements:

  • Add shared testRigor rules, suite structure, settings, and test data for maintainable tests-as-code coverage.

CI:

  • Add a GitHub Actions workflow to run the testRigor suite on demand or when E2E definitions change, with configurable credentials, suite ID, application URL, and JUnit artifact reporting.

Tests:

  • Add reusable testRigor test cases covering core AppFlowy Web user journeys.

@sourcery-ai

sourcery-ai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a testRigor tests-as-code suite for major AppFlowy Web user journeys, shared reusable rules, and a GitHub Actions workflow that runs the explicitly synchronized suite on configured non-main changes or manual dispatch, with JUnit artifact reporting.

Sequence diagram for synchronized testRigor suite execution

sequenceDiagram
    actor Contributor
    participant GitHub as GitHub Actions
    participant Runner as Ubuntu Runner
    participant CLI as testRigor CLI
    participant TestRigor as testRigor Service
    participant App as AppFlowy Web
    participant Artifacts as JUnit Artifact Storage

    Contributor->>GitHub: Push testRigor/workflow change or dispatch workflow
    GitHub->>Runner: Checkout repository and setup Node.js
    Runner->>CLI: Install testrigor-cli
    Runner->>CLI: testrigor test-suite run
    CLI->>TestRigor: Sync explicit testcases and rules
    TestRigor->>App: Execute E2E user journeys
    App-->>TestRigor: Test results
    TestRigor-->>CLI: Exit status and JUnit report
    CLI-->>Runner: Complete synchronous run
    Runner->>Artifacts: Upload report.xml
Loading

File-Level Changes

Change Details Files
Adds a CI workflow that synchronizes and runs the local testRigor suite against AppFlowy Web.
  • Installs the testRigor CLI on Node.js 20.
  • Validates API credentials and suite configuration, including an auth-token fallback and configurable application URL.
  • Runs in synchronous mode with explicit local test-case/rule mutations and commit metadata.
  • Uploads the generated JUnit report even when the test job fails.
  • Scopes automatic execution to non-main pushes affecting the suite or workflow, with manual dispatch and concurrency cancellation.
.github/workflows/testrigor.yml
Introduces the testRigor project structure and shared reusable rules for common account and document operations.
  • Defines paths for test cases, rules, test data, and datasets.
  • Adds reusable login, sign-up, account deletion, document deletion, and custom input-entry rules.
testRigor/structure.yaml
testRigor/rules/Delete account.txt
testRigor/rules/Delete current document.txt
testRigor/rules/Login using password.txt
testRigor/rules/Sign up using password.txt
testRigor/rules/custom enter \"value\" into \"input\".txt
Adds plain-English E2E coverage for core AppFlowy Web document, editor, database, navigation, search, collaboration, and account flows.
  • Covers document lifecycle actions including create, edit, delete, restore, and publish.
  • Exercises rich-text blocks, slash-menu interactions, grid sorting/filtering, and comprehensive Kanban operations.
  • Validates favorites, sub-pages, global search, and quick-find behavior.
  • Covers workspace invitations from both inviter and invitee perspectives.
  • Tests sign-up, workspace creation, and account deletion.
testRigor/testcases/Board_(Kanban)_—_full_regression__cards,_groups,_hidden_groups,_fields.txt
testRigor/testcases/Document_Create,_Edit,_Delete,_Restore_and_Publish.txt
testRigor/testcases/Favorites_and_Sub-pages_(E2E).txt
testRigor/testcases/Global_Search___Quick-find_(E2E).txt
testRigor/testcases/Grid_Row__Sort_and_Filter_Operations.txt
testRigor/testcases/Invite_new_user_to_the_workspace.txt
testRigor/testcases/Invitee_accepts_workspace_invite_(E2E).txt
testRigor/testcases/Rich_Text_Blocks_and_Slash_Menu_(E2E).txt
testRigor/testcases/Sign_up,_create_a_new_workspace_and_delete_account.txt
Updates repository ignore rules to exclude generated testRigor run output.
  • Prevents local test artifacts from being committed.
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/testrigor.yml" line_range="84-90" />
<code_context>
+
+          # Sync mode (no --async): exit code gates the job.
+          # --explicit-mutations: local testRigor/testcases (+ rules) is authoritative —
+          # only those cases are kept/updated on the suite and executed. Remote-only
+          # cases not present as files are dropped from the suite.
+          testrigor test-suite run "${TESTRIGOR_TEST_SUITE_ID}" \
+            --url "${APP_URL}" \
+            --test-cases-path "testRigor/testcases/**/*.{txt,yaml,yml}" \
+            --rules-path "testRigor/rules/**/*.{txt,yaml,yml}" \
+            --explicit-mutations \
+            --branch "${GITHUB_REF_NAME}" \
+            --commit "${GITHUB_SHA}" \
</code_context>
<issue_to_address>
**issue (bug_risk):** Concurrent runs from different feature branches use the same `TESTRIGOR_TEST_SUITE_ID` while each run treats its checked-out test cases and rules as authoritative, so one branch overwrites or removes the other branch's suite definitions and the runs execute a nondeterministic mixture of files.

**Triggers:** When multiple feature branches push changes while their workflows are running concurrently.

**Suggested fix:** Use an isolated testRigor suite per branch, or serialize mutations to the shared suite and separate synchronization from execution.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +84 to +90
# only those cases are kept/updated on the suite and executed. Remote-only
# cases not present as files are dropped from the suite.
testrigor test-suite run "${TESTRIGOR_TEST_SUITE_ID}" \
--url "${APP_URL}" \
--test-cases-path "testRigor/testcases/**/*.{txt,yaml,yml}" \
--rules-path "testRigor/rules/**/*.{txt,yaml,yml}" \
--explicit-mutations \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Concurrent runs from different feature branches use the same TESTRIGOR_TEST_SUITE_ID while each run treats its checked-out test cases and rules as authoritative, so one branch overwrites or removes the other branch's suite definitions and the runs execute a nondeterministic mixture of files.

Triggers: When multiple feature branches push changes while their workflows are running concurrently.

Suggested fix: Use an isolated testRigor suite per branch, or serialize mutations to the shared suite and separate synchronization from execution.

Add testRigor GitHub Actions workflow with localhost health check.

Gate the suite run on a curl probe to the local AppFlowy instance and version the testRigor cases/rules used by CI.

ci: target AppFlowy Web instead of localhost in testRigor

Remove localhost health check; run testRigor against AppFlowy Web.

Pass the AppFlowy Web URL in the retest payload so CI targets the hosted app, not a local instance.

ci: run testRigor suite via CLI in GitHub Actions

Run testRigor suite via CLI in GitHub Actions.

Install testrigor-cli, push local cases/rules, and sync-run against AppFlowy Web with a JUnit artifact.

ci: disable automatic commitlint on push and PR

Keep the workflow available via workflow_dispatch so feature-branch CI is not blocked by conventional-commit checks.

test: harden testRigor Web E2E cases and CI workflow

Restore commitlint for upstream PR checks, sync the suite from local
files with --explicit-mutations, add Global Search coverage, and align
invite/settings steps with the People nav rename.

test: fix post-login assertion in testRigor login rule

The "Login using password" rule ended with check page contains "Welcome",
which only matches the login page ("Welcome to AppFlowy"). It passed while
login failed and failed once the workspace loaded, breaking all 7
login-based cases in CI. Assert the sidebar "New page" button instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: sync testRigor suite files from the maintained suite

Replace the local testcases and rules with the current suite export
(includes the post-login "New Page" assertion), drop the three
superseded duplicate case files, and keep rule filenames space-named so
the case-level rule invocations still resolve. Adds Settings.yaml and
testdata/storedValues.yaml from the same export for reference.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: set page title via the Untitled placeholder in sign-up case

"generate unique name, then enter into "Title"" fails intermittently in
CI ("Failed to execute action ... Retrying the click before it") because
the title is a contenteditable that is not directly interactable. Use
the triple-click-on-"Untitled" pattern already proven in the document,
search and invite cases, and wait for the editor to render first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: type page body instead of entering the editor placeholder

"enter into "Enter a / to insert a block, or start typing"" fails with
"Can't find input element by descriptor" — the editor placeholder is not
addressable as an input. Type into the focused editor instead, as the
document case already does, and apply the same Untitled-placeholder
title pattern to the workspace-management case.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: stop collapsing the General section before asserting its pages

click "General" toggles the sidebar section, which is already expanded
because it holds the page the case just created, so the following
"Getting started"/"To-dos" checks looked for hidden elements. Assert the
default pages directly and drop the spatial qualifier — they only exist
in that section.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: drop workspace switcher ordering assumption

check page contains workspaceName "roughly below" "My Workspace" fails
because the switcher does not guarantee that the newly created (active)
workspace is listed under the original one. Assert that both workspaces
are listed instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: wait for the new workspace to seed; report per-case results in CI

The "Getting started" check right after a workspace switch passed in the
previous run and failed in this one, so the workspace's default pages are
seeded too slowly for the 30s check budget. Wait before asserting.

Also print the suite status JSON after the run: the JUnit report labels
every case "Test Case UUID=" with an empty uuid, so a failing step cannot
be mapped back to a case file without it. Diagnostic only — it never
changes the job verdict.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: use the People settings nav in the workspace invite case

The suite status API confirms this case crashes with "Can't find button
element by descriptor 'Members'": the settings nav was renamed to
"People", as the sibling invite case already documents.

Also summarise the per-case report (name, severity, error, step) instead
of dumping each affected case's full step list, which drowned the log.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

test: close the page dialog with a precise descriptor

Both "Getting started" and "To-dos" failed at the same step while
"General" passed, i.e. the space label was visible but its children were
not — the section was collapsed. The preceding "2nd button above and on
the right of pageTitle" is loose enough to land on the space chevron.
Use the descriptor the two passing cases use instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants