Skip to content
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

.type() error is inaccurately stating what can be typed into #1650

Closed
jennifer-shehane opened this issue Apr 30, 2018 · 6 comments · Fixed by #1651
Closed

.type() error is inaccurately stating what can be typed into #1650

jennifer-shehane opened this issue Apr 30, 2018 · 6 comments · Fixed by #1651
Assignees
Labels
pkg/driver This is due to an issue in the packages/driver directory type: unexpected behavior User expected result, but got another
Milestone

Comments

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Apr 30, 2018

Current behavior:

If you call .type() on an element that is not supported for typing, the error displays:

CypressError: .type() can only be called on textarea or :text. Your subject is a:

Desired behavior:

This error message is inaccurate and has led to a lot of confusion for users on what .type() supports typing into. In actuality, we support typing into:

  • HTML body and textarea elements
  • Elements with a defined tabindex attribute
  • Elements with a defined contenteditable attribute
  • HTML input elements with a defined type attribute of one of the following:
    • text
    • password
    • email
    • number
    • date
    • week
    • month
    • time
    • datetime
    • datetime-local
    • search
    • url
    • tel

The error message should be updated to just say that .type() has been called on an unsupported element and link to a doc that lists supported elements.

@jennifer-shehane jennifer-shehane added type: unexpected behavior User expected result, but got another pkg/driver This is due to an issue in the packages/driver directory stage: ready for work The issue is reproducible and in scope labels Apr 30, 2018
@jennifer-shehane jennifer-shehane self-assigned this Apr 30, 2018
@jennifer-shehane
Copy link
Member Author

Due to the fact that the supported type elements could change per version of Cypress - the error message should not link to an outside doc and instead include a list of supported type elements.

Ideally, this list should be generated from the actual options checked, so they should be sent to the error message and generated from there.

@bishwenduk029
Copy link

@jennifer-shehane If this is open I can work on this one. I will update accordingly with changes.

@jennifer-shehane jennifer-shehane removed the good first issue Good for newcomers label May 7, 2018
@jennifer-shehane
Copy link
Member Author

@bishwenduk029 The work has already been done for this feature if you have any feedback to give here: #1651

@jennifer-shehane
Copy link
Member Author

jennifer-shehane commented May 15, 2018

New error message for .type():

screen shot 2018-05-15 at 11 39 27 am

New error message for .clear():

screen shot 2018-05-15 at 11 43 07 am

@jennifer-shehane jennifer-shehane added stage: pending release and removed stage: pending release stage: investigating Someone from Cypress is looking into this stage: needs investigating Someone from Cypress needs to look at this stage: ready for work The issue is reproducible and in scope labels May 24, 2018
@brian-mann
Copy link
Member

Released in 3.0.0.

@CarrieZ0320
Copy link

Hi, I am trying to write a test to confirm I can update the name, email those kind of information. Before I update cypress (was version 3.0.2) the feature worked fine. But now with 3.1.0, it shows me the error.
image
But I do want to clear the input to type something else, How should I do this?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory type: unexpected behavior User expected result, but got another
Projects
None yet
4 participants