-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add e2e for rubriken elements as pseude-code
- Loading branch information
Showing
1 changed file
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,55 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test( | ||
test.only( | ||
'Visiting the Rubriken step of creating a documentUnit', | ||
{ tag: ['@RISDEV-6043'] }, | ||
async ({ page }) => { | ||
// In the future the new documentUnit needs to be mocked | ||
// As this functionality is not there yet we can simply enter the desired page and finish the process | ||
await page.goto('/documentUnit/KSNR054920707/rubriken') | ||
await page.goto('/') | ||
await page.getByRole('button', { name: 'Neue Dokumentationseinheit' }).click() | ||
await page.getByText('Rubriken').click() | ||
await expect(page.getByText('Rubriken')).toHaveCount(1) | ||
await expect(page.getByText('Formaldaten')).toHaveCount(2) | ||
|
||
|
||
// Read the below as pseudo code that will be implemented properly while extending the application | ||
// Remove these comments once we're done with the page | ||
|
||
// const zitierdatumElement = page.getByText('Zitierdatum') | ||
// await expect(zitierdatumElement).toHaveCount(1) | ||
// zitierdatumElement.fill('01.01.1970') | ||
// await expect(zitierdatumElement).toHaveValue('01.01.1970') | ||
|
||
// const amtlicheLangüberschriftElement = page.getByText('Amtl. Langüberschrift') | ||
// await expect(amtlicheLangüberschriftElement).toHaveCount(1) | ||
// zitierdatumElement.fill('my long title') | ||
// await expect(zitierdatumElement).toHaveValue('my long title') | ||
|
||
// const dokumentTyp = page.getByText('Dokumenttyp') | ||
// await expect(dokumentTyp).toHaveCount(1) | ||
// dokumentTyp.selectOption({ label: 'VR' }) // select by visible text option | ||
// await expect(dokumentTyp).toHaveValue('vr') // confirm selection by value | ||
|
||
// const inkrafttretedatumElement = page.getByText('Inkrafttretedatum') | ||
// await expect(inkrafttretedatumElement).toHaveCount(1) | ||
// inkrafttretedatumElement.fill('02.02.1970') | ||
// await expect(inkrafttretedatumElement).toHaveValue('02.02.1970') | ||
|
||
// const ausserkrafttretedatumElement = page.getByText('Ausserkrafttretedatum') | ||
// await expect(ausserkrafttretedatumElement).toHaveCount(1) | ||
// ausserkrafttretedatumElement.fill('03.03.1970') | ||
// await expect(ausserkrafttretedatumElement).toHaveValue('03.03.1970') | ||
|
||
// const aktenzeichenElement = page.getByText('Aktenzeichen') | ||
// await expect(aktenzeichenElement).toHaveCount(1) | ||
// aktenzeichenElement.fill('Az1') | ||
// aktenzeichenElement.fill('Az2') | ||
// await expect(aktenzeichenElement).toHaveValues(['Az1', 'Az2']) | ||
|
||
// const keinAktenzeichenElement = page.getByText('Kein Aktenzeichen') | ||
// await expect(keinAktenzeichenElement).toHaveCount(1) | ||
// aktenzeichenElement.check() | ||
// expect(aktenzeichenElement).toBeChecked() | ||
}, | ||
) |