Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f4ef4c0
fix: remove duplicate screenshot delay
shadowusr Apr 14, 2026
7369319
fix: correctly handle absence of capture rects in safe area computation
shadowusr Apr 14, 2026
55720b9
fix: remove delay in screen-shooter and wait for settle when capturin…
shadowusr Apr 14, 2026
c56b6d1
fix: fix safe area computation and failing e2e tests
shadowusr Apr 14, 2026
7e2bd63
test: fix unit tests and formatting issues
shadowusr Apr 15, 2026
0605b62
fix: simplify return types in client-scripts and use correct logging …
shadowusr Apr 16, 2026
2c63a70
chore: use better variable names when computing pseudo element coords…
shadowusr Apr 16, 2026
f04fdfc
ci: use separate comment tag for browser-env tests
shadowusr Apr 16, 2026
3fd262b
chore: do not collect coverage for browser-env tests
shadowusr Apr 16, 2026
36411e9
test: tiny fixes of browser-env tests and removing unnecessary consol…
shadowusr Apr 16, 2026
199e206
fix: add a few explanatory comments and fix a typo in image class
shadowusr Apr 16, 2026
0a0d5b3
test: commit composite-image fixtures instead of generating them on t…
shadowusr Apr 16, 2026
1214194
docs: add info about generating debug images to dev docs
shadowusr Apr 19, 2026
d5290d0
fix: use correct viewport offset for a case when driver returns full-…
shadowusr Apr 19, 2026
ba977a5
refactor: move composite iterations limit to constants, minor review …
shadowusr Apr 19, 2026
3d0a92d
fix: fix off-by-one errors in calibrator and leave a comment clearing…
shadowusr Apr 19, 2026
a194b50
test: fix a couple of ever-green tests on screen-shooter
shadowusr Apr 19, 2026
f059162
test: run fractional scroll test only in chrome
shadowusr Apr 19, 2026
c49ceee
fix: fix calibration script and add debug logging to calibrator
shadowusr Apr 20, 2026
495385b
chore: enhance logging in elements screenshooter and fix tests
shadowusr Apr 20, 2026
b5bccc2
ci: add tsc-out to prettierignore
shadowusr Apr 20, 2026
2639132
fix: do not apply calibration if viewport size changed
shadowusr Apr 21, 2026
dc44163
fix: add more robust logic for computing layout shifts and fix tests
shadowusr May 22, 2026
5fc2c26
test: exclude fixtures from unit tests
shadowusr May 22, 2026
6192614
test: fix tests with node types stripping
shadowusr May 22, 2026
4a5c353
test: fix integration screenshot tests
shadowusr May 22, 2026
2c35a3c
test: build browser bundle before test
shadowusr May 22, 2026
a10119b
test: build project before test
shadowusr May 22, 2026
6c2281e
test: do not run screenshot integration tests in firefox
shadowusr May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ module.exports = {
{
patterns: [
{
group: ["../../**", "!../../isomorphic", "!../../isomorphic/**", "!../../..", "!../../../isomorphic", "!../../../isomorphic/**"],
group: [
"../../**",
"!../../isomorphic",
"!../../isomorphic/**",
"!../../..",
"!../../../isomorphic",
"!../../../isomorphic/**",
],
message: "Client-scripts cannot import server-side code, except isomorphic modules.",
},
],
Expand All @@ -66,5 +73,13 @@ module.exports = {
"@typescript-eslint/no-var-requires": "off",
},
},
{
files: ["test/**"],
rules: {
"@typescript-eslint/no-empty-function": "off",
// For convenient casting of test objects
"@typescript-eslint/no-explicit-any": "off",
},
},
],
};
2 changes: 1 addition & 1 deletion .github/workflows/browser-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
uses: thollander/actions-comment-pull-request@v3
with:
message: ${{ env.PR_COMMENT }}
comment-tag: testplane_results
comment-tag: testplane_browser_env_results

- name: Fail the job if any Testplane job is failed
if: ${{ steps.testplane.outcome != 'success' }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build
- run: npm test

- name: Build
if: ${{ startsWith(matrix.node-version, '20') }}
run: npm run build

- name: Publish
if: ${{ startsWith(matrix.node-version, '20') }}
run: npx pkg-pr-new publish
31 changes: 31 additions & 0 deletions .github/workflows/standalone-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
jobs:
integration-test:
runs-on: ubuntu-latest
env:
DOCKER_IMAGE_NAME: html-reporter-browsers

strategy:
matrix:
node-version: [20.18.1]
Expand Down Expand Up @@ -36,7 +39,35 @@ jobs:
- name: Build project
run: npm run build

- name: "Prepare screenshot tests: Cache browser docker image"
if: ${{ matrix.browser == 'chrome' }}
uses: actions/cache@v3
with:
path: ~/.docker/cache
key: docker-browser-image-testplane

- name: "Prepare screenshot tests: Pull browser docker image"
if: ${{ matrix.browser == 'chrome' }}
run: |
mkdir -p ~/.docker/cache
if [ -f ~/.docker/cache/image.tar ]; then
docker load -i ~/.docker/cache/image.tar
else
docker pull yinfra/html-reporter-browsers
docker save yinfra/html-reporter-browsers -o ~/.docker/cache/image.tar
fi

- name: "Prepare screenshot tests: Run browser docker image"
if: ${{ matrix.browser == 'chrome' }}
run: docker run -d --name ${{ env.DOCKER_IMAGE_NAME }} -it --rm --network=host $(which colima >/dev/null || echo --add-host=host.docker.internal:0.0.0.0) yinfra/html-reporter-browsers

- name: Run integration tests for ${{ matrix.browser }}
env:
BROWSER: ${{ matrix.browser }}
run: npm run test-integration

- name: "Screenshot tests: Stop browser docker image"
if: ${{ always() && matrix.browser == 'chrome' }}
run: |
docker kill ${{ env.DOCKER_IMAGE_NAME }} || true
docker rm ${{ env.DOCKER_IMAGE_NAME }} || true
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ testplane/**
testplane-report/**
*.tsbuildinfo
test/browser-env/report/**
test/src/browser/screen-shooter/composite-image/fixtures/**
!test/src/browser/screen-shooter/composite-image/fixtures/generate.ts
3 changes: 2 additions & 1 deletion .mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
module.exports = {
recursive: true,
extension: [".js", ".ts"],
require: ["./test/setup", "./test/assert-ext", "./test/ts-node"],
ignore: ["./test/browser-env/**", "**/report/**", "**/basic-report/**"],
require: ["./test/setup", "./test/assert-ext", "./test/ts-node", "tsconfig-paths/register"],
};
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ coverage/**
test/browser-env/report/**
*.png
*.DS_Store
.claude
tsc-out
75 changes: 52 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testplane",
"version": "9.0.0-rc.3",
"version": "9.0.0-rc.4",
"description": "Tests framework based on mocha and wdio",
"main": "build/src/index.js",
"files": [
Expand Down Expand Up @@ -30,17 +30,17 @@
"lint": "eslint --cache . && prettier --check .",
"reformat": "eslint --fix . && prettier --write .",
"prettier-watch": "onchange '**' --exclude-path .prettierignore -- prettier --write {{changed}}",
"test-unit": "npm run test-unit:generate-fixtures && _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\"",
"test-unit:generate-fixtures": "TS_NODE_PROJECT=test/tsconfig.json node -r ts-node/register -r tsconfig-paths/register test/src/browser/screen-shooter/composite-image/fixtures/generate.ts",
"test-unit": "node scripts/run-node-without-type-stripping.js ./node_modules/mocha/bin/_mocha \"test/!(integration|e2e|browser-env|fixtures)/**/*.[jt]s\"",
"test-unit:coverage": "c8 --all --src=src --reporter=html --reporter=text-summary --exclude=\"build/**\" --exclude=\"test/**\" --exclude=\"**/*.d.ts\" node scripts/run-node-without-type-stripping.js ./node_modules/mocha/bin/_mocha \"test/!(integration|browser-env|e2e)/**/*.[jt]s\"",
"test-unit:generate-fixtures": "TS_NODE_PROJECT=test/tsconfig.json node -r ts-node/register -r tsconfig-paths/register test/src/browser/screen-shooter/composite-image/fixtures/generate.ts generate",
"test": "npm run test-unit && npm run check-types && npm run lint",
"test-integration": "TS_NODE_TRANSPILE_ONLY=1 mocha -r ts-node/register test/integration/*/**",
"test-integration": "TS_NODE_TRANSPILE_ONLY=1 node scripts/run-node-without-type-stripping.js ./node_modules/mocha/bin/_mocha -r ts-node/register test/integration/*/**",
"test-e2e": "npm run test-e2e:generate-fixtures && npm run test-e2e:run-tests",
"test-e2e:run-tests": "node bin/testplane --config test/e2e/testplane.config.ts",
"test-e2e:generate-fixtures": "node bin/testplane --config test/e2e/fixtures/basic-report/testplane.config.ts || true",
"test-e2e:gui": "node bin/testplane --config test/e2e/testplane.config.ts gui",
"test-browser-env": "NODE_OPTIONS='-r tsconfig-paths/register' TS_NODE_PROJECT=./test/browser-env/tsconfig.json node bin/testplane --config test/browser-env/testplane.config.ts",
"test-browser-env:gui": "NODE_OPTIONS='-r tsconfig-paths/register' TS_NODE_PROJECT=./test/browser-env/tsconfig.json node bin/testplane gui --config test/browser-env/testplane.config.ts",
"test-browser-env": "TS_NODE_PROJECT=./test/browser-env/tsconfig.json node bin/testplane -r tsconfig-paths/register --config test/browser-env/testplane.config.ts",
"test-browser-env:gui": "TS_NODE_PROJECT=./test/browser-env/tsconfig.json node bin/testplane gui -r tsconfig-paths/register --config test/browser-env/testplane.config.ts",
"toc": "doctoc docs --title '### Contents'",
"precommit": "npm run lint",
"prepack": "npm run clean && npm run build",
Expand Down Expand Up @@ -173,7 +173,7 @@
"eslint-config-prettier": "8.7.0",
"execa": "5.1.1",
"glob-extra": "5.0.2",
"html-reporter": "11.8.3",
"html-reporter": "11.9.3",
"husky": "0.11.4",
"js-levenshtein": "1.1.6",
"jsdom": "^24.0.0",
Expand Down
27 changes: 27 additions & 0 deletions scripts/run-node-without-type-stripping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"use strict";

const { spawnSync } = require("node:child_process");

const DISABLE_TYPE_STRIPPING_FLAG = "--no-experimental-strip-types";

const supportsDisableTypeStripping = () => {
const result = spawnSync(process.execPath, [DISABLE_TYPE_STRIPPING_FLAG, "-e", ""], {
stdio: "ignore",
});

return result.status === 0;
};

const nodeArgs = supportsDisableTypeStripping() ? [DISABLE_TYPE_STRIPPING_FLAG] : [];
const commandArgs = process.argv.slice(2);

const result = spawnSync(process.execPath, [...nodeArgs, ...commandArgs], {
stdio: "inherit",
env: process.env,
});

if (result.error) {
throw result.error;
}

process.exit(result.status ?? 1);
Loading
Loading