https://cypress.io logo
Join Discord
Powered by
# help
  • g

    gray-kilobyte-89541

    12/16/2022, 6:45 PM
    Search https://cypress.tips/search for "email"
  • w

    worried-lifeguard-15953

    12/17/2022, 12:16 AM
    How can I iterate table rows if they exist? I can do something like cy.get('tr') .each(($el) => { // Do something }) }) but it fails if it never finds any. I want the test to continue even if it doesn't find any s.
  • t

    thousands-house-85089

    12/17/2022, 1:01 AM
    Can you get better control over your test data? I would try to test a known state, so you run one test against a table where you know which rows do exist, and you run another test against a table where you know rows don't exist. This way it's much less flaky, more reliable, and follows best practice for app testing.
  • w

    worried-lifeguard-15953

    12/17/2022, 1:06 AM
    Yes, I could do that. It's just so inconsequential to the test, that it seems like overkill to basically run the same test twice. Essentially, I'm testing a "Cancelling a create-new" functionality. The page shows a table of existing records. If I click "Add New", but then cancel it, I just want to make sure the same set of records is there after the cancel as was before; regardless of how many records it is.
  • t

    thousands-house-85089

    12/17/2022, 1:09 AM
    cy.get('.datatable').find('tr').should('have.length', 4) Can you use something like this? You can pass in a variable instead of the number 4. Perhaps you can store the variable from finding the length the first time, then compare it after cancelling the button click.
  • w

    worried-lifeguard-15953

    12/17/2022, 1:13 AM
    In my
    // Do something
    , I'm storing the
    data-cy
    value of each row in an array. Then I do that again after the cancel, and compare the arrays. Like I said, it works fine when there are rows, but it times-out and fails if there aren't any.
  • t

    thousands-house-85089

    12/17/2022, 1:15 AM
    You could wrap it in an if, so if row length > 0 then do the rest of the test But you are in danger of the test passing and a bug existing when rows do exist in the data, and it won't run to cover that scenario.
  • t

    thousands-house-85089

    12/17/2022, 1:16 AM
    Sometimes you run it might fail, other times it might pass. Hence building a flaky test.
  • t

    thousands-house-85089

    12/17/2022, 1:16 AM
    So I would still personally fall back to trying to control the data more precisely and know exactly what state it's in when my test runs.
  • f

    few-waitress-52308

    12/17/2022, 9:59 AM
    Need help : power BI dashboard not loading only through cypress e2e. it works perfectly using playwright and selenium
  • f

    fresh-doctor-14925

    12/17/2022, 1:56 PM
    !moreinfo
  • n

    nutritious-analyst-96582

    12/17/2022, 1:56 PM
    Hey! You're unlikely to get an answer to this question because it is too broad and/or vague. Take a look at #how-to-get-help for some tips on how to improve your question
  • g

    gray-kilobyte-89541

    12/17/2022, 3:24 PM
    https://glebbahmutov.com/cypress-examples/9.7.0/recipes/conditional-testing.html
  • s

    straight-pencil-91170

    12/18/2022, 7:18 AM
    Hey, So I got this weird issue maybe someone encountered it: Locally all my tests are running smoothly and everything works fine, but when I run my cypress e2e test on bitbucket CI it runs super slow, and when I say super slow it's changing the 10 min local test to 4 hours, anyone have any idea on how to solve this? I use: docker run -v $PWD:/e2e -w /e2e --entrypoint=cypress cypress/included:12.1.0 run --browser electron --record --key {Key} to run it
  • f

    fresh-doctor-14925

    12/18/2022, 9:21 AM
    Hard to say based on the information here, but try disabling video
  • s

    straight-pencil-91170

    12/18/2022, 9:22 AM
    Ill try
  • s

    straight-pencil-91170

    12/18/2022, 9:22 AM
    @fresh-doctor-14925 What information can I add, so you could help me more?
  • f

    fresh-doctor-14925

    12/18/2022, 9:28 AM
    Take a look at #763097415896268840
  • h

    handsome-twilight-72740

    12/18/2022, 9:44 AM
    Hey there, I have an element with display: sticky which acts butterfly on chrome browser, but when scrolling on cypress debug browser, it gets disappear from the screen, meanning that the display: sticky don't work
  • m

    magnificent-laptop-98009

    12/18/2022, 11:09 AM
    Hi, I got trouble with new tabs: - Cannot get URL of new opened tab. - Cannot set focus on it. - And cannot close it also. So, are you guys have exp with the new open tabs on Cypress, pls share with me the solution for this. Many thanks.
  • t

    thousands-house-85089

    12/18/2022, 6:44 PM
    Cypress doesn't handle new browser tabs and windows by default. However there are some articles you can find which describe possible solutions. E.g. https://testersdock.com/cypress-new-window/
  • t

    thousands-house-85089

    12/18/2022, 6:46 PM
    Try using workarounds like forcing the link to open in the same window instead of a new one. I've found this method to be quite reliable.
  • m

    magnificent-laptop-98009

    12/18/2022, 6:49 PM
    Thank you so much, I will try this again
  • p

    proud-gpu-14798

    12/18/2022, 7:13 PM
    My app uses a continuous-scroll UI which makes selecting elements challenging. Originally I thought I could grab the currently visible element using
    cy.get('[data-testid="code-box"]:visible'
    only to discover "visible" really means "could be visible currently OR visible if the user can scroll it into view" so that locator strategy often fails for me due to multiple matches. Elsewhere, I'm currently using the
    isInViewport
    custom chai assertion successfully. I am thinking I need to write a helper that can use similar logic during a
    cy.get()
    to filter elements to just those that are currently in the viewport. Has anyone already tackled this?
  • m

    most-secretary-62975

    12/19/2022, 12:37 AM
    Can anyone recommend an email provider for E2E testing. We were using gmail but now gmail keeps giving security warning, check activity, and tests are failing. Any suggestions would be appreciated.
  • t

    thousands-house-85089

    12/19/2022, 12:40 AM
    https://www.thunderbird.net/en-GB/ Tried Mozilla Thunderbird?
  • m

    most-secretary-62975

    12/19/2022, 12:41 AM
    @thousands-house-85089 I have not but will give it a try.
  • t

    thousands-house-85089

    12/19/2022, 12:41 AM
    You host it yourself and can control everything about it
  • t

    thousands-house-85089

    12/19/2022, 12:41 AM
    and it's free
  • m

    most-secretary-62975

    12/19/2022, 12:41 AM
    Ah nice. Will give it a try.
1...232233234...252Latest