mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 22:21:40 +03:00
3c31155fe9
- Implements https://github.com/enso-org/cloud-v2/issues/631 - Tests for dashboard (`app/ide-desktop/lib/dashboard/`): - End-to-end tests - Unit tests - Component tests The purpose of this PR is to introduce the testing framework - more tests can be added later in separate PRs. # Important Notes To test, run `npm run test` in `app/ide-desktop`, or `app/ide-desktop/lib/dashboard/`. All tests should pass. Individual test types can be run using `npm run test-unit`, `npm run test-component` and `npm run test-e2e` in `app/ide-desktop/lib/dashboard/`. Individual end-to-end tests can be run using `npx playwright test -c playwright-e2e.config.ts test-e2e/<file name>.spec.ts` in `app/ide-desktop/lib/dashboard/`. End-to-end tests require internet access to pass (for things like fonts). This PR *does* check in screenshots to guard against visual regessions (and/or to make visual changes obvious)
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
/** @file Test the login flow. */
|
|
import * as test from '@playwright/test'
|
|
|
|
import * as actions from './actions'
|
|
import * as apiModule from './api'
|
|
|
|
// =============
|
|
// === Tests ===
|
|
// =============
|
|
|
|
test.test('sign up without organization id', async ({ page }) => {
|
|
await page.goto('/')
|
|
await page.waitForLoadState('domcontentloaded')
|
|
await page.goto('/registration')
|
|
const api = await apiModule.mockApi(page)
|
|
api.setCurrentUser(null)
|
|
|
|
// Sign up
|
|
await actions.locateEmailInput(page).fill(actions.VALID_EMAIL)
|
|
await actions.locatePasswordInput(page).fill(actions.VALID_PASSWORD)
|
|
await actions.locateConfirmPasswordInput(page).fill(actions.VALID_PASSWORD)
|
|
await actions.locateRegisterButton(page).click()
|
|
|
|
// Log in
|
|
await actions.locateEmailInput(page).fill(actions.VALID_EMAIL)
|
|
await actions.locatePasswordInput(page).fill(actions.VALID_PASSWORD)
|
|
await actions.locateLoginButton(page).click()
|
|
|
|
// Set username
|
|
await actions.locateUsernameInput(page).fill('arbitrary username')
|
|
await actions.locateSetUsernameButton(page).click()
|
|
|
|
test.expect(api.currentUser?.id, 'new user has correct organization id').toBe(
|
|
api.defaultOrganizationId
|
|
)
|
|
})
|