Comments (11)
probably not the same issue then. would you mind creating another one with steps to repro please ? 🙏🏻
from cypress-audit.
Hello @MuckT
I have similar configuration:
export const performanceReport = () => { cy.lighthouse( { performance: 5, accessibility: 95, }, { formFactor: 'desktop', screenEmulation: { mobile: false, width: 1920, height: 1080, deviceScaleFactor: 1, disabled: false, }, }); }
and this package.json
"cypress": "^6.3.0", "cypress-audit": "MuckT/cypress-audit#master", "cypress-cucumber-preprocessor": "^4.0.0", "cypress-react-unit-test": "^4.11.2", "cypress-screenplay": "^0.1.0", "eslint-plugin-cypress": "^2.10.3", "lighthouse": "^7.0.1",
And I have this issue:
I think it is related.
from cypress-audit.
We solved this issue by explicitly setting the browser to chrome
project.json
{
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/web-e2e/cypress.json",
"devServerTarget": "web:serve",
"browser": "chrome"
}
}
}
}
or on the cli
nx e2e --browser=chrome
from cypress-audit.
Submitted a PR that I believe solves this issue #59
from cypress-audit.
Hi @MuckT,
I'm facing an issue in spite of the same configuration.
I have the following error message: cy.lighthouse is not a function
while running my tests with ng e2e --watch
My IDE spots an issue on cy.lighthouse()
, saying TS2339: Property 'lighthouse' does not exist on type 'cy & EventEmitter'
Am I missing some configuration?
The only difference is that I'm using https://github.com/TheBrainFamily/cypress-cucumber-preprocessor
from cypress-audit.
@RoRoche Can you try and use (cy as any).lighthouse()
as recommended here: #36
Alternatively you could try my branch #59 with this in your package.json
"cypress-audit": "MuckT/cypress-audit#master",
from cypress-audit.
@FannyBarco do you have the commands from step four added? I've also noticed that sometimes other plugins can have issues running along side cypress-audit; can you try with just the cypress-audit plugin in Chrome?
from cypress-audit.
I've managed to make nx work using the "index.d.ts" at the root of cypress-audit 🤔 . In this specific PR: #60 .
Here are the files that I've modified in order to make it work:
- In the root package.json of the NX repo, I've added the chrome + headless flags (https://github.com/mfrachet/cypress-audit/blob/master/examples/nx/package.json#L11)
- In the E2E app of the NX repo, in the "plugins/index.js" file, I've added the cypress-audit configuration (https://github.com/mfrachet/cypress-audit/blob/master/examples/nx/apps/nx-e2e/src/plugins/index.js#L17,L25)
- In the E2E app of the NX repo, in the "integrations", at the top of the test, I've imported the cypress-audit commands https://github.com/mfrachet/cypress-audit/blob/master/examples/nx/apps/nx-e2e/src/integration/app.spec.ts#L1
Then I had to restart my visual studio code typescript plugin since it crashes all the time. And finally:
Also, I've added this folder example https://github.com/mfrachet/cypress-audit/tree/master/examples/nx and make the NX build part of the CI. It means that we'll know in the future if something breaks for this particular tool 😊
I'll let this one open for some times to get your feedbacks.
Thanks for your help folks, for your help and feedbacks 🙏🏻
from cypress-audit.
Hello @MuckT
I have similar configuration:
export const performanceReport = () => { cy.lighthouse( { performance: 5, accessibility: 95, }, { formFactor: 'desktop', screenEmulation: { mobile: false, width: 1920, height: 1080, deviceScaleFactor: 1, disabled: false, }, }); }
and this package.json
"cypress": "^6.3.0", "cypress-audit": "MuckT/cypress-audit#master", "cypress-cucumber-preprocessor": "^4.0.0", "cypress-react-unit-test": "^4.11.2", "cypress-screenplay": "^0.1.0", "eslint-plugin-cypress": "^2.10.3", "lighthouse": "^7.0.1",
And I have this issue:
I think it is related.
I have the same issue, I did all the steps from readme, any ideas? I have plain JS.
from cypress-audit.
My case if fixed now by including, at the top of the test, the cypress-audit commands such as:
https://github.com/mfrachet/cypress-audit/blob/master/examples/nx/apps/nx-e2e/src/integration/app.spec.ts#L1
😃
Using "cypress-audit": "MuckT/cypress-audit#master"
is also OK! 👍
Thanks a lot for your help.
from cypress-audit.
Good to hear. I'm closing this for now. Feel free to reopen or comment if something is not okay 👍🏻
from cypress-audit.
Related Issues (20)
- Light House: Save Trace File after audit HOT 1
- More detailed failure report HOT 1
- Error: Webpack Compilation Error: Module parse failed: Unexpected token (151:33) HOT 2
- Lighthouse check is skipped when we pass chrome binary path in cypress run HOT 1
- cy.pa11y() fails with the following error: The "listener" argument must be of type function. Received undefined
- Cypress Lighthouse test failing after latest Chrome Version Upgrade (Version 111.0.5563.64 ) HOT 30
- Can't install v1.4.1 via npm HOT 1
- Cypress-Audit support for Lighthouse-user-flow
- Unexpected token '||=' HOT 3
- Create output report (html and json) doesn't work HOT 4
- CRA example does not work out of the box: Unexpected token '??=' HOT 1
- pa11y/cypress integration with typescript
- Cypress screenshot error since Chrome 107
- cy.task('lighthouse') failed with the following error: > Unexpected token '??=' HOT 2
- VSCode Pa11y and typescript - /node_modules/.pnpm/@[email protected]/node_modules/@cypress-audit/pa11y/index.d.ts' is not a module HOT 1
- Seeing invalid arguments compilation error with HTML Reports "Expected 0 arguments, but got 1."
- This plugin doesn't work with Cypress version >= 13
- When cy.lighthouse() command is run, Cypress opens a new browser tab HOT 1
- Typescript: compilation error when using plugin with and Cypress >= 13.5.1 (no exported member BrowserLaunchOptions)
- 3rd party authentication scenario: lighthouse runs the login page on a separate new tab
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 cypress-audit.