Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions tests/playwright/e2e/users/users.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@ import { handlePasswordConfirmation } from '../../support/utils/password-confirm

test.describe('Settings: Create and delete accounts', () => {
test('can create a user with username and password', async ({ page }) => {
const settingsPage = new SettingsUsersPage(page)
await settingsPage.open()

await settingsPage.openNewUserDialog()
const newUserId = crypto.randomUUID()
try {
const settingsPage = new SettingsUsersPage(page)
await settingsPage.open()

const dialog = settingsPage.newUserDialog()
await dialog.getByLabel(/Account name/).fill('newuser-basic')
await dialog.getByLabel(/Password/).and(page.locator('input')).fill('password123')
await settingsPage.openNewUserDialog()

await dialog.getByRole('button', { name: 'Add new account' }).click()
await handlePasswordConfirmation(page)
await dialog.waitFor({ state: 'hidden' })
const dialog = settingsPage.newUserDialog()
await dialog.getByLabel(/Account name/).fill(newUserId)
await dialog.getByLabel(/Password/).and(page.locator('input')).fill('password123')

await expect(settingsPage.userRow('newuser-basic')).toContainText('newuser-basic')
await dialog.getByRole('button', { name: 'Add new account' }).click()
await handlePasswordConfirmation(page)
await dialog.waitFor({ state: 'hidden' })

await runOcc(['user:delete', 'newuser-basic'])
await expect(settingsPage.userRow(newUserId)).toContainText(newUserId)
} finally {
await runOcc(['user:delete', newUserId], { failOnError: false })
}
})

test('can create a user with display name and email', async ({ page }) => {
Expand Down
Loading