Skip to content

Commit

Permalink
Add e2e for rubriken page elements as pseude-code (RISDEV-6162) (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-mk authored Jan 15, 2025
1 parent 8c9c253 commit 4eab289
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion frontend/e2e/RubrikenPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,49 @@ test(
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()
},
)

0 comments on commit 4eab289

Please sign in to comment.