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

    bulky-sundown-74498

    06/11/2021, 9:08 PM
    @User I hope this helps
  • l

    limited-keyboard-75773

    06/12/2021, 4:37 AM
    Even if I do import
    cy.restoreLocalStorage();
    &
    saveLocalStorage
    in the
    support/index.js
    file, I'll still need to call them in
    beforeEach
    &
    afterEach
    hooks per spec file right? I just trying to find a way to not be force to use the
    afterEach
    in all spec files in order to use the
    cy.saveLocalStorage();
    alone.
  • s

    stocky-dream-36427

    06/15/2021, 9:13 PM
    Yeah
  • u

    user

    06/16/2021, 7:52 AM
    Hello, I'd love to know if it's possible to test how a random website reacts to a cookie decline and cookie accept. Basically, what I am asking is if it's possible to monitor cookies with Cypress before any click, after declining and then clear cookies and do the same thing but this time accept cookies. I don't know the name of the cookies as these are 3rd party websites.
  • r

    rich-businessperson-57314

    06/17/2021, 11:05 AM
    Hey, all! I am having troubles running the Cypress tests in Jenkins. Has anyone successfully integrated with Jenkins and can share the knowledge or a link to a working repo + Jenkins build?
  • u

    user

    06/17/2021, 1:57 PM
    @User What issue are you running into specifically? We have an example Jenkins setup here: https://docs.cypress.io/guides/continuous-integration/ci-provider-examples#Jenkins
  • l

    limited-keyboard-75773

    06/18/2021, 12:24 AM
    I'm having issues setting a request header, it seems it's duplicating the value. I have added a detailed question here: https://stackoverflow.com/questions/68027823/getting-duplicated-request-header-values-when-setting-it-with-cypress If somebody could help me.
  • u

    user

    06/18/2021, 8:36 AM
    Anyone?
  • b

    bulky-sundown-74498

    06/18/2021, 3:25 PM
    Hello Angelx, thank you for your question. Every time a new spec opens in cypress, a "fresh" instance of the browser is spawned. It means that unless you push them in yourself you don't have any cookies when you open.
  • b

    bulky-sundown-74498

    06/18/2021, 3:27 PM
    You can have 1 spec for accepting cookies, and another to refusing cookies
  • b

    bulky-sundown-74498

    06/18/2021, 3:29 PM
    If you prefer to do it all in the same spec, look up the function cy.clearCookies() (https://docs.cypress.io/api/commands/clearcookies)
  • u

    user

    06/19/2021, 9:16 AM
    thank you
  • f

    fancy-toddler-26933

    06/21/2021, 12:17 AM
    hi guys, Im new to cypress, Do we have anyway to save text to temps ?
    Copy code
    let temps   
            cy.get(somthing).invoke('text').then((text) =>{
                  temps = text
                  cy.log(temps)
              })
            cy.log(temps)
  • f

    fancy-toddler-26933

    06/21/2021, 12:20 AM
    its only show text in the 1st log not the 2nd log. Any idea ?
  • i

    icy-rainbow-39970

    06/21/2021, 5:17 PM
    You can create alias using cy.wrap and access it later
  • b

    bulky-sundown-74498

    06/21/2021, 5:18 PM
    @User you should try and add numbers to your logs to clarify what you code does:
    Copy code
    js
    let temps   
    cy.get(somthing).invoke('text').then((text) =>{
                temps = text
                  cy.log('inside', temps)
    })
    cy.log('outside', temps)
    If you run this test, you will see that the
    outside
    is run before the
    inside
    log.
  • b

    bulky-sundown-74498

    06/21/2021, 5:20 PM
    This is because what happens in the function called in
    .then
    is asynchronous. It is going to be called after the
    invoke
    is done AND the rest of the synchronous code is finished.
  • b

    bulky-sundown-74498

    06/21/2021, 5:22 PM
    To get a better understanding of how asynchronous code (AKA Promises) is working checkout this article https://www.freecodecamp.org/news/javascript-es6-promises-for-beginners-resolve-reject-and-chaining-explained/
  • c

    crooked-thailand-45717

    06/22/2021, 12:02 AM
    I have a VB.net application that I am testing. Can anyone help with testing pop up windows? For example, the main window creates, pop up window 1, which in turn creates pop window 2. I have to submit the form in pop window 2 , followed by submitting the pop up 1 and finally submit form again in main window. does anyone how to test this using cypress? Thank you for the help!
  • b

    bulky-sundown-74498

    06/22/2021, 6:02 PM
    Hello @crooked-thailand-45717, I think you might have stepped in a tradeoff that cypress sadly has https://docs.cypress.io/guides/references/trade-offs#Permanent-trade-offs-1
  • b

    bulky-sundown-74498

    06/22/2021, 6:03 PM
    But I believe once more @User has some of your bacon saved
  • b

    bulky-sundown-74498

    06/22/2021, 6:03 PM
    https://glebbahmutov.com/blog/cypress-using-child-window/
  • u

    user

    06/22/2021, 6:06 PM
    I am trying to find out how the socket io of the runner/server works. My understanding the browser gets conifigured to use a http proxy initiated by Cypress. Only I am unclear if this is a http proxy and then the socket io connects over wss when the base url of the test is https and over ws when the base url is http?
  • u

    user

    06/23/2021, 11:37 AM
    Hello guys, I am wondering if anyone tried using eslint to make sure code they commit does not contain "it.only"
  • w

    wonderful-match-15836

    06/23/2021, 1:18 PM
    @User my team's considered it!
  • t

    tall-country-74934

    06/23/2021, 1:33 PM
    Hey all! I'm trying to run a
    cy.exec('someCommand')
    but every time, I get a timeout, no matter what command I try. I want to run
    php artisan tinker
    but even simple commands like
    print Hello
    will timeout. Can anyone think of any reason why this might be? I've searched high and low on the internet but nobody seems to be having the same issue!
  • u

    user

    06/24/2021, 1:49 AM
    Hey everyone! I am currently adding Cypress tests through out the work project but am at the stage of getting it running in CircleCi and have a little issue that I can't seem to solve. Locally I am using
    cypress.env.json
    but am wondering how I will translate this up to CircleCi?
  • f

    flat-electrician-52949

    06/24/2021, 9:46 AM
    Does cypress have some way to add text details to a contain/should assertion.
  • f

    flat-electrician-52949

    06/24/2021, 9:46 AM
    In some cases it's quite clear that it's looking for at date or email
  • f

    flat-electrician-52949

    06/24/2021, 9:47 AM
    but in others (like with numbers) it would be nice to append some details to it
1...242526...252Latest