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

    cold-van-45410

    08/15/2022, 8:07 AM
    is any other way to assert?
  • f

    fresh-doctor-14925

    08/15/2022, 8:11 AM
    There's plenty of documentation on the Cypress website showing various ways to do what you are trying to achieve. Have you looked on there?
  • f

    fresh-doctor-14925

    08/15/2022, 8:14 AM
    Got a fun little challenge today: trying to convince an application that my Cypress test isn't a bot (even though it totally is šŸ˜…) So far I have tried: • Adding wait statements and delays to the typing speed • Using the cypress-real-events plugin (https://github.com/dmtrKovalenko/cypress-real-events) Has anyone else encountered a similar issue with bot detection? Or, even better, has anyone found a way to overcome it for their application?
  • s

    stale-optician-85950

    08/15/2022, 8:22 AM
    @fresh-doctor-14925 Is this an in-house application? Can't you ask the devs to put a back door in just on the test environments? Like a recognisable cookie etc, something to disable the bot in your test environments, as that could become a nightmare to deal with. Otherwise, I'd be asking the devs to give me the list of checks the bot is doing.
  • l

    limited-room-30929

    08/15/2022, 8:55 AM
    user-agent?
  • f

    fresh-doctor-14925

    08/15/2022, 10:07 AM
    It is, yeah. I have a meeting with them this afternoon, but it's owned by a team that isn't very accommodating from what I've heard
  • f

    fresh-doctor-14925

    08/15/2022, 10:15 AM
    Good suggestion! Hadn't thought of that. Just gave it a try and their bot detection caught me again šŸ˜… I'll go with @stale-optician-85950 's approach and see what the team responsible can suggest. Thanks!
  • s

    stale-optician-85950

    08/15/2022, 10:18 AM
    Might be a tough sell with the other team, but if you can't control the application state, it has the potential to keep changing outside of your control. Bring (virtual) biscuits to the meeting to win them over šŸ˜†
  • f

    fresh-doctor-14925

    08/15/2022, 12:10 PM
    I was lucky. Found a nice developer and a way to circumvent without entering into an arms race with their bot protection šŸ™‚
  • f

    future-translator-75417

    08/15/2022, 2:12 PM
    Hi team I am trying to login on a website with cy.visit() which leads to the dashboard,but rather than redirecting to the dashboard my cypress test spec window closes and redirect to spec files page where we select the test file execute. I have been working on it for the past week but didn't find any workaround , please someone look into this Link : https://my.demosphere.com/sign-in Cred : Username : alidem2 Password : Alidem2
  • d

    damp-fountain-74482

    08/15/2022, 2:23 PM
    Hi, I'm trying to implement an after-test hook by listening on
    test:after:run
    events. I want to report some data after each and every test, and send it via HTTP to another server. However, it seems like the event handler gets cut-off immediately, before the request can be be completed, and the next test beings to run. How can I make the event listener wait until the request is done, and only then return? It seems like the common Node practices of async/await or even the classic then/catch logic on promises don't have any effect. Thanks.
  • f

    fresh-doctor-14925

    08/15/2022, 2:38 PM
    Have you looked into using
    afterEach()
    ?
  • c

    cold-eye-66538

    08/15/2022, 5:01 PM
    Hello. My team really likes the Cypress Runner and attempts to make reports using cucumber-html-reporter are not yielding what we want. Is there a way to save the Cypress Runner as a report?
  • s

    stale-optician-85950

    08/15/2022, 8:17 PM
    Have you seen this tutorial https://www.cypress.io/blog/2020/04/01/streaming-test-results/ ? I use this technique successfully to push individual test results into New Relic.
  • g

    gray-kilobyte-89541

    08/15/2022, 9:16 PM
    what a great blog post...
  • s

    strong-energy-6158

    08/16/2022, 5:01 AM
    Hi Friends, I need a help, please. I am learning to run the cypress automation suite using Jenkins. My suite is in local and configured job in Jenkins. But getting an error while running. Checked google and didnt get a solution. Building in workspace /Users/shajisebastian/Desktop/Shaji/Learning/Automation/Cypress/CypressWeb_v10_Jenkins java.nio.file.AccessDeniedException: /Users at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) My script locaitoni is /Users/shajisebastian/Desktop/Shaji/Learning/Automation/Cypress/CypressWeb_v10_Jenkins. I am using Mac and how to give access to /Users?
  • p

    purple-kilobyte-85592

    08/16/2022, 6:40 AM
    Has anyone tried to preserve cookies in latest version without preserve Once method as it is depreciated?
  • f

    faint-fountain-74551

    08/16/2022, 9:30 AM
    Hello everyone hope your day is going well I was wondering if it is possible to not show POST requests from the site on the timeline. I understand this might not be best practice and do not plan to use this long term.
  • j

    jolly-machine-52750

    08/16/2022, 1:26 PM
    what are the common problems I should check when my e2e UI of Cypress is freezing after app login:
    Copy code
    Cypress.Commands.add('loginViaUI', (
        email = Cypress.env('userEmail'),
        password = Cypress.env('userPassword')
      ) => {
        cy.visit(`/login`)
        cy.get('input[type="text"]').type(Cypress.env('userEmail'))
        cy.get('input[type="password"]').type(Cypress.env('userPassword'))
        cy.get('button.bg-primary').click()
      })
    then in page test I do
    Copy code
    describe('Orders page', () => {
        beforeEach(() => {
             cy.loginViaUI()
             ...
    login passes and then UI of Cypress is freezing
  • f

    fresh-doctor-14925

    08/16/2022, 1:40 PM
    Couple of usual suspects Does the login happen on a different domain? Could be a cross origin issue Does the login usually open a new tab? Cypress can't handle multiple tabs
  • j

    jolly-machine-52750

    08/16/2022, 2:04 PM
    no it's all in one domain/tab. I've ordered 2 sec delay to let all the resources in additional data requests to load and now it seems a bit more repetitive
  • f

    fresh-doctor-14925

    08/16/2022, 2:33 PM
    That shouldn't be necessary. Instead of a 2 sec delay, you could look for items that will appear once the page has loaded, or use
    cy.intercept()
    to look out for those network responses
  • p

    polite-policeman-65273

    08/16/2022, 2:37 PM
    Just wanted to share that I was able to resolve the circleCI issue with Cypress tests running in a Docker container (see my previous post in the channel). Adding the
    --browser chrome
    flag to CMD in Dockerfile was a game changer. Obviously running Cypress in a container using the default Electron on circleCI is not the best option. Also, please be AWARE that if you are using secret env variables in your tests on circleCI, they WILL BE EXPOSED in a video recording made by Cypress
  • f

    fresh-doctor-14925

    08/16/2022, 3:05 PM
    Are you putting these env variables into
    cy.type()
    ?
  • p

    polite-policeman-65273

    08/16/2022, 4:58 PM
    cy.type(password)
    where
    password: Cypress.env('YOUR_PASSWWORD')
  • s

    shy-river-90411

    08/16/2022, 5:17 PM
    I have a project with some Cypress e2e tests which uses a sqlite database. Running my tests locally works fine but I also run the tests in a github action. Sometimes when running in CI the Cypress step runs forever (or at least >12h). The logs show nothing wrong except that it just never continues from one test. Running the tests locally works has never had any issues. The source for the tests is available here if anyone wants to take a look (https://github.com/anton-g/fredagslunchen/blob/main/cypress/e2e/smoke.cy.ts, https://github.com/anton-g/fredagslunchen/blob/dev/cypress.config.ts) but I'm mainly looking for input on how to debug it, or common mistakes that might cause these issues.
  • p

    polite-policeman-65273

    08/16/2022, 5:18 PM
    are you running the tests in Electron v100 on circleCI?
  • s

    shy-river-90411

    08/16/2022, 5:19 PM
    Nope, on github with the official action: https://github.com/anton-g/fredagslunchen/blob/dev/.github/workflows/deploy.yml#L82
  • g

    gray-kilobyte-89541

    08/16/2022, 5:32 PM
    https://glebbahmutov.com/blog/keep-passwords-secret-in-e2e-tests/
  • p

    polite-policeman-65273

    08/16/2022, 5:35 PM
    yes, that's it, just found it, thanks for plugging this security hole
1...818283...192Latest