MM-64282 E2E/Playwright: Test documentation format (#31050)
* initial implementation of test documentation in spec file with AI-assisted prompt from Claude and linter script * update snapshots --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -3,38 +3,49 @@
|
||||
|
||||
import {test} from '@mattermost/playwright-lib';
|
||||
|
||||
test('/signup_email', async ({pw, page, browserName, viewport}, testInfo) => {
|
||||
// Set up the page not to redirect to the landing page
|
||||
await pw.hasSeenLandingPage();
|
||||
/**
|
||||
* @objective Verify the appearance of the signup email page in normal and error states
|
||||
*/
|
||||
test(
|
||||
'signup_email visual verification',
|
||||
{tag: '@visual_signup'},
|
||||
async ({pw, page, browserName, viewport}, testInfo) => {
|
||||
// # Set up the page not to redirect to the landing page
|
||||
await pw.hasSeenLandingPage();
|
||||
|
||||
// Go to login page
|
||||
const {adminClient} = await pw.getAdminClient();
|
||||
await pw.loginPage.goto();
|
||||
await pw.loginPage.toBeVisible();
|
||||
// # Navigate to login page
|
||||
const {adminClient} = await pw.getAdminClient();
|
||||
await pw.loginPage.goto();
|
||||
await pw.loginPage.toBeVisible();
|
||||
|
||||
// Create an account
|
||||
await pw.loginPage.createAccountLink.click();
|
||||
// # Click on create account link
|
||||
await pw.loginPage.createAccountLink.click();
|
||||
|
||||
// Should have redirected to signup page
|
||||
await pw.signupPage.toBeVisible();
|
||||
// * Verify redirection to signup page
|
||||
await pw.signupPage.toBeVisible();
|
||||
|
||||
// Click to other element to remove focus from email input
|
||||
await pw.signupPage.title.click();
|
||||
// # Remove focus from email input by clicking elsewhere
|
||||
await pw.signupPage.title.click();
|
||||
|
||||
// Match snapshot of signup_email page
|
||||
const testArgs = {page, browserName, viewport};
|
||||
const license = await adminClient.getClientLicenseOld();
|
||||
const editionSuffix = license.IsLicensed === 'true' ? '' : 'free edition';
|
||||
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} ${editionSuffix}`}, testArgs);
|
||||
// # Get license information to determine snapshot suffix
|
||||
const license = await adminClient.getClientLicenseOld();
|
||||
const editionSuffix = license.IsLicensed === 'true' ? '' : 'free edition';
|
||||
const testArgs = {page, browserName, viewport};
|
||||
|
||||
// Click sign in button without entering user credential
|
||||
const invalidUser = {email: 'invalid', username: 'a', password: 'b'};
|
||||
await pw.signupPage.create(invalidUser, false);
|
||||
await pw.signupPage.emailError.waitFor();
|
||||
await pw.signupPage.usernameError.waitFor();
|
||||
await pw.signupPage.passwordError.waitFor();
|
||||
await pw.waitForAnimationEnd(pw.signupPage.bodyCard);
|
||||
// * Verify visual appearance of signup page
|
||||
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} ${editionSuffix}`}, testArgs);
|
||||
|
||||
// Match snapshot of signup_email page
|
||||
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} error ${editionSuffix}`}, testArgs);
|
||||
});
|
||||
// # Attempt to create account with invalid credentials
|
||||
const invalidUser = {email: 'invalid', username: 'a', password: 'b'};
|
||||
await pw.signupPage.create(invalidUser, false);
|
||||
|
||||
// * Verify error messages appear for each field
|
||||
await pw.signupPage.emailError.waitFor();
|
||||
await pw.signupPage.usernameError.waitFor();
|
||||
await pw.signupPage.passwordError.waitFor();
|
||||
await pw.waitForAnimationEnd(pw.signupPage.bodyCard);
|
||||
|
||||
// * Verify visual appearance of signup page with errors
|
||||
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} error ${editionSuffix}`}, testArgs);
|
||||
},
|
||||
);
|
||||
|
||||
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 209 KiB |
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 211 KiB |
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 508 KiB |
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 170 KiB |
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 507 KiB |
Двоичный файл не отображается.
|
После Ширина: | Высота: | Размер: 167 KiB |
Ссылка в новой задаче
Block a user