Skip to content

Support for Native Browser Events #311

Open
@brian-mann

Description

@brian-mann

click

  • simulated click fixes [moved] Simulated click fixes  #2956
  • on text-editable click in center move the cursor to the end
    • ensure possible in IE11 without causing side effects
  • cy.body().type():
    • blur focused element, send events to body
  • support .rightClick() 🆕

possible:

  • move cursor to beginning if click('left') or click('topleft') ⚠️

not fixed:

type

  • by default issues native events
  • force:true skips actionability and uses simulated keys
  • simulated keys have no delay ⚠️ change from 50ms
  • native keys by default have no delay ⚠️ change from 50ms
  • support new special .type() sequences: {moveToEnd},{moveToStart} 🆕
  • support new special .type() sequences: {tab},{shift+tab} 🆕
  • type follows focus ⚠️
  • trusted native keyboard events 🆕
{moveToEnd}/{moveToStart}
  • IE: setSelectionRange on all inputs
  • chrome/ff: setSelectionRange except for email/number inputs. For those we use execCommand('selectAll') + selection.modify('...')
  • branch logic based on browserFeatures object. For ex)
{
  setSelectionRangeOnAllInputTypes: true
}

focus

contenteditable

  • treated as any other text-editable in the commands above.
  • By default move cursor to end
  • support {moveToEnd}/{moveToStart}
  • support {tab}

file uploads 🆕

cy.hover 🆕

scroll behavior

  • scroll into view only if needed ⚠️
    • use getElementFromPoint on the pixel needing click
  • scroll into center by default ⚠️
  • allow user to configure scroll position (center, bottom, top) Enable users to change the scrolling strategy Enable users to change the scrolling strategy #871 🆕
    For IE:
    • scrollIntoView can't center, so calculate coords and try to center it manually

Considerations / Research

select text command? 🆕

  • allow user to make arbitrary text selection

mouse state

  • tbd

for mouse actions that involve mouse state:

  • in open mode, warn if potentially affected test
  • includes click (since hover before click), hover, drag-and-drop

For IE11 & firefox, see branch issue-311-ie-ff

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions