Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mahbub #65

Merged
merged 11 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 25 additions & 22 deletions .github/workflows/cypress_report.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
name: Cypress CI/CD With Github Page Publish
on:
push:
branches:
- "master"
name: Generate Cypress Report
on: [push]

jobs:
cypress-run:
cypress-test:
name: Run Tests on Chrome Browser
runs-on: ubuntu-latest
container: cypress/browsers:node18.12.0-chrome107
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Cypress run
uses: cypress-io/github-action@v4
with:
command: npm run cy:test
- name: Install cypress and verify
run: |
npm ci
$(npm bin)/cypress verify

- name: Run Cypress tests
run: npm run cy:test
continue-on-error: true

- name: Copy test execution videos and screenshots
run: |
mkdir public
cp -r cypress/videos public/videos
cp -r cypress/screenshots public/screenshots

# - name: Copy test execution videos and screenshots
# run: |
# mkdir public
# cp -r public/videos
# cp -r public/screenshots
# - name: Merge test reports
# run: npm run combine-reports
- name: Merge test reports
run: npm run combine-reports

# - name: Generate HTML report
# run: npm run generate-report
- name: Generate HTML report
run: npm run generate-report

- name: Deploy report page to GitHub Page
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./public
8 changes: 6 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = defineConfig({
viewportHeight: 1200,
viewportWidth: 1920,
screenshotOnRunFailure: false,
screenshotsFolder: "cypress/reports/screenshots",
videosFolder: "cypress/reports/videos",
screenshotsFolder: "cypress/screenshots",
videosFolder: "cypress/videos",
trashAssetsBeforeRuns: true,
reporter: "cypress-mochawesome-reporter",
reporterOptions: {
Expand All @@ -25,6 +25,10 @@ module.exports = defineConfig({
reportPageTitle: "End-To-End Test Suite",
embeddedScreenshots: true,
inlineAssets: true,
quiet: true,
overwrite: false,
html: false,
json: true,
},
e2e: {
experimentalRunAllSpecs: true,
Expand Down

Large diffs are not rendered by default.

Empty file added cypress/screenshots/readme.MD
Empty file.
Empty file added cypress/videos/readme.MD
Empty file.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"clean:reports": "if exist cypress\\reports rmdir /s/q cypress\\reports && mkdir cypress\\reports\\mochareports",
"pretest": "npm run clean:reports",
"scripts": "cypress run --browser chrome --headless",
"combine-reports": "mochawesome-merge cypress/reports/**/*.json>cypress/reports/mochareports/report.json",
"generate-report": "marge cypress/reports/mochareports/report.json -f report -o cypress/reports/mochareports -- inline",
"combine-reports": "mochawesome-merge ./cypress/reports/mocha/*.json -o cypress/reports/report.json",
"generate-report": "marge cypress/reports/mochareports/report.json -f report -o cypress/reports/mocha",
"posttest": "npm run combine-reports && npm run generate-report"
},
"repository": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"cypress-plugin-store": "^1.3.2",
"eslint-plugin-cypress": "^2.12.1",
"mochawesome": "^7.1.3",
"mochawesome-merge": "^4.2.2",
"mochawesome-merge": "^4.3.0",
"mochawesome-report-generator": "^6.2.0",
"prettier": "^2.7.1"
},
Expand Down
Loading