upgrade playwright dependencies, screenshots and tests (#29466)

Этот коммит содержится в:
Saturnino Abril
2024-12-04 19:52:18 +08:00
коммит произвёл GitHub
родитель 43d589be79
Коммит 90c0235c4b
37 изменённых файлов: 1333 добавлений и 1260 удалений

Просмотреть файл

@@ -60,7 +60,7 @@ test('MM-T5435_1 Global Drafts link in sidebar should be hidden when another use
try {
await adminClient.deletePost(adminPost.id);
} catch (error) {
throw new Error('Failed to delete post by admin');
throw new Error(`Failed to delete post by admin: ${error}`);
}
// # Open the last post in the channel sent by admin again

Просмотреть файл

@@ -17,16 +17,42 @@ test('Search box suggestion must be case insensitive', async ({pw, pages}) => {
// # Open the search UI
await channelsPage.globalHeader.openSearch();
const searchInput = await page.getByPlaceholder('Search messages');
const searchWord = 'off';
const searchOutput = 'In:off-topic';
const channelName = 'Off-Topic';
// * it's working when using lowercase
await searchInput.fill('In:off');
await searchInput.press('Enter');
await expect(searchInput).toHaveValue('In:off-topic ');
// Should work as expected when using lowercase
// # Type in lowercase "off" to search for the "Off-Topic" channel
const {searchInput} = await channelsPage.searchPopover;
await searchInput.pressSequentially(`In:${searchWord}`);
// * it's working when using uppercase
await searchInput.clear();
await searchInput.fill('In:Off');
// * The suggestion should be visible
await expect(channelsPage.searchPopover.selectedSuggestion).toBeVisible();
await expect(channelsPage.searchPopover.selectedSuggestion).toHaveText(channelName);
// # Press Enter to select the suggestion and another Enter to search
await searchInput.press('Enter');
await expect(searchInput).toHaveValue('In:off-topic ');
await searchInput.press('Enter');
// * The search box should contain the selected suggestion
await expect(channelsPage.globalHeader.searchBox.getByText(searchOutput, {exact: true})).toBeVisible();
// Should work as expected when using uppercase
// # Close then open the search UI
await channelsPage.globalHeader.closeSearch();
await channelsPage.globalHeader.openSearch();
// # Type in uppercase "OFF" to search for the "Off-Topic" channel
await searchInput.pressSequentially(`In:${searchWord.toUpperCase()}`);
// * The suggestion should be visible
await expect(channelsPage.searchPopover.selectedSuggestion).toBeVisible();
await expect(channelsPage.searchPopover.selectedSuggestion).toHaveText(channelName);
// # Press Enter to select the suggestion and another Enter to search
await searchInput.press('Enter');
await searchInput.press('Enter');
// * The search box should contain the selected suggestion
await expect(channelsPage.globalHeader.searchBox.getByText(searchOutput, {exact: true})).toBeVisible();
});

Просмотреть файл

@@ -8,15 +8,8 @@ async function interceptConfigWithLandingPage(page: Page, enabled: boolean) {
route.fulfill({
status: 200,
body: JSON.stringify({
EmailLoginButtonBorderColor: '#2389D7',
EmailLoginButtonColor: '#0000',
EmailLoginButtonTextColor: '#2389D7',
EnableDesktopLandingPage: enabled,
EnableSignInWithEmail: 'true',
EnableSignInWithUsername: 'true',
EnableSignUpWithEmail: 'true',
SiteName: 'Mattermost',
SiteURL: 'http://localhost:8065',
}),
headers: {'Content-Type': 'application/json'},
});
@@ -29,7 +22,7 @@ test('MM-T5640_1 should not see landing page ', async ({pw, pages, page}) => {
await interceptConfigWithLandingPage(page, false);
// Navigate to your starting URL
await page.goto('http://localhost:8065');
await page.goto('/');
// Wait until the URL contains '/login'
await page.waitForURL(/.*\/login.*/);
@@ -44,11 +37,11 @@ test('MM-T5640_1 should not see landing page ', async ({pw, pages, page}) => {
test('MM-T5640_2 should see landing page', async ({pages, isMobile, page}) => {
// Navigate to your starting URL
await page.goto('http://localhost:8065');
await page.goto('/');
await page.evaluate(() => localStorage.clear());
await page.goto('http://localhost:8065');
await page.goto('/');
// Wait until the URL contains '/landing'
await page.waitForURL(/.*\/landing.*/);

Просмотреть файл

@@ -7,6 +7,7 @@ test('/login', async ({pw, pages, page, browserName, viewport}, testInfo) => {
// Go to login page
const {adminClient} = await pw.getAdminClient();
const adminConfig = await adminClient.getConfig();
const license = await adminClient.getClientLicenseOld();
const loginPage = new pages.LoginPage(page, adminConfig);
await loginPage.goto();
await loginPage.toBeVisible();
@@ -16,7 +17,8 @@ test('/login', async ({pw, pages, page, browserName, viewport}, testInfo) => {
// Match snapshot of login page
const testArgs = {page, browserName, viewport};
await pw.matchSnapshot(testInfo, testArgs);
const editionSuffix = license.IsLicensed === 'true' ? '' : 'free edition';
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} ${editionSuffix}`}, testArgs);
// Click sign in button without entering user credential
await loginPage.signInButton.click();
@@ -24,5 +26,5 @@ test('/login', async ({pw, pages, page, browserName, viewport}, testInfo) => {
await pw.waitForAnimationEnd(loginPage.bodyCard);
// Match snapshot of login page with error
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} error`}, testArgs);
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} error ${editionSuffix}`}, testArgs);
});

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 138 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 275 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 125 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 139 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 280 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 120 KiB

Просмотреть файл

@@ -7,6 +7,7 @@ test('/signup_email', async ({pw, pages, page, browserName, viewport}, testInfo)
// Go to login page
const {adminClient} = await pw.getAdminClient();
const adminConfig = await adminClient.getConfig();
const license = await adminClient.getClientLicenseOld();
const loginPage = new pages.LoginPage(page, adminConfig);
await loginPage.goto();
await loginPage.toBeVisible();
@@ -23,7 +24,8 @@ test('/signup_email', async ({pw, pages, page, browserName, viewport}, testInfo)
// Match snapshot of signup_email page
const testArgs = {page, browserName, viewport};
await pw.matchSnapshot(testInfo, testArgs);
const editionSuffix = license.IsLicensed === 'true' ? '' : 'free edition';
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} ${editionSuffix}`}, testArgs);
// Click sign in button without entering user credential
const invalidUser = {email: 'invalid', username: 'a', password: 'b'};
@@ -34,5 +36,5 @@ test('/signup_email', async ({pw, pages, page, browserName, viewport}, testInfo)
await pw.waitForAnimationEnd(signupPage.bodyCard);
// Match snapshot of signup_email page
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} error`}, testArgs);
await pw.matchSnapshot({...testInfo, title: `${testInfo.title} error ${editionSuffix}`}, testArgs);
});

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 159 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 301 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 161 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 153 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 296 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 155 KiB