Skip to content

Commit

Permalink
Merge branch 'development' into question-page
Browse files Browse the repository at this point in the history
  • Loading branch information
KoudeIceTea committed Dec 10, 2024
2 parents 0ac8577 + 23cebce commit 9e69393
Show file tree
Hide file tree
Showing 40 changed files with 1,860 additions and 321 deletions.
7 changes: 0 additions & 7 deletions .env.example

This file was deleted.

47 changes: 20 additions & 27 deletions cypress/e2e/firstTimeUser.cy.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
describe('First time user tests', () => {
beforeEach(() => {
it('can skip the background collect form', () => {
cy.visit('/');
});

it('can display the welcome message and background input buttons', () => {
cy.contains('Welkom bij Windesheim.AI!');
cy.get('[data-testid="userLogo"]').should('exist');
cy.contains('Vertel me uw achtergrond!');
cy.contains('We bieden u op maat gemaakte training.');
cy.contains('Oke').click();
});
// Check if the disclaimer pop-up is displayed and close it if it is
cy.get('body').then(($body) => {
if ($body.find('.disclaimer-popup').length > 0) {
cy.contains('Disclaimer').should('be.visible');
cy.get('.disclaimer-popup .close-button').click();
}
});

it('can skip the background collect form', () => {
cy.contains('Welkom bij Windesheim.AI!');
// After the disclaimer (if present) is closed,
// check if the homepage is displayed correctly
cy.contains('Welkom bij Windesheim.AI!').should('be.visible');
cy.contains('We bieden u op maat gemaakte training.').should(
'be.visible',
);

// Now skip the background form process
cy.contains('Overslaan').click();
cy.contains('Overslaan').click();

cy.contains('Windesheim AI');
cy.contains('Disclaimer');
});

it('can answer the background questions and progresses through it', () => {
cy.contains('Oke').click();
cy.contains('Achtergrondinformatie verzamelen');
cy.contains('Wat is uw positie?');
cy.get('[data-testid="listButton"]').first().click();
cy.contains('In welk gebied van AI bent u geïnteresseerd?');
cy.get('[data-testid="listButton"]').first().click();
cy.contains('Hoe bekend bent u met AI?');
cy.get('[data-testid="listButton"]').first().click();
cy.contains('Overslaan').click();
cy.contains('Windesheim AI');
cy.contains('Disclaimer');
// Check if you land at the expected place after skipping
cy.contains('Windesheim AI').should('be.visible');
// Since the disclaimer only appears at the beginning and does not appear again afterwards,
// no further check for "Disclaimer" at the end is necessary.
});
});
28 changes: 26 additions & 2 deletions cypress/e2e/home.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
describe('Home page tests', () => {
beforeEach(() => {
cy.visit('/');

// Handle the disclaimer pop-up if present at the beginning
cy.get('body').then(($body) => {
if ($body.find('.disclaimer-popup').length > 0) {
cy.contains('Disclaimer').should('be.visible');
cy.get('.disclaimer-popup .close-button').click();
}
});

// Proceed with initial setup steps
cy.get('[data-testid="FirstCollect-skip-button"]').click();
cy.visit('/settings');
cy.get('[data-testid="tutorial-skip-button"]').click();
Expand All @@ -12,7 +22,21 @@ describe('Home page tests', () => {
it('can display the home page', () => {
cy.visit('/');

cy.contains('Why Windesheim AI');
cy.contains('Disclaimer');
// Handle the disclaimer pop-up if present after re-visiting the home page
cy.get('body').then(($body) => {
if ($body.find('.disclaimer-popup').length > 0) {
// If the disclaimer pop-up is present, close it
cy.contains('Disclaimer').should('be.visible');
cy.get('.disclaimer-popup .close-button').click();
}
});

// Verify that the home page content is visible
// Replace 'Why Windesheim AI' with the actual content you expect
cy.contains('Why Windesheim AI').should('be.visible');

// If the disclaimer is not expected anymore, remove this check
// If a disclaimer link or label is always part of the home page (not as a pop-up), adjust accordingly
// cy.contains('Disclaimer').should('be.visible'); // Only if needed
});
});
Loading

0 comments on commit 9e69393

Please sign in to comment.