@bigbinary/neeto-playwright-commons 1.9.6 → 1.9.8

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 CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as _playwright_test from '@playwright/test';
2
- import { Page, APIRequestContext, Response, APIResponse, Fixtures, PlaywrightWorkerArgs, PlaywrightWorkerOptions, PlaywrightTestArgs, PlaywrightTestOptions, Browser, BrowserContext, FrameLocator, Locator, CDPSession } from '@playwright/test';
2
+ import { Page, APIRequestContext, Response, Locator, APIResponse, Fixtures, PlaywrightWorkerArgs, PlaywrightWorkerOptions, PlaywrightTestArgs, PlaywrightTestOptions, Browser, BrowserContext, FrameLocator, CDPSession } from '@playwright/test';
3
3
  import * as mailosaur_lib_models from 'mailosaur/lib/models';
4
4
  import MailosaurClient from 'mailosaur';
5
5
  import { I18nPlaywrightFixture } from 'playwright-i18next-fixture';
6
6
  import { TFunction } from 'i18next';
7
+ import * as playwright_core from 'playwright-core';
7
8
  import { Protocol } from 'playwright-core/types/protocol';
8
9
  import * as ts_toolbelt_out_Function_Curry from 'ts-toolbelt/out/Function/Curry';
9
- import * as playwright_core from 'playwright-core';
10
10
  import { Secret, TOTP } from 'otpauth';
11
11
  interface InterceptMultipleResponsesParams {
12
12
  responseUrl: string;
@@ -232,6 +232,29 @@ declare class CustomCommands {
232
232
  * @endexample
233
233
  */
234
234
  uploadImage: (localImagePath: string) => Promise<void>;
235
+ /**
236
+ *
237
+ * Command to verify the tooltip content. It takes the following parameters:
238
+ *
239
+ * triggerElement: The element that triggers the tooltip.
240
+ *
241
+ * content: The content inside the tooltip.
242
+ *
243
+ * @example
244
+ *
245
+ * await neetoPlaywrightUtilities.verifyTooltip({
246
+ * triggerElement: page.getByTestId("triggerElement"),
247
+ * content: "Tooltip content",
248
+ * });
249
+ * @endexample
250
+ */
251
+ verifyTooltip: ({
252
+ triggerElement,
253
+ content
254
+ }: {
255
+ triggerElement: Locator;
256
+ content: string;
257
+ }) => Promise<void>;
235
258
  }
236
259
  interface EmailContentParams {
237
260
  email: string;
@@ -869,6 +892,324 @@ declare class ImageUploader {
869
892
  height
870
893
  }?: Partial<SelectImage>) => Promise<void>;
871
894
  }
895
+ type sublink = "active" | "deactivated" | "all";
896
+ type emailCondition = "Contains" | "Does not contain" | "Is" | "Is not" | "Starts with" | "Does not start with" | "Ends with" | "Does not end with";
897
+ interface EditMemberProps$1 {
898
+ email: string;
899
+ firstName: string;
900
+ lastName: string;
901
+ role: string;
902
+ }
903
+ declare class TeamMembers {
904
+ page: Page;
905
+ neetoPlaywrightUtilities: CustomCommands;
906
+ t: TFunction;
907
+ constructor({
908
+ page,
909
+ neetoPlaywrightUtilities
910
+ }: {
911
+ page: Page;
912
+ neetoPlaywrightUtilities: CustomCommands;
913
+ });
914
+ /**
915
+ *
916
+ * Used to navigate to the specified sublink in the team members page.
917
+ *
918
+ * sublink (optional): The sublink to navigate to. Default is all.
919
+ *
920
+ * @example
921
+ *
922
+ * await teamMembers.navigateToTeamMembersSublink("all");
923
+ * @endexample
924
+ */
925
+ navigateToTeamMembersSublink: (sublink?: sublink) => Promise<void>;
926
+ /**
927
+ *
928
+ * Used to add a member using the add button in the header. It takes the following parameters:
929
+ *
930
+ * emails (optional): The emails of the members to be added. Default is an example email.
931
+ *
932
+ * role (optional): The role of the new members. Default is standard.
933
+ *
934
+ * @example
935
+ *
936
+ * await teamMembers.addMemberViaUI({
937
+ * emails: ["sam@example.com", "tom@example.com"],
938
+ * role: "admin",
939
+ * });
940
+ * @endexample
941
+ */
942
+ addMemberViaUI: ({
943
+ emails,
944
+ role
945
+ }?: {
946
+ emails?: string[] | undefined;
947
+ role?: string | undefined;
948
+ }) => Promise<void>;
949
+ /**
950
+ *
951
+ * Used to search and verify the member by providing email as the search term. It takes the following parameters:
952
+ *
953
+ * email (required): The email of the member to be searched.
954
+ *
955
+ * interceptOptions (optional): The options to be passed to the waitForMultipleResponse command.
956
+ *
957
+ * @example
958
+ *
959
+ * await teamMembers.searchAndVerifyMemberByEmail({
960
+ * email: "sam@example.com",
961
+ * interceptOptions: { timeout: 10000, requestCount: 1 },
962
+ * });
963
+ * @endexample
964
+ */
965
+ searchAndVerifyMemberByEmail: ({
966
+ email,
967
+ interceptOptions
968
+ }: {
969
+ email: string;
970
+ interceptOptions?: Partial<InterceptMultipleResponsesParams> | undefined;
971
+ }) => Promise<void>;
972
+ /**
973
+ *
974
+ * Used to edit a member using the edit button in row dropdown. A member has to be searched before editing. It takes the following parameters:
975
+ *
976
+ * email (optional): The new email of the member.
977
+ *
978
+ * role (optional): The new role of the member. Default is standard.
979
+ *
980
+ * firstName (optional): The new first name of the member.
981
+ *
982
+ * lastName (optional): The new last name of the member.
983
+ *
984
+ * @example
985
+ *
986
+ * await teamMembers.searchAndVerifyMemberByEmail({
987
+ * email: "sam@example.com",
988
+ * });
989
+ * await teamMembers.editMemberViaUI({
990
+ * email: "tom@example.com",
991
+ * role: "admin",
992
+ * firstName: "Tom",
993
+ * lastName: "Hanks",
994
+ * });
995
+ * @endexample
996
+ * @example
997
+ *
998
+ * await teamMembers.searchAndVerifyMemberByEmail({
999
+ * email: "sam@example.com",
1000
+ * });
1001
+ * await teamMembers.editMemberViaUI();
1002
+ *
1003
+ * // This will change the role of the member with email "sam@example.com" to the `standard` role.
1004
+ * @endexample
1005
+ */
1006
+ editMemberViaUI: ({
1007
+ email,
1008
+ firstName,
1009
+ lastName,
1010
+ role
1011
+ }?: Partial<EditMemberProps$1>) => Promise<void>;
1012
+ /**
1013
+ *
1014
+ * Used to toggle the state of a member between active or deactivated, using the activate or deactivate button in row dropdown. A member has to be searched before toggling.
1015
+ *
1016
+ * @example
1017
+ *
1018
+ * await teamMembers.searchAndVerifyMemberByEmail({
1019
+ * email: "sam@example.com",
1020
+ * });
1021
+ * await teamMembers.toggleMemberStateViaUI();
1022
+ * @endexample
1023
+ */
1024
+ toggleMemberStateViaUI: () => Promise<void>;
1025
+ /**
1026
+ *
1027
+ * Used to filter members by multi select fields such as role, group, teams, etc. The filter pane should be opened and closed before and after filtering. It takes the following parameters:
1028
+ *
1029
+ * selectedOptions (required): The options to be selected in the multi select field.
1030
+ *
1031
+ * selectContainerLocator (optional): The locator of the container of the multi select field. Default is the container of the role field.
1032
+ *
1033
+ * @example
1034
+ *
1035
+ * await filterUtils.openFilterPane(page);
1036
+ * await teamMembers.filterMembersByMultiSelect({
1037
+ * selectedOptions: ["Admin", "Standard"],
1038
+ * selectContainerLocator: NEETO_FILTERS_SELECTORS.roleSelectContainer
1039
+ * });
1040
+ * @endexample
1041
+ */
1042
+ filterMembersByMultiSelect: ({
1043
+ selectedOptions,
1044
+ selectContainerLocator
1045
+ }: {
1046
+ selectedOptions: string[];
1047
+ selectContainerLocator?: string | undefined;
1048
+ }) => Promise<void>;
1049
+ /**
1050
+ *
1051
+ * Used to filter members by at least one these field: email with conditions, role, or name. It takes the following parameters:
1052
+ *
1053
+ * email (optional): An object with the id and condition as keys to filter by email.
1054
+ *
1055
+ * roles (optional): The roles to filter by.
1056
+ *
1057
+ * name (optional): The name to filter by.
1058
+ *
1059
+ * @example
1060
+ *
1061
+ * await teamMembers.filterMembers({
1062
+ * email: { id: "sam", condition: "Contains" },
1063
+ * roles: ["Admin", "Standard"],
1064
+ * });
1065
+ * @endexample
1066
+ * @example
1067
+ *
1068
+ * await teamMembers.filterMembers({
1069
+ * name: "Sam",
1070
+ * roles: ["Admin"],
1071
+ * });
1072
+ * @endexample
1073
+ */
1074
+ filterMembers: ({
1075
+ email,
1076
+ roles,
1077
+ name
1078
+ }: {
1079
+ email?: {
1080
+ id: string;
1081
+ condition: emailCondition;
1082
+ } | undefined;
1083
+ roles?: string[] | undefined;
1084
+ name?: string | undefined;
1085
+ }) => Promise<void>;
1086
+ /**
1087
+ *
1088
+ * Used to get the row of the team members table by providing the name of the member.
1089
+ *
1090
+ * @example
1091
+ *
1092
+ * await teamMembers.getMemberRowByName("Sam");
1093
+ * @endexample
1094
+ */
1095
+ getMemberRowByName: (name: string) => playwright_core.Locator;
1096
+ /**
1097
+ *
1098
+ * Used to take action on members by selecting the members and clicking on the take action button in the subheader. It takes the following parameters:
1099
+ *
1100
+ * names (optional): The names of the members to take action on. If not provided, all members will be selected.
1101
+ *
1102
+ * state (optional): The state to change the members to.
1103
+ *
1104
+ * action (optional): An object with actionButtonText and valueButtonText as keys to take action on the members. actionButtonText and valueButtonText are the text of the action button to be clicked and the value of the action to be changed to, respectively.
1105
+ *
1106
+ * @example
1107
+ *
1108
+ * await teamMembers.takeActionOnMembers({
1109
+ * names: ["Sam", "Tom"],
1110
+ * state: "Deactivate",
1111
+ * });
1112
+ * @endexample
1113
+ * @example
1114
+ *
1115
+ * await teamMembers.takeActionOnMembers({
1116
+ * action: { actionButtonText: "Change role", valueButtonText: "Admin" },
1117
+ * });
1118
+ * @endexample
1119
+ */
1120
+ takeActionOnMembers: ({
1121
+ names,
1122
+ state,
1123
+ action
1124
+ }: {
1125
+ names?: string[] | undefined;
1126
+ state?: "activate" | "deactivate" | undefined;
1127
+ action?: {
1128
+ actionButtonText: string;
1129
+ valueButtonText: string;
1130
+ } | undefined;
1131
+ }) => Promise<void>;
1132
+ /**
1133
+ *
1134
+ * Used to perform an action on a column header in the team members table. It takes the following parameters:
1135
+ *
1136
+ * columnName (optional): The name of the column to perform the action on. Default is Name.
1137
+ *
1138
+ * actionButtonText (optional): The text of the action button to be clicked. Default is Ascending.
1139
+ *
1140
+ * @example
1141
+ *
1142
+ * await teamMembers.performColumnAction({
1143
+ * columnName: "Role",
1144
+ * actionButtonText: "Hide column",
1145
+ * });
1146
+ * @endexample
1147
+ * @example
1148
+ *
1149
+ * await teamMembers.performColumnAction();
1150
+ *
1151
+ * // This will sort the `name` column in ascending order.
1152
+ * @endexample
1153
+ */
1154
+ performColumnAction: ({
1155
+ columnName,
1156
+ actionButtonText
1157
+ }?: {
1158
+ columnName?: string | undefined;
1159
+ actionButtonText?: "Ascending" | "Descending" | "Hide column" | undefined;
1160
+ }) => Promise<void>;
1161
+ /**
1162
+ *
1163
+ * Used to toggle the visibility of columns in the team members table. It takes the following parameters:
1164
+ *
1165
+ * columns (optional): The columns whose visibility is to be toggled.
1166
+ *
1167
+ * bulkAction (optional): The option to show or hide all columns. If not provided, the columns will be toggled individually based on the columns parameter.
1168
+ *
1169
+ * @example
1170
+ *
1171
+ * await teamMembers.toggleMemberColumns({
1172
+ * bulkAction: "show",
1173
+ * });
1174
+ * @endexample
1175
+ * @example
1176
+ *
1177
+ * await teamMembers.toggleMemberColumns({
1178
+ * columns: ["role", "email"],
1179
+ * });
1180
+ * @endexample
1181
+ */
1182
+ toggleMemberColumns: ({
1183
+ columns,
1184
+ bulkAction
1185
+ }: {
1186
+ columns?: string[] | undefined;
1187
+ bulkAction?: "hide" | "show" | undefined;
1188
+ }) => Promise<void>;
1189
+ /**
1190
+ *
1191
+ * Used to verify the presence of a member in the team members table. It takes the following parameters:
1192
+ *
1193
+ * email (required): The email of the member to be verified.
1194
+ *
1195
+ * name (optional): The name of the member to be verified.
1196
+ *
1197
+ * @example
1198
+ *
1199
+ * await teamMembers.verifyMemberInTable({
1200
+ * email: "sam@example.com",
1201
+ * name: "Sam",
1202
+ * });
1203
+ * @endexample
1204
+ */
1205
+ verifyMemberInTable: ({
1206
+ name,
1207
+ email
1208
+ }: {
1209
+ name: string;
1210
+ email: string;
1211
+ }) => Promise<void>;
1212
+ }
872
1213
  interface BasicUserInfo {
873
1214
  firstName: string;
874
1215
  lastName: string;
@@ -1128,6 +1469,9 @@ declare const COMMON_SELECTORS: {
1128
1469
  sidebarSubLink: (label: string) => string;
1129
1470
  sidebarGoBackButton: (label: string) => string;
1130
1471
  selectSingleValue: string;
1472
+ actionSelectIndicator: string;
1473
+ takeActionDropdown: string;
1474
+ columnsSearchInput: string;
1131
1475
  };
1132
1476
  declare const NEETO_EDITOR_SELECTORS: {
1133
1477
  boldOption: string;
@@ -1247,6 +1591,7 @@ declare const MEMBER_SELECTORS: {
1247
1591
  activatedMembersButton: string;
1248
1592
  columnCheckBox: string;
1249
1593
  roleLabel: (role: string) => string;
1594
+ teamMembersTable: string;
1250
1595
  dropDownIcon: string;
1251
1596
  editButton: string;
1252
1597
  menuBarHeading: string;
@@ -1261,6 +1606,9 @@ declare const MEMBER_SELECTORS: {
1261
1606
  deactivateButton: string;
1262
1607
  rolesButton: string;
1263
1608
  statusTag: string;
1609
+ menubarSubLink: (sublink: string) => string;
1610
+ takeActionStateOption: (option?: string) => string;
1611
+ checkboxLabel: (label: string) => string;
1264
1612
  };
1265
1613
  declare const MEMBER_FORM_SELECTORS: {
1266
1614
  emailTextField: string;
@@ -1478,6 +1826,10 @@ declare const CHAT_WIDGET_TEXTS: {
1478
1826
  };
1479
1827
  declare const MEMBER_TEXTS: {
1480
1828
  agent: string;
1829
+ admin: string;
1830
+ selectAll: string;
1831
+ hide: string;
1832
+ show: string;
1481
1833
  };
1482
1834
  declare const INTEGRATIONS_TEXTS: {
1483
1835
  connectHeader: (integration: string) => string;
@@ -1711,6 +2063,18 @@ declare const memberUtils: {
1711
2063
  email,
1712
2064
  neetoPlaywrightUtilities
1713
2065
  }: DeactiveMemberProps) => Promise<playwright_core.APIResponse | undefined>;
2066
+ generateRandomTeamMembers: ({
2067
+ count,
2068
+ role
2069
+ }: {
2070
+ count?: number | undefined;
2071
+ role?: string | undefined;
2072
+ }) => {
2073
+ firstName: string;
2074
+ lastName: string;
2075
+ email: string;
2076
+ role: string;
2077
+ }[];
1714
2078
  };
1715
2079
  interface AssertColumnHeaderVisibilityProps {
1716
2080
  page: Page;
@@ -1803,6 +2167,7 @@ declare const basicHTMLContent: (content: string) => string;
1803
2167
  declare const hexToRGB: (hex: string) => string;
1804
2168
  declare const filterUtils: {
1805
2169
  openFilterPane: (page: Page) => Promise<void>;
2170
+ clearFiltersFromActionBlock: (page: Page) => Promise<void>;
1806
2171
  };
1807
2172
  /**
1808
2173
  *
@@ -1847,4 +2212,4 @@ interface Overrides {
1847
2212
  * @endexample
1848
2213
  */
1849
2214
  declare const definePlaywrightConfig: (overrides: Overrides) => _playwright_test.PlaywrightTestConfig<{}, {}>;
1850
- export { API_ROUTES, ATTACHMENT_DELETION_TOASTR_MESSAGE, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_PICKER_LABEL, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, USER_AGENTS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
2215
+ export { API_ROUTES, ATTACHMENT_DELETION_TOASTR_MESSAGE, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_PICKER_LABEL, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, TeamMembers, USER_AGENTS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };