Skip to content

fix: html-reporter gui playwright test launch (step.startTime.getTime)#646

Merged
KuznetsovRoman merged 1 commit into
masterfrom
TESTPLANE-491.pwt_date_fix
Apr 3, 2025
Merged

fix: html-reporter gui playwright test launch (step.startTime.getTime)#646
KuznetsovRoman merged 1 commit into
masterfrom
TESTPLANE-491.pwt_date_fix

Conversation

@KuznetsovRoman

Copy link
Copy Markdown
Member

No description provided.

[TestStepKey.Args]: [],
[TestStepKey.IsFailed]: Boolean(step.error),
[TestStepKey.TimeStart]: step.startTime.getTime(),
[TestStepKey.TimeStart]: step.startTime instanceof Date ? step.startTime.getTime() : new Date(step.startTime).getTime(),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

When launched via "npx playwright test", its intance of Date.
When launched via "npx html-reporter --tool playwright", its ISO string

})];

assert.deepEqual(adapter.history, expectedHistory);
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the test differs from the previous one only by the field startTime. It seems we can get rid of duplication by using forEach

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

as those are just 2 tests, i think its more readable that way

@KuznetsovRoman KuznetsovRoman merged commit 2b2db1f into master Apr 3, 2025
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