Skip to content

Commit

Permalink
Add e2e for rubriken elements as pseude-code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-mk committed Jan 15, 2025
1 parent 0cd7948 commit 54a10ab
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions frontend/e2e/RubrikenPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,55 @@
import { test, expect } from '@playwright/test'

test(
test.only(

Check failure on line 3 in frontend/e2e/RubrikenPage.spec.ts

View workflow job for this annotation

GitHub Actions / frontend-checks / lint-and-format-check-frontend

Unexpected focused test
'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()
},
)

0 comments on commit 54a10ab

Please sign in to comment.