Cypress: Feature request: global configuration of type delay

Created on 2 Apr 2020  路  2Comments  路  Source: cypress-io/cypress

Current behavior:

Delay has to be specified per-use as .type('string', { delay: num }).

Desired behavior:

A global config that's something like typeDelay: number. Specifically, I'd like to globally reduce the timeout to 1ms or something.

I have the beginnings of a PR here but it might be incomplete in parts, especially in the specs. Would be happy to help close it out, though I feel this task would be trivial for someone with more knowledge of the codebase! (Assuming this feature is something others want, of course.)

wontfix

Most helpful comment

You can override the type command (or any command) so that every use of .type() uses the delay you'd like by default.

Cypress.Commands.overwrite('type', (originalFn, subject, text, options = {}) => {
  options.delay = 100

  return originalFn(subject, text, options)
})

it('type override', function () {
  cy.visit('index.html')
  cy.get('input').type('my text')
})

Adding this feature as a global configuration is not something we see as within our scope of feature work, so we will be closing this issue. We will reconsider and reopen if we see this issue gains more 馃憤 or comments in support.

All 2 comments

You can override the type command (or any command) so that every use of .type() uses the delay you'd like by default.

Cypress.Commands.overwrite('type', (originalFn, subject, text, options = {}) => {
  options.delay = 100

  return originalFn(subject, text, options)
})

it('type override', function () {
  cy.visit('index.html')
  cy.get('input').type('my text')
})

Adding this feature as a global configuration is not something we see as within our scope of feature work, so we will be closing this issue. We will reconsider and reopen if we see this issue gains more 馃憤 or comments in support.

Great! Exactly what I was looking for. Thank you!

Was this page helpful?
0 / 5 - 0 ratings