No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    E2E testing with cypress

    [v1] App Extensions
    3
    5
    1322
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kwi last edited by

      I can integrate cypress in my quasar project. it works, but how can I identify my input-fields? In older versions of quasar I marked my input fields with Id="…". Now quasar assigns its own IDs.

      here an examle of one input field:
      <input tabindex=“0” data-autofocus=“true” aria-label=“Benutzername” id=“f_0f78a881-3692-4d73-bd06-383baad9734a” type=“text” class=“q-field__native q-placeholder”>

      How can I find this input field in my cypress-test-script? cy.get(???)

      thanks, Kerstin

      1 Reply Last reply Reply Quote 0
      • K
        keechan last edited by keechan

        I personally use data-cy tag.

        <q-input outlined clearable lazy-rules v-model="field" clear-icon="close" label="Field" data-cy="field" />
        

        Then on your cypress test:

        cy.get('[data-cy=field]').type('some value here').should('have.value', 'some value here')
        

        Hope this helps!

        K 1 Reply Last reply Reply Quote 0
        • K
          kwi last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • K
            kwi @keechan last edited by

            @keechan Thank you so much, that tip helped me a lot

            1 Reply Last reply Reply Quote 0
            • patryckx
              patryckx last edited by

              @kwi some examples here https://github.com/W3AS/quasar-cypress-example

              1 Reply Last reply Reply Quote 0
              • First post
                Last post