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

Eris: Add tests for home #12

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
27 changes: 23 additions & 4 deletions cypress/integration/home.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
describe('My First Test', () => {
describe('On the home page', () => {

it('Can load the page', () => {
cy.visit('/test.html')
cy.title().should('eq', 'QA Web Automation Activity')
cy.visit('/')
cy.title().should('eq', 'Our Fake Restaurant')
})

it('Can view a menu item', () => {
cy.visit('/')

// Help! This worked before, but then the page changed, and now it's failing!
cy.contains('open menu').click()

cy.get('h5').first().should('be.visible').should('contain', 'Tomato Soup')
})

it('Can enter contact details', () => {
cy.visit('/test.html')
cy.visit('/')

cy.contains('div', 'show contact').click()
cy.contains('contact').should('be.visible')
Expand All @@ -18,4 +27,14 @@ describe('My First Test', () => {
// the 'name' field is focused by default, so we can type into it right away
cy.focused().type('John Smith')
})

it('Can toggle the contact form', () => {
cy.visit('/')

cy.contains('div', 'show contact').click()
cy.contains('Reserve a table').should('be.visible')

cy.get("div[data-nri-id='contact'] .w3-button").first().click()
cy.contains('Reserve a table').should('not.be.visible')
})
})
2 changes: 1 addition & 1 deletion home.html → index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
<title>QA Web Automation Activity</title>
<title>Our Fake Restaurant</title>
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" ></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
Loading