Comments (41)
thanks @Robdel12 ! that did the trick i see snapshots being taken and uploaded now after updating to 0.8.3
from percy-cypress.
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....
from percy-cypress.
Seems to work now. Just deleted node_modules and reinstalled everything. Thanks!
from percy-cypress.
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?
from percy-cypress.
Hi @GordonTester, I had the same issue and downgrading to version 1.0.2 fixed it for me.
from percy-cypress.
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
from percy-cypress.
1.0.4 works for me. Looks like the healthcheck path fix did the trick!
from percy-cypress.
I believe this is safe to close now. If anyone sees any more issues with the healthcheck failing please comment and we'll reopen π
from percy-cypress.
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
from percy-cypress.
@Robdel12 I cannot add that flag?
I tried before exec command as well
from percy-cypress.
Thank you so much @Robdel12, much appreciated . Issue is resolved with 9.1.1
from percy-cypress.
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 :(
from percy-cypress.
@Robdel12 I did try 1.0.4, and I had the same issue as with 1.0.3.
from percy-cypress.
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.
from percy-cypress.
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.
from percy-cypress.
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
from percy-cypress.
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
from percy-cypress.
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:
- @percy/agent
npm ls @percy/agent
[email protected] /Users/hughej/Projects/Personal/JavaScript/Cypress/cy-visual-tests
βββ¬ @percy/[email protected]
βββ @percy/[email protected]
- package.json dependencies
"dependencies": {
"@percy/cypress": "^2.3.1",
"cypress": "^4.9.0",
"cypress-image-snapshot": "^3.1.1",
"prettier": "^2.0.5"
}
- cypress.json
{
"video": false,
"defaultTimeoutCommand": 5000,
"pageLoadTimeout": 10000,
"waitForAnimations": true,
"chromeWebSecurity": false
}
Any help would be greatly appreciated. Thanks!
from percy-cypress.
@james-hughes-ntt i updated @percy/agent to the newest version like @Robdel12 suggested and that ended up working.
from percy-cypress.
Thanks. So after running npm ls @percy/agent
it shows that I'm using @percy/[email protected]
which appears to be the newest version. Not sure what else to try π€·ββοΈ
from percy-cypress.
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?
from percy-cypress.
@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.
from percy-cypress.
Just to be 100% sure, what is the code for that test?
from percy-cypress.
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;
});
});
from percy-cypress.
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();
});
});
from percy-cypress.
@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
from percy-cypress.
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
from percy-cypress.
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.
[email protected] 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.
from percy-cypress.
@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:
from percy-cypress.
from percy-cypress.
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.
from percy-cypress.
Also, the log there suggests Percy isn't running. Are you using percy exec -- cypress run
with a PERCY_TOKEN
set?
from percy-cypress.
I'm running with these versions:
from percy-cypress.
You disregard that font log. It doesnt work with a proper font as well.
from percy-cypress.
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. π€¨
from percy-cypress.
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
)
from percy-cypress.
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!
from percy-cypress.
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
?
from percy-cypress.
@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
.
from percy-cypress.
@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)
- Started processing: Compressing to 32 CRF
- Finished processing: C:\Work\ntx_appdevit_automation\ncc_automation\cypress\vide (3 seconds)
os\visual_testing\purek2.spec.js.mp4
====================================================================================================
(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
from percy-cypress.
Hey @skareemu! Upgrade Cypress from 9.1 to 9.1.1: #437 (reply in thread) v9.1 has missing patched dependencies, which makes for some wonky bugs.
from percy-cypress.
Related Issues (20)
- How to select Approved build as base build?
- Webpages behind Netlify Authentication not showing css in Percy snapshot
- [TypeScript] percySnapshot - TypeError: Cannot read properties of undefined (reading 'isTTY') HOT 19
- [Cypress regression]`TypeError: data.hasOwnProperty is not a function` HOT 12
- [percy] Fails to take dom snapshot
- Does percy with cypress support visual testing of shadow dom elements? HOT 1
- `cy.percySnapshot()` not uploading screenshots when used via `browserstack-cypress` HOT 1
- Percy does not work for Cypress component testing
- Cannot read properties of undefined (reading 'isServer') HOT 9
- SyntaxError: Unexpected identifier HOT 2
- Test is marked as successful, but `Could not take DOM snapshot` error is present.
- The term 'percy' is not recognized as the name of a cmdlet
- Duplicate snapshot name in a parallel build causes missing snapshots HOT 13
- Need the ability to set width and height for screenshots HOT 2
- Snapshot ignores the passed `scope` and renders the whole screen HOT 3
- Percy no longer captures embedded pdf viewer since Cypress v12.15.0 and above HOT 4
- Uncaught error was detected outside of a test: No commands were issued in this test HOT 3
- Specifying "width" instead of "widths" in percySnapshot HOT 4
- Cannot finalize before all snapshots have comparisons created HOT 2
- Images not captured by percy with cypress v13.6.4 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from percy-cypress.