Giter Club home page Giter Club logo

Comments (11)

mfrachet avatar mfrachet commented on May 20, 2024 3

probably not the same issue then. would you mind creating another one with steps to repro please ? 🙏🏻

from cypress-audit.

FannyBarco avatar FannyBarco commented on May 20, 2024 1

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:

image

I think it is related.

from cypress-audit.

cdierkens avatar cdierkens commented on May 20, 2024 1

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.

MuckT avatar MuckT commented on May 20, 2024

Submitted a PR that I believe solves this issue #59

from cypress-audit.

RoRoche avatar RoRoche commented on May 20, 2024

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.

MuckT avatar MuckT commented on May 20, 2024

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

MuckT avatar MuckT commented on May 20, 2024

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

mfrachet avatar mfrachet commented on May 20, 2024

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:

Then I had to restart my visual studio code typescript plugin since it crashes all the time. And finally:

Screenshot 2021-01-28 at 09 16 48 (2)

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.

Lukaszli avatar Lukaszli commented on May 20, 2024

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:

image

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.

RoRoche avatar RoRoche commented on May 20, 2024

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.

mfrachet avatar mfrachet commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.