Skip to content

Commit 8ed97c7

Browse files
authored
chore: update Playwright to version 1.52.0-alpha-1741100475000 and enhance test reporting (#42)
1 parent 161428e commit 8ed97c7

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"@eslint/js": "^9.18.0",
18-
"@playwright/test": "^1.52.0-alpha-2025-03-03",
18+
"@playwright/test": "^1.52.0-alpha-1741100475000",
1919
"@types/eslint__js": "^8.42.3",
2020
"@types/node": "^22.5.4",
2121
"eslint": "^9.18.0",

tests/logged-out/dark-mode.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test.describe('Theme Mode Switching', () => {
77

88
test('should have light mode initially', async ({ page }) => {
99
// Assert that the body has the 'light' class initially
10+
await page.emulateMedia({contrast: 'more'});
1011
await expect(page.locator('body')).toHaveClass(/light/);
1112
});
1213

tests/logged-out/movie-list.spec.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test';
22

33
test('Avengers: Infinity is the first top rated movie', async ({
44
page,
5-
}, testInfo) => {
5+
}) => {
66
await page.goto('/?category=Top+Rated&page=1');
77

88
const firstMovie = page.getByRole('listitem', { name: 'movie' }).first();
@@ -14,17 +14,14 @@ test('Avengers: Infinity is the first top rated movie', async ({
1414
`);
1515
await expect(firstMovieRating).toHaveAccessibleName('rating');
1616

17-
await test.step('Verify movie rating tooltip content', async () => {
17+
await test.step('Verify movie rating tooltip content', async (step) => {
1818
await firstMovieRating.hover();
1919
const tooltip = page.getByRole('tooltip');
2020
const tooltipText = await tooltip.textContent() ?? '';
2121
await expect(tooltip).toContainText(/average rating on/);
2222

2323
// Attach the tooltip text content to the test report
24-
await testInfo.attach('first movies tooltip text content', {
25-
body: tooltipText,
26-
contentType: 'text/markdown',
27-
});
24+
await step.attach('first movies tooltip text content', { body: tooltipText, contentType: 'text/markdown' });
2825
});
2926

3027
await test.step('Click on movie and verify details page', async () => {
@@ -63,14 +60,14 @@ test('dynamic content for first upcoming movie', async ({ page }, testInfo) => {
6360
.toHaveAccessibleName(`poster of ${movieName ?? ''}`);
6461
await expect(firstMovieRating).toHaveAccessibleName('rating');
6562

66-
await test.step('Verify movie rating tooltip content', async () => {
63+
await test.step('Verify movie rating tooltip content', async (step) => {
6764
await firstMovieRating.hover();
6865
const tooltip = page.getByRole('tooltip');
6966
const tooltipText = await tooltip.textContent() ?? '';
7067
await expect(tooltip).toContainText(/average rating on/);
7168

7269
// Attach the tooltip text content to the test report
73-
await testInfo.attach('first movies tooltip text content', {
70+
await step.attach('first movies tooltip text content', {
7471
body: tooltipText,
7572
contentType: 'text/markdown',
7673
});

0 commit comments

Comments
 (0)