Skip to content

test: implement browser-env tests on client-scripts#1237

Open
shadowusr wants to merge 1 commit intousers/shadowusr/TESTPLANE-672.client-scripts-refactorfrom
users/shadowusr/TESTPLANE-672.implement-browser-env-tests
Open

test: implement browser-env tests on client-scripts#1237
shadowusr wants to merge 1 commit intousers/shadowusr/TESTPLANE-672.client-scripts-refactorfrom
users/shadowusr/TESTPLANE-672.implement-browser-env-tests

Conversation

@shadowusr
Copy link
Copy Markdown
Member

@shadowusr shadowusr commented Apr 13, 2026

What's done?

  • Introduced a new type of tests — browser-env tests that test client-scripts behavior in real browser environment
  • These tests verify the correctness of core logic in our visual checks engine, like computing boundaries of elements to capture and safe area size

⚠️ A large portion of this PR is AI-generated HTML fixture pages that we mount in tests

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@shadowusr
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d091e30d77

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"prettier-watch": "onchange '**' --exclude-path .prettierignore -- prettier --write {{changed}}",
"test-unit": "npm run create-client-scripts-symlinks && _mocha \"test/!(integration|e2e)/**/*.js\"",
"test-unit": "_mocha \"test/!(integration|e2e|browser-env)/**/*.[jt]s\"",
"test-unit:coverage": "c8 --all --src=src --reporter=html --reporter=text-summary --exclude=\"build/**\" --exclude=\"test/**\" --exclude=\"**/*.d.ts\" _mocha \"test/!(integration|e2e)/**/*.[jt]s\"",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude browser-env specs from unit coverage run

test-unit:coverage uses _mocha "test/!(integration|e2e)/**/*.[jt]s", which now matches test/browser-env/**/*.testplane.ts. Those files are browser-env specs (they use Vite-only ?raw imports and browser fixtures like browser.assertView) and are not runnable in the plain mocha/c8 unit-test process, so npm run test-unit:coverage will fail when it reaches this suite. Update the coverage glob to exclude browser-env like test-unit already does.

Useful? React with 👍 / 👎.

uses: thollander/actions-comment-pull-request@v3
with:
message: ${{ env.PR_COMMENT }}
comment-tag: testplane_results
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Use a unique PR comment tag for browser-env job

This workflow posts PR comments with comment-tag: testplane_results, which is already used by .github/workflows/e2e.yml; when both jobs run on the same PR, they target the same tagged comment and overwrite each other’s report link/message. Give browser-env its own tag so both E2E and browser-env results remain visible.

Useful? React with 👍 / 👎.

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.

1 participant