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

    billions-receptionist-99356

    11/22/2022, 3:18 PM
    Hello everyone. Hope you're doing wellπŸ™‚ . I'm trying to integrate cypress in my react app, but tests are failing in the CI (I'm working with Jenkins), and exactly in the cy.visit('/') . Here is the error : `CypressError:
    cy.visit()
    failed trying to load: http://localhost:3000/ The response we received from your web server was: > 403: Forbidden This was considered a failure because the status code was not
    2xx
    . If you do not want status codes to cause failures pass the option: `failOnStatusCode: false``
  • s

    swift-fireman-48516

    11/22/2022, 3:33 PM
    maximum 3-4 minutes, but it doesn't happen to hang every time and not always the same spec file.
  • s

    swift-fireman-48516

    11/22/2022, 3:35 PM
    anyways, what we're trying to achieve is to send an error to cypress dashboard so we don't wait those 90 minutes if we make the job time out, while our team fix the tests (about 270 spec files, more than 3k tests) which will take a while
  • n

    nutritious-army-46708

    11/22/2022, 4:30 PM
    Does anyone have some suggestions about cypress playing the DRM video? Thank you so much!
  • m

    mysterious-belgium-25713

    11/22/2022, 5:51 PM
    How are you starting your app in jenkins. And does your Jenkins have firewall rules blocking connection to localhost?
  • s

    sticky-energy-17458

    11/22/2022, 6:08 PM
    How to remove value after decimal in Cypress
  • m

    mysterious-belgium-25713

    11/22/2022, 6:23 PM
    Uhh depends on how you get the number. But you can do a parseint. Or try this trick but both tricks are just plain JavaScript
    Copy code
    js
    var num = 2.9
    console.log(num | 0); // 2
  • m

    mysterious-belgium-25713

    11/22/2022, 6:24 PM
    Copy code
    js
    parseInt(d, 10);
  • s

    sticky-energy-17458

    11/22/2022, 6:28 PM
    When I try to get the number it's coming like $400.56 so I want just 400 out of it.
  • m

    mysterious-belgium-25713

    11/22/2022, 6:51 PM
    Are you always rounding your number down. Can't you just use substring and remove the last characters from your string. Don't know if you can combine them but trim and then substring if you always have decimal you can remove the last 3 characters. Btw I'm now answering from my phone so might be a sloppy answer but this is what pops up in my head
  • m

    mysterious-belgium-25713

    11/22/2022, 6:52 PM
    Or maybe slice is even better
  • g

    gray-kilobyte-89541

    11/22/2022, 6:52 PM
    First convert it to a float, then use "closeTo" assertion. You can find
    closeTo
    assertion examples by searching https://cypress.tips/search
  • m

    mysterious-belgium-25713

    11/22/2022, 6:53 PM
    Or just pay Gleb for a private session πŸ˜…
  • b

    bitter-judge-96754

    11/22/2022, 8:07 PM
    As you can see from first pic there is 'Call Us' button and 'Cancel' button in mobile But When I make assertion, Cypress can't find them because it disappears in Cypress. How to solve this issue in Cypress? Is it a bug for Cypress?
  • a

    adventurous-beach-9295

    11/22/2022, 8:17 PM
    Hello πŸ‘‹ Anyone using cypress-grep plugin to create groups like smoke, sanity regression and cypress dashboard (now cypress cloud) noticed a significant increase in "Run duration" ?? idk if this change to cypress cloud has something to do, I'm still investigating..
  • b

    bitter-fountain-36713

    11/22/2022, 8:23 PM
    Have you checked the resolution matches or you may have to scroll to view the buttons?
  • b

    bitter-judge-96754

    11/22/2022, 8:27 PM
    It’s already scrolled since the flyout fits the whole page
  • p

    powerful-gigabyte-69168

    11/22/2022, 8:45 PM
    So we've had a race condition in our test initialization that has been stopping us from upgrading past cypress 9 for months. We have a helper function called
    setupGameAsP0()
    which is a regular js function that calls several custom cypress commands including creating multiple accounts and making a game. Someone tried wrapping the beginning of the function in
    cy.then()
    and it suddenly works, to my bewilderment. Can anyone help me make sense of this? We now have
    Copy code
    cy.then(() => { // we added this wrapping cy.then()
        if (!alreadyAuthenticated) {
          cy.wipeDatabase();
          cy.visit('/');
          cy.signupPlayer(username, validPassword);
        }
      });
    and suddenly the tests pass in CI
  • b

    bitter-fountain-36713

    11/22/2022, 9:08 PM
    The footer with the buttons are not rendering. Are you using the same userAgent as your previous example?
  • m

    mysterious-belgium-25713

    11/22/2022, 9:24 PM
    Your viewport is also different in the 2 pictures, Because where you can see the buttons also the phone number is on 1 line and in your cypress test its doesnt fit the line
  • f

    freezing-wall-7568

    11/22/2022, 10:35 PM
    once I login via cy.session and if I want to do cy.request within the same domain, do I have to pass a token? or does the cy.session handles that for me
  • b

    bitter-fountain-36713

    11/22/2022, 10:52 PM
    !duplicate
  • n

    nutritious-analyst-96582

    11/22/2022, 10:52 PM
    Uh oh, It looks like you have posted the same question in multiple channels. Help us prevent spam by removing any duplicates of your questions, Thanks! πŸ˜€
  • b

    bitter-judge-96754

    11/23/2022, 3:54 AM
    Viewports are the same. Both pics are from mobile view. Buttons are not rendering
  • m

    mysterious-belgium-25713

    11/23/2022, 7:44 AM
    When do you set the viewport in the test or before loading cypress. For mobile view testing i always use a different cypress config and use that to start cypress.
  • s

    stale-wire-41120

    11/23/2022, 7:45 AM
    how to solve cross origin issue i
  • f

    fresh-doctor-14925

    11/23/2022, 9:08 AM
    cy.origin()
    ?
  • s

    stale-wire-41120

    11/23/2022, 9:08 AM
    experimentalSessionAndOrigin: true
  • s

    stale-wire-41120

    11/23/2022, 9:08 AM
    do i have to do this
  • f

    fresh-doctor-14925

    11/23/2022, 9:09 AM
    Yeah. docs are here https://docs.cypress.io/api/commands/origin
1...150151152...192Latest