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

Add example of testing `datalist` to `.next()` and `.type()` #824

Open
jennifer-shehane opened this Issue Aug 8, 2018 · 2 comments

Comments

2 participants
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Aug 8, 2018

From: cypress-io/cypress#445 (comment)

Can add example to next.md and type.md.

Testing a datalist:

  <input list="fruit" />
  <datalist id="fruit">
    <option>Apple</option>
    <option>Banana</option>
    <option>Cantaloupe</option>
  </datalist>
  cy.get('#fruit option').should('have.length', 3)
    .first().should('have.text', 'Apple')
    .next().should('have.text', 'Banana')
    .next().should('have.text', 'Cantaloupe')
  cy.get('input').type('Apple')
@malydok

This comment has been minimized.

Copy link

malydok commented Sep 7, 2018

I'd like to contribute on this but after taking some time reading through the original issue and the docs of both .next() and .type() I can't really understand how this particular case is relevant to these pages. How would adding this example in both of the function pages make sense? The use cases of both functions in this datalist example are explained clearly in their respective docs. Where would the example fit inside the docs?

@jennifer-shehane

This comment has been minimized.

Copy link
Member Author

jennifer-shehane commented Sep 10, 2018

I think this would just be another example to have in .next() doc under https://on.cypress.io/next#Examples:

<input list="fruit" />
  <datalist id="fruit">
    <option>Apple</option>
    <option>Banana</option>
    <option>Cantaloupe</option>
  </datalist>
  cy.get('#fruit option')
    .first().should('have.text', 'Apple')
    .next().should('have.text', 'Banana')
    .next().should('have.text', 'Cantaloupe')

And this could be an example for testing datalist in .type() doc under https://on.cypress.io/type#Examples:

  <input list="fruit" />
  <datalist id="fruit">
    <option>Apple</option>
    <option>Banana</option>
    <option>Cantaloupe</option>
  </datalist>
 cy.get('input').type('Apple')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.