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

    refined-monkey-52031

    04/29/2021, 8:20 PM
    if that plugin works
  • b

    bulky-sundown-74498

    04/29/2021, 8:20 PM
    I would try it on a smaller scale just to make sure the process works first
  • b

    bulky-sundown-74498

    04/29/2021, 8:20 PM
    then add it when it works to the big site
  • r

    refined-monkey-52031

    04/29/2021, 8:21 PM
    Sounds good thanks! Do you think that plugin would work to add the instrumentation for cypress ?
  • r

    refined-monkey-52031

    04/29/2021, 8:22 PM
    @User thanks!
  • b

    bulky-sundown-74498

    04/29/2021, 8:22 PM
    If it adds istanbul instrumentation it should be great
  • r

    refined-monkey-52031

    04/29/2021, 8:23 PM
    Ok cool thanks ! I will let you know if it works thanks again for your help!!!
  • b

    bulky-sundown-74498

    04/29/2021, 8:23 PM
    🙏
  • b

    breezy-australia-64868

    04/29/2021, 9:32 PM
    Another help question! I just upgraded to the latest packages and omg - this stuff is SO fire. My tests were taking a easily over a minute before and now they take roughly 20sec. Can't believe it. Just running into a simple issue - when I try to run my e2e tests with
    npx cypress run
    they fail and it's due to my stylesheets I'm loading in the support file. Any idea what the fix is? I created a fresh project with cypress and just referenced a stylesheet, and the same issue. Thanks!
    Copy code
    Oops...we found an error preparing this test file:
    
      tests/support/index.js
    
    The error was:
    
    Error: Webpack Compilation Error
    ./node_modules/buefy/dist/buefy.css 2:0
    Module parse failed: Unexpected character '@' (2:0)
    You may need an appropriate loader to handle this file type...
  • b

    bulky-sundown-74498

    04/29/2021, 9:35 PM
    In 7.0, you can have 2 distinct support files one for e2e and one for ct
  • b

    breezy-australia-64868

    04/29/2021, 9:35 PM
    ahh gotcha, that would make sense. thanks!
  • b

    bulky-sundown-74498

    04/29/2021, 9:36 PM
    use the e2e and component flag to configure which is which https://docs.cypress.io/guides/references/configuration#Runner-Specific-Overrides
  • b

    breezy-australia-64868

    04/29/2021, 9:39 PM
    fixed - thanks!
  • p

    purple-alarm-62049

    04/30/2021, 6:05 PM
    I have a list of scroll heights I want to screenshot and having issues with the async/sync chaining of Cypress I think to get it working...
    Copy code
    cy.window()
          .should('have.property', ANIMATION_GLOBAL)
          .then((animations) => {
            cy.log('animations', animations)
            callPerLabel(animations, (section, label, value) => {
              cy.scrollTo(0, value)
              cy.percySnapshot(`${section}: ${label}`)
            })
          })
  • f

    future-gold-77198

    05/04/2021, 8:40 PM
    I think I have some time to do this finally. But I was reading through the introduction.md you mentioned and I noticed there is this section that has this line "if (config.testingType === 'component')" (and in the screenshot) as an example of how to account for using E2E tests along with CTs. This sounds like another way to accomplish what we had talked about previously. So I wonder if this method is no longer preferred or if both this and the cypress.json approach are fine and users can choose whichever they want? Seems like there is a fair amount of overlap between the "Existing end-to-end users" and "Install" sections in general, but if you just want me to add something and leave trimming anything out to someone else, that is fine with me. Just wanted to be more clear before proceeding.
  • c

    calm-notebook-16224

    05/05/2021, 9:49 AM
    Hi, has anyone had an issue with testing
    canvas
    on cypress? I'm using react Cytoscape and basically when I run my cypress test it would load an empty canvas, nothing would be drawn in it. But if I run cypress in headed mode, then within the cypress chrome browser I open the same URL I'm testing in a new tab, it loads the canvas perfectly. In my understanding both cases will still use mocks instead of calling the actual APIs (evidently everything in the page is just
    String
    String
    etc instead of real data). So does anyone have any ideas why cypress behaves differently? Am I missing a config or something?
  • w

    worried-sunset-85459

    05/05/2021, 1:51 PM
    Hi, does anyone know if the "wait" behaviour has changed? I explain before I was doing this:
    Copy code
    js
    cy.wait('@Submit').then(interception => {
      if (interception.response.statusCode != 200) {
      //do something
      }
    })
    and something would happen when I got a 400 error for example, today 05/05 it stops at the "wait" and doesn't do the "then".
  • p

    purple-alarm-62049

    05/06/2021, 4:11 PM
    Trying to write a custom command that recursively checks an external api using
    request()
    but I'm struggling with cypress async/sync. > cy.then() failed because you are mixing up async and sync code. https://gist.github.com/iDVB/4c77f2160bbd6ff35067e6fd7cf647a5 Ideally, I would like the command to return the
    vid
    of the contact. Or fail the expect
  • s

    stocky-dream-36427

    05/06/2021, 4:23 PM
    Runtime gating it with the conditional you pasted is your best bet right now, but you don't have to change anything if you're using cypress.json. We'll possibly change the recommendation in a few months, but both of the approaches will be compatible and will likely never break. We're considering stuff like cypress.js but it's unclear when/if that'll land (4+ months prolly)
  • r

    red-easter-74903

    05/07/2021, 6:17 PM
    Hi all! :D, I'm having some issues with cy.request() method upon Api testing, this is the error cypress is showing me:
  • r

    red-easter-74903

    05/07/2021, 6:20 PM
    This is the code for it:
  • g

    gray-kilobyte-89541

    05/07/2021, 7:00 PM
    probably this https://github.com/cypress-io/cypress/issues/15101
  • r

    red-easter-74903

    05/07/2021, 7:11 PM
    Hi Gleb, I tried downgrading to 6.4 but still see the error, I'm running on local, not Ci yet
  • g

    gray-kilobyte-89541

    05/07/2021, 7:30 PM
    I would downgrade more or wait until the fix comes out, probably Monday
  • s

    stocky-dream-36427

    05/07/2021, 9:48 PM
    @User it largely depends on what URL you're trying to test in your baseUrl. Cypress also has support for proxies though. Here you go https://docs.cypress.io/guides/references/proxy-configuration
  • u

    user

    05/08/2021, 1:40 PM
    Hi @User appreciate your quick response. I read this documentation but I am failing to grasp what "open internet access" means. Our company maintains an explicit allow list for specific domains to be accessed from our CI/CD pipeline. Almost everything we use is internal only. Eg. Opening up access to cypress.io helped resolve the download issue. The setup is a Jenkins pipeline that runs inside AWS VPC and only internal systems can talk to each other. The URL I'm testing is internal to the network but does not work. Right now, I am unable to explain to the network / security folks what exactly is needed. Would allowing more *.cypress.io access resolve the issue? I'm doing a POC after which we would consider a business license but I have to prove it out first. I'm sure it's something simple that I'm not grasping and if I can explain what needs to happen, the network team will support. Appreciate any pointers / help.
  • a

    ancient-appointment-66951

    05/10/2021, 1:00 AM
    I have a simple canvas example working here: https://github.com/lmiller1990/cypress/tree/cy-draw/my-project
  • p

    prehistoric-action-94870

    05/10/2021, 8:48 AM
    Hi all, I need help outputting 2 array var's to the Cypress log. The array vars contains text from elements extracted using JQuery. Below is my code:
    Copy code
    it("test", () => {
            cy.get('.person-item-template > .name').each(function($personName) {
                const peopleNames = $personName.text()
    
                cy.get('.person-item-template > .name').siblings('job-title').each(function($personJobTitle) {
                    const peopleJobTitles = $personJobTitle.text()
                    cy.log("Person found: " + peopleNames + ". Job Title: " + peopleJobTitles)
                })
            })
        })
    I'm expecting 20
    peopleNames
    and 20
    peopleJobTitles
    but I'm actually getting 120 returns in the Cypress log
  • p

    prehistoric-action-94870

    05/10/2021, 8:50 AM
    I'm assuming this is not the best way of dealing with Arrays and outputting to the Cypress log, could anyone point me in the right direction?
  • s

    stocky-dream-36427

    05/10/2021, 5:28 PM
    @User if you're trying to debug, you can actually open the devtools and look at the array within Chrome
1...8910...252Latest