Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #390 from SELab-2/e2e-tests
Browse files Browse the repository at this point in the history
E2e tests
  • Loading branch information
matt01y authored May 23, 2024
2 parents 8cfbd8d + 03ed499 commit f02316b
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions frontend/src/tests/existing-user-pages.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from '@playwright/test';
import {Token} from "../utils/ApiInterfaces.ts";

test('fake login works', async ({ page }) => {
test('user flow: student', async ({ page }) => {
await page.goto('https://localhost:8080');
await page.waitForLoadState('networkidle');
await expect(page).toHaveTitle(/Delphi/);
Expand Down Expand Up @@ -39,12 +39,22 @@ test('fake login works', async ({ page }) => {
//klik op flashcards
const flashcardsButton = page.getByRole('link', { name: 'Flash Cards' })
await flashcardsButton.click();
const confirmButton = page.getByRole('button', { name: 'Confirm' })
await expect(confirmButton).toBeVisible();
const groupMember = page.getByText('[email protected]');
const groupMember = page.getByText('[email protected]');
await expect(groupMember).toBeVisible();
const submissionReq = page.getByText('submission.zip');
await expect(submissionReq).toBeVisible();
const leaveButton = page.getByRole('button').nth(2);
await expect(leaveButton).toBeVisible();
await leaveButton.click();
await expect(groupMember).toBeHidden();
//selecteer groep
const joinButton = page.getByRole('row', { name: '2 2' }).getByRole('button');
await expect(joinButton).toBeVisible();
await joinButton.click();
await expect(groupMember).toBeVisible();
const otherMember = page.getByRole('cell', { name: 'Ruben', exact: true });
await expect(otherMember).toBeVisible();
await expect(joinButton).toBeHidden();
//ga naar courses
const coursesButton = page.getByRole('link').nth(2);
await coursesButton.click();
Expand All @@ -59,7 +69,7 @@ test('fake login works', async ({ page }) => {
//ga naar settings en log uit
await settingsButton.click();
const logoutButton = page.locator('div').filter({ hasText: /^Logout:$/ }).getByRole('link')
await logoutButton.click(); // deze button zou wel iets eenvoudiger mogen zijn
await logoutButton.click();
await page.waitForLoadState('networkidle');
await expect(page).toHaveTitle(/Delphi/);
const loginButton = page.getByRole('link', { name: 'Log in' })
Expand Down

0 comments on commit f02316b

Please sign in to comment.