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

Test for browse page search bar #202

Closed
wants to merge 2 commits into from
Closed
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
30 changes: 30 additions & 0 deletions cypress/e2e/browse.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
describe('The home page', () => {
Copy link
Member

@alishaevn alishaevn Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it('should be able to reach the browse page', () => {
// Start from the home/index page
cy.visit('http://localhost:3000/')

// Find the search button and perform an empty search, which should lead to the browse page
cy.get('button.search-button').click()

// The new url should include "/browse"
cy.url().should('include', '/browse')
})

it('should perform a search on the browse page', () => {
// Start from the browse page
cy.visit('/browse')

// type an example search into the searchbar
cy.get('input.search-bar').type('next')

// Find the search button to enter the search
cy.get('button.search-button').click()

// The new url should include "/browse"
cy.get('div.card-title').contains('Next Generation Sequencing').then(() => {
cy.log("Successfully performed a search from the browse page");
});
})
})

//
12 changes: 0 additions & 12 deletions cypress/e2e/index.cy.js

This file was deleted.