-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
describe('[Research - List Articles]', () => { | ||
const researchPageUrl = '/research' | ||
|
||
beforeEach(() => { | ||
cy.visit(researchPageUrl) | ||
}) | ||
|
||
it('[By Everyone - Lists all research articles]', () => { | ||
cy.step('Verify page loads with research articles') | ||
cy.get('[data-cy=ResearchList]').should('be.visible') | ||
cy.get('[data-cy=ResearchListItem]').should('have.length.greaterThan', 0) | ||
}) | ||
|
||
it('[Search Functionality - Filters articles]', () => { | ||
const searchTerm = 'test' | ||
|
||
cy.step('Type a keyword into the search bar') | ||
cy.get('[data-cy=research-search-box]').clear().type(searchTerm) | ||
|
||
cy.step('Verify filtered results are displayed') | ||
cy.get('[data-cy=ResearchListItem]').should('have.length.at.least', 1) | ||
}) | ||
|
||
it('[Pagination - Displays additional articles]', () => { | ||
cy.step('Verify pagination is visible') | ||
let itemCount | ||
cy.get('[data-cy=ResearchListItem]').then((items) => { | ||
itemCount = items.length | ||
}) | ||
cy.get('[data-cy=loadMoreButton]').should('be.visible') | ||
cy.get('[data-cy=loadMoreButton]').click() | ||
|
||
cy.step('Verify additional articles are loaded') | ||
cy.then(() => { | ||
cy.get('[data-cy=ResearchListItem]').should( | ||
'have.length.greaterThan', | ||
itemCount, | ||
) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters