enso/app/gui/integration-test/dashboard/setup.spec.ts
Adam Obuchowicz 736134e491
Add traces to integration tests + suppress one flaky assertion. (#11595)
Fixes #11604

Most issues were caused by a problem with Project List flooding the network with its requests - this was fixed on develop.
But one assertion was flaky - it assumed we will see the "real" run result on `write` node, but sometimes it is immediately overwritten by dry run.

But the most important part of this PR is adding traces to Electron packages - it's should be much easier now to debug E2E test failures.

Also renamed the previously misnamed "E2E tests" to "[GUI] integration tests".
2024-11-27 14:09:59 +00:00

85 lines
2.0 KiB
TypeScript

/** @file Test the setup flow. */
import * as test from '@playwright/test'
import { Plan } from 'enso-common/src/services/Backend'
import * as actions from './actions'
// Reset storage state for this file to avoid being authenticated
test.test.use({ storageState: { cookies: [], origins: [] } })
test.test('setup (free plan)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
.stayOnFreePlan()
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
test.test('setup (solo plan)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
.selectSoloPlan()
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
test.test('setup (team plan, skipping invites)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
.selectTeamPlan(Plan.team)
.setOrganizationName('test organization')
.skipInvitingUsers()
.setTeamName('test team')
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
test.test('setup (team plan)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
.selectTeamPlan(Plan.team, 10)
.setOrganizationName('test organization')
.inviteUsers('foo@bar.baz bar@bar.baz, baz@example.com; other+email@org.co.uk')
.setTeamName('test team')
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
// No test for enterprise plan as the plan must be set to enterprise manually.