Skip to content

Commit 412d940

Browse files
authored
Merge branch 'master' into fix-diff-images-saving
2 parents b77dcf2 + 0cef1cd commit 412d940

File tree

83 files changed

+2350
-1109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2350
-1109
lines changed

.circleci/config.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,22 @@ jobs:
33
build:
44
working_directory: ~/html-reporter
55
docker:
6-
- image: cimg/node:16.20-browsers
6+
- image: yinfra/html-reporter-browsers
77
environment:
8-
CHROME_VERSION: 116
98
SERVER_HOST: localhost
10-
9+
1110
steps:
12-
1311
- checkout
1412

1513
- run: npm ci
1614
- run:
1715
name: Build html-reporter
18-
1916
command: npm run build
20-
- run:
21-
name: Download Chromium
22-
command: >-
23-
cd test/func/docker/browser-utils &&
24-
npm ci &&
25-
npm run install-chromium
17+
2618
- run:
2719
name: Install Chromium for Playwright
2820
command: npx playwright install chromium
2921

30-
- run:
31-
name: Download Selenium
32-
command: npm install [email protected] -g
33-
- run:
34-
name: Start Selenium
35-
command: >-
36-
selenium-standalone install --drivers.chrome.version=$CHROME_VERSION &&
37-
selenium-standalone start --drivers.chrome.version=$CHROME_VERSION
38-
background: true
39-
4022
- run:
4123
name: Functional tests
4224
command: npm run e2e

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [14.x, 16.x, 18.x, 20.x]
15+
node-version: [18.x, 20.x, 22.x]
1616

1717
steps:
1818
- uses: actions/checkout@v2

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: NPM publish
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
versionType:
6+
type: choice
7+
description: Version Type
8+
required: true
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
permissions:
14+
contents: write
15+
jobs:
16+
publish:
17+
name: Publishing to NPM
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
token: ${{ secrets.GH_ACCESS_TOKEN }}
25+
- name: Setup Node JS
26+
uses: actions/setup-node@v2
27+
with:
28+
node-version: 18
29+
registry-url: https://registry.npmjs.org
30+
- run: npm ci
31+
- run: git config --global user.email "[email protected]"
32+
- run: git config --global user.name "y-infra"
33+
- run: npm run release -- --release-as ${{ github.event.inputs.versionType }}
34+
- run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
- run: git push --follow-tags

CHANGELOG.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,93 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
<a name="10.3.2"></a>
6+
## [10.3.2](https://github.com/gemini-testing/html-reporter/compare/v10.3.1...v10.3.2) (2024-07-02)
7+
8+
9+
### Bug Fixes
10+
11+
* fix copy button text ([#563](https://github.com/gemini-testing/html-reporter/issues/563)) ([e197d22](https://github.com/gemini-testing/html-reporter/commit/e197d22))
12+
13+
14+
15+
<a name="10.3.1"></a>
16+
## [10.3.1](https://github.com/gemini-testing/html-reporter/compare/v10.3.0...v10.3.1) (2024-06-26)
17+
18+
19+
### Bug Fixes
20+
21+
* result state after screenshot-accepter image accept ([fa18026](https://github.com/gemini-testing/html-reporter/commit/fa18026))
22+
23+
24+
25+
<a name="10.3.0"></a>
26+
# [10.3.0](https://github.com/gemini-testing/html-reporter/compare/v10.0.0...v10.3.0) (2024-06-21)
27+
28+
29+
### Bug Fixes
30+
31+
* escape regexp chars when copying a test link ([#552](https://github.com/gemini-testing/html-reporter/issues/552)) ([e7b2103](https://github.com/gemini-testing/html-reporter/commit/e7b2103))
32+
* save RunMode to localStorage ([#554](https://github.com/gemini-testing/html-reporter/issues/554)) ([e523e21](https://github.com/gemini-testing/html-reporter/commit/e523e21))
33+
* **pwt:** ignore private report options from pwt ([88e9e5d](https://github.com/gemini-testing/html-reporter/commit/88e9e5d))
34+
35+
36+
### Features
37+
38+
* add ability to run cli commands using html-reporter binary ([db0862c](https://github.com/gemini-testing/html-reporter/commit/db0862c))
39+
* add copy to clipboard button to all fields in meta ([fb651d0](https://github.com/gemini-testing/html-reporter/commit/fb651d0))
40+
* add relativePath to refImg ([b722899](https://github.com/gemini-testing/html-reporter/commit/b722899))
41+
42+
43+
44+
<a name="10.2.0"></a>
45+
# [10.2.0](https://github.com/gemini-testing/html-reporter/compare/v10.0.0...v10.2.0) (2024-06-20)
46+
47+
48+
### Features
49+
50+
* add relativePath to refImg ([b722899](https://github.com/gemini-testing/html-reporter/commit/b722899))
51+
52+
53+
54+
<a name="10.1.0"></a>
55+
# [10.1.0](https://github.com/gemini-testing/html-reporter/compare/v10.0.0...v10.1.0) (2024-06-20)
56+
57+
58+
### Bug Fixes
59+
60+
* escape regexp chars when copying a test link ([#552](https://github.com/gemini-testing/html-reporter/issues/552)) ([e7b2103](https://github.com/gemini-testing/html-reporter/commit/e7b2103))
61+
* save RunMode to localStorage ([#554](https://github.com/gemini-testing/html-reporter/issues/554)) ([e523e21](https://github.com/gemini-testing/html-reporter/commit/e523e21))
62+
* **pwt:** ignore private report options from pwt ([88e9e5d](https://github.com/gemini-testing/html-reporter/commit/88e9e5d))
63+
64+
65+
### Features
66+
67+
* add ability to run cli commands using html-reporter binary ([db0862c](https://github.com/gemini-testing/html-reporter/commit/db0862c))
68+
69+
70+
71+
<a name="10.0.0"></a>
72+
# [10.0.0](https://github.com/gemini-testing/html-reporter/compare/v9.19.0...v10.0.0) (2024-05-31)
73+
74+
75+
### Bug Fixes
76+
77+
* align the menu icon with the rest of the items ([0d493cc](https://github.com/gemini-testing/html-reporter/commit/0d493cc))
78+
* handle edge case when error is null ([#523](https://github.com/gemini-testing/html-reporter/issues/523)) ([65b3808](https://github.com/gemini-testing/html-reporter/commit/65b3808))
79+
80+
81+
### Features
82+
83+
* drop node versions less than 18 ([5569be6](https://github.com/gemini-testing/html-reporter/commit/5569be6))
84+
85+
86+
### BREAKING CHANGES
87+
88+
* node versions less than 18.0.0 are no longer supported
89+
90+
91+
592
<a name="9.19.0"></a>
693
# [9.19.0](https://github.com/gemini-testing/html-reporter/compare/v9.18.1...v9.19.0) (2024-05-01)
794

CONTRIBUTING.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ In order to make e2e/screenshot tests stable and reproducible across different e
1212
you need to launch browsers inside a Docker container.
1313

1414
1. Make sure you have Docker installed.
15-
<details><summary>How to?</summary>
15+
<details>
16+
<summary>How to?</summary>
17+
1618
1. If you want to make a personal open-source contribution, you may use Docker free of charge and follow the [official guide](https://docs.docker.com/get-docker/).
1719
2. If you are acting on behalf of a company, you may not have access to Docker Desktop. In this case:
1820
- On Linux, you may follow the official installation guide.
1921
- On Mac, you may use [colima](https://github.com/abiosoft/colima) as a replacement for Docker Desktop.
2022
- On Windows, you may use Windows Subsystem for Linux to run the Docker CLI without the Desktop application.
2123
</details>
2224

23-
2. Build and start an image with browsers:
25+
2. Start an image with browsers:
2426
```
25-
npm run e2e:build-browsers && npm run e2e:launch-browsers
27+
npm run browsers:launch
2628
```
2729
3. Run e2e tests:
2830
```bash
@@ -38,3 +40,36 @@ If you want a finer-grained control over the process, the following commands may
3840
- `npm run e2e:generate-fixtures` — generate fixture reports to run tests on
3941
- `npm run --workspace=test/func/tests gui:plugins` — launch hermione GUI for the `plugins` tests set
4042
- `npm run e2e:test` — run e2e tests only, without building packages or generating fixtures
43+
44+
### Working with browser docker images
45+
46+
#### Building an image for current platform
47+
48+
If you want to build an image with browsers you can use this command:
49+
- `npm run browsers:build:local`
50+
51+
#### Building a multiplatform image on Mac (Apple Silicon)
52+
53+
If you use colima then you can follow these steps to build a multiplatform image:
54+
1. Install buildx
55+
- `brew install docker-buildx`
56+
- `docker buildx install`
57+
2. Start 2 instances
58+
- `colima start --profile amd --arch amd`
59+
- `colima start --profile arm --arch arm`
60+
3. Create a buildx context to use the created instances as nodes
61+
- `docker buildx create --use --name custom colima-amd`
62+
- `docker buildx create --append --name custom colima-arm`
63+
4. Build and publish an image
64+
- `npm run browsers:build-and-push`
65+
66+
Note: to use already created buildx instance, execute this command:
67+
- `docker buildx use custom`
68+
69+
#### Managing multiple colima instances
70+
71+
To get the list of all colima instances you can use `colima list`.
72+
To use specific colima instance, you have to set DOCKER_HOST environment variable.
73+
To get the desired value for DOCKER_HOST, use `colima status [INSTANCE]`
74+
75+
If you want to update chromedriver or chrome version, change the variables at the beginning of the [Dockerfile](/test/func/docker/Dockerfile).

bin/html-reporter

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
(async () => {
5+
await require('../build/lib/cli').run();
6+
})();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export {
2+
TestplaneTestResultAdapter as HermioneTestResultAdapter,
3+
TestplaneTestResultAdapterOptions as HermioneTestResultAdapterOptions,
4+
getStatus
5+
} from './testplane';

lib/test-adapter/index.ts renamed to lib/adapters/test-result/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {TestStatus} from '../constants';
2-
import {ErrorDetails, ImageBase64, ImageFile, ImageInfoFull, TestError} from '../types';
1+
import {TestStatus} from '../../constants';
2+
import {ErrorDetails, ImageBase64, ImageFile, ImageInfoFull, TestError} from '../../types';
33

44
export interface ReporterTestResult {
55
readonly attempt: number;

lib/test-adapter/playwright.ts renamed to lib/adapters/test-result/playwright.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import _ from 'lodash';
55
import stripAnsi from 'strip-ansi';
66

77
import {ReporterTestResult} from './index';
8-
import {getError, getShortMD5, isImageDiffError, isNoRefImageError} from '../common-utils';
9-
import {ERROR, FAIL, PWT_TITLE_DELIMITER, SUCCESS, TestStatus} from '../constants';
10-
import {ErrorName} from '../errors';
8+
import {getError, getShortMD5, isImageDiffError, isNoRefImageError} from '../../common-utils';
9+
import {ERROR, FAIL, PWT_TITLE_DELIMITER, SUCCESS, TestStatus} from '../../constants';
10+
import {ErrorName} from '../../errors';
1111
import {
1212
DiffOptions,
1313
ErrorDetails,
@@ -16,7 +16,7 @@ import {
1616
ImageInfoFull, ImageInfoNoRef, ImageInfoPageError, ImageInfoPageSuccess, ImageInfoSuccess,
1717
ImageSize,
1818
TestError
19-
} from '../types';
19+
} from '../../types';
2020
import type {CoordBounds} from 'looks-same';
2121

2222
export type PlaywrightAttachment = PlaywrightTestResult['attachments'][number];
@@ -127,7 +127,7 @@ const getImageData = (attachment: PlaywrightAttachment | undefined): ImageFile |
127127
};
128128
};
129129

130-
export class PlaywrightTestAdapter implements ReporterTestResult {
130+
export class PlaywrightTestResultAdapter implements ReporterTestResult {
131131
private readonly _testCase: PlaywrightTestCase;
132132
private readonly _testResult: PlaywrightTestResult;
133133
private _attempt: number;

lib/test-adapter/reporter.ts renamed to lib/adapters/test-result/reporter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {TestStatus} from '../constants';
2-
import {TestError, ErrorDetails, ImageInfoFull, ImageBase64, ImageFile} from '../types';
1+
import {TestStatus} from '../../constants';
2+
import {TestError, ErrorDetails, ImageInfoFull, ImageBase64, ImageFile} from '../../types';
33
import {ReporterTestResult} from './index';
44
import _ from 'lodash';
55
import {extractErrorDetails} from './utils';
6-
import {getShortMD5, getTestHash} from '../common-utils';
6+
import {getShortMD5, getTestHash} from '../../common-utils';
77

88
// This class is primarily useful when cloning ReporterTestResult.
99
// It allows to override some properties while keeping computable

0 commit comments

Comments
 (0)