@bigbinary/neeto-playwright-commons 4.11.0 → 4.11.2
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/index.d.ts +0 -13
- package/index.js +14 -23
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1262,7 +1262,6 @@ declare class SlackApi {
|
|
|
1262
1262
|
fetchMessages: (channelId: string, unixTimestamp: number) => Promise<playwright_core.APIResponse<any> | undefined>;
|
|
1263
1263
|
createChannel: (channelName: string) => Promise<playwright_core.APIResponse<any> | undefined>;
|
|
1264
1264
|
addUser: (channelId: string, userId: string) => Promise<playwright_core.APIResponse<any> | undefined>;
|
|
1265
|
-
listChannels: () => Promise<playwright_core.APIResponse<any> | undefined>;
|
|
1266
1265
|
archiveChannel: (channelId: string) => Promise<playwright_core.APIResponse<any> | undefined>;
|
|
1267
1266
|
mockChannelDeleted: (channelId: string) => Promise<playwright_core.APIResponse<any> | undefined>;
|
|
1268
1267
|
}
|
|
@@ -3668,18 +3667,6 @@ declare class SlackPage extends IntegrationBase {
|
|
|
3668
3667
|
channelName,
|
|
3669
3668
|
kind
|
|
3670
3669
|
}: CreateNewSlackChannelParams) => Promise<void>;
|
|
3671
|
-
/**
|
|
3672
|
-
*
|
|
3673
|
-
* Archives a Slack channel by name using the Slack Web API (conversations.list then conversations.archive). Requires SLACK_BOT_TOKEN with scopes that allow listing and archiving channels. Does not drive the Slack web UI; use when tests only need the channel removed or archived on the workspace.
|
|
3674
|
-
*
|
|
3675
|
-
* channel: Channel name to archive.
|
|
3676
|
-
*
|
|
3677
|
-
* @example
|
|
3678
|
-
*
|
|
3679
|
-
* await slackPage.archiveChannelViaAPI("temp-test-channel");
|
|
3680
|
-
* @endexample
|
|
3681
|
-
*/
|
|
3682
|
-
archiveChannelViaAPI: (name: string) => Promise<void>;
|
|
3683
3670
|
}
|
|
3684
3671
|
interface WebhooksPageParams {
|
|
3685
3672
|
page: Page;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPresent, keysToSnakeCase, hyphenate, humanize, noop as noop$2, isNotPresent, keysToCamelCase,
|
|
1
|
+
import { isPresent, keysToSnakeCase, hyphenate, humanize, noop as noop$2, isNotPresent, keysToCamelCase, dynamicArray, findBy, truncate, isNotEmpty, _findBy, isNotEqualDeep, randomPick } from '@bigbinary/neeto-cist';
|
|
2
2
|
import { faker } from '@faker-js/faker/locale/en';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import { readFileSync, writeFileSync, unlinkSync, mkdirSync, rmSync, existsSync, createWriteStream } from 'fs';
|
|
@@ -713,7 +713,6 @@ class SlackApi {
|
|
|
713
713
|
fetchMessages = (channelId, unixTimestamp) => this.apiRequest("history", { channel: channelId, oldest: unixTimestamp });
|
|
714
714
|
createChannel = (channelName) => this.apiRequest("create", { name: channelName });
|
|
715
715
|
addUser = (channelId, userId) => this.apiRequest("invite", { channel: channelId, users: userId });
|
|
716
|
-
listChannels = () => this.apiRequest("list", { exclude_archived: 1, limit: 1000 });
|
|
717
716
|
archiveChannel = (channelId) => this.apiRequest("archive", { channel: channelId });
|
|
718
717
|
mockChannelDeleted = (channelId) => this.neetoPlaywrightUtilities.apiRequest({
|
|
719
718
|
url: "/neeto_slack/api/v1/testing/webhooks",
|
|
@@ -1517,7 +1516,7 @@ const SLACK_SELECTORS = {
|
|
|
1517
1516
|
loginEmail: dataQa("login_email"),
|
|
1518
1517
|
loginPassword: dataQa("login_password"),
|
|
1519
1518
|
signInButton: dataQa("signin_button"),
|
|
1520
|
-
teamPicketButtonContent: dataQa("team-picker-button-content"),
|
|
1519
|
+
teamPicketButtonContent: dataQa("oauth-team-picker-button-content"),
|
|
1521
1520
|
redirectOpenInBrowser: dataQa("ssb_redirect_open_in_browser"),
|
|
1522
1521
|
workspaceActionsButton: dataQa("workspace_actions_button"),
|
|
1523
1522
|
teamMenuTrigger: dataQa("team-menu-trigger"),
|
|
@@ -7968,27 +7967,25 @@ class HelpAndProfilePage {
|
|
|
7968
7967
|
});
|
|
7969
7968
|
};
|
|
7970
7969
|
openAppSwitcherAndVerify = async () => {
|
|
7971
|
-
const productName = "
|
|
7970
|
+
const productName = "Cal";
|
|
7972
7971
|
const searchQueryPartial = productName.slice(0, 1).toLowerCase();
|
|
7973
7972
|
const searchQueryFull = productName.toLowerCase();
|
|
7974
7973
|
await test.step("1: Verify hovering over app switcher opens the app switcher drawer", () => expect(async () => {
|
|
7975
7974
|
await this.openHelpCenter();
|
|
7976
7975
|
await this.page.getByTestId(COMMON_SELECTORS.appSwitcherButton).hover();
|
|
7977
7976
|
await expect(this.page.getByTestId(COMMON_SELECTORS.appSwitcherWrapper)).toBeVisible();
|
|
7978
|
-
|
|
7977
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
7978
|
+
}).toPass({ timeout: 60_000 }));
|
|
7979
7979
|
await test.step("2: Verify search functionality", async () => {
|
|
7980
|
-
const
|
|
7981
|
-
const
|
|
7980
|
+
const cal = this.page.getByTestId(COMMON_SELECTORS.appLink(productName));
|
|
7981
|
+
const chat = this.page.getByTestId(COMMON_SELECTORS.appLink("Chat"));
|
|
7982
7982
|
const searchInput = this.page.getByTestId(COMMON_SELECTORS.productSwitcherSearchInput);
|
|
7983
7983
|
await searchInput.fill(faker.word.words(3));
|
|
7984
7984
|
await expect(this.page.getByTestId(COMMON_SELECTORS.noAppsFoundTitle)).toBeVisible();
|
|
7985
7985
|
await searchInput.fill(searchQueryPartial);
|
|
7986
|
-
await Promise.all([
|
|
7986
|
+
await Promise.all([cal, chat].map(app => expect(app).toBeVisible()));
|
|
7987
7987
|
await searchInput.fill(searchQueryFull);
|
|
7988
|
-
await Promise.all([
|
|
7989
|
-
expect(crm).toBeVisible(),
|
|
7990
|
-
expect(course).toBeHidden(),
|
|
7991
|
-
]);
|
|
7988
|
+
await Promise.all([expect(cal).toBeVisible(), expect(chat).toBeHidden()]);
|
|
7992
7989
|
});
|
|
7993
7990
|
};
|
|
7994
7991
|
verifyLogout = async () => {
|
|
@@ -8731,12 +8728,6 @@ class SlackPage extends IntegrationBase {
|
|
|
8731
8728
|
await nextButton.click();
|
|
8732
8729
|
await this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.inviteToWorkspaceSkipButton).click();
|
|
8733
8730
|
};
|
|
8734
|
-
archiveChannelViaAPI = async (name) => {
|
|
8735
|
-
const response = await this.slackApi.listChannels();
|
|
8736
|
-
const { channels } = (await response?.json());
|
|
8737
|
-
const channel = findBy({ name }, channels);
|
|
8738
|
-
channel?.id && (await this.slackApi.archiveChannel(channel.id));
|
|
8739
|
-
};
|
|
8740
8731
|
}
|
|
8741
8732
|
|
|
8742
8733
|
class WebhooksPage {
|
|
@@ -11338,11 +11329,11 @@ class TagsPage {
|
|
|
11338
11329
|
}
|
|
11339
11330
|
|
|
11340
11331
|
const USER_AGENTS = {
|
|
11341
|
-
windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
11342
|
-
mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X
|
|
11343
|
-
iPhone: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
|
11344
|
-
iPad: "Mozilla/5.0 (iPad; CPU OS
|
|
11345
|
-
android: "Mozilla/5.0 (Linux; Android
|
|
11332
|
+
windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36",
|
|
11333
|
+
mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36",
|
|
11334
|
+
iPhone: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/154.0.8037.55 Mobile/15E148 Safari/604.1",
|
|
11335
|
+
iPad: "Mozilla/5.0 (iPad; CPU OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/154.0.8037.55 Mobile/15E148 Safari/604.1",
|
|
11336
|
+
android: "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Mobile Safari/537.36",
|
|
11346
11337
|
};
|
|
11347
11338
|
|
|
11348
11339
|
const networkConditions = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-playwright-commons",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.2",
|
|
4
4
|
"description": "A package encapsulating common playwright code across neeto projects.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
|
|
6
6
|
"license": "apache-2.0",
|