lively-balloon-98986
01/08/2023, 8:37 AMpowerful-orange-86819
01/08/2023, 9:42 AMpowerful-orange-86819
01/08/2023, 9:43 AMmodern-dawn-86006
01/08/2023, 3:35 PMmodern-dawn-86006
01/08/2023, 3:40 PMclever-salesmen-46486
01/08/2023, 8:25 PMgray-kilobyte-89541
01/08/2023, 8:31 PMmysterious-psychiatrist-29678
01/08/2023, 8:33 PMmysterious-psychiatrist-29678
01/08/2023, 8:38 PMclever-salesmen-46486
01/08/2023, 8:40 PMon('before:browser:launch', (browser = {}, args) => {
console.log('browser', browser)
if (browser.family === 'chrome') {
console.log('adding dark mode browser flags')
args.push('--force-dark-mode=true')
return args
}
})
powerful-orange-86819
01/08/2023, 10:22 PMmysterious-psychiatrist-29678
01/08/2023, 10:29 PMmysterious-psychiatrist-29678
01/08/2023, 11:45 PMcy.get('label')
.should('exist')
.and('contain.text', 'Email address')
.and('be.visible')
billions-king-35651
01/09/2023, 6:56 AMlog⚠️ Code coverage tasks were not registered by the plugins file. See support issue for possible workarounds. [@cypress/code-coverage]
If I run nyc cypress open, the tests are not even running.
I am using NextJs. Any help to get the code coverage to work will be appreciated.
Thankslemon-oxygen-25956
01/09/2023, 7:38 AMlively-match-61863
01/09/2023, 8:42 AMclean-processor-42509
01/09/2023, 8:58 AMcolossal-table-38461
01/09/2023, 9:03 AMclean-processor-42509
01/09/2023, 9:10 AMclean-processor-42509
01/09/2023, 9:11 AMcolossal-table-38461
01/09/2023, 9:11 AMstraight-microphone-66008
01/09/2023, 12:23 PMgray-kilobyte-89541
01/09/2023, 3:26 PM// @ts-ignore
nice-lifeguard-81070
01/09/2023, 3:59 PM{
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt build && nuxt preview"
},
and In YML file
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: install npm
run: npm ci
- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: npm run dev
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
browser: chrome
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage
fail_ci_if_error: true
verbose: true
If instead of using npm run dev, I run npm run preview, it works fine and Cypress runs successfully, but it does not generate a code coverage report. A code coverage report can only be generated when I use npm run dev, but it gives a 404 error.dazzling-crowd-57204
01/09/2023, 4:23 PMmysterious-psychiatrist-29678
01/09/2023, 4:39 PMCypress.Commands.add('visitCustomDeployment', (deploymentLink) => {
cy.intercept({
url: 'https://management.azure.com/batch?api-version=2020-06-01',
headers: {
'x-ms-command-name': '{ Microsoft_Azure_CreateUIDef.Batch:0,Services.ArmLocations.getLocForSub:1}'
}
})
.as('reponseFromBackend')
cy.visit(deploymentLink)
cy.wait('@reponseFromBackend', {timeout: 60000})
})
---------------------
before(() => {
cy.loginOnUI(Cypress.env('username'), Cypress.env('password'))
})
beforeEach(() => {
cy.visitCustomDeployment(Cypress.env('customDeploymentLink'))
})
modern-dawn-86006
01/09/2023, 8:15 PMmodern-dawn-86006
01/09/2023, 8:21 PM