File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
1
node_modules /
2
+ cypress /videos
Original file line number Diff line number Diff line change
1
+ export const getByCommand = ( name ) => ( label ) => {
2
+ cy . log ( `**${ name } **` )
3
+ cy . contains ( 'label' , label )
4
+ . invoke ( 'attr' , 'for' )
5
+ . then ( ( id ) => {
6
+ cy . get ( '#' + id )
7
+ } )
8
+ }
Original file line number Diff line number Diff line change
1
+ import { getByCommand } from './get-by'
1
2
export const registerCommand = ( name = 'getByLabel' ) => {
2
- const getByCommand = ( label ) => {
3
- cy . log ( `**${ name } **` )
4
- cy . contains ( 'label' , label )
5
- . invoke ( 'attr' , 'for' )
6
- . then ( ( id ) => {
7
- cy . get ( '#' + id )
8
- } )
9
- }
10
-
11
- Cypress . Commands . add ( name , getByCommand )
3
+ const getByName = getByCommand ( name )
4
+ Cypress . Commands . add ( name , getByName )
12
5
}
You can’t perform that action at this time.
0 commit comments