@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test';
2
2
3
3
test ( 'Avengers: Infinity is the first top rated movie' , async ( {
4
4
page,
5
- } , testInfo ) => {
5
+ } ) => {
6
6
await page . goto ( '/?category=Top+Rated&page=1' ) ;
7
7
8
8
const firstMovie = page . getByRole ( 'listitem' , { name : 'movie' } ) . first ( ) ;
@@ -14,17 +14,14 @@ test('Avengers: Infinity is the first top rated movie', async ({
14
14
` ) ;
15
15
await expect ( firstMovieRating ) . toHaveAccessibleName ( 'rating' ) ;
16
16
17
- await test . step ( 'Verify movie rating tooltip content' , async ( ) => {
17
+ await test . step ( 'Verify movie rating tooltip content' , async ( step ) => {
18
18
await firstMovieRating . hover ( ) ;
19
19
const tooltip = page . getByRole ( 'tooltip' ) ;
20
20
const tooltipText = await tooltip . textContent ( ) ?? '' ;
21
21
await expect ( tooltip ) . toContainText ( / a v e r a g e r a t i n g o n / ) ;
22
22
23
23
// 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' } ) ;
28
25
} ) ;
29
26
30
27
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) => {
63
60
. toHaveAccessibleName ( `poster of ${ movieName ?? '' } ` ) ;
64
61
await expect ( firstMovieRating ) . toHaveAccessibleName ( 'rating' ) ;
65
62
66
- await test . step ( 'Verify movie rating tooltip content' , async ( ) => {
63
+ await test . step ( 'Verify movie rating tooltip content' , async ( step ) => {
67
64
await firstMovieRating . hover ( ) ;
68
65
const tooltip = page . getByRole ( 'tooltip' ) ;
69
66
const tooltipText = await tooltip . textContent ( ) ?? '' ;
70
67
await expect ( tooltip ) . toContainText ( / a v e r a g e r a t i n g o n / ) ;
71
68
72
69
// 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' , {
74
71
body : tooltipText ,
75
72
contentType : 'text/markdown' ,
76
73
} ) ;
0 commit comments