@bigbinary/neeto-playwright-commons 1.16.7 → 1.17.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/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { TFunction } from 'i18next';
6
6
  import { TOTP, Secret } from 'otpauth';
7
7
  import { MemberApis } from 'apis/members';
8
8
  import * as playwright_core from 'playwright-core';
9
+ import { RoleApis } from 'apis/roles';
9
10
  import { TagsApi } from 'apis/tags';
10
11
  import { Protocol } from 'playwright-core/types/protocol';
11
12
  import * as ts_toolbelt_out_Function_Curry from 'ts-toolbelt/out/Function/Curry';
@@ -2763,6 +2764,96 @@ declare class OrganizationPage {
2763
2764
  }) => Promise<void>;
2764
2765
  changeCountry: (country: string) => Promise<void>;
2765
2766
  }
2767
+ interface ApiKeyDetails {
2768
+ label: string;
2769
+ expiryDate?: string;
2770
+ }
2771
+ declare class ApiKeysPage {
2772
+ page: Page;
2773
+ neetoPlaywrightUtilities: CustomCommands;
2774
+ t: TFunction;
2775
+ constructor(page: Page, neetoPlaywrightUtilities: CustomCommands);
2776
+ /**
2777
+ *
2778
+ * Used to fill in the details for creating or editing an API key.
2779
+ *
2780
+ * label (required): The name for the API key.
2781
+ *
2782
+ * expiryDate (optional): The day of the month for the expiry date, formatted as "dd".
2783
+ *
2784
+ * @example
2785
+ *
2786
+ * await apiKeysPage.fillApiKeyDetails({
2787
+ * label: "API Key",
2788
+ * expiryDate: "15"
2789
+ * });
2790
+ * @endexample
2791
+ */
2792
+ fillApiKeyDetails: ({
2793
+ label,
2794
+ expiryDate
2795
+ }: ApiKeyDetails) => Promise<void>;
2796
+ /**
2797
+ *
2798
+ * Used to verify the values in the API keys table.
2799
+ *
2800
+ * targetRow (required): The locator of the row where the API key should be verified.
2801
+ *
2802
+ * label (required): The name of the API key.
2803
+ *
2804
+ * date (required): The creation date of the API key, formatted as "MMM dd, yyyy".
2805
+ *
2806
+ * @example
2807
+ *
2808
+ * await apiKeysPage.verifyApiKey({
2809
+ * targetRow: page.getByRole("row"),
2810
+ * label: "API Key",
2811
+ * date: "Mar 11, 2025"
2812
+ * });
2813
+ * @endexample
2814
+ */
2815
+ verifyApiKey: ({
2816
+ targetRow,
2817
+ label,
2818
+ date
2819
+ }: {
2820
+ targetRow: Locator;
2821
+ label: string;
2822
+ date: string;
2823
+ }) => Promise<[void, void, void, void]>;
2824
+ /**
2825
+ *
2826
+ * Used to edit an existing API key.
2827
+ *
2828
+ * label (required): The new name for the API key.
2829
+ *
2830
+ * expiryDate (optional): The day of the month for the expiry date, formatted as "dd".
2831
+ *
2832
+ * @example
2833
+ *
2834
+ * await apiKeysPage.editApiKey({
2835
+ * label: "new API Key",
2836
+ * expiryDate: "20"
2837
+ * });
2838
+ * @endexample
2839
+ */
2840
+ editApiKey: ({
2841
+ label,
2842
+ expiryDate
2843
+ }: ApiKeyDetails) => Promise<void>;
2844
+ /**
2845
+ *
2846
+ * Used to delete an existing API key.
2847
+ *
2848
+ * targetRow (required): The locator of the row containing the API key to delete.
2849
+ *
2850
+ * @example
2851
+ *
2852
+ * await apiKeysPage.deleteApiKey(targetRow);
2853
+ * @endexample
2854
+ */
2855
+ deleteApiKey: (targetRow: Locator) => Promise<void>;
2856
+ }
2766
2857
  interface VerifyAuditLogProps {
2767
2858
  targetRow: Locator;
2768
2859
  action: string;
@@ -2848,6 +2939,198 @@ declare class AuditLogsPage {
2848
2939
  roleName
2849
2940
  }: VerifyDataInPaneProps) => Promise<void>;
2850
2941
  }
2942
+ interface RoleDetails {
2943
+ roleName: string;
2944
+ permissions: string[];
2945
+ }
2946
+ interface VerifyAdminPanelCardProps {
2947
+ cardLocator: Locator;
2948
+ title: string;
2949
+ description: string;
2950
+ }
2951
+ declare class RolesPage {
2952
+ page: Page;
2953
+ neetoPlaywrightUtilities: CustomCommands;
2954
+ roleApis: RoleApis;
2955
+ t: TFunction;
2956
+ constructor(page: Page, neetoPlaywrightUtilities: CustomCommands);
2957
+ private getPermissionIds;
2958
+ private getRoleIdAndOrganizationId;
2959
+ /**
2960
+ *
2961
+ * Used to add a custom role via API request.
2962
+ *
2963
+ * roleName (required): The name of the role to add.
2964
+ *
2965
+ * targetPermissions (required): Array of permission names to assign.
2966
+ *
2967
+ * @example
2968
+ *
2969
+ * await rolesPage.addCustomRoleViaRequest("Custom Role", ["Manage themes", "View roles"]);
2970
+ * @endexample
2971
+ */
2972
+ addCustomRoleViaRequest: (roleName: string, targetPermissions: string[]) => Promise<playwright_core.APIResponse | undefined>;
2973
+ /**
2974
+ *
2975
+ * Used to edit an existing role via API request.
2976
+ *
2977
+ * roleName (required): The name of the role to edit.
2978
+ *
2979
+ * targetPermissions (required): Array of permission names to update.
2980
+ *
2981
+ * @example
2982
+ *
2983
+ * await rolesPage.editRoleViaRequest("Custom Role", ["Manage roles"]);
2984
+ * @endexample
2985
+ */
2986
+ editRoleViaRequest: (roleName: string, targetPermissions: string[]) => Promise<playwright_core.APIResponse | undefined>;
2987
+ /**
2988
+ *
2989
+ * Used to delete a role via API request.
2990
+ *
2991
+ * roleName (required): The name of the role to delete.
2992
+ *
2993
+ * @example
2994
+ *
2995
+ * await rolesPage.deleteRoleViaRequest("Custom Role");
2996
+ * @endexample
2997
+ */
2998
+ deleteRoleViaRequest: (roleName: string) => Promise<playwright_core.APIResponse | undefined>;
2999
+ /**
3000
+ *
3001
+ * Used to add a role through the UI.
3002
+ *
3003
+ * roleName (required): The name of the role to add.
3004
+ *
3005
+ * permissions (required): Array of permission names to assign.
3006
+ *
3007
+ * @example
3008
+ *
3009
+ * await rolesPage.addRoleViaUI({
3010
+ * roleName: "Custom Role",
3011
+ * permissions: ["Manage themes", "View roles"]
3012
+ * });
3013
+ * @endexample
3014
+ */
3015
+ addRoleViaUI: ({
3016
+ roleName,
3017
+ permissions
3018
+ }: RoleDetails) => Promise<void>;
3019
+ /**
3020
+ *
3021
+ * Used to edit an existing role through the UI.
3022
+ *
3023
+ * roleName (required): The name of the role to edit.
3024
+ *
3025
+ * permissions (required): Array of permission names to update.
3026
+ *
3027
+ * @example
3028
+ *
3029
+ * await rolesPage.editRoleViaUI({
3030
+ * roleName: "Custom Role",
3031
+ * permissions: ["Manage roles"]
3032
+ * });
3033
+ * @endexample
3034
+ */
3035
+ editRoleViaUI: ({
3036
+ roleName,
3037
+ permissions
3038
+ }: RoleDetails) => Promise<void>;
3039
+ /**
3040
+ *
3041
+ * Used to select permissions.
3042
+ *
3043
+ * permissions (required): Array of permission names to select.
3044
+ *
3045
+ * @example
3046
+ *
3047
+ * await rolesPage.selectAndSubmitPermissions(["Manage themes", "View roles"]);
3048
+ * @endexample
3049
+ */
3050
+ selectAndSubmitPermissions: (permissions: string[]) => Promise<void>;
3051
+ /**
3052
+ *
3053
+ * Used to verify the admin panel card details.
3054
+ *
3055
+ * cardLocator (required): The locator of the card to verify.
3056
+ *
3057
+ * title (required): The title of the card.
3058
+ *
3059
+ * description (required): The description of the card.
3060
+ *
3061
+ * @example
3062
+ *
3063
+ * await rolesPage.verifyAdminPanelCard({
3064
+ * description: "Roles card description",
3065
+ * title: "Roles card title",
3066
+ * cardLocator: page.getByTestId("roles-tab"),
3067
+ * });
3068
+ * @endexample
3069
+ */
3070
+ verifyAdminPanelCard: ({
3071
+ cardLocator,
3072
+ title,
3073
+ description
3074
+ }: VerifyAdminPanelCardProps) => Promise<[void, void, void]>;
3075
+ /**
3076
+ *
3077
+ * Used to delete a role through the UI.
3078
+ *
3079
+ * roleName (required): The name of the role to delete.
3080
+ *
3081
+ * @example
3082
+ *
3083
+ * await rolesPage.deleteRoleViaUI("Custom Role");
3084
+ * @endexample
3085
+ */
3086
+ deleteRoleViaUI: (roleName: string) => Promise<void>;
3087
+ /**
3088
+ *
3089
+ * Used to verify role permissions visibility.
3090
+ *
3091
+ * allPermissions (required): Object containing all possible permissions.
3092
+ *
3093
+ * rolePermissions (required): Array of permissions assigned to the role.
3094
+ *
3095
+ * @example
3096
+ *
3097
+ * await rolesPage.verifyPermissions({
3098
+ * allPermissions: { adminPanel: "settings-nav-tab", members: "members-nav-tab" },
3099
+ * rolePermissions: ["members-nav-tab"]
3100
+ * });
3101
+ * @endexample
3102
+ */
3103
+ verifyPermissions: ({
3104
+ allPermissions,
3105
+ rolePermissions
3106
+ }: {
3107
+ allPermissions: object;
3108
+ rolePermissions: string[];
3109
+ }) => Promise<void[]>;
3110
+ /**
3111
+ *
3112
+ * Used to verify role-specific link access.
3113
+ *
3114
+ * roleAccessableLinks (optional): Array of links the role can access.
3115
+ *
3116
+ * adminAccessableLinks (required): Array of links an admin can access.
3117
+ *
3118
+ * @example
3119
+ *
3120
+ * await rolesPage.verifyRoleSpecificLinkAccess({
3121
+ * roleAccessableLinks: ["/themes","/seo","roles"],
3122
+ * adminAccessableLinks: ["/themes"]
3123
+ * });
3124
+ * @endexample
3125
+ */
3126
+ verifyRoleSpecificLinkAccess: ({
3127
+ roleAccessableLinks,
3128
+ adminAccessableLinks
3129
+ }: {
3130
+ roleAccessableLinks?: string[];
3131
+ adminAccessableLinks: string[];
3132
+ }) => Promise<void>;
3133
+ }
2851
3134
  declare class SidebarSection {
2852
3135
  page: Page;
2853
3136
  neetoPlaywrightUtilities: CustomCommands;
@@ -3178,6 +3461,14 @@ declare const SINGULAR: {
3178
3461
  declare const PLURAL: {
3179
3462
  count: number;
3180
3463
  };
3464
+ declare const COLOR: {
3465
+ transparent: string;
3466
+ softBlue: string;
3467
+ };
3468
+ declare const DATE_TEXTS: {
3469
+ now: string;
3470
+ nextYear: string;
3471
+ };
3181
3472
  declare const USER_AGENTS: {
3182
3473
  windows: string;
3183
3474
  mac: string;
@@ -5135,6 +5426,8 @@ declare const ZAPIER_SELECTORS: {
5135
5426
  *
5136
5427
  * columnHeaderTitle: Selector for column header title.
5137
5428
  *
5429
+ * columnMenuButton: Selector for column menu button.
5430
+ *
5138
5431
  */
5139
5432
  declare const TABLE_SELECTORS: {
5140
5433
  freezeUnfreezeButton: string;
@@ -5142,6 +5435,7 @@ declare const TABLE_SELECTORS: {
5142
5435
  descendingButton: string;
5143
5436
  hideButton: string;
5144
5437
  columnHeaderTitle: (columnName: string) => string;
5438
+ columnMenuButton: string;
5145
5439
  };
5146
5440
  /**
5147
5441
  *
@@ -5987,4 +6281,4 @@ interface Overrides {
5987
6281
  * @endexample
5988
6282
  */
5989
6283
  declare const definePlaywrightConfig: (overrides: Overrides) => _playwright_test.PlaywrightTestConfig<{}, {}>;
5990
- export { API_ROUTES, AUDIT_LOGS_TEXTS, AuditLogsPage, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, COMMON_TEXTS, CREDENTIALS, CustomCommands, type CustomFixture, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, ENGAGE_TEXTS, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GooglePage, 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, MailerUtils, Member, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PLURAL, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SELECT_COUNTRY, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, TagsPage, TeamMembers, ThankYouPage, USER_AGENTS, WEBHOOK_SELECTORS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, currencyUtils, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
6284
+ export { API_ROUTES, AUDIT_LOGS_TEXTS, ApiKeysPage, AuditLogsPage, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, CREDENTIALS, CustomCommands, type CustomFixture, DATE_TEXTS, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, ENGAGE_TEXTS, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GooglePage, 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, MailerUtils, Member, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PLURAL, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RolesPage, SELECT_COUNTRY, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, TagsPage, TeamMembers, ThankYouPage, USER_AGENTS, WEBHOOK_SELECTORS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, currencyUtils, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };