Skip to content

Commit

Permalink
better comments for Cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Feb 1, 2024
1 parent 44e1a93 commit 864c4af
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/cypress/template/concept.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ describe('Concept page', () => {
it('concept preflabel can be copied to clipboard', () => {
cy.visit('/yso/en/page/p21685') // go to "music research" concept page

// click the copy to clipboard button next to the prefLabel
cy.get('#copy-preflabel').click()

// check that the clipboard now contains "music research"
// NOTE: This test may fail when running Cypress interactively in a browser.
// The reason is browser security policies for accessing the clipboard.
// If that happens, make sure the browser window has focus and re-run the test.
cy.window().its('navigator.clipboard').invoke('readText').then((result) => {}).should('equal', 'music research');
})
it('contains concept type', () => {
Expand Down Expand Up @@ -229,8 +234,13 @@ describe('Concept page', () => {
it('concept URI can be copied to clipboard', () => {
cy.visit('/yso/en/page/p21685') // go to "music research" concept page

// click the copy to clipboard button next to the URI
cy.get('#copy-uri').click()

// check that the clipboard now contains "http://www.yso.fi/onto/yso/p21685"
// NOTE: This test may fail when running Cypress interactively in a browser.
// The reason is browser security policies for accessing the clipboard.
// If that happens, make sure the browser window has focus and re-run the test.
cy.window().its('navigator.clipboard').invoke('readText').then((result) => {}).should('equal', 'http://www.yso.fi/onto/yso/p21685');
})
it('contains created & modified times (English)', () => {
Expand Down

0 comments on commit 864c4af

Please sign in to comment.