File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,7 @@ describe('dom-testing-library commands', () => {
10
10
} )
11
11
12
12
it ( 'getByText' , ( ) => {
13
- cy
14
- . getByText ( 'Button Text' )
15
- . click ( )
13
+ cy . getByText ( 'Button Text' ) . click ( )
16
14
} )
17
15
18
16
it ( 'getByLabelText' , ( ) => {
@@ -23,15 +21,11 @@ describe('dom-testing-library commands', () => {
23
21
} )
24
22
25
23
it ( 'getByAltText' , ( ) => {
26
- cy
27
- . getByAltText ( 'Image Alt Text' )
28
- . click ( )
24
+ cy . getByAltText ( 'Image Alt Text' ) . click ( )
29
25
} )
30
26
31
27
it ( 'getByTestId' , ( ) => {
32
- cy
33
- . getByTestId ( 'image-with-random-alt-tag' )
34
- . click ( )
28
+ cy . getByTestId ( 'image-with-random-alt-tag' ) . click ( )
35
29
} )
36
30
} )
37
31
Original file line number Diff line number Diff line change @@ -17,11 +17,22 @@ const commands = Object.keys(queries)
17
17
}
18
18
` ,
19
19
) ( commandImpl )
20
- return cy . window ( { log : false } ) . then ( thenHandler )
20
+ return cy
21
+ . window ( { log : false } )
22
+ . then ( thenHandler )
23
+ . then ( subject => {
24
+ Cypress . log ( {
25
+ $el : subject ,
26
+ name : queryName ,
27
+ message : args ,
28
+ } )
29
+ return subject
30
+ } )
21
31
} ,
22
32
}
23
33
} )
24
34
25
35
export { commands }
26
36
27
37
/* eslint no-new-func:0 */
38
+ /* globals Cypress */
You can’t perform that action at this time.
0 commit comments