Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:42
    brkreddy06 opened #8960
  • 05:29
    davidmh synchronize #8453
  • Oct 23 22:31

    JessicaSachs on evergreen

    testing out monkeypatch of cy.c… (compare)

  • Oct 23 22:17
    CLAassistant commented #8959
  • Oct 23 22:17
    cypress-bot[bot] unlabeled #8714
  • Oct 23 22:17
    cypress-bot[bot] labeled #8714
  • Oct 23 22:17
    CLAassistant commented #8959
  • Oct 23 22:17
    cypress-bot[bot] commented #8959
  • Oct 23 22:16
    gvdp opened #8959
  • Oct 23 21:48
    renovate[bot] edited #3777
  • Oct 23 21:43
    milan-easykad commented #8146
  • Oct 23 21:38
    milan-easykad opened #8958
  • Oct 23 20:20
    haug1 opened #8957
  • Oct 23 19:44
    todd-m-kemp edited #8954
  • Oct 23 19:44
    todd-m-kemp opened #8956
  • Oct 23 19:44
    todd-m-kemp opened #8955
  • Oct 23 19:44
    todd-m-kemp opened #8954
  • Oct 23 18:29
    renovate[bot] edited #3777
  • Oct 23 18:20
    renovate[bot] edited #3777
  • Oct 23 18:05
    ncjones commented #8920
sasmita-nanda
@sasmita-nanda

Hi All, I am getting this error while installing cypress npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/cypress failed, reason: getaddrinfo ENOTFOUND my-company-proxy.com
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\M91957\AppData\Roaming\npm-cache_logs\2020-08-14T12_20_33_859Z-debug.log

ramsy-leftclick
@ramsy-leftclick
You probably need to configure your proxy. See https://docs.npmjs.com/misc/config#proxy
QA1980
@QA1980
hey gents !I after I upgraded cypress version , I m not able to see the test suite representation in the left side while I run my test
image.png
Sam Fent
@samfent_gitlab
I'm having a hard time stubbing an ES6 module's function. I stub it, visit my app, and the original async function gets called instead of my new one. I wrote a question in more detail here: https://stackoverflow.com/questions/63399396/trying-to-stub-an-async-function-that-gets-called-in-componentdidmount-using-c
tallkid24
@tallkid24
Does Cypress write any files out to a temp location while running or have any files cached between tests? We run Cypress on an AWS Codebuild and randomly the Codebuild will just completely stall far into the run. Just wondering if we can clear something out between spec files so that it has a better chance to not stall.
Hassan Murtaza
@hmx789
Hey all what is the best way to test a chrome extension without popping open a browser? I've tried using --headless flag but I've heard that chrome does not support extensions in headless mode and this seems to be true after using the headless flag.
Marco Pivetta
@Ocramius

Hey folks! I'm super-rusty in JS/JSX, but I tried Cypress for the first time this week, and I must say that, as a past Selenium user, it looks quite impressive, kudos!

Now here comes the question...

I have some code like this:

context('Homepage', {execTimeout: 90000}, () => {
    beforeEach(() => {
        cy.exec('sleep 2'); // for the sake of the example 
        cy.exec('some/application/command');
    });
    // ...
});

From what I've seen in the logs (of some/application/command) the command execution starts, but then execution is immediately aborted by cypress. Looking at the logs with DEBUG=cypress:server I see something like this:

  cypress:server shell /bin/bash profile ~/.bash_profile +0ms
  cypress:server cy.exec found shell /bin/bash +1ms
  cypress:server and is running command: sleep 2 +1ms
  cypress:server in folder: /tests +0ms
  cypress:server shell /bin/bash profile ~/.bash_profile +245ms
  cypress:server profile has already been sourced +0ms
  cypress:server cy.exec found shell /bin/bash +0ms
  cypress:server and is running command: some/application/command +0ms
  cypress:server in folder: /tests +0m

Now... this line is super-suspicious:

  cypress:server and is running command: sleep 2 +1ms

This smells like the promise never gets to its completion. Is this a common problem or am I misunderstanding usage? Is the beforeEach() block not being waited upon, before running assertions?

I've also tried doing the hadouken-style promise chaining with multiple nested .then() (horrible), but to no effect either.

If I write:

cy.exec('sleep 2')
    .then(() => {
        cy.exec('some/application/command');
    })

It still reports 1ms execution time for sleep 2, unless I'm mis-interpreting that output

Marco Pivetta
@Ocramius

Ok, seems like (sorry if noisy: I'm trying stuff out) if I remove every assertion after my beforeEach() block, the commands are executed in the right order, and it is taking 2 seconds to sleep 2.

Still, they don't seem to actually be fired anywhere. Is there a way to see console.log() stuff in STDERR? All of this is running inside a docker container disconnected from the host network :D

sudheer-cypress
@sudheer-cypress
cy.request ({
method: 'GET',
url : 'something'
body: {},
headers: {
'Accept-Encoding': 'gzip, deflate'
}
}).then(function (response1) { cy.writefile('filename.xls',response1.body,'base64'} }) When I use the above code, I am not able to open the xls file in readable format.
Marco Pivetta
@Ocramius
Regarding https://gitter.im/cypress-io/cypress?at=5f36b945367ff60c32b244a3, turns out that all is good and I'm just mis-interpreting output. What was happening is that the command was going to the wrong endpoint, effectively making it no-op
Ming Han Chung
@mystoryphoto_twitter
Ok, this seems ridiculous but I can't get the --spec to work. My integration directory is set to ui (cypress/ui/visual is where the test i want to run sit). I am trying to run --spec 'visual/visual.js' but it can't find it. I seem to run it locally fine but in bitbucket pipellines it can't find no matter what
learnuser
@learnuser
Hi Guys - I notice that one of the web application in my project is taking longer to load in cypress container/chrome browser when compared to the chrome browser in my machine. Does anyone have any insights on this?
Eugene Myunster
@t0lkman

Hi there, I have something like Cypress.on('test:after:run', (test, runnable) => {
if (test.state == 'failed') {
cy.writeFile('failedTests.log', ${test.corrId} - ${test.title}\n, {encoding: 'utf-8', flag: 'a+'})
}
}
But cypress complains - CypressError: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.

The command that returned the promise was:

cy.writeFile()

9 replies
Carlos Salazar
@csalazar1
Untitled.png
am I going insane, or it's failing to compare two arrays?
3 replies
sudheer-cypress
@sudheer-cypress
Need help urgently ..
cy.request ({
method: 'GET',
url : 'something'
body: {},
headers: {
'Accept-Encoding': 'gzip, deflate'
}
}).then(function (response1) { cy.writefile('filename.xls',response1.body,'base64'} }) When I use the above code, I am not able to open the xls file in readable format.
abhar115
@abhar115
Hi Team, I am integrating cypress test with Gitlab CI. When i am running it, i came up with these issues. Attaching screenshot
abhar115
@abhar115
image.png
Pls help me with the solution as I am unable to find it.
Jonas Amundsen
@badeball
I have a helper method that consumes Cypress' lodash instance and I want to unit-test this helper method (Yes, a test of test-code. It's sufficiently complex that it's warranted.) Can I access Cypress' lodash in pure node-context?
I know I can simply require("lodash") and it will incidentally work due to hoisting, but I don't get types with this.
Marek Alexa
@coding_hedgehog_gitlab
10 replies
Ondskan56
@Ondskan56
Hey all, the issue with '.get' that scrolls the screen is really annoying and it seems that it hasn't been fixed since 2017.
Is this on the roadmap? Are you aware of this issue and you think on a solution? any feedback is appreciated
cypress-io/cypress#871
I tried some of the workaround and they work on some of my tests but they don't work on all of them.
I find it really difficult using Cypress with this issue.
Viktor Soroka
@ViktorSoroka07
Hi all, having an issue with experimental component testing when I want to run them all with "Run all specs" button. I have the " No tests found in your file:" __all error. Though I am able to run the specs for individual file upon click on file name. Has anyone faced this?
Mahesh Thota
@maheshthota31
Hi all, I have to test an API which content type is multipart/form-data. Can you please help me out with example on how to upload files with cy.request() ?
2 replies
Samih-Shaikh
@Samih-Shaikh
Hey guys !!
Hey guys !! How can i get text of an html element for eg. From and h3 tag into a const so that i can later use it to assert with another element after few actions
1 reply
PratapJi
@PratapJi

Hi guys

I am trying to automate a site with Cypress, but it seems I hit a roadblock.
Here is my problem statement :

The base URL I am trying to access makes a 302 to 'https://login.microsoftonline.com/{tenant_id}/oauth2/authorize' for authentication. while trying to launch base URL a 302 happens and gets timed out (after 1 minute) on visit step.

23 replies
any help would be appriciated.
thanks
nimmala89
@nimmala89
Hi Guys, I'm trying to run cypress tests on Teamcity CI/CD. I have a Before() blocks which does the login into the application and stores the cookies of the session for each subsequent test to use. For some reason when i run locally, this works pretty much fine. But when I try to run it on Teamcity , the tests fail abruptly. From what I investigated, they fail at the step of logging in (i.e in the Before() hook). Has anyone else faced the same issue ?
nimmala89
@nimmala89

Hi Guys, I'm trying to run cypress tests on Teamcity CI/CD. I have a Before() blocks which does the login into the application and stores the cookies of the session for each subsequent test to use. For some reason when i run locally, this works pretty much fine. But when I try to run it on Teamcity , the tests fail abruptly. From what I investigated, they fail at the step of logging in (i.e in the Before() hook). Has anyone else faced the same issue ?

cypress-io/cypress#8294

Sam Fent
@samfent_gitlab
I've been trying to solve this issue for several days now, and still no luck: I'm trying to stub an async ES6 module function, which is called in my React app's componentDidMount. After I cy.stub I cy.visit, but the original function is still called.
Question in a little more detail here: https://stackoverflow.com/questions/63399396/trying-to-stub-an-async-function-that-gets-called-in-componentdidmount-using-c
alewolf
@alewolf
Hi guys. I've created a WordPress plugin that I need to test with several themes. I do have already a bunch of tests and they all must work with every theme. In order to test this I need a method to run all tests, then switch the theme, then run all tests again, then switch the theme, and so forth. What is a good, or the proper way how to handle this?
cindysongzi
@cindysongzi

Hi, can anyone help how to assert a new window is opened?

// click Practice should open a new tab.
beforeEach(function () {
    cy.visit('/index.html', {onBeforeLoad(win){cy.stub(win, 'open')}})
})

it.only('test pdf', ()=>{
    cy.contains('Lesson 1').click()
    cy.contains('Practice').click()
    cy.window().its('open').should('be.called')
})

Error:
its .open
Type Error: Timed out retrying: [Function: open] is not a spy or a call to a spy!

3 replies
benpal
@_JBRP__twitter
any one here experience using 360 image on cypress?
Rafaa Turki
@Turkirafaa
Can someone help with pag object model?
3 replies
Patrick Schaub
@pschaub
hey guys, i need to do an api request and get the body response as json out of the promise
anybody has an idea how to get the body response without promise? i just need the body response
in a command
Willoiam
@Willoiam
Hi everyone, i'm a C# developer and my company is looking for a freelancer - Mainframe Cypress developer, I figure this would be a good place to reach out to see if anyone can help out?
1 reply
My email is william@sparagus.be, we can pay 600-700 Eur per day , 12 month contract(mostly home based) client is in brussels.
Thanks all !
Marco Buschini
@marcobuschini
Hello, I am in need of a solution to fix the language cypress tests are run once and for all. I am developing in it_IT but I want my tests to run in en_US. It is possible?
2 replies
Ming Han Chung
@mystoryphoto_twitter
Anyone know how to set the integrationfolder and directory structure right to make --spec work? Having major issues trying to get it to run a specific spec file
7 replies
nikkieta
@nikkieta
image.png
image.png