Skip to content

Commit 3b9f799

Browse files
authored
Merge pull request #122 from joomcode/feat/update-html-report-layout
feat: full update of HTML report layout
2 parents b85c79c + 4d18bdf commit 3b9f799

82 files changed

Lines changed: 2505 additions & 1460 deletions

Some content is hidden

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

package-lock.json

Lines changed: 35 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
"url": "git+https://github.com/joomcode/e2ed.git"
2626
},
2727
"dependencies": {
28-
"@playwright/test": "1.55.0",
28+
"@playwright/test": "1.56.0",
2929
"create-locator": "0.0.27",
3030
"get-modules-graph": "0.0.11",
3131
"sort-json-keys": "1.0.3"
3232
},
3333
"devDependencies": {
34-
"@playwright/browser-chromium": "1.55.0",
35-
"@types/node": "24.3.0",
34+
"@playwright/browser-chromium": "1.56.0",
35+
"@types/node": "24.7.0",
3636
"@typescript-eslint/eslint-plugin": "7.18.0",
3737
"@typescript-eslint/parser": "7.18.0",
3838
"assert-modules-support-case-insensitive-fs": "1.0.1",
@@ -45,7 +45,7 @@
4545
"eslint-plugin-typescript-sort-keys": "3.3.0",
4646
"husky": "9.1.7",
4747
"prettier": "3.6.2",
48-
"typescript": "5.9.2"
48+
"typescript": "5.9.3"
4949
},
5050
"peerDependencies": {
5151
"@types/node": ">=20",

src/actions/asserts/assertUrlMatchRoute.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import {assertValueIsDefined, assertValueIsNotNull} from '../../utils/asserts';
44
import {log} from '../../utils/log';
55

66
import type {Route} from '../../Route';
7-
import type {Url} from '../../types/internal';
7+
import type {MaybePromise, Url} from '../../types/internal';
88

99
type MaybeUrlOrPath = Url | string | null | undefined;
1010

1111
/**
1212
* Asserts that url or url path (which can be wrapped in a promise) match route.
1313
*/
1414
export const assertUrlMatchRoute = async (
15-
maybeUrlOrPath: MaybeUrlOrPath | Promise<MaybeUrlOrPath>,
15+
maybeUrlOrPath: MaybePromise<MaybeUrlOrPath>,
1616
route: Route<unknown>,
1717
): Promise<void> => {
1818
const {routeParams} = route;

src/types/events.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export type LogEvent = Readonly<{
1919
type: LogEventType;
2020
}>;
2121

22+
/**
23+
* Log event with children (for groupping of `TestRun` steps).
24+
*/
25+
export type LogEventWithChildren = LogEvent & Readonly<{children: readonly LogEventWithChildren[]}>;
26+
2227
/**
2328
* EndTestRun event (on closing test).
2429
* @internal

src/types/global.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ declare global {
5858
class?: string;
5959
}
6060
>;
61+
} & {
62+
button: {popovertarget?: string};
63+
input: {popovertarget?: string};
64+
meta: {charset?: string};
6165
};
6266

6367
/**

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export type {ConsoleMessage, ConsoleMessageType} from './console';
1616
export type {UtcTimeInMs} from './date';
1717
export type {DeepMutable, DeepPartial, DeepReadonly, DeepRequired} from './deep';
1818
export type {E2edPrintedFields, JsError} from './errors';
19-
export type {LogEvent, Onlog, TestRunEvent} from './events';
19+
export type {LogEvent, LogEventWithChildren, Onlog, TestRunEvent} from './events';
2020
export type {Fn, MergeFunctions} from './fn';
2121
export type {
2222
FullMocksConfig,

src/types/internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type {E2edEnvironment} from './environment';
3131
export type {E2edPrintedFields, JsError} from './errors';
3232
/** @internal */
3333
export type {GlobalErrorType, MaybeWithIsTestRunBroken} from './errors';
34-
export type {LogEvent, Onlog, TestRunEvent} from './events';
34+
export type {LogEvent, LogEventWithChildren, Onlog, TestRunEvent} from './events';
3535
/** @internal */
3636
export type {EndTestRunEvent, FullEventsData} from './events';
3737
export type {Fn, MergeFunctions} from './fn';

src/types/report.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type {EndE2edReason, ExitCode, TestRunStatus} from '../constants/internal
55
import type {ApiStatistics} from './apiStatistics';
66
import type {FullPackConfig} from './config';
77
import type {UtcTimeInMs} from './date';
8-
import type {SafeHtml} from './html';
98
import type {TestFilePath} from './paths';
109
import type {StartInfo} from './startInfo';
1110
import type {FullTestRun, LiteTestRun, RunHash, RunId} from './testRun';
@@ -99,7 +98,7 @@ export type ReportClientState = {
9998
readonly fullTestRuns: readonly FullTestRun[];
10099
readonly internalDirectoryName: string;
101100
lengthOfReadedJsonReportDataParts: number;
102-
readonly locator: LocatorFunction<SafeHtml>;
101+
readonly locator: LocatorFunction;
103102
readonly pathToScreenshotsDirectoryForReport: string | null;
104103
readonly readJsonReportDataObservers: MutationObserver[];
105104
reportClientData?: ReportClientData;

src/utils/getDurationWithUnits.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Get the duration of time interval in hours, minutes, seconds and milliseconds.
33
* `getDurationWithUnits(1213)` = `'1s 213ms'`.
44
* Should be a pure function without dependencies in the form of a function declaration,
5-
* because it is used in the JS code of HTML report.
5+
* because it is used in the JS client code of HTML report.
66
*/
7-
export function getDurationWithUnits(durationInMs: number): string {
7+
export const getDurationWithUnits = (durationInMs: number): string => {
88
const msInSecond = 1_000;
99
const timeMultiplicator = 60;
1010

@@ -37,4 +37,4 @@ export function getDurationWithUnits(durationInMs: number): string {
3737
}
3838

3939
return parts.slice(0, 2).join(' ') || '0ms';
40-
}
40+
};

src/utils/parse/parseValueAsJsonIfNeeded.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ type Return = Readonly<{hasParseError: boolean; value: unknown}>;
44

55
/**
66
* Parses `unknown` value as JSON, if needed.
7-
* If `isoValueInJsonFormat` is `true`, then parses value as JSON and saves parse error.
8-
* If `isoValueInJsonFormat` is `false`, then returns value as is.
9-
* If `isoValueInJsonFormat` is `undefined`, then safely tries to parse value as JSON.
7+
* If `isValueInJsonFormat` is `true`, then parses value as JSON and saves parse error.
8+
* If `isValueInJsonFormat` is `false`, then returns value as is.
9+
* If `isValueInJsonFormat` is `undefined`, then safely tries to parse value as JSON.
1010
*/
1111
export const parseValueAsJsonIfNeeded = (
1212
originalValue: unknown,
13-
isoValueInJsonFormat?: boolean,
13+
isValueInJsonFormat?: boolean,
1414
): Return => {
1515
let hasParseError = false;
1616
let value = originalValue;
1717

18-
if (isoValueInJsonFormat === true) {
18+
if (isValueInJsonFormat === true) {
1919
try {
2020
value = parseMaybeEmptyValueAsJson(originalValue);
2121
} catch {
2222
hasParseError = true;
2323
}
24-
} else if (isoValueInJsonFormat !== false) {
24+
} else if (isValueInJsonFormat !== false) {
2525
try {
2626
value = parseMaybeEmptyValueAsJson(originalValue);
2727
} catch {}

0 commit comments

Comments
 (0)