LambdaTest / lambdatest-cypress-cli

Allows Customers to run cypress test on Lambdatest Infrastructure
https://www.lambdatest.com/
MIT License
7 stars 24 forks source link

How can I use the capabilities of some third-party packages #258

Closed ZengTianShengZ closed 1 year ago

ZengTianShengZ commented 1 year ago

I want to use cypress-mochawesome-reporter in cypress, but when I installed the npm package and configured it according to the document, running lambdatest-cypress-cli run reported an error.

image

my cypress.config.js

const { defineConfig } = require('cypress');

module.exports = defineConfig({
  reporter: 'cypress-mochawesome-reporter',
  e2e: {
    setupNodeEvents(on, config) {
      require('cypress-mochawesome-reporter/plugin')(on);
    },
  },
});

my package.json

{
    "name": "cypress-demo",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
        "test": "cypress run --headed"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
        "cypress": "^12.14.0",
        "lambdatest-cypress-cli": "^3.0.15"
    },
    "dependencies": {
        "cypress-mochawesome-reporter": "^3.5.1"
    }
}
ZengTianShengZ commented 1 year ago

How do I install some toolkits before running the tests

ZengTianShengZ commented 1 year ago

I tested the lambdatest-config.json run_settings configuration and it doesn't work

 "run_settings": {
        "reporter_config_file": "base_reporter_config.json",
        "build_name": "test-16",
        "parallels": 1,
        "specs": "./cypress/e2e/*.cy.js",
        "ignore_files": "",
        "network": false,
        "headless": false,
        "npm_dependencies": {
            "cypress": "10",
            "cypress-mochawesome-reporter": "^3.5.1"
        }
    },
ZengTianShengZ commented 1 year ago

I repeated the test, configuring npm_dependencies is ok