Skip to content

Commit

Permalink
Merge pull request #5 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 f922ddb + c62f684 commit a351a43
Show file tree
Hide file tree
Showing 7 changed files with 4,647 additions and 24 deletions.
10 changes: 8 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const {defineConfig} = require("cypress");

module.exports = defineConfig({
e2e: {
env: {
codeCoverage: {
url: 'http://localhost:3000/__coverage__',
},
}, projectId: '5r89t6', e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here

require('@cypress/code-coverage/task')(on, config)
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))
return config
},
},
});
41 changes: 41 additions & 0 deletions cypress/e2e/contact_us.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
describe('Contact Us Form', () => {
it('Contact Us Form validation checking....', () => {
// Step 1: Launch browser
// Cypress automatically launches the browser

// Step 2: Navigate to url 'http://automationexercise.com'
cy.visit('http://automationexercise.com');

// Step 3: Verify that home page is visible successfully
cy.url().should('include', 'automationexercise');

// Step 4: Click on 'Contact Us' button
cy.contains('Contact us').click();

// Step 5: Verify 'GET IN TOUCH' is visible
cy.get('#contact-page > div.row > div.col-sm-8 > div > h2').should('contain', 'Get In Touch');

// Step 6: Enter name, email, subject and message
cy.get('[data-qa="name"]').type('Test User');
cy.get('[data-qa="email"]').type('testuser@example.com');
cy.get('[data-qa="subject"]').type('Test Subject');
cy.get('[data-qa="message"]').type('Test Message');

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

// Step 8: Click 'Submit' button
cy.get('[data-qa="submit-button"]').click();

// Step 9: Click OK button
cy.on('window:confirm', () => true);

// Step 10: Verify success message 'Success! Your details have been submitted successfully.' is visible
cy.get('.status ').should('contain', 'Success! Your details have been submitted successfully.');

// Step 11: Click 'Home' button and verify that landed to home page successfully
cy.get('#form-section > a > span > i').click();
cy.url().should('include', 'automationexercise');
});
});
20 changes: 20 additions & 0 deletions cypress/e2e/verify_testCases_files.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
describe('Verify Test Cases Page', () => {
it('Verify Test Cases Page', () => {
// Step 1: Launch browser
// Cypress automatically launches the browser

// Step 2: Navigate to url 'http://automationexercise.com'
cy.visit('http://automationexercise.com');

// Step 3: Verify that home page is visible successfully
cy.url().should('include', 'automationexercise');

// Step 4: Click on 'Test Cases' button
cy.contains('Test Cases').click();

cy.get('#form > div > div.row > div > h2').should('contain', 'Test Cases');

// Step 5: Verify user is navigated to test cases page successfully
cy.url().should('include', 'test_cases');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a351a43

Please sign in to comment.