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

Add cypress tests for partial page load on vocab home page #1474

Closed
wants to merge 1 commit into from
Closed
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
37 changes: 30 additions & 7 deletions cypress/e2e/vocab-home.cy.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
describe('Vocabulary home page', () => {
it('contains vocabulary title', () => {
// go to the Skosmos front page
cy.visit('/')
// click on the first vocabulary in the list
cy.get('#vocabulary-list').find('a').first().click()
// using context because otherwise cypress would not clear the state and tests couldn't be run independently
context('Vocabulary home page', () => {
it('contains vocabulary title', () => {
// go to the Skosmos front page
cy.visit('/')
// click on the first vocabulary in the list
cy.get('#vocabulary-list').find('a').first().click()

// check that the vocabulary title is not empty
cy.get('#vocab-title > a').invoke('text').should('match', /.+/)
})
})

context('partial page load', () => {
it('does a partial page load', () => {
// go to the YSO home page (Allärs does not have an index in the backend for some reason)
cy.visit('/yso/en')
// click on the first concept in the alphabetical index
cy.get('#alpha-list').find('a').first().click()
// check that the term heading exists
cy.get('#term-heading')
})

// check that the vocabulary title is not empty
cy.get('#vocab-title > a').invoke('text').should('match', /.+/)
it('updates mappings component after partial page load', () => {
// go to the YSO home page
cy.visit('/yso/en')
// click on the first concept in the alphabetical index
cy.get('#alpha-list').find('a').first().click()
// check that concept mappings is not empty
cy.get('#concept-mappings').should('not.be.empty')
})
})
})