-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: move cy.type()
event tests to its own file.
#20191
Conversation
Thanks for taking the time to open a PR!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few minor changes to the tests to make them consistent.
'#target-button-tag', | ||
'#target-input-button', | ||
'#target-input-image', | ||
'#target-input-reset', | ||
'#target-input-submit', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added #target
to make tests consistent with cy.type(' ')
tests.
it(target, () => { | ||
cy.get(target).focus().type('{enter}') | ||
|
||
cy.get('li').should('have.length', 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line has been added not to allow more than 4 li
s.
it(target, () => { | ||
cy.get(target).focus().type('{enter}') | ||
|
||
cy.get('li').should('have.length', 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line has been added not to allow more than 3 lis.
'#target-input-checkbox', | ||
'#target-input-radio', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added #target
to make tests consistent with cy.type(' ')
tests.
1ad4eb0
to
f474883
Compare
it('fires events in the correct order') | ||
|
||
it('fires events for each key stroke') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets remove these empty tests or log an issue to back-fill these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea. Mind logging the issue & add TODO with link to these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened this issue at #20283.
// changed = 0 | ||
|
||
// cy.$$(":text:first").change -> | ||
// changed += 1 | ||
|
||
// cy.get(":text:first").invoke("val", "foo").type("b{tab}").then -> | ||
// expect(changed).to.eq 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cy.visit('fixtures/dom.html') | ||
}) | ||
|
||
describe('events', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be appropriate to rename this to keyboard events
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. keyboard events
better describes the tests. I fixed it that way.
f474883
to
8239cdd
Compare
8239cdd
to
b186d44
Compare
b186d44
to
c944ac6
Compare
cy.type(' ')
fires click event on button-like elements. #20067User facing changelog
N/A. It's just an internal cleanup.
Additional details
type_spec.js
is too long. It takes about 2 minutes to finish. After adding event-related tests in this PR series, I thought it's a good idea to move them to its own file.How has the user experience changed?
N/A
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?