@mattermost/playwright-lib 10.7.0-0 → 10.7.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser_context.js +14 -21
- package/dist/constant.js +3 -6
- package/dist/file.js +20 -20
- package/dist/flag.d.ts +2 -0
- package/dist/flag.js +49 -38
- package/dist/flag.js.map +1 -1
- package/dist/global_setup.js +14 -49
- package/dist/global_setup.js.map +1 -1
- package/dist/index.js +9 -42
- package/dist/mock_browser_api.js +2 -8
- package/dist/server/channel.js +3 -9
- package/dist/server/client.js +10 -16
- package/dist/server/default_config.js +9 -15
- package/dist/server/init.js +29 -36
- package/dist/server/plugins.d.ts +1 -1
- package/dist/server/plugins.js +13 -14
- package/dist/server/plugins.js.map +1 -1
- package/dist/server/post.js +3 -9
- package/dist/server/team.js +3 -9
- package/dist/server/user.js +8 -15
- package/dist/test_action.js +3 -14
- package/dist/test_config.js +4 -30
- package/dist/test_fixture.d.ts +2 -1
- package/dist/test_fixture.js +50 -68
- package/dist/test_fixture.js.map +1 -1
- package/dist/ui/components/channels/app_bar.js +3 -9
- package/dist/ui/components/channels/center_view.js +22 -28
- package/dist/ui/components/channels/delete_post_confirmation_dialog.js +8 -14
- package/dist/ui/components/channels/delete_post_modal.js +4 -10
- package/dist/ui/components/channels/emoji_gif_picker.js +9 -15
- package/dist/ui/components/channels/find_channels_modal.js +3 -9
- package/dist/ui/components/channels/generic_confirm_modal.js +5 -11
- package/dist/ui/components/channels/header.js +3 -9
- package/dist/ui/components/channels/message_priority.js +14 -20
- package/dist/ui/components/channels/post.js +10 -16
- package/dist/ui/components/channels/post_create.js +23 -29
- package/dist/ui/components/channels/post_dot_menu.js +3 -9
- package/dist/ui/components/channels/post_edit.js +16 -22
- package/dist/ui/components/channels/post_menu.js +3 -9
- package/dist/ui/components/channels/post_reminder_menu.js +3 -9
- package/dist/ui/components/channels/restore_post_confirmation_dialog.js +6 -12
- package/dist/ui/components/channels/scheduled_draft_menu.js +3 -9
- package/dist/ui/components/channels/scheduled_draft_modal.js +4 -10
- package/dist/ui/components/channels/search_popover.js +3 -9
- package/dist/ui/components/channels/settings/notification_settings.js +8 -14
- package/dist/ui/components/channels/settings/settings_modal.js +7 -13
- package/dist/ui/components/channels/sidebar_left.js +8 -14
- package/dist/ui/components/channels/sidebar_right.js +20 -26
- package/dist/ui/components/channels/thread_footer.js +3 -9
- package/dist/ui/components/channels/user_profile_popover.js +3 -9
- package/dist/ui/components/footer.js +3 -9
- package/dist/ui/components/global_header.js +7 -13
- package/dist/ui/components/index.js +72 -74
- package/dist/ui/components/main_header.js +3 -9
- package/dist/ui/components/system_console/navbar.js +3 -9
- package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.js +4 -10
- package/dist/ui/components/system_console/sections/system_users/feature_discovery.js +4 -10
- package/dist/ui/components/system_console/sections/system_users/filter_menu.js +3 -9
- package/dist/ui/components/system_console/sections/system_users/filter_popover.js +8 -14
- package/dist/ui/components/system_console/sections/system_users/mobile_security.js +3 -9
- package/dist/ui/components/system_console/sections/system_users/system_users.js +10 -16
- package/dist/ui/components/system_console/sidebar.js +4 -10
- package/dist/ui/pages/channels.js +18 -24
- package/dist/ui/pages/drafts.js +17 -23
- package/dist/ui/pages/index.js +17 -30
- package/dist/ui/pages/landing_login.js +5 -11
- package/dist/ui/pages/login.js +8 -14
- package/dist/ui/pages/reset_password.js +9 -15
- package/dist/ui/pages/scheduled_draft.js +19 -25
- package/dist/ui/pages/signup.js +11 -17
- package/dist/ui/pages/system_console.js +16 -22
- package/dist/util.js +8 -19
- package/dist/visual/index.js +14 -20
- package/dist/visual/percy.js +4 -10
- package/package.json +1 -1
package/dist/test_fixture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_fixture.js","sources":["../src/test_fixture.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Browser, Page, test as base} from '@playwright/test';\nimport {AxeResults} from 'axe-core';\nimport {AxeBuilder} from '@axe-core/playwright';\n\nimport {TestBrowser} from './browser_context';\nimport {\n ensureLicense,\n shouldHaveCallsEnabled,\n shouldHaveFeatureFlag,\n shouldRunInLinux,\n skipIfFeatureFlagNotSet,\n skipIfNoLicense,\n} from './flag';\nimport {getBlobFromAsset, getFileFromAsset} from './file';\nimport {\n createRandomChannel,\n createRandomPost,\n createRandomTeam,\n createRandomUser,\n ensurePluginsLoaded,\n getAdminClient,\n initSetup,\n} from './server';\nimport {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';\nimport {pages} from './ui/pages';\nimport {matchSnapshot} from './visual';\nimport {stubNotification, waitForNotification} from './mock_browser_api';\nimport {duration, getRandomId, simpleEmailRe, wait} from './util';\n\nexport {expect} from '@playwright/test';\n\nexport type ExtendedFixtures = {\n axe: AxeBuilderExtended;\n pw: PlaywrightExtended;\n};\n\ntype AxeBuilderOptions = {\n disableColorContrast?: boolean;\n disableLinkInTextBlock?: boolean;\n};\n\nexport const test = base.extend<ExtendedFixtures>({\n // eslint-disable-next-line no-empty-pattern\n axe: async ({}, use) => {\n const ab = new AxeBuilderExtended();\n await use(ab);\n },\n pw: async ({browser, page, isMobile}, use) => {\n const pw = new PlaywrightExtended(browser, page, isMobile);\n await use(pw);\n await pw.testBrowser.close();\n },\n});\n\nexport class PlaywrightExtended {\n // ./browser_context\n readonly testBrowser;\n\n // ./flag\n readonly shouldHaveCallsEnabled;\n readonly shouldHaveFeatureFlag;\n readonly shouldRunInLinux;\n readonly ensureLicense;\n readonly skipIfNoLicense;\n readonly skipIfFeatureFlagNotSet;\n\n // ./file\n readonly getBlobFromAsset;\n readonly getFileFromAsset;\n\n // ./server\n readonly ensurePluginsLoaded;\n readonly getAdminClient;\n readonly initSetup;\n\n // ./test_action\n readonly hideDynamicChannelsContent;\n readonly waitForAnimationEnd;\n readonly waitUntil;\n\n // ./mock_browser_api\n readonly stubNotification;\n readonly waitForNotification;\n\n // ./visual\n readonly matchSnapshot;\n\n // ./util\n readonly duration;\n readonly simpleEmailRe;\n readonly wait;\n\n // random\n readonly random;\n\n // unauthenticated page\n readonly loginPage;\n readonly landingLoginPage;\n readonly signupPage;\n readonly resetPasswordPage;\n\n readonly hasSeenLandingPage;\n\n constructor(browser: Browser, page: Page, isMobile: boolean) {\n // ./browser_context\n this.testBrowser = new TestBrowser(browser);\n\n // ./flag\n this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;\n this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;\n this.shouldRunInLinux = shouldRunInLinux;\n this.ensureLicense = ensureLicense;\n this.skipIfNoLicense = skipIfNoLicense;\n this.skipIfFeatureFlagNotSet = skipIfFeatureFlagNotSet;\n\n // ./file\n this.getBlobFromAsset = getBlobFromAsset;\n this.getFileFromAsset = getFileFromAsset;\n\n // ./server\n this.ensurePluginsLoaded = ensurePluginsLoaded;\n this.initSetup = initSetup;\n this.getAdminClient = getAdminClient;\n\n // ./test_action\n this.hideDynamicChannelsContent = hideDynamicChannelsContent;\n this.waitForAnimationEnd = waitForAnimationEnd;\n this.waitUntil = waitUntil;\n\n // unauthenticated page\n this.loginPage = new pages.LoginPage(page);\n this.landingLoginPage = new pages.LandingLoginPage(page, isMobile);\n this.signupPage = new pages.SignupPage(page);\n this.resetPasswordPage = new pages.ResetPasswordPage(page);\n\n // ./mock_browser_api\n this.stubNotification = stubNotification;\n this.waitForNotification = waitForNotification;\n\n // ./visual\n this.matchSnapshot = matchSnapshot;\n\n // ./util\n this.duration = duration;\n this.wait = wait;\n this.simpleEmailRe = simpleEmailRe;\n\n this.random = {\n id: getRandomId,\n channel: createRandomChannel,\n post: createRandomPost,\n team: createRandomTeam,\n user: createRandomUser,\n };\n\n this.hasSeenLandingPage = async () => {\n // Visit the base URL to be able to set the localStorage\n await page.goto('/');\n return await waitUntilLocalStorageIsSet(page, '__landingPageSeen__', 'true');\n };\n }\n}\n\nexport class AxeBuilderExtended {\n readonly builder: (page: Page, options?: AxeBuilderOptions) => AxeBuilder;\n\n // See https://github.com/dequelabs/axe-core/blob/master/doc/API.md#axe-core-tags\n readonly tags: string[] = ['wcag2a', 'wcag2aa'];\n\n constructor() {\n this.builder = (page: Page, options: AxeBuilderOptions = {}) => {\n // See https://github.com/dequelabs/axe-core/blob/master/doc/rule-descriptions.md#wcag-20-level-a--aa-rules\n const disabledRules: string[] = [];\n\n if (options.disableColorContrast) {\n // Disabled in pages due to impact to overall theme of Mattermost.\n // Option: make use of custom theme to improve color contrast.\n disabledRules.push('color-contrast');\n }\n\n if (options.disableLinkInTextBlock) {\n // Disabled in pages due to impact to overall theme of Mattermost.\n // Option: make use of custom theme to improve color contrast.\n disabledRules.push('link-in-text-block');\n }\n\n return new AxeBuilder({page}).withTags(this.tags).disableRules(disabledRules);\n };\n }\n\n violationFingerprints(accessibilityScanResults: AxeResults) {\n const fingerprints = accessibilityScanResults.violations.map((violation) => ({\n rule: violation.id,\n description: violation.description,\n helpUrl: violation.helpUrl,\n targets: violation.nodes.map((node) => {\n return {target: node.target, impact: node.impact, html: node.html};\n }),\n }));\n\n return JSON.stringify(fingerprints, null, 2);\n }\n}\n\nasync function waitUntilLocalStorageIsSet(page: Page, key: string, value: string, timeout = duration.ten_sec) {\n await waitUntil(\n () =>\n page.evaluate(\n ({key, value}) => {\n if (localStorage.getItem(key) === value) {\n return true;\n }\n localStorage.setItem(key, value);\n return false;\n },\n {key, value},\n ),\n {timeout},\n );\n}\n"],"names":["base","TestBrowser","shouldHaveCallsEnabled","shouldHaveFeatureFlag","shouldRunInLinux","ensureLicense","skipIfNoLicense","skipIfFeatureFlagNotSet","getBlobFromAsset","getFileFromAsset","ensurePluginsLoaded","initSetup","getAdminClient","hideDynamicChannelsContent","waitForAnimationEnd","waitUntil","pages","stubNotification","waitForNotification","matchSnapshot","duration","wait","simpleEmailRe","getRandomId","createRandomChannel","createRandomPost","createRandomTeam","createRandomUser","AxeBuilder"],"mappings":";;;;;;;;;;;;;;;;;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E,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAI;AAClC,gBAAA,OAAO,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAC;AACtE,aAAC,CAAC;AACL,SAAA,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;;AAEnD;AAED,eAAe,0BAA0B,CAAC,IAAU,EAAE,GAAW,EAAE,KAAa,EAAE,OAAO,GAAGR,aAAQ,CAAC,OAAO,EAAA;AACxG,IAAA,MAAML,wBAAS,CACX,MACI,IAAI,CAAC,QAAQ,CACT,CAAC,EAAC,GAAG,EAAE,KAAK,EAAC,KAAI;QACb,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE;AACrC,YAAA,OAAO,IAAI;;AAEf,QAAA,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;AAChC,QAAA,OAAO,KAAK;AAChB,KAAC,EACD,EAAC,GAAG,EAAE,KAAK,EAAC,CACf,EACL,EAAC,OAAO,EAAC,CACZ;AACL;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"test_fixture.js","sources":["../src/test_fixture.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Browser, Page, test as base} from '@playwright/test';\nimport {AxeResults} from 'axe-core';\nimport {AxeBuilder} from '@axe-core/playwright';\n\nimport {TestBrowser} from './browser_context';\nimport {\n ensureLicense,\n ensureServerDeployment,\n shouldHaveCallsEnabled,\n shouldHaveFeatureFlag,\n shouldRunInLinux,\n skipIfFeatureFlagNotSet,\n skipIfNoLicense,\n} from './flag';\nimport {getBlobFromAsset, getFileFromAsset} from './file';\nimport {\n createRandomChannel,\n createRandomPost,\n createRandomTeam,\n createRandomUser,\n ensurePluginsLoaded,\n getAdminClient,\n initSetup,\n} from './server';\nimport {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';\nimport {pages} from './ui/pages';\nimport {matchSnapshot} from './visual';\nimport {stubNotification, waitForNotification} from './mock_browser_api';\nimport {duration, getRandomId, simpleEmailRe, wait} from './util';\n\nexport {expect} from '@playwright/test';\n\nexport type ExtendedFixtures = {\n axe: AxeBuilderExtended;\n pw: PlaywrightExtended;\n};\n\ntype AxeBuilderOptions = {\n disableColorContrast?: boolean;\n disableLinkInTextBlock?: boolean;\n};\n\nexport const test = base.extend<ExtendedFixtures>({\n // eslint-disable-next-line no-empty-pattern\n axe: async ({}, use) => {\n const ab = new AxeBuilderExtended();\n await use(ab);\n },\n pw: async ({browser, page, isMobile}, use) => {\n const pw = new PlaywrightExtended(browser, page, isMobile);\n await use(pw);\n await pw.testBrowser.close();\n },\n});\n\nexport class PlaywrightExtended {\n // ./browser_context\n readonly testBrowser;\n\n // ./flag\n readonly shouldHaveCallsEnabled;\n readonly shouldHaveFeatureFlag;\n readonly shouldRunInLinux;\n readonly ensureLicense;\n readonly ensureServerDeployment;\n readonly skipIfNoLicense;\n readonly skipIfFeatureFlagNotSet;\n\n // ./file\n readonly getBlobFromAsset;\n readonly getFileFromAsset;\n\n // ./server\n readonly ensurePluginsLoaded;\n readonly getAdminClient;\n readonly initSetup;\n\n // ./test_action\n readonly hideDynamicChannelsContent;\n readonly waitForAnimationEnd;\n readonly waitUntil;\n\n // ./mock_browser_api\n readonly stubNotification;\n readonly waitForNotification;\n\n // ./visual\n readonly matchSnapshot;\n\n // ./util\n readonly duration;\n readonly simpleEmailRe;\n readonly wait;\n\n // random\n readonly random;\n\n // unauthenticated page\n readonly loginPage;\n readonly landingLoginPage;\n readonly signupPage;\n readonly resetPasswordPage;\n\n readonly hasSeenLandingPage;\n\n constructor(browser: Browser, page: Page, isMobile: boolean) {\n // ./browser_context\n this.testBrowser = new TestBrowser(browser);\n\n // ./flag\n this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;\n this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;\n this.shouldRunInLinux = shouldRunInLinux;\n this.ensureLicense = ensureLicense;\n this.ensureServerDeployment = ensureServerDeployment;\n this.skipIfNoLicense = skipIfNoLicense;\n this.skipIfFeatureFlagNotSet = skipIfFeatureFlagNotSet;\n\n // ./file\n this.getBlobFromAsset = getBlobFromAsset;\n this.getFileFromAsset = getFileFromAsset;\n\n // ./server\n this.ensurePluginsLoaded = ensurePluginsLoaded;\n this.initSetup = initSetup;\n this.getAdminClient = getAdminClient;\n\n // ./test_action\n this.hideDynamicChannelsContent = hideDynamicChannelsContent;\n this.waitForAnimationEnd = waitForAnimationEnd;\n this.waitUntil = waitUntil;\n\n // unauthenticated page\n this.loginPage = new pages.LoginPage(page);\n this.landingLoginPage = new pages.LandingLoginPage(page, isMobile);\n this.signupPage = new pages.SignupPage(page);\n this.resetPasswordPage = new pages.ResetPasswordPage(page);\n\n // ./mock_browser_api\n this.stubNotification = stubNotification;\n this.waitForNotification = waitForNotification;\n\n // ./visual\n this.matchSnapshot = matchSnapshot;\n\n // ./util\n this.duration = duration;\n this.wait = wait;\n this.simpleEmailRe = simpleEmailRe;\n\n this.random = {\n id: getRandomId,\n channel: createRandomChannel,\n post: createRandomPost,\n team: createRandomTeam,\n user: createRandomUser,\n };\n\n this.hasSeenLandingPage = async () => {\n // Visit the base URL to be able to set the localStorage\n await page.goto('/');\n return await waitUntilLocalStorageIsSet(page, '__landingPageSeen__', 'true');\n };\n }\n}\n\nexport class AxeBuilderExtended {\n readonly builder: (page: Page, options?: AxeBuilderOptions) => AxeBuilder;\n\n // See https://github.com/dequelabs/axe-core/blob/master/doc/API.md#axe-core-tags\n readonly tags: string[] = ['wcag2a', 'wcag2aa'];\n\n constructor() {\n this.builder = (page: Page, options: AxeBuilderOptions = {}) => {\n // See https://github.com/dequelabs/axe-core/blob/master/doc/rule-descriptions.md#wcag-20-level-a--aa-rules\n const disabledRules: string[] = [];\n\n if (options.disableColorContrast) {\n // Disabled in pages due to impact to overall theme of Mattermost.\n // Option: make use of custom theme to improve color contrast.\n disabledRules.push('color-contrast');\n }\n\n if (options.disableLinkInTextBlock) {\n // Disabled in pages due to impact to overall theme of Mattermost.\n // Option: make use of custom theme to improve color contrast.\n disabledRules.push('link-in-text-block');\n }\n\n return new AxeBuilder({page}).withTags(this.tags).disableRules(disabledRules);\n };\n }\n\n violationFingerprints(accessibilityScanResults: AxeResults) {\n const fingerprints = accessibilityScanResults.violations.map((violation) => ({\n rule: violation.id,\n description: violation.description,\n helpUrl: violation.helpUrl,\n targets: violation.nodes.map((node) => {\n return {target: node.target, impact: node.impact, html: node.html};\n }),\n }));\n\n return JSON.stringify(fingerprints, null, 2);\n }\n}\n\nasync function waitUntilLocalStorageIsSet(page: Page, key: string, value: string, timeout = duration.ten_sec) {\n await waitUntil(\n () =>\n page.evaluate(\n ({key, value}) => {\n if (localStorage.getItem(key) === value) {\n return true;\n }\n localStorage.setItem(key, value);\n return false;\n },\n {key, value},\n ),\n {timeout},\n );\n}\n"],"names":["base","TestBrowser","shouldHaveCallsEnabled","shouldHaveFeatureFlag","shouldRunInLinux","ensureLicense","ensureServerDeployment","skipIfNoLicense","skipIfFeatureFlagNotSet","getBlobFromAsset","getFileFromAsset","ensurePluginsLoaded","initSetup","getAdminClient","hideDynamicChannelsContent","waitForAnimationEnd","waitUntil","pages","stubNotification","waitForNotification","matchSnapshot","duration","wait","simpleEmailRe","getRandomId","createRandomChannel","createRandomPost","createRandomTeam","createRandomUser","AxeBuilder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AA4Ca,MAAA,IAAI,GAAGA,WAAI,CAAC,MAAM,CAAmB;;AAE9C,IAAA,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,KAAI;AACnB,QAAA,MAAM,EAAE,GAAG,IAAI,kBAAkB,EAAE;AACnC,QAAA,MAAM,GAAG,CAAC,EAAE,CAAC;KACh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AAI,EAAE,IAAI,CAAC,IAAI,EAAC;AACtE,aAAC,CAAC;AACL,SAAA,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;;AAEnD;AAED,eAAe,0BAA0B,CAAC,IAAU,EAAE,GAAW,EAAE,KAAa,EAAE,OAAO,GAAGR,aAAQ,CAAC,OAAO,EAAA;AACxG,IAAA,MAAML,wBAAS,CACX,MACI,IAAI,CAAC,QAAQ,CACT,CAAC,EAAC,GAAG,EAAE,KAAK,EAAC,KAAI;QACb,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE;AACrC,YAAA,OAAO,IAAI;;AAEf,QAAA,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;AAChC,QAAA,OAAO,KAAK;AAChB,KAAC,EACD,EAAC,GAAG,EAAE,KAAK,EAAC,CACf,EACL,EAAC,OAAO,EAAC,CACZ;AACL;;;;;;;;;;"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
7
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export default class ChannelsAppBar {
|
|
8
5
|
container;
|
|
9
6
|
playbooksIcon;
|
|
10
7
|
constructor(container) {
|
|
@@ -12,9 +9,6 @@ class ChannelsAppBar {
|
|
|
12
9
|
this.playbooksIcon = container.locator('#app-bar-icon-playbooks').getByRole('img');
|
|
13
10
|
}
|
|
14
11
|
async toBeVisible() {
|
|
15
|
-
await
|
|
12
|
+
await expect(this.container).toBeVisible();
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
module.exports = ChannelsAppBar;
|
|
20
|
-
//# sourceMappingURL=app_bar.js.map
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
var header = require('./header.js');
|
|
5
|
-
var post_create = require('./post_create.js');
|
|
6
|
-
var post_edit = require('./post_edit.js');
|
|
7
|
-
var post = require('./post.js');
|
|
8
|
-
var util = require('../../../util.js');
|
|
9
|
-
var asyncWaitUntil = require('async-wait-until');
|
|
10
|
-
|
|
11
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
12
2
|
// See LICENSE.txt for license information.
|
|
13
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
import ChannelsHeader from './header';
|
|
5
|
+
import ChannelsPostCreate from './post_create';
|
|
6
|
+
import ChannelsPostEdit from './post_edit';
|
|
7
|
+
import ChannelsPost from './post';
|
|
8
|
+
import { duration } from '@/util';
|
|
9
|
+
import { waitUntil } from '@/test_action';
|
|
10
|
+
export default class ChannelsCenterView {
|
|
14
11
|
container;
|
|
15
12
|
header;
|
|
16
13
|
postCreate;
|
|
@@ -26,10 +23,10 @@ class ChannelsCenterView {
|
|
|
26
23
|
constructor(container) {
|
|
27
24
|
this.container = container;
|
|
28
25
|
this.scheduledDraftChannelInfoMessageLocator = 'span:has-text("Message scheduled for")';
|
|
29
|
-
this.header = new
|
|
30
|
-
this.postCreate = new
|
|
31
|
-
this.scheduledDraftOptions = new
|
|
32
|
-
this.postEdit = new
|
|
26
|
+
this.header = new ChannelsHeader(this.container.locator('.channel-header'));
|
|
27
|
+
this.postCreate = new ChannelsPostCreate(container.getByTestId('post-create'));
|
|
28
|
+
this.scheduledDraftOptions = new ChannelsPostCreate(container.locator('#dropdown_send_post_options'));
|
|
29
|
+
this.postEdit = new ChannelsPostEdit(container.locator('.post-edit__container'));
|
|
33
30
|
this.postBoxIndicator = container.locator('div.postBoxIndicator');
|
|
34
31
|
this.scheduledDraftChannelIcon = container.locator('#create_post i.icon-draft-indicator');
|
|
35
32
|
this.scheduledDraftChannelInfoMessage = container.locator('div.ScheduledPostIndicator span');
|
|
@@ -38,7 +35,7 @@ class ChannelsCenterView {
|
|
|
38
35
|
this.editedPostIcon = (postID) => container.locator(`#postEdited_${postID}`);
|
|
39
36
|
}
|
|
40
37
|
async toBeVisible() {
|
|
41
|
-
await
|
|
38
|
+
await expect(this.container).toBeVisible();
|
|
42
39
|
await this.postCreate.toBeVisible();
|
|
43
40
|
}
|
|
44
41
|
/**
|
|
@@ -54,7 +51,7 @@ class ChannelsCenterView {
|
|
|
54
51
|
async getFirstPost() {
|
|
55
52
|
const firstPost = this.container.getByTestId('postView').first();
|
|
56
53
|
await firstPost.waitFor();
|
|
57
|
-
return new
|
|
54
|
+
return new ChannelsPost(firstPost);
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* Return the last post in the Center
|
|
@@ -62,7 +59,7 @@ class ChannelsCenterView {
|
|
|
62
59
|
async getLastPost() {
|
|
63
60
|
const lastPost = this.container.getByTestId('postView').last();
|
|
64
61
|
await lastPost.waitFor();
|
|
65
|
-
return new
|
|
62
|
+
return new ChannelsPost(lastPost);
|
|
66
63
|
}
|
|
67
64
|
/**
|
|
68
65
|
* Return the ID of the last post in the Center
|
|
@@ -82,7 +79,7 @@ class ChannelsCenterView {
|
|
|
82
79
|
async getNthPost(index) {
|
|
83
80
|
const nthPost = this.container.getByTestId('postView').nth(index);
|
|
84
81
|
await nthPost.waitFor();
|
|
85
|
-
return new
|
|
82
|
+
return new ChannelsPost(nthPost);
|
|
86
83
|
}
|
|
87
84
|
/**
|
|
88
85
|
* Returns the Center post by post's id
|
|
@@ -91,17 +88,17 @@ class ChannelsCenterView {
|
|
|
91
88
|
async getPostById(id) {
|
|
92
89
|
const postById = this.container.locator(`[id="post_${id}"]`);
|
|
93
90
|
await postById.waitFor();
|
|
94
|
-
return new
|
|
91
|
+
return new ChannelsPost(postById);
|
|
95
92
|
}
|
|
96
|
-
async waitUntilLastPostContains(text, timeout =
|
|
97
|
-
await
|
|
93
|
+
async waitUntilLastPostContains(text, timeout = duration.ten_sec) {
|
|
94
|
+
await waitUntil(async () => {
|
|
98
95
|
const post = await this.getLastPost();
|
|
99
96
|
const content = await post.container.textContent();
|
|
100
97
|
return content?.includes(text);
|
|
101
98
|
}, { timeout });
|
|
102
99
|
}
|
|
103
|
-
async waitUntilPostWithIdContains(id, text, timeout =
|
|
104
|
-
await
|
|
100
|
+
async waitUntilPostWithIdContains(id, text, timeout = duration.ten_sec) {
|
|
101
|
+
await waitUntil(async () => {
|
|
105
102
|
const post = await this.getPostById(id);
|
|
106
103
|
const content = await post.container.textContent();
|
|
107
104
|
return content?.includes(text);
|
|
@@ -111,7 +108,7 @@ class ChannelsCenterView {
|
|
|
111
108
|
await this.postBoxIndicator.isVisible();
|
|
112
109
|
await this.scheduledDraftChannelIcon.isVisible();
|
|
113
110
|
const messageLocator = this.scheduledDraftChannelInfoMessage.first();
|
|
114
|
-
await
|
|
111
|
+
await expect(messageLocator).toContainText('Message scheduled for');
|
|
115
112
|
}
|
|
116
113
|
async clickOnLastEditedPost(postID) {
|
|
117
114
|
if (postID) {
|
|
@@ -119,6 +116,3 @@ class ChannelsCenterView {
|
|
|
119
116
|
}
|
|
120
117
|
}
|
|
121
118
|
}
|
|
122
|
-
|
|
123
|
-
module.exports = ChannelsCenterView;
|
|
124
|
-
//# sourceMappingURL=center_view.js.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
7
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export default class DeletePostConfirmationDialog {
|
|
8
5
|
container;
|
|
9
6
|
cancelButton;
|
|
10
7
|
confirmButton;
|
|
@@ -14,14 +11,14 @@ class DeletePostConfirmationDialog {
|
|
|
14
11
|
this.confirmButton = container.locator('button#deletePostModalButton');
|
|
15
12
|
}
|
|
16
13
|
async toBeVisible() {
|
|
17
|
-
await
|
|
18
|
-
await
|
|
19
|
-
await
|
|
14
|
+
await expect(this.container).toBeVisible();
|
|
15
|
+
await expect(this.cancelButton).toBeVisible();
|
|
16
|
+
await expect(this.confirmButton).toBeVisible();
|
|
20
17
|
}
|
|
21
18
|
async notToBeVisible() {
|
|
22
|
-
await
|
|
23
|
-
await
|
|
24
|
-
await
|
|
19
|
+
await expect(this.container).not.toBeVisible();
|
|
20
|
+
await expect(this.cancelButton).not.toBeVisible();
|
|
21
|
+
await expect(this.confirmButton).not.toBeVisible();
|
|
25
22
|
}
|
|
26
23
|
async cancelDeletion() {
|
|
27
24
|
await this.cancelButton.click();
|
|
@@ -30,6 +27,3 @@ class DeletePostConfirmationDialog {
|
|
|
30
27
|
await this.confirmButton.click();
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
module.exports = DeletePostConfirmationDialog;
|
|
35
|
-
//# sourceMappingURL=delete_post_confirmation_dialog.js.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
7
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export default class DeletePostModal {
|
|
8
5
|
container;
|
|
9
6
|
confirmButton;
|
|
10
7
|
constructor(container) {
|
|
@@ -12,15 +9,12 @@ class DeletePostModal {
|
|
|
12
9
|
this.confirmButton = container.locator('#deletePostModalButton');
|
|
13
10
|
}
|
|
14
11
|
async toBeVisible() {
|
|
15
|
-
await
|
|
12
|
+
await expect(this.container).toBeVisible();
|
|
16
13
|
}
|
|
17
14
|
async confirm() {
|
|
18
15
|
await this.confirmButton.waitFor();
|
|
19
16
|
await this.confirmButton.click();
|
|
20
17
|
// Wait for the modal to disappear
|
|
21
|
-
await
|
|
18
|
+
await expect(this.container).not.toBeVisible();
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
module.exports = DeletePostModal;
|
|
26
|
-
//# sourceMappingURL=delete_post_modal.js.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
7
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export default class EmojiGifPicker {
|
|
8
5
|
container;
|
|
9
6
|
gifTab;
|
|
10
7
|
gifSearchInput;
|
|
@@ -16,23 +13,23 @@ class EmojiGifPicker {
|
|
|
16
13
|
this.gifPickerItems = container.locator('.gif-picker__items');
|
|
17
14
|
}
|
|
18
15
|
async toBeVisible() {
|
|
19
|
-
await
|
|
16
|
+
await expect(this.container).toBeVisible();
|
|
20
17
|
}
|
|
21
18
|
async openGifTab() {
|
|
22
|
-
await
|
|
19
|
+
await expect(this.gifTab).toBeVisible();
|
|
23
20
|
await this.gifTab.click({ force: true });
|
|
24
|
-
await
|
|
25
|
-
await
|
|
21
|
+
await expect(this.gifSearchInput).toBeVisible();
|
|
22
|
+
await expect(this.gifPickerItems).toBeVisible();
|
|
26
23
|
}
|
|
27
24
|
async searchGif(name) {
|
|
28
25
|
await this.gifSearchInput.fill(name);
|
|
29
|
-
await
|
|
26
|
+
await expect(this.gifSearchInput).toHaveValue(name);
|
|
30
27
|
}
|
|
31
28
|
async getNthGif(n) {
|
|
32
|
-
await
|
|
29
|
+
await expect(this.gifPickerItems).toBeVisible();
|
|
33
30
|
await this.gifPickerItems.locator('img').nth(n).waitFor();
|
|
34
31
|
const nthGif = this.gifPickerItems.locator('img').nth(n);
|
|
35
|
-
await
|
|
32
|
+
await expect(nthGif).toBeVisible();
|
|
36
33
|
const nthGifSrc = await nthGif.getAttribute('src');
|
|
37
34
|
const nthGifAlt = await nthGif.getAttribute('alt');
|
|
38
35
|
if (!nthGifSrc || !nthGifAlt) {
|
|
@@ -45,6 +42,3 @@ class EmojiGifPicker {
|
|
|
45
42
|
};
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
|
-
|
|
49
|
-
module.exports = EmojiGifPicker;
|
|
50
|
-
//# sourceMappingURL=emoji_gif_picker.js.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
7
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export default class FindChannelsModal {
|
|
8
5
|
container;
|
|
9
6
|
input;
|
|
10
7
|
searchList;
|
|
@@ -14,9 +11,6 @@ class FindChannelsModal {
|
|
|
14
11
|
this.searchList = container.locator('.suggestion-list__item');
|
|
15
12
|
}
|
|
16
13
|
async toBeVisible() {
|
|
17
|
-
await
|
|
14
|
+
await expect(this.container).toBeVisible();
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
|
-
|
|
21
|
-
module.exports = FindChannelsModal;
|
|
22
|
-
//# sourceMappingURL=find_channels_modal.js.map
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
7
4
|
/**
|
|
8
5
|
* This is the generic confirm modal that is used in the app.
|
|
9
6
|
* It has optional cancel button, optional checkbox and confirm button along with title and message body.
|
|
10
7
|
* It can present in different parts of the app such as channel, system console, etc and hence its constructor
|
|
11
8
|
* should be able to accept the page object of the app and an optional id to uniquely identify the modal.
|
|
12
9
|
*/
|
|
13
|
-
class GenericConfirmModal {
|
|
10
|
+
export default class GenericConfirmModal {
|
|
14
11
|
container;
|
|
15
12
|
confirmButton;
|
|
16
13
|
cancelButton;
|
|
@@ -20,21 +17,18 @@ class GenericConfirmModal {
|
|
|
20
17
|
this.cancelButton = container.locator('#cancelModalButton');
|
|
21
18
|
}
|
|
22
19
|
async toBeVisible() {
|
|
23
|
-
await
|
|
20
|
+
await expect(this.container).toBeVisible();
|
|
24
21
|
}
|
|
25
22
|
async confirm() {
|
|
26
23
|
await this.confirmButton.waitFor();
|
|
27
24
|
await this.confirmButton.click();
|
|
28
25
|
// Wait for the modal to disappear
|
|
29
|
-
await
|
|
26
|
+
await expect(this.container).not.toBeVisible();
|
|
30
27
|
}
|
|
31
28
|
async cancel() {
|
|
32
29
|
await this.cancelButton.waitFor();
|
|
33
30
|
await this.cancelButton.click();
|
|
34
31
|
// Wait for the modal to disappear
|
|
35
|
-
await
|
|
32
|
+
await expect(this.container).not.toBeVisible();
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
module.exports = GenericConfirmModal;
|
|
40
|
-
//# sourceMappingURL=generic_confirm_modal.js.map
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
7
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export default class ChannelsHeader {
|
|
8
5
|
container;
|
|
9
6
|
constructor(container) {
|
|
10
7
|
this.container = container;
|
|
11
8
|
}
|
|
12
9
|
async toBeVisible() {
|
|
13
|
-
await
|
|
10
|
+
await expect(this.container).toBeVisible();
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
module.exports = ChannelsHeader;
|
|
18
|
-
//# sourceMappingURL=header.js.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
|
|
5
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
2
|
// See LICENSE.txt for license information.
|
|
7
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export default class MessagePriority {
|
|
8
5
|
container;
|
|
9
6
|
priorityIcon;
|
|
10
7
|
priorityMenu;
|
|
@@ -29,38 +26,35 @@ class MessagePriority {
|
|
|
29
26
|
}
|
|
30
27
|
async verifyPriorityIconVisible() {
|
|
31
28
|
await this.priorityIcon.waitFor({ state: 'visible' });
|
|
32
|
-
await
|
|
29
|
+
await expect(this.priorityIcon).toBeVisible();
|
|
33
30
|
}
|
|
34
31
|
async verifyStandardPrioritySelected() {
|
|
35
|
-
await
|
|
36
|
-
await
|
|
32
|
+
await expect(this.priorityMenu).toBeVisible();
|
|
33
|
+
await expect(this.standardPriorityOption).toHaveAttribute('aria-checked', 'true');
|
|
37
34
|
}
|
|
38
35
|
async verifyPriorityMenuVisible() {
|
|
39
|
-
await
|
|
36
|
+
await expect(this.priorityMenu).toBeVisible();
|
|
40
37
|
// Look for beta text in header
|
|
41
|
-
await
|
|
38
|
+
await expect(this.priorityMenu.locator('text=Message Priority')).toBeVisible();
|
|
42
39
|
}
|
|
43
40
|
async closePriorityMenu() {
|
|
44
41
|
await this.priorityMenu.press('Escape');
|
|
45
|
-
await
|
|
42
|
+
await expect(this.priorityMenu).not.toBeVisible();
|
|
46
43
|
}
|
|
47
44
|
async verifyNoPriorityLabel(postText) {
|
|
48
45
|
const post = this.container.locator(`text=${postText}`);
|
|
49
|
-
await
|
|
46
|
+
await expect(post).toBeVisible();
|
|
50
47
|
// Verify no priority label exists
|
|
51
48
|
const priorityLabel = post.locator('[data-testid="post-priority-label"]');
|
|
52
|
-
await
|
|
49
|
+
await expect(priorityLabel).toHaveCount(0);
|
|
53
50
|
}
|
|
54
51
|
async verifyPriorityDialog() {
|
|
55
|
-
await
|
|
56
|
-
await
|
|
52
|
+
await expect(this.priorityDialog).toBeVisible();
|
|
53
|
+
await expect(this.dialogHeader).toHaveText('Message priority');
|
|
57
54
|
}
|
|
58
55
|
async verifyStandardOptionSelected() {
|
|
59
56
|
const standardOption = this.priorityDialog.getByRole('menuitemradio', { name: 'Standard' });
|
|
60
|
-
await
|
|
61
|
-
await
|
|
57
|
+
await expect(standardOption).toBeVisible();
|
|
58
|
+
await expect(standardOption.locator('svg.StyledCheckIcon-dFKfoY')).toBeVisible();
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
|
-
|
|
65
|
-
module.exports = MessagePriority;
|
|
66
|
-
//# sourceMappingURL=message_priority.js.map
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('@playwright/test');
|
|
4
|
-
var post_menu = require('./post_menu.js');
|
|
5
|
-
var thread_footer = require('./thread_footer.js');
|
|
6
|
-
|
|
7
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
8
2
|
// See LICENSE.txt for license information.
|
|
9
|
-
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
import PostMenu from './post_menu';
|
|
5
|
+
import ThreadFooter from './thread_footer';
|
|
6
|
+
export default class ChannelsPost {
|
|
10
7
|
container;
|
|
11
8
|
body;
|
|
12
9
|
profileIcon;
|
|
@@ -18,11 +15,11 @@ class ChannelsPost {
|
|
|
18
15
|
this.body = container.locator('.post__body');
|
|
19
16
|
this.profileIcon = container.locator('.profile-icon');
|
|
20
17
|
this.removePostButton = container.locator('.post__remove');
|
|
21
|
-
this.postMenu = new
|
|
22
|
-
this.threadFooter = new
|
|
18
|
+
this.postMenu = new PostMenu(container.locator('.post-menu'));
|
|
19
|
+
this.threadFooter = new ThreadFooter(container.locator('.ThreadFooter'));
|
|
23
20
|
}
|
|
24
21
|
async toBeVisible() {
|
|
25
|
-
await
|
|
22
|
+
await expect(this.container).toBeVisible();
|
|
26
23
|
}
|
|
27
24
|
/**
|
|
28
25
|
* Hover over the post. Can be used for post menu to appear.
|
|
@@ -32,7 +29,7 @@ class ChannelsPost {
|
|
|
32
29
|
}
|
|
33
30
|
async getId() {
|
|
34
31
|
const id = await this.container.getAttribute('id');
|
|
35
|
-
|
|
32
|
+
expect(id, 'No post ID found.').toBeTruthy();
|
|
36
33
|
return (id || '').substring('post_'.length);
|
|
37
34
|
}
|
|
38
35
|
async getProfileImage(username) {
|
|
@@ -44,7 +41,7 @@ class ChannelsPost {
|
|
|
44
41
|
*/
|
|
45
42
|
async remove() {
|
|
46
43
|
// Verify the post is a deleted post
|
|
47
|
-
await
|
|
44
|
+
await expect(this.container).toContainText(/\(message deleted\)/);
|
|
48
45
|
// Hover over the post and click on the remove post button
|
|
49
46
|
await this.container.hover();
|
|
50
47
|
await this.removePostButton.waitFor();
|
|
@@ -55,9 +52,6 @@ class ChannelsPost {
|
|
|
55
52
|
* @param text Text to be verified in the post
|
|
56
53
|
*/
|
|
57
54
|
async toContainText(text) {
|
|
58
|
-
await
|
|
55
|
+
await expect(this.container).toContainText(text);
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
|
-
|
|
62
|
-
module.exports = ChannelsPost;
|
|
63
|
-
//# sourceMappingURL=post.js.map
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var path = require('node:path');
|
|
4
|
-
var test = require('@playwright/test');
|
|
5
|
-
var util = require('../../../util.js');
|
|
6
|
-
var file = require('../../../file.js');
|
|
7
|
-
var asyncWaitUntil = require('async-wait-until');
|
|
8
|
-
|
|
9
1
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
10
2
|
// See LICENSE.txt for license information.
|
|
11
|
-
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { expect } from '@playwright/test';
|
|
5
|
+
import { duration } from '@/util';
|
|
6
|
+
import { assetPath } from '@/file';
|
|
7
|
+
import { waitUntil } from '@/test_action';
|
|
8
|
+
export default class ChannelsPostCreate {
|
|
12
9
|
container;
|
|
13
10
|
input;
|
|
14
11
|
attachmentButton;
|
|
@@ -35,9 +32,9 @@ class ChannelsPostCreate {
|
|
|
35
32
|
this.filePreview = container.locator('.file-preview__container');
|
|
36
33
|
}
|
|
37
34
|
async toBeVisible() {
|
|
38
|
-
await
|
|
35
|
+
await expect(this.container).toBeVisible();
|
|
39
36
|
await this.input.waitFor();
|
|
40
|
-
await
|
|
37
|
+
await expect(this.input).toBeVisible();
|
|
41
38
|
}
|
|
42
39
|
/**
|
|
43
40
|
* It just writes the message in the input and doesn't send it
|
|
@@ -45,42 +42,42 @@ class ChannelsPostCreate {
|
|
|
45
42
|
*/
|
|
46
43
|
async writeMessage(message) {
|
|
47
44
|
await this.input.waitFor();
|
|
48
|
-
await
|
|
45
|
+
await expect(this.input).toBeVisible();
|
|
49
46
|
await this.input.fill(message);
|
|
50
47
|
}
|
|
51
48
|
/**
|
|
52
49
|
* Returns the value of the message input
|
|
53
50
|
*/
|
|
54
51
|
async getInputValue() {
|
|
55
|
-
await
|
|
52
|
+
await expect(this.input).toBeVisible();
|
|
56
53
|
return await this.input.inputValue();
|
|
57
54
|
}
|
|
58
55
|
/**
|
|
59
56
|
* Sends the message already written in the input
|
|
60
57
|
*/
|
|
61
58
|
async sendMessage() {
|
|
62
|
-
await
|
|
59
|
+
await expect(this.input).toBeVisible();
|
|
63
60
|
const messageInputValue = await this.getInputValue();
|
|
64
|
-
|
|
65
|
-
await
|
|
66
|
-
await
|
|
61
|
+
expect(messageInputValue).not.toBe('');
|
|
62
|
+
await expect(this.sendMessageButton).toBeVisible();
|
|
63
|
+
await expect(this.sendMessageButton).toBeEnabled();
|
|
67
64
|
await this.sendMessageButton.click();
|
|
68
65
|
}
|
|
69
66
|
/**
|
|
70
67
|
* Click on Scheduled Draft button to open options
|
|
71
68
|
*/
|
|
72
69
|
async clickOnScheduleDraftDropdownButton() {
|
|
73
|
-
await
|
|
74
|
-
await
|
|
75
|
-
await
|
|
70
|
+
await expect(this.input).toBeVisible();
|
|
71
|
+
await expect(this.scheduleDraftMessageButton).toBeVisible();
|
|
72
|
+
await expect(this.scheduleDraftMessageButton).toBeEnabled();
|
|
76
73
|
await this.scheduleDraftMessageButton.click();
|
|
77
74
|
}
|
|
78
75
|
/**
|
|
79
76
|
* Opens the message priority menu
|
|
80
77
|
*/
|
|
81
78
|
async openPriorityMenu() {
|
|
82
|
-
await
|
|
83
|
-
await
|
|
79
|
+
await expect(this.priorityButton).toBeVisible();
|
|
80
|
+
await expect(this.priorityButton).toBeEnabled();
|
|
84
81
|
await this.priorityButton.click();
|
|
85
82
|
}
|
|
86
83
|
/**
|
|
@@ -89,7 +86,7 @@ class ChannelsPostCreate {
|
|
|
89
86
|
async postMessage(message, files) {
|
|
90
87
|
await this.writeMessage(message);
|
|
91
88
|
if (files) {
|
|
92
|
-
const filePaths = files.map((file
|
|
89
|
+
const filePaths = files.map((file) => path.join(assetPath, file));
|
|
93
90
|
this.container.page().once('filechooser', async (fileChooser) => {
|
|
94
91
|
await fileChooser.setFiles(filePaths);
|
|
95
92
|
});
|
|
@@ -101,11 +98,11 @@ class ChannelsPostCreate {
|
|
|
101
98
|
await this.sendMessage();
|
|
102
99
|
}
|
|
103
100
|
async openEmojiPicker() {
|
|
104
|
-
await
|
|
101
|
+
await expect(this.emojiButton).toBeVisible();
|
|
105
102
|
await this.emojiButton.click();
|
|
106
103
|
}
|
|
107
|
-
async waitUntilFilePreviewContains(files, timeout =
|
|
108
|
-
await
|
|
104
|
+
async waitUntilFilePreviewContains(files, timeout = duration.ten_sec) {
|
|
105
|
+
await waitUntil(async () => {
|
|
109
106
|
const previews = this.filePreview.locator('.file-preview');
|
|
110
107
|
const details = this.filePreview.locator('.post-image__details');
|
|
111
108
|
const [previewsCount, detailsCount] = await Promise.all([previews.count(), details.count()]);
|
|
@@ -113,6 +110,3 @@ class ChannelsPostCreate {
|
|
|
113
110
|
}, { timeout });
|
|
114
111
|
}
|
|
115
112
|
}
|
|
116
|
-
|
|
117
|
-
module.exports = ChannelsPostCreate;
|
|
118
|
-
//# sourceMappingURL=post_create.js.map
|