1
1
import '@testing-library/cypress/add-commands' ;
2
2
3
3
Cypress . Commands . add ( 'getCanvas' , function ( ) {
4
- return cy . findByRole ( 'presentation' , { name : / r e a c t \- s k e t c h \- c a n v a s / i } ) ;
4
+ return cy . findByRole ( 'presentation' ) ;
5
5
} ) ;
6
6
7
7
Cypress . Commands . add (
@@ -12,7 +12,7 @@ Cypress.Commands.add(
12
12
originY : number = 0 ,
13
13
pointerType : Cypress . PointerEventType = 'pen'
14
14
) {
15
- cy . findByRole ( 'presentation' , { name : / r e a c t \- s k e t c h \- c a n v a s / i } ) . then (
15
+ cy . findByRole ( 'presentation' ) . then (
16
16
( $canvas ) => {
17
17
const x = $canvas . offset ( ) . left + originX ;
18
18
const y = $canvas . offset ( ) . top + originY ;
@@ -70,7 +70,7 @@ Cypress.Commands.add(
70
70
originY : number = 0 ,
71
71
pointerType : Cypress . PointerEventType = 'pen'
72
72
) {
73
- cy . findByRole ( 'presentation' , { name : / r e a c t \- s k e t c h \- c a n v a s / i } ) . then (
73
+ cy . findByRole ( 'presentation' ) . then (
74
74
( $canvas ) => {
75
75
const x = $canvas . offset ( ) . left + originX ;
76
76
const y = $canvas . offset ( ) . top + originY ;
@@ -107,7 +107,7 @@ Cypress.Commands.add(
107
107
originY : number = 0 ,
108
108
pointerType : Cypress . PointerEventType = 'pen'
109
109
) {
110
- cy . findByRole ( 'presentation' , { name : / r e a c t \- s k e t c h \- c a n v a s / i } ) . then (
110
+ cy . findByRole ( 'presentation' ) . then (
111
111
( $canvas ) => {
112
112
const x = $canvas . offset ( ) . left + originX ;
113
113
const y = $canvas . offset ( ) . top + originY ;
0 commit comments