Skip to content

Commit

Permalink
E2E test that navigates to the Finnish homepage, changes the UI langu…
Browse files Browse the repository at this point in the history
…age to English, selects 'yso' from the vocabulary list, changes the content language to Finnish within 'yso', performs a search, lands on the search results page, selects a concept from the results and finally lands on the concept page
  • Loading branch information
miguelvaara committed Nov 15, 2023
1 parent 2f38c45 commit f4ee687
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/cypress/e2e/fp-lang-yso-clang-result-vocab.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
describe('Front page -> lang -> vocab -> cLang -> search -> concept page', () => {
beforeEach(() => {
cy.visit('/fi');
cy.wait(3000);
});

it('should change UI language to English and navigate to YSO concept page', () => {
// Change the UI language to English from the top bar
cy.visit('/en');

// Select "YSO - Yleinen suomalainen ontologia (arkeologia)" from the vocabulary list
// Go to the vocab page
cy.contains('.list-group-item a', 'YSO - Yleinen suomalainen ontologia (arkeologia)')
.click();

// Confirm that we are on the correct page (yso)
cy.url().should('include', '/yso/en/');
});

it('should perform a search fuction and go to the search result page', () => {
// This following be replaced with actual implementation once available
cy.visit('/yso/fi/search?query=tiede');

// Potentially wait for a long time (10-20 seconds)
cy.wait(10000);
});

it('should select the text "tiede" from the search results and navigate to the concept page', () => {
cy.visit('/yso/fi/search?query=tiede');
// Potentially wait for a long time again (10-20 seconds)
cy.wait(10000);

// Select the text 'tiede' from the list and go to the page the link is directing
cy.get('.search-result-term a.prefLabel').contains('tiede')
.click();

// Confirm that we are on the correct page
cy.url().should('include', '/yso/fi/page/p2240');

// The page should contains the text "tiede"
cy.get('#pref-label').should('have.text', 'tiede');
});
});

0 comments on commit f4ee687

Please sign in to comment.