Skip to content

Commit

Permalink
Merge pull request #12 from AbuBakkar32/abu-bakkar
Browse files Browse the repository at this point in the history
Abu bakkar
  • Loading branch information
AbuBakkar32 authored May 11, 2024
2 parents 4f2f188 + 4c70340 commit cf9e80a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
20 changes: 7 additions & 13 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ const {defineConfig} = require("cypress");
const {beforeRunHook, afterRunHook} = require('cypress-mochawesome-reporter/lib');

module.exports = defineConfig({
//screenshotsFolder: 'cypress/screenshots',
//videosFolder: 'cypress/videos',
//reporter: 'mochawesome',
screenshotsFolder: 'cypress/screenshots',
videosFolder: 'cypress/videos',
reporter: 'cypress-mochawesome-reporter', reporterOptions: {
charts: true,
reportPageTitle: 'custom-title',
embeddedScreenshots: true,
inlineAssets: true,
saveAllAttempts: false,
}, //video: true,
//screenshotOnRunFailure: true,
},
video: true,
screenshotOnRunFailure: true,

env: {
// codeCoverage: {
// url: 'http://localhost:3000/__coverage__',
// },
}, projectId: '5r89t6', e2e: {
env: {}, projectId: '5r89t6', e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
require('cypress-mochawesome-reporter/plugin')(on);
on('before:run', async (details) => {
console.log('override before:run');
Expand All @@ -30,9 +27,6 @@ module.exports = defineConfig({
console.log('override after:run');
await afterRunHook();
});
// implement node event listeners here
//require('@cypress/code-coverage/task')(on, config)
//on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))
},
},
});
2 changes: 1 addition & 1 deletion cypress/e2e/contact_us.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Contact Us Form', () => {
cy.get('[data-qa="message"]').type('Test Message');

// Step 7: Upload file
const fileName = 'C:\\Users\\ABS RAKIB\\Videos\\Abu Bakkar Siddikk-CV.pdf';
const fileName = './reports/unittest.pdf';
cy.get('input[type=file]').selectFile(fileName);

// Step 8: Click 'Submit' button
Expand Down
26 changes: 26 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Cypress CI

on:
push:
branches:
- main

jobs:
cypress-run:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: npm install

- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: pdf-file
path: ./reports/unittest.pdf

- name: Run Cypress tests
run: npx cypress run --record --key af8ca1ca-a0be-4fbd-b377-fb03d094d8eb
Binary file added reports/unittest.pdf
Binary file not shown.

0 comments on commit cf9e80a

Please sign in to comment.