follow up to MM-61126 desktop landing page (#28888)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
99a95508d2
Коммит
c7aec8c5c5
@@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
playwright-report
|
||||
test-results
|
||||
results
|
||||
|
||||
@@ -3,3 +3,5 @@ package.json
|
||||
package-lock.json
|
||||
playwright-report
|
||||
storage_state
|
||||
test-results
|
||||
results
|
||||
|
||||
@@ -81,7 +81,7 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
|
||||
};
|
||||
|
||||
// Should be based only from the generated default config from ./server via "make config-reset"
|
||||
// Based on v10.0 server
|
||||
// Based on v10.2 server
|
||||
const defaultServerConfig: AdminConfig = {
|
||||
ServiceSettings: {
|
||||
SiteURL: '',
|
||||
@@ -167,6 +167,7 @@ const defaultServerConfig: AdminConfig = {
|
||||
EnableAPITriggerAdminNotifications: false,
|
||||
EnableAPIUserDeletion: false,
|
||||
EnableAPIPostDeletion: false,
|
||||
EnableDesktopLandingPage: true,
|
||||
ExperimentalEnableHardenedMode: false,
|
||||
ExperimentalStrictCSRFEnforcement: false,
|
||||
EnableEmailInvitations: false,
|
||||
@@ -548,12 +549,14 @@ const defaultServerConfig: AdminConfig = {
|
||||
AppDownloadLink: 'https://mattermost.com/pl/download-apps',
|
||||
AndroidAppDownloadLink: 'https://mattermost.com/pl/android-app/',
|
||||
IosAppDownloadLink: 'https://mattermost.com/pl/ios-app/',
|
||||
MobileExternalBrowser: false,
|
||||
},
|
||||
CacheSettings: {
|
||||
CacheType: 'lru',
|
||||
RedisAddress: '',
|
||||
RedisPassword: '',
|
||||
RedisDB: -1,
|
||||
DisableClientCache: false,
|
||||
},
|
||||
ClusterSettings: {
|
||||
Enable: false,
|
||||
@@ -731,7 +734,7 @@ const defaultServerConfig: AdminConfig = {
|
||||
ConsumePostHook: false,
|
||||
CloudAnnualRenewals: false,
|
||||
CloudDedicatedExportUI: false,
|
||||
ChannelBookmarks: false,
|
||||
ChannelBookmarks: true,
|
||||
WebSocketEventScope: true,
|
||||
NotificationMonitoring: true,
|
||||
ExperimentalAuditSettingsSystemConsoleUI: false,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {test, expect, chromium, Page} from '@playwright/test';
|
||||
import {Page} from '@playwright/test';
|
||||
import {expect, test} from '@e2e-support/test_fixture';
|
||||
|
||||
// Helper function to intercept API request and modify the response
|
||||
async function interceptConfigWithLandingPage(page: Page, enabled: boolean) {
|
||||
@@ -22,10 +23,9 @@ async function interceptConfigWithLandingPage(page: Page, enabled: boolean) {
|
||||
});
|
||||
}
|
||||
|
||||
test('MM-T5640_1 should not see landing page ', async () => {
|
||||
const browser = await chromium.launch();
|
||||
const context = await browser.newContext();
|
||||
const page = await context.newPage();
|
||||
test('MM-T5640_1 should not see landing page ', async ({pw, pages, page}) => {
|
||||
const {adminClient} = await pw.getAdminClient();
|
||||
const adminConfig = await adminClient.getConfig();
|
||||
await interceptConfigWithLandingPage(page, false);
|
||||
|
||||
// Navigate to your starting URL
|
||||
@@ -37,19 +37,12 @@ test('MM-T5640_1 should not see landing page ', async () => {
|
||||
// At this point, the URL should contain '/login'
|
||||
expect(page.url()).toContain('/login');
|
||||
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
|
||||
page.locator('#saveSetting').waitFor();
|
||||
const loginButton = page.locator('#saveSetting');
|
||||
await expect(loginButton).toHaveText('Log in');
|
||||
// Verify the login page is visible
|
||||
const loginPage = new pages.LoginPage(page, adminConfig);
|
||||
await loginPage.toBeVisible();
|
||||
});
|
||||
|
||||
test('MM-T5640_2 should see landing page', async () => {
|
||||
const browser = await chromium.launch();
|
||||
const context = await browser.newContext();
|
||||
const page = await context.newPage();
|
||||
|
||||
test('MM-T5640_2 should see landing page', async ({pages, isMobile, page}) => {
|
||||
// Navigate to your starting URL
|
||||
await page.goto('http://localhost:8065');
|
||||
|
||||
@@ -63,13 +56,7 @@ test('MM-T5640_2 should see landing page', async () => {
|
||||
// At this point, the URL should contain '/landing'
|
||||
expect(page.url()).toContain('/landing');
|
||||
|
||||
// Check the user agent
|
||||
const userAgent = await page.evaluate(() => navigator.userAgent);
|
||||
|
||||
const viewInAppButton = page.locator('a.btn-primary');
|
||||
await expect(viewInAppButton).toBeVisible();
|
||||
await expect(viewInAppButton).toHaveText(userAgent.includes('iPad') ? 'View in App' : 'View in Desktop App');
|
||||
|
||||
const viewInBrowser = page.locator('a.btn-tertiary');
|
||||
await expect(viewInBrowser).toHaveText('View in Browser');
|
||||
// Verify the landing page is visible
|
||||
const landingLoginPage = new pages.LandingLoginPage(page, isMobile);
|
||||
await landingLoginPage.toBeVisible();
|
||||
});
|
||||
|
||||
@@ -396,6 +396,7 @@ export type ServiceSettings = {
|
||||
RefreshPostStatsRunTime: string;
|
||||
MaximumPayloadSizeBytes: number;
|
||||
EnableAPIPostDeletion: boolean;
|
||||
EnableDesktopLandingPage: boolean;
|
||||
MaximumURLLength: number;
|
||||
};
|
||||
|
||||
@@ -760,6 +761,7 @@ export type NativeAppSettings = {
|
||||
AppDownloadLink: string;
|
||||
AndroidAppDownloadLink: string;
|
||||
IosAppDownloadLink: string;
|
||||
MobileExternalBrowser: boolean;
|
||||
};
|
||||
|
||||
export type ClusterSettings = {
|
||||
@@ -808,6 +810,7 @@ export type CacheSettings = {
|
||||
RedisAddress: string;
|
||||
RedisPassword: string;
|
||||
RedisDB: number;
|
||||
DisableClientCache: boolean;
|
||||
};
|
||||
|
||||
export type ElasticsearchSettings = {
|
||||
|
||||
Ссылка в новой задаче
Block a user