Closed stijnbernards closed 5 years ago
Hi there!
Percy can capture HTTPS websites. This seems a lot like there's CSP or CORS issues on the page blocking us from POSTing the DOM back to our node process. Can you try disabling Cypress web security and give it another shot?
Hi, thank you for your response.
This does indeed seem to fix it. Would be nice if we're able to get error logging about this issue. I did see the part in the Percy Cypress docs about the websecurity. But I did not receive any error logging at all :(
I'm seeing an issue with Percy not taking screenshots within my Cypress project. I've tried to point the tests to both a https and non https site and each time the tests pass in Cypress but fail within the Percy Dash as it was unable to find any screenshots.
When I run via chrome (and the cy GUI opens locally) I can see that the percy agent healthcheck is failing for some reason...
Any advice?
I am running my test using a script, as such:
"cy:run:percy": "export TEST_SUITE=foo; PERCY_TOKEN=xxx PERCY_BRANCH=test percy exec -- cypress run",
I can see it running in the terminal, bookended by percy calls
[percy] percy has started / ended etc....
Hi @GordonTester, I had the same issue and downgrading to version 1.0.2 fixed it for me.
Hey all! We had an issue with the 1.0.3 release but it should be fixed with 1.0.4. Can you give it a try and let us know? https://github.com/percy/percy-cypress/releases/tag/v1.0.4
@Robdel12 I did try 1.0.4, and I had the same issue as with 1.0.3.
Can you share a little more about your setup? I'd be curious if there's any error logs or anything we can learn from what's going on there.
1.0.4 works for me. Looks like the healthcheck path fix did the trick!
I think that perhaps it is because we are using webpack, and require.resolve
is returning a number instead of a path, similar to this issue.
I believe this is safe to close now. If anyone sees any more issues with the healthcheck failing please comment and we'll reopen ๐
hello i am getting this issue. i dont get any snapshots and i get this error: 'Percy agent is not running. Skipping snapshots'
im running 3.3.2, my baseUrl in cypress.json is a https if that matters and i have the "chromeWebSecurity": false. my tests are pretty basic:
describe('desktop home page tests', function () {
beforeEach('SetUp', function () {
cy.visit('/?flagoverride=flag1::true,flag2::false')
})
context('Desktop_Homepage_LayoutCorrect', function () {
it('The layout is correct.', function () {
cy.percySnapshot('Desktop Homepage')
})
})
})
this is also is the log: [33mยป[39m Warning: [33mhealth-check[39m is not a percy command.โตDid you mean [94mexec[39m? [y/n]:
it happens in chrome and electron browser.
thanks
Hey @amrwahdan3! It sounds like you're running an old version of @percy/agent
with a new version of the Cypress SDK. Could you do an npm ls @percy/agent
and post what the results of that are? v0.2.0 is when the healthcheck
command was implemented: https://github.com/percy/percy-agent/blob/master/CHANGELOG.md#020-2019-04-03
Edit: I looked at one of your builds and can confirm that you're running @percy/agent 0.1.15
thanks @Robdel12 ! that did the trick i see snapshots being taken and uploaded now after updating to 0.8.3
I'm seeing the same issue that @amrwahdan3 was seeing.
[percy] stopping percy...
[percy] waiting for 0 snapshots to complete...
[percy] done.
I have the following setup:
npm ls @percy/agent
cy-visual-tests@1.0.0 /Users/hughej/Projects/Personal/JavaScript/Cypress/cy-visual-tests
โโโฌ @percy/cypress@2.3.1
โโโ @percy/agent@0.28.1
"dependencies": {
"@percy/cypress": "^2.3.1",
"cypress": "^4.9.0",
"cypress-image-snapshot": "^3.1.1",
"prettier": "^2.0.5"
}
{
"video": false,
"defaultTimeoutCommand": 5000,
"pageLoadTimeout": 10000,
"waitForAnimations": true,
"chromeWebSecurity": false
}
Any help would be greatly appreciated. Thanks!
@james-hughes-ntt i updated @percy/agent to the newest version like @Robdel12 suggested and that ended up working.
Thanks. So after running npm ls @percy/agent
it shows that I'm using @percy/agent@0.28.1
which appears to be the newest version. Not sure what else to try ๐คทโโ๏ธ
I don't believe this is a health check issue (unless you're seeing that specific log in Cypress command log). What test is calling cy.percySnapshot
? Are there any logs around that?
@Robdel12 I'm running percy exec -- cypress run
Here's the log from running that:
percy exec -- cypress run
[percy] created build #18 ...
[percy] percy has started.
====================================================================================================
(Run Starting)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Cypress: 4.9.0 โ
โ Browser: Electron 80 (headless) โ
โ Specs: 1 found (percy.spec.js) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running: percy.spec.js (1 of 1)
Visual Regression Testing with Percy and Cypress
โ should take a percy snapshot (1295ms)
1 passing (4s)
(Results)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Tests: 1 โ
โ Passing: 1 โ
โ Failing: 0 โ
โ Pending: 0 โ
โ Skipped: 0 โ
โ Screenshots: 0 โ
โ Video: false โ
โ Duration: 3 seconds โ
โ Spec Ran: percy.spec.js โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ percy.spec.js 00:03 1 1 - - - โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ All specs passed! 00:03 1 1 - - -
[percy] stopping percy...
[percy] waiting for 0 snapshots to complete...
[percy] done.
Just to be 100% sure, what is the code for that test?
Yeah good shout @Robdel12 . Pretty standard test.
describe('Visual Regression Testing with Percy and Cypress', () => {
it('should take a percy snapshot', () => {
cy.visit('https://www.example.com');
cy.wait(1000);
cy.percySnapshot;
});
});
Hey @james-hughes-ntt, thanks for that! Looks like you're missing the parens to invoke the function:
describe('Visual Regression Testing with Percy and Cypress', () => {
it('should take a percy snapshot', () => {
cy.visit('https://www.example.com');
cy.wait(1000);
cy.percySnapshot();
});
});
@Robdel12 ah thanks mate, yeah that was it! So duh of me. I was looking at all the places except for the most obvoius - where percy is actually invoked! Thanks again appreciate the help
Ahhh, no worries! This happens to me all the time when doing support too. I get too far off in the weeds and it turns out it was something obvious :p
Happy it was something easy rather than something like the health check failing :D
Hey there. Seems like I'm having the same issue as @james-hughes-ntt and I've checked the parens etc within the code but all seems fine (to me that is)..the below is the output and I can see something about the certificate but not sure if that's the issue. Also, disabled websecurity for chrome in the cypress.json file.
cypress_snapshot@1.0.0 cy:percy percy exec -- cypress run
[percy] RequestError Error: self signed certificate in certificate chain | Wed Feb 03 2021 20:58:22 GMT+0000 (Greenwich Mean Time) [percy] stopping percy... [percy] waiting for 0 snapshots to complete... [percy] done. [percy] percy has started.
====================================================================================================
(Run Starting)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Cypress: 6.3.0 โ โ Browser: Electron 87 (headless) โ โ Specs: 3 found (percy.spec.js, percy2.spec.js, Snapshot/image.spec.js) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running: percy.spec.js (1 of 3)
Visual Regression test with Percy and Cypress โ should take percy snapshot (4559ms)
1 passing (6s)
(Results)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Tests: 1 โ โ Passing: 1 โ โ Failing: 0 โ โ Pending: 0 โ โ Skipped: 0 โ โ Screenshots: 0 โ โ Video: false โ โ Duration: 6 seconds โ โ Spec Ran: percy.spec.js โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running: percy2.spec.js (2 of 3)
Visual Regression test with Percy and Cypress โ should take percy snapshot (3277ms)
1 passing (4s)
(Results)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Tests: 1 โ โ Passing: 1 โ โ Failing: 0 โ โ Pending: 0 โ โ Skipped: 0 โ โ Screenshots: 0 โ โ Video: false โ โ Duration: 4 seconds โ โ Spec Ran: percy2.spec.js โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running: Snapshot/image.spec.js (3 of 3)
0 passing (0ms)
(Results)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Tests: 0 โ โ Passing: 0 โ โ Failing: 0 โ โ Pending: 0 โ โ Skipped: 0 โ โ Screenshots: 0 โ โ Video: false โ โ Duration: 0 seconds โ โ Spec Ran: Snapshot/image.spec.js โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ percy.spec.js 00:06 1 1 - - - โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ โ percy2.spec.js 00:04 1 1 - - - โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ โ Snapshot/image.spec.js 2ms - - - - - โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ All specs passed! 00:10 2 2 - - -
[percy] stopping percy... [percy] waiting for 0 snapshots to complete... [percy] done.
Hey @Uraz04, it looks like you're running on a network with a self signed cert (this won't work with Percy)
[percy] RequestError Error: self signed certificate in certificate chain
@Robdel12 I have tried to get Percy taking snapshot as well in Cypress. Tried all the above, and no missing parens. Also disabled web security. The only thing I can see is this:
What version are you using? This likely isn't related to this issue. The latest version of the SDK doesn't have a health check like this anymore.
Also, the log there suggests Percy isn't running. Are you using percy exec -- cypress run
with a PERCY_TOKEN
set?
I'm running with these versions:
You disregard that font log. It doesnt work with a proper font as well.
Can you set --verbose
(npx percy exec --verbose -- ...
) for debug logs? Looks like the network request to http://localhost:5338/percy/snapshot
is failing for some reason. Curious if it's related to Cypress's 7.x networking bug in a different flavor. ๐คจ
@Robdel12 I cannot add that flag?
I tried before exec command as well
which percy
? Smells like you have @percy/agent
hanging around somewhere. --verbose
is a new @percy/cli
flag (and @percy/agent
is replaced by @percy/cli
)
Seems to work now. Just deleted node_modules and reinstalled everything. Thanks!
Hi, I am running into a missing snapshot issue. It is not consistent and I can't figure out the cause. I ran the command with --verbose and see this error.
Cypress: 6.9.1
"@percy/cli": "^1.0.0-beta.63"
"@percy/cypress": "^3.1.1"
[percy:core] Error: Navigation failed: Timeout of 30000ms exceeded.
at Timeout.check [as _onTimeout] (/node_modules/@percy/core/dist/utils.js:103:17)
at listOnTimeout (node:internal/timers:559:11)
at processTimers (node:internal/timers:500:7) (0ms)```
Any help would be much appreciated!
Hey @stuthib! That doesn't appear to be related to what this issue was about. Can you try upgrading @percy/cli
to the latest (beta.68
) and if that still is a problem open a new discussion on @percy/cli
?
@Robdel12 Thank you for the quick response. I updated @percy/cli
and also set the timeout
in percy config to 60000
, while the default was 30000
and it was timing out on page navigation. The last few builds have not errored out and seems to be consistent. If I run into this issue again, I will open a new discussion on @percy/cli
.
@Robdel12 I am also running into the same issue. When I do --verbose, it says the below.
[percy:cypress] Could not take DOM snapshot "Dashboard Page" (36154ms) [percy:cypress] Error: Missing required URL for snapshot at request (https://customer.nintex.com/__cypress/tests?p=cypress\support\index.js:784:28) at async Object.postSnapshot (https://customer.nintex.com/__cypress/tests?p=cypress\support\index.js:895:6) (5ms)
When I researched further, I came to know that it is working fine in my personal laptop, however in my company laptop it is not working. It appears like from my company laptop it is failing to connect to percy server or failing to get the build url or something like that. Appreciate if you could please look into it and advise me to resolve this issue. Please see complete console log below
---------------------------Here is the complete console log------------------ npx percy exec --verbose -- cypress run [percy:config] Config file not found (0ms) [percy:client] Creating a new build... (27ms) [percy:core:browser] Launching browser (491ms) [percy:core:browser] Browser connected: HeadlessChrome/92.0.4515.0 (117ms) [percy:core] Percy has started! (3ms) [percy:cli:exec] Running "cypress run" (0ms)
====================================================================================================
(Run Starting)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Cypress: 9.1.0 โ โ Browser: Electron 94 (headless) โ โ Node Version: v16.13.1 (C:\Program Files\nodejs\node.exe) โ โ Specs: 1 found (visual_testing/purek2.spec.js) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running: visual_testing/purek2.spec.js (1 of 1) Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Customer Central-Visual Testing [percy:cypress] Could not take DOM snapshot "Dashboard Page" (36154ms) [percy:cypress] Error: Missing required URL for snapshot at request (https://customer.nintex.com/__cypress/tests?p=cypress\support\index.js:784:28) at async Object.postSnapshot (https://customer.nintex.com/__cypress/tests?p=cypress\support\index.js:895:6) (5ms) โ Pure K2 Permission checks - Dashboard Page (27854ms)
1 passing (28s)
(Results)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Tests: 1 โ โ Passing: 1 โ โ Failing: 0 โ โ Pending: 0 โ โ Skipped: 0 โ โ Screenshots: 0 โ โ Video: true โ โ Duration: 27 seconds โ โ Spec Ran: visual_testing/purek2.spec.js โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
(Video)
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ visual_testing/purek2.spec.js 00:27 1 1 - - - โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ All specs passed! 00:27 1 1 - - -
[percy:core:browser] Closing browser (4392ms) [percy:client] Finalizing build 14402721... (135ms) [percy:core] Finalized build #13: https://percy.io/3f3a16fc/ncc_automation/builds/14402721
Hey @skareemu! Upgrade Cypress from 9.1 to 9.1.1: https://github.com/percy/percy-cypress/discussions/437#discussioncomment-1759828 v9.1 has missing patched dependencies, which makes for some wonky bugs.
Thank you so much @Robdel12, much appreciated . Issue is resolved with 9.1.1
Same issue with Cypress v13.13
Hi
I'm trying to integrate Percy and Cypress for one of my projects. Sadly Percy doesn't seem to take any snapshots even though I'm calling cy.percySnapshot multiple times.
This is my current test:
This is my Cypress result:
UPDATE: Seems like percy is unable to capture screenshots on https websites. Is this correct? This is quite a showstopper for the current project I'm integrating it for.