aboutsummaryrefslogtreecommitdiff
path: root/tests/e2e/user-courseware.spec.js
blob: 5fc220d33de5fb5a7e29057217fb6b8900bdd63c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { test, expect } from '@playwright/test';

const autorFile = 'tests/e2e/.auth/autor.json';

test.describe('Visiting my Arbeitsplatz @autor @courseware', () => {
    test.use({ storageState: autorFile });

    test('should let us create a new Lernmaterial', async ({ page }) => {
        await page.goto('dispatch.php/start');
        await page.getByRole('link', { name: /Courseware Erstellen/ }).click();
        await page.getByRole('button', { name: 'Lernmaterial hinzufügen' }).click();
        await page.getByLabel('Titel des Lernmaterials*').click();
        await page.getByLabel('Titel des Lernmaterials*').fill('Ein Titel');
        await page.getByLabel('Titel des Lernmaterials*').press('Tab');
        await page.getByLabel('Beschreibung*').fill('Eine Beschreibung');
        await page.getByRole('tab', { name: 'Erscheinung' }).click();
        await page
            .getByRole('combobox', { name: 'Search for option' })
            .locator('div')
            .filter({ hasText: 'Blau' })
            .click();
        await page.getByRole('button', { name: 'Erstellen' }).click();
        const lernmaterial = await page.getByRole('link', { name: 'Ein Titel Eine Beschreibung' }).last();
        await expect(lernmaterial).toBeVisible();
    });
});