Several changes have been made to optimize the testing and validation workflows. The end-to-end tests for user billing, invitations, account, team billing, and team accounts have been retouched for improved performance and better accuracy. There has been a minor modification in the validation rules for plan-picker in the billing component. Furthermore, modifications are made to several utility functions to fine-tune their operations.
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { Page, expect, test } from '@playwright/test';
|
|
|
|
import { TeamAccountsPageObject } from './team-accounts.po';
|
|
|
|
test.describe('Team Accounts', () => {
|
|
let page: Page;
|
|
let teamAccounts: TeamAccountsPageObject;
|
|
|
|
test.beforeAll(async ({ browser }) => {
|
|
page = await browser.newPage();
|
|
teamAccounts = new TeamAccountsPageObject(page);
|
|
});
|
|
|
|
test('user can update their team name (and slug)', async () => {
|
|
await teamAccounts.setup();
|
|
|
|
const { teamName, slug } = teamAccounts.createTeamName();
|
|
|
|
await teamAccounts.goToSettings();
|
|
await teamAccounts.updateName(teamName, slug);
|
|
|
|
// the slug should be updated to match the new team name
|
|
await page.waitForURL(`http://localhost:3000/home/${slug}/settings`);
|
|
|
|
await teamAccounts.openAccountsSelector();
|
|
|
|
await expect(teamAccounts.getTeamFromSelector(teamName)).toBeVisible();
|
|
});
|
|
});
|
|
|
|
test.describe('Account Deletion', () => {
|
|
test('user can delete their team account', async ({ page }) => {
|
|
const teamAccounts = new TeamAccountsPageObject(page);
|
|
const params = teamAccounts.createTeamName();
|
|
|
|
await teamAccounts.setup(params);
|
|
await teamAccounts.goToSettings();
|
|
|
|
await teamAccounts.deleteAccount(params.teamName);
|
|
await teamAccounts.openAccountsSelector();
|
|
|
|
await expect(
|
|
teamAccounts.getTeamFromSelector(params.teamName),
|
|
).not.toBeVisible();
|
|
});
|
|
});
|