Multiple updates are made to refine the account management features, including updating the 'Your Teams' text to show the number of teams, and modifying the form data validation process in the 'deletePersonalAccountAction' service. Additionally, improvements have been made in test configurations including updating the test timeout settings, taking screenshots when a test fails, and adjusting the location for saving Playwright reports.
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import { expect, Page, 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);
|
|
|
|
await teamAccounts.setup();
|
|
});
|
|
|
|
test('user can update their team name (and slug)', async () => {
|
|
const {teamName, slug} = teamAccounts.createTeamName();
|
|
|
|
await teamAccounts.goToSettings();
|
|
await teamAccounts.updateName(teamName);
|
|
|
|
// the slug should be updated to match the new team name
|
|
await page.waitForURL(`http://localhost:3000/home/${slug}/settings`);
|
|
|
|
await expect(await teamAccounts.getTeamFromSelector(slug)).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 page.waitForURL('http://localhost:3000/home', {
|
|
timeout: 5000,
|
|
});
|
|
|
|
expect(page.url()).toEqual('http://localhost:3000/home');
|
|
|
|
await expect(await teamAccounts.getTeamFromSelector(params.slug)).not.toBeVisible();
|
|
});
|
|
}); |