@@ -4310,39 +4310,40 @@ describe('src/cy/commands/actions/type', () => {
4310
4310
// https://github.com/cypress-io/cypress/issues/5424
4311
4311
it ( 'has a table of keys' , ( ) => {
4312
4312
cy . get ( ':text:first' ) . type ( '{cmd}{option}foo{enter}b{leftarrow}{del}{enter}' )
4313
- . then ( function ( ) {
4314
- const table = this . lastLog . invoke ( 'consoleProps' ) . table [ 3 ] ( )
4313
+ . then ( function ( $input ) {
4314
+ const table = this . lastLog . invoke ( 'consoleProps' ) . table [ 2 ] ( )
4315
4315
4316
4316
// eslint-disable-next-line
4317
4317
console . table ( table . data , table . columns )
4318
- expect ( table . columns ) . to . deep . eq ( [
4319
- 'typed' , 'which' , 'keydown' , 'keypress' , 'textInput' , 'input' , 'keyup' , 'change' , 'modifiers' ,
4320
- ] )
4321
4318
4322
4319
expect ( table . name ) . to . eq ( 'Keyboard Events' )
4323
4320
const expectedTable = {
4324
- 1 : { typed : '<meta>' , which : 91 , keydown : true , modifiers : 'meta' } ,
4325
- 2 : { typed : '<alt>' , which : 18 , keydown : true , modifiers : 'alt, meta' } ,
4326
- 3 : { typed : 'f' , which : 70 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4327
- 4 : { typed : 'o' , which : 79 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4328
- 5 : { typed : 'o' , which : 79 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4329
- 6 : { typed : '{enter}' , which : 13 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4330
- 7 : { typed : 'b' , which : 66 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4331
- 8 : { typed : '{leftArrow}' , which : 37 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4332
- 9 : { typed : '{del}' , which : 46 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4333
- 10 : { typed : '{enter}' , which : 13 , keydown : true , keyup : true , modifiers : 'alt, meta' } ,
4321
+ 1 : { 'Details' : '{ code: MetaLeft, which: 91 }' , Typed : '{cmd}' , 'Events Fired' : 'keydown' , 'Active Modifiers' : 'meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4322
+ 2 : { 'Details' : '{ code: AltLeft, which: 18 }' , Typed : '{option}' , 'Events Fired' : 'keydown' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4323
+ 3 : { 'Details' : '{ code: KeyF, which: 70 }' , Typed : 'f' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4324
+ 4 : { 'Details' : '{ code: KeyO, which: 79 }' , Typed : 'o' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4325
+ 5 : { 'Details' : '{ code: KeyO, which: 79 }' , Typed : 'o' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4326
+ 6 : { 'Details' : '{ code: Enter, which: 13 }' , Typed : '{enter}' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4327
+ 7 : { 'Details' : '{ code: KeyB, which: 66 }' , Typed : 'b' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4328
+ 8 : { 'Details' : '{ code: ArrowLeft, which: 37 }' , Typed : '{leftarrow}' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4329
+ 9 : { 'Details' : '{ code: Delete, which: 46 }' , Typed : '{del}' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4330
+ 10 : { 'Details' : '{ code: Enter, which: 13 }' , Typed : '{enter}' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : 'alt, meta' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4331
+ 11 : { 'Details' : '{ code: MetaLeft, which: 91 }' , Typed : '{cmd}' , 'Events Fired' : 'keyup' , 'Active Modifiers' : 'alt' , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4332
+ 12 : { 'Details' : '{ code: AltLeft, which: 18 }' , Typed : '{option}' , 'Events Fired' : 'keyup' , 'Active Modifiers' : null , 'Prevented Default' : null , 'Target Element' : $input [ 0 ] } ,
4334
4333
}
4335
4334
4335
+ // uncomment for debugging
4336
+ // _.each(table.data, (v, i) => expect(v).containSubset(expectedTable[i]))
4336
4337
expect ( table . data ) . to . deep . eq ( expectedTable )
4337
4338
} )
4338
4339
} )
4339
4340
4340
4341
it ( 'has no modifiers when there are none activated' , ( ) => {
4341
- cy . get ( ':text:first' ) . type ( 'f' ) . then ( function ( ) {
4342
- const table = this . lastLog . invoke ( 'consoleProps' ) . table [ 3 ] ( )
4342
+ cy . get ( ':text:first' ) . type ( 'f' ) . then ( function ( $el ) {
4343
+ const table = this . lastLog . invoke ( 'consoleProps' ) . table [ 2 ] ( )
4343
4344
4344
4345
expect ( table . data ) . to . deep . eq ( {
4345
- 1 : { typed : 'f' , which : 70 , keydown : true , keypress : true , textInput : true , input : true , keyup : true } ,
4346
+ 1 : { Typed : 'f' , 'Events Fired' : 'keydown, keypress, textInput, input, keyup' , 'Active Modifiers' : null , Details : '{ code: KeyF, which: 70 }' , 'Prevented Default' : null , 'Target Element' : $el [ 0 ] } ,
4346
4347
} )
4347
4348
} )
4348
4349
} )
@@ -4352,14 +4353,14 @@ describe('src/cy/commands/actions/type', () => {
4352
4353
return false
4353
4354
} )
4354
4355
4355
- cy . get ( ':text:first' ) . type ( 'f' ) . then ( function ( ) {
4356
- const table = this . lastLog . invoke ( 'consoleProps' ) . table [ 3 ] ( )
4356
+ cy . get ( ':text:first' ) . type ( 'f' ) . then ( function ( $el ) {
4357
+ const table = this . lastLog . invoke ( 'consoleProps' ) . table [ 2 ] ( )
4357
4358
4358
4359
// eslint-disable-next-line
4359
4360
console . table ( table . data , table . columns )
4360
4361
4361
4362
expect ( table . data ) . to . deep . eq ( {
4362
- 1 : { typed : 'f' , which : 70 , keydown : 'preventedDefault ', keyup : true } ,
4363
+ 1 : { Typed : 'f' , 'Events Fired' : 'keydown, keyup' , 'Active Modifiers' : null , Details : '{ code: KeyF, which: 70 } ', 'Prevented Default' : true , 'Target Element' : $el [ 0 ] } ,
4363
4364
} )
4364
4365
} )
4365
4366
} )
@@ -5284,10 +5285,9 @@ https://on.cypress.io/type`)
5284
5285
5285
5286
$ ( commandLogEl ) . find ( '.command-wrapper' ) . click ( )
5286
5287
5287
- expect ( spyTableName . firstCall ) . calledWith ( 'Mouse Move Events' )
5288
- expect ( spyTableName . secondCall ) . calledWith ( 'Mouse Click Events' )
5289
- expect ( spyTableName . thirdCall ) . calledWith ( 'Keyboard Events' )
5290
- expect ( spyTableData ) . calledThrice
5288
+ expect ( spyTableName . firstCall ) . calledWith ( 'Mouse Events' )
5289
+ expect ( spyTableName . secondCall ) . calledWith ( 'Keyboard Events' )
5290
+ expect ( spyTableData ) . calledTwice
5291
5291
} )
5292
5292
} )
5293
5293
} )
4 commit comments
cypress-bot[bot] commentedon Nov 7, 2019
Circle has built the
linux x64
version of the Test Runner.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.cypress-bot[bot] commentedon Nov 7, 2019
AppVeyor has built the
win32 x64
version of the Test Runner.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.cypress-bot[bot] commentedon Nov 7, 2019
AppVeyor has built the
win32 ia32
version of the Test Runner.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.cypress-bot[bot] commentedon Nov 7, 2019
Circle has built the
darwin x64
version of the Test Runner.You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.
You will need to use custom
CYPRESS_INSTALL_BINARY
url and install Cypress using an url instead of the version.