Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • 15:41
    bahmutov commented #8632
  • 15:01
    SurmaAa commented #4464
  • 14:54
    skflowne commented #7158
  • 14:38
    bahmutov commented #8596
  • 14:34
    cypress-bot[bot] commented #5913
  • 14:34

    bahmutov on develop

    fix: cy.task() can pass undefin… (compare)

  • 14:34
    cypress-bot[bot] unlabeled #5913
  • 14:34
    cypress-bot[bot] labeled #5913
  • 14:34
    bahmutov closed #5913
  • 14:34
    bahmutov closed #8600
  • 14:33
    bahmutov edited #8600
  • 14:30
    LisaManresa commented #8267
  • 14:21
    LisaManresa commented #8267
  • 14:21
    renovate[bot] edited #3777
  • 14:20
    bahmutov commented #8631
  • 14:07
    sync-by-unito[bot] edited #8634
  • 14:07
    bahmutov labeled #8634
  • 14:07
    bahmutov labeled #8634
  • 14:06
    bahmutov labeled #8634
  • 14:06
    bahmutov labeled #8634
anyone have a way to deal with code coverage for parallel runs? I.E., in pipelines, it tries to write the same file from the config for each machine...

Hello - I would like to understand how I can assert data in a pdf file? Basically, the file is already downloaded.
I have tried assertions in the callback loop, but cypress seems to skip it.

Here is my setup:


const parsePdf = async (pdfName) => {
const pdfPathname = path.join(repoRoot, pdfName)
let dataBuffer = fs.readFileSync(pdfPathname)
return pdf(dataBuffer);

module.exports = (on, config) => {
on('task', {
getPdfContent (pdfName) {
return String(parsePdf(pdfName))
Test File "admin.reports.spec.js"

import LoginPageObjects from "../../support/pageObjects/common.pageObjects/login.pageObjects";
import ReportsDelegateReportPageObjects
from "../../support/pageObjects/common.pageObjects/reports.delegateReport.pageObjects";


const loginPage = new LoginPageObjects();
const reportsPage = new ReportsDelegateReportPageObjects();

describe('Delegate Report Functionality', function (){

beforeEach(() => {
    // Provides admin credentials
    // Navigates to Report Menu, Selects Report, Downloads PDF report.

it('should return the report and verify the data in it', function () {
    cy.readFile('C:/Users/$user/Downloads/delegate_report.pdf', 'base64').should('contain.value', "Report")


1 reply
Max Savchuk
@vadymstroiu maybe this will be useful for you: from cypress recipes
6 replies
Hi. In my integration tests, I am visiting a page and making assertions about the contents (texts and table) displayed. After cy.visit('the url to visit'), Cypress loads all the contents in the page except for the table. If I do something like: cy.visit("the url to visit").wait("1000"), I see the contents of the table displayed, but I want to find other ways of doing this since wait("time") is described as anti-pattern. Any ideas on this?
Hemant Choudhari
Hi All,
does anyone successfully completed OKTA login to react app using cypress? I found few solution but Im still getting OKTA screen .Even though I received the 200OK and 302 response. I really appreciate your help.
I am trying to exit the loop when my conditions are met but the each loop doesn't stop even if the condition are met
var loop = false; scorecardreview.employeeListItem().each(($e1, index, $list)=> { cy.wrap($e1).find('[datacy=statusStat]').invoke('text').then(text=>{ if(index >= 0 && text.trim() === 'No Scorecard' { cy.wrap($e1).find('.fa-ellipsis-h').click(); scorecardreview.assignScorecard().click() ; return false ; } }) })
Gleb Bahmutov
@jameseg you would need to combine them yourself, which is not ideal
2 replies
Hi All, is there a way bypass waiting for page load event?
Eduardo Del Balso
Hi folks, I'm in a situation where if I do a cy.get('some-lookup').whithin(() => return cy.get('some-other-lookup')).should('contain','some-val'), but if I do 2-3 right after each other, only the first works and the subsequent ones fail. If I comment out the first one, then the second one works but third onwards fails, if I comment third, fourth works but fifth fails, etc... basically only the first one works and I'm not sure why
Sidharth LaLa

ERROR: Failed to merge reports

SyntaxError: cypress/report/mochawesome-report/seelgo_report.json: Unexpected end of JSON input

Guys any idea why i am getting this error when i am performing mochawesome-merge
Mirza Chilman
anyone experience cypress cannot cannot resolve ./commands cypress? my cypress somehow does not able to read custom command files
This message was deleted
1 reply
How to bypass login for in latest version of cypress. As even after bypassing it using token it still requires Active Directory login and gets refused to connect error.
6 replies
version i m using 4.10.1
Just a quick question: In cypress open, I can run all the tests from different files in same browser window/session. Any way to do this in cypress run? Now it seems to to launch a new window for each test file
4 replies
Eamonn Gahan
Hi all - I am using cypress parallel with gitlab runners with AWS autoscale and having trouble getting cypress to use more than one machine (Gitlab only sees one runner but there are 5 EC2 instances running). Has anyone got this setup working?
Hello, I'm using "cypress run " and my utility.js files are treated as if they would be .spec files so cypress is trying to run them, records videos, etc... Any way to avoid this?
8 replies
Hi guys, any ideas how to get code coverage on experimentalComponentTesting? Right now, when running integration tests, code coverage is collected properly, however when I run component tests I get the following message "Did you forget to instrument your web application?".

Hi All, I am getting this error while installing cypress npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to failed, reason: getaddrinfo ENOTFOUND
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

You probably need to configure your proxy. See
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
Sam Fent
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:
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
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

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 
    // ...

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(() => {

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

Marco Pivetta

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

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
Regarding, 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
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
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

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:


9 replies
Carlos Salazar
am I going insane, or it's failing to compare two arrays?
3 replies
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.
Hi Team, I am integrating cypress test with Gitlab CI. When i am running it, i came up with these issues. Attaching screenshot
Pls help me with the solution as I am unable to find it.
Jonas Amundsen
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
10 replies
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
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
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
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