This commit adds e2e testing for the user invitation process in the app. It introduces data-test attributes to key components in the invitation flow, assisting in test case creation. Newly created tests validate user invitation functionality including form filling, role selection, and submission.
35 lines
825 B
TypeScript
35 lines
825 B
TypeScript
import { Page, test } from '@playwright/test';
|
|
import { InvitationsPageObject } from './invitations.po';
|
|
|
|
test.describe('Invitations', () => {
|
|
let page: Page;
|
|
let invitations: InvitationsPageObject;
|
|
|
|
test.beforeAll(async ({ browser }) => {
|
|
page = await browser.newPage();
|
|
invitations = new InvitationsPageObject(page);
|
|
|
|
await invitations.setup();
|
|
});
|
|
|
|
test('user invite users', async ({page}) => {
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
await invitations.navigateToMembers();
|
|
await invitations.openInviteForm();
|
|
|
|
const invites = [
|
|
{
|
|
email: invitations.auth.createRandomEmail(),
|
|
role: 'member'
|
|
},
|
|
{
|
|
email: invitations.auth.createRandomEmail(),
|
|
role: 'member'
|
|
},
|
|
];
|
|
|
|
await invitations.inviteMembers(invites);
|
|
});
|
|
});
|