Skip to content

Commit

Permalink
added test for contact us
Browse files Browse the repository at this point in the history
  • Loading branch information
PontusPilatus committed May 16, 2024
1 parent 44a04af commit a11b5fa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Cypress/specs/contactUs.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Contact Us

Scenario: Navigate to Contact Us page and send a message
Given I am on the homepage
When I click on Contact Us
Then I can fill in my name, email and message
Then I can submit my message
19 changes: 19 additions & 0 deletions Cypress/specs/step_definitions/contactUs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Given, When, Then } from "@badeball/cypress-cucumber-preprocessor";

When('I click on Contact Us', () => {
cy.get(':nth-child(4) > a').click();
});

Then('I should be on the Contact Us page', () => {
cy.url().should('include', '/contact');
});

Then('I can fill in my name, email and message', () => {
cy.get('#name').type('Testköpare');
cy.get('#email').type('[email protected]');
cy.get('#message').type('This is a test message');
});

Then('I can submit my message', () => {
cy.get('form > button').click();
});

0 comments on commit a11b5fa

Please sign in to comment.