https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • c

    cool-application-67821

    06/18/2021, 4:52 AM
    P.S. Even debugger wont help, just console.log helps
  • u

    user

    06/18/2021, 11:55 AM
    When using
    .within
    , does cypress retry the
    .get
    it was chained on? For instance:
    Copy code
    cy.get('table tbody tr:nth(1)').within(() -> {
      // some asserts here
    })
  • u

    user

    06/18/2021, 11:57 AM
    main reason: table updates based on a call to backend (which we wait on), but the update to the table has some delay. This delay is not a problem local, but we've noticed flakiness when it runs on CI
  • c

    cool-application-67821

    06/18/2021, 2:51 PM
    I think it is not like cy.get() is repeatedly called, it might be that cy.get}() is called once and internally it is retried for the default/overrirdden time
  • t

    thankful-lunch-80439

    06/18/2021, 4:59 PM
    Unfortuantely this doesn't work
  • t

    thankful-lunch-80439

    06/18/2021, 4:59 PM
    The test ID is always available on the page, so it finds it prior to the state up
  • b

    bulky-sundown-74498

    06/18/2021, 5:02 PM
    you can replace your cy.get('#mything') by a cy.contains('#mything', 'coco')
  • b

    bulky-sundown-74498

    06/18/2021, 5:02 PM
    then it will only return once coco is the contents or mything
  • t

    thankful-lunch-80439

    06/18/2021, 5:04 PM
    Testing...
  • t

    thankful-lunch-80439

    06/18/2021, 5:08 PM
    😄 yaaay it worked!
  • t

    thankful-lunch-80439

    06/18/2021, 5:08 PM
    I think...give me a second..
  • t

    thankful-lunch-80439

    06/18/2021, 5:13 PM
    Tests passing with slow 3g connection 🙌 thank you for your help @User
  • b

    bulky-sundown-74498

    06/18/2021, 5:17 PM
    \o/
  • b

    bulky-sundown-74498

    06/18/2021, 5:17 PM
    🎉
  • c

    cool-application-67821

    06/18/2021, 9:31 PM
    great to know of contains. I suppose another thing we can do is fill a data-attribute={some data} when rest of the data is fileld and we just do .get([data-att='']), but i prefer your way using containers
  • c

    cool-application-67821

    06/18/2021, 9:31 PM
    contains
  • b

    bulky-sundown-74498

    06/18/2021, 9:49 PM
    Yes, I think it should be added to the docs on the “get” page. I will mention it to the DX team. @User ?
  • w

    worried-pizza-99625

    06/20/2021, 2:19 PM
    I have been using Istanbul to provide code coverage to VueJS, which works well. We have recenlty introduced Keycloak which provides a login via an Iframe to another domain for SSO. This means that I have to trun off web security for it to work. Testing works just fine, but Istanbul code coverage does not work, I think because of the Iframe but I can't be sure. Basicly, any code that is run after being returned to main site after logging via keycloak, is shown as having no test coverage.
  • m

    mammoth-arm-34681

    06/22/2021, 9:06 AM
    Hi folks, is anyone here have a solid example on how to execute cypress through AWS Lambda Function using a docker container ?
  • f

    future-journalist-95278

    06/28/2021, 8:04 PM
    Hey Jess, here's an example repo. I'm trying to intercept a request and replace the returned status code, but it's not doing what I expect. https://github.com/CodyBontecou/ssr-cypress-intercept
  • t

    thankful-motherboard-76645

    07/01/2021, 8:55 AM
    Hi All! I'm currently trying to use @cypress/skip-test to dynamically skip my test based on certain condition. however, I found out that it will mark skip the test if it is known flag (i.e. 'chrome', 'mac', etc). If I use some other condition, the test would still be run, but no code executed resulting in the test marked as passed, instead of skipped. does anyone know how to mark the test as skipped?
  • t

    thankful-lunch-80439

    07/08/2021, 3:51 PM
    I'm testing a form with 2 "Yes / No" options on one page. How can I select the 2nd set of "Yes / No"
  • w

    wonderful-match-15836

    07/08/2021, 4:06 PM
    You have a few ways, but in this situation I would see if there's a way to select the label of the question itself, and then target the yes/no options from there. Then if stuff moves around in the page, it doesn't break your test. If that's not ideal in your setup another option is to put a
    data-testid
    attribute the element you want to select, and use that as your selector. And then there is always
    .eq(n)
    (https://api.jquery.com/eq/) so you could do
    cy.get('.whatever').eq(1)
    to get the second matching element. The drawback with that is that if, say, another question is added above, your tests will now be selecting that other option instead of your intended set, which could produce confusing results.
  • t

    thankful-lunch-80439

    07/08/2021, 4:07 PM
    Wow excellent reply Mark thank you so much. I agree I have to update the code to make it better; then use eq.
  • f

    future-journalist-95278

    07/14/2021, 4:29 AM
    Hey @User , any chance you could check on this thread?
  • s

    sticky-dentist-24502

    07/14/2021, 8:14 AM
    HI, I need help Can I run parallel cypress tests in gitlab CI ? thanks
  • i

    important-river-75795

    07/14/2021, 8:17 AM
    @User yes you can
  • h

    hallowed-soccer-80135

    07/14/2021, 8:30 AM
    hello guys and gals, has anyone implemented a solution for retrying/rerunning a failed spec. Not retries related to a
    it()
    block. I am referring to retry on the parent
    describe()
    level. If one of the it() block fails even after re-trying for
    n
    times, the entire
    describe()
    should be retried
  • b

    best-yacht-92435

    07/14/2021, 2:08 PM
    So following the programatic login for Cognito (https://docs.cypress.io/guides/testing-strategies/amazon-cognito-authentication#Custom-Command-for-Amazon-Cognito-Authentication) there is one thing that is not making sense for me. Why would it have to redo the login after every test. Right now the login fail after running 4 test. I am sure I am missing something.
  • p

    purple-afternoon-2408

    07/14/2021, 3:55 PM
    Hello everyone, have anyone came across an issue where
    cy.get('input[type="date"]').eq(0).type('1980-06-24').should('have.value', '1980-06-24')
    would have no affect or impact on the input?
1...101112...192Latest