@bigbinary/neeto-commons-frontend 3.0.5 → 3.0.7
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/{constants.cjs.js → cjs/constants/index.js} +11 -10
- package/cjs/constants/index.js.map +1 -0
- package/cjs/cypress-utils/commands.js +276 -0
- package/cjs/cypress-utils/commands.js.map +1 -0
- package/cjs/cypress-utils/constants/index.js +14 -0
- package/cjs/cypress-utils/constants/index.js.map +1 -0
- package/cjs/cypress-utils/constants/routes.js +40 -0
- package/cjs/cypress-utils/constants/routes.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/common.js +103 -0
- package/cjs/cypress-utils/constants/selectors/common.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/editor.js +29 -0
- package/cjs/cypress-utils/constants/selectors/editor.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/ipRestriction.js +19 -0
- package/cjs/cypress-utils/constants/selectors/ipRestriction.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/login.js +21 -0
- package/cjs/cypress-utils/constants/selectors/login.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/member.js +65 -0
- package/cjs/cypress-utils/constants/selectors/member.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/navigation.js +28 -0
- package/cjs/cypress-utils/constants/selectors/navigation.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/roles.js +24 -0
- package/cjs/cypress-utils/constants/selectors/roles.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/signUp.js +23 -0
- package/cjs/cypress-utils/constants/selectors/signUp.js.map +1 -0
- package/cjs/cypress-utils/constants/selectors/tags.js +31 -0
- package/cjs/cypress-utils/constants/selectors/tags.js.map +1 -0
- package/cjs/cypress-utils/constants/texts/common.js +40 -0
- package/cjs/cypress-utils/constants/texts/common.js.map +1 -0
- package/cjs/cypress-utils/constants/texts/member.js +68 -0
- package/cjs/cypress-utils/constants/texts/member.js.map +1 -0
- package/cjs/cypress-utils/constants/texts/navigation.js +24 -0
- package/cjs/cypress-utils/constants/texts/navigation.js.map +1 -0
- package/cjs/cypress-utils/constants/texts/roles.js +25 -0
- package/cjs/cypress-utils/constants/texts/roles.js.map +1 -0
- package/cjs/cypress-utils/constants/texts/signUp.js +14 -0
- package/cjs/cypress-utils/constants/texts/signUp.js.map +1 -0
- package/cjs/cypress-utils/constants/texts/tags.js +28 -0
- package/cjs/cypress-utils/constants/texts/tags.js.map +1 -0
- package/cjs/cypress-utils/fixtures/fake.js +177 -0
- package/cjs/cypress-utils/fixtures/fake.js.map +1 -0
- package/cjs/cypress-utils/index.js +226 -0
- package/cjs/cypress-utils/index.js.map +1 -0
- package/cjs/cypress-utils/utils/authentication.js +45 -0
- package/cjs/cypress-utils/utils/authentication.js.map +1 -0
- package/cjs/cypress-utils/utils/common.js +92 -0
- package/cjs/cypress-utils/utils/common.js.map +1 -0
- package/cjs/cypress-utils/utils/date.js +28 -0
- package/cjs/cypress-utils/utils/date.js.map +1 -0
- package/cjs/cypress-utils/utils/email.js +165 -0
- package/cjs/cypress-utils/utils/email.js.map +1 -0
- package/cjs/cypress-utils/utils/member.js +352 -0
- package/cjs/cypress-utils/utils/member.js.map +1 -0
- package/cjs/cypress-utils/utils/navigation.js +208 -0
- package/cjs/cypress-utils/utils/navigation.js.map +1 -0
- package/cjs/cypress-utils/utils/organization.js +109 -0
- package/cjs/cypress-utils/utils/organization.js.map +1 -0
- package/cjs/cypress-utils/utils/validation.js +17 -0
- package/cjs/cypress-utils/utils/validation.js.map +1 -0
- package/cjs/initializers/axios/index.js +199 -0
- package/cjs/initializers/axios/index.js.map +1 -0
- package/cjs/initializers/axios/paramsSerializer.js +27 -0
- package/cjs/initializers/axios/paramsSerializer.js.map +1 -0
- package/cjs/initializers/constants.js +17 -0
- package/cjs/initializers/constants.js.map +1 -0
- package/cjs/initializers/globalProps.js +15 -0
- package/cjs/initializers/globalProps.js.map +1 -0
- package/cjs/initializers/i18n.js +68 -0
- package/cjs/initializers/i18n.js.map +1 -0
- package/cjs/initializers/index.js +51 -0
- package/cjs/initializers/index.js.map +1 -0
- package/cjs/initializers/logger.js +17 -0
- package/cjs/initializers/logger.js.map +1 -0
- package/cjs/initializers/reactDevTools.js +26 -0
- package/cjs/initializers/reactDevTools.js.map +1 -0
- package/cjs/initializers/utils/customFormatters.js +43 -0
- package/cjs/initializers/utils/customFormatters.js.map +1 -0
- package/cjs/initializers/utils/customPostProcessors.js +21 -0
- package/cjs/initializers/utils/customPostProcessors.js.map +1 -0
- package/cjs/initializers/utils.js +37 -0
- package/cjs/initializers/utils.js.map +1 -0
- package/cjs/react-utils/BrowserPushNotifications/devices.js +26 -0
- package/cjs/react-utils/BrowserPushNotifications/devices.js.map +1 -0
- package/cjs/react-utils/BrowserPushNotifications/index.js +19 -0
- package/cjs/react-utils/BrowserPushNotifications/index.js.map +1 -0
- package/cjs/react-utils/BrowserPushNotifications/pushHelper.js +116 -0
- package/cjs/react-utils/BrowserPushNotifications/pushHelper.js.map +1 -0
- package/cjs/react-utils/BrowserPushNotifications/registerServiceWorker.js +146 -0
- package/cjs/react-utils/BrowserPushNotifications/registerServiceWorker.js.map +1 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js +153 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js.map +1 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/constants.js +9 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/constants.js.map +1 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/index.js +59 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/index.js.map +1 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/utils.js +17 -0
- package/cjs/react-utils/HoneybadgerErrorBoundary/utils.js.map +1 -0
- package/cjs/react-utils/PrivateRoute.js +80 -0
- package/cjs/react-utils/PrivateRoute.js.map +1 -0
- package/cjs/react-utils/constants/constants.js +11 -0
- package/cjs/react-utils/constants/constants.js.map +1 -0
- package/cjs/react-utils/constants/index.js +28 -0
- package/cjs/react-utils/constants/index.js.map +1 -0
- package/cjs/react-utils/constants/query.js +11 -0
- package/cjs/react-utils/constants/query.js.map +1 -0
- package/cjs/react-utils/index.js +242 -0
- package/cjs/react-utils/index.js.map +1 -0
- package/cjs/react-utils/metaClick.js +16 -0
- package/cjs/react-utils/metaClick.js.map +1 -0
- package/cjs/react-utils/useDebounce.js +28 -0
- package/cjs/react-utils/useDebounce.js.map +1 -0
- package/cjs/react-utils/useDisplayErrorPage.js +23 -0
- package/cjs/react-utils/useDisplayErrorPage.js.map +1 -0
- package/cjs/react-utils/useFetchNeetoApps/apis/neeto_apps.js +17 -0
- package/cjs/react-utils/useFetchNeetoApps/apis/neeto_apps.js.map +1 -0
- package/cjs/react-utils/useFetchNeetoApps/index.js +14 -0
- package/cjs/react-utils/useFetchNeetoApps/index.js.map +1 -0
- package/cjs/react-utils/useFetchNeetoApps/useFetchNeetoApps.js +27 -0
- package/cjs/react-utils/useFetchNeetoApps/useFetchNeetoApps.js.map +1 -0
- package/cjs/react-utils/useFieldSubmit.js +33 -0
- package/cjs/react-utils/useFieldSubmit.js.map +1 -0
- package/cjs/react-utils/useFuncDebounce.js +27 -0
- package/cjs/react-utils/useFuncDebounce.js.map +1 -0
- package/cjs/react-utils/useHotKeys/constants.js +36 -0
- package/cjs/react-utils/useHotKeys/constants.js.map +1 -0
- package/cjs/react-utils/useHotKeys/index.js +14 -0
- package/cjs/react-utils/useHotKeys/index.js.map +1 -0
- package/cjs/react-utils/useHotKeys/useHotKeys.js +65 -0
- package/cjs/react-utils/useHotKeys/useHotKeys.js.map +1 -0
- package/cjs/react-utils/useHotKeys/utils.js +37 -0
- package/cjs/react-utils/useHotKeys/utils.js.map +1 -0
- package/cjs/react-utils/useIsElementVisibleInDom/index.js +14 -0
- package/cjs/react-utils/useIsElementVisibleInDom/index.js.map +1 -0
- package/cjs/react-utils/useIsElementVisibleInDom/useForceUpdate.js +23 -0
- package/cjs/react-utils/useIsElementVisibleInDom/useForceUpdate.js.map +1 -0
- package/cjs/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js +34 -0
- package/cjs/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js.map +1 -0
- package/cjs/react-utils/useKeyboardShortcutsPaneState.js +36 -0
- package/cjs/react-utils/useKeyboardShortcutsPaneState.js.map +1 -0
- package/cjs/react-utils/useLocalStorage.js +39 -0
- package/cjs/react-utils/useLocalStorage.js.map +1 -0
- package/cjs/react-utils/useMutationWithInvalidation.js +33 -0
- package/cjs/react-utils/useMutationWithInvalidation.js.map +1 -0
- package/cjs/react-utils/useOnClickOutside.js +32 -0
- package/cjs/react-utils/useOnClickOutside.js.map +1 -0
- package/cjs/react-utils/usePersistedQuery.js +59 -0
- package/cjs/react-utils/usePersistedQuery.js.map +1 -0
- package/cjs/react-utils/usePrevious.js +17 -0
- package/cjs/react-utils/usePrevious.js.map +1 -0
- package/cjs/react-utils/useQueryParams.js +15 -0
- package/cjs/react-utils/useQueryParams.js.map +1 -0
- package/cjs/react-utils/useRegisterNavigationCheckpoint.js +43 -0
- package/cjs/react-utils/useRegisterNavigationCheckpoint.js.map +1 -0
- package/cjs/react-utils/useStateWithDependency.js +23 -0
- package/cjs/react-utils/useStateWithDependency.js.map +1 -0
- package/cjs/react-utils/useTimer.js +51 -0
- package/cjs/react-utils/useTimer.js.map +1 -0
- package/cjs/react-utils/useUpdateEffect.js +21 -0
- package/cjs/react-utils/useUpdateEffect.js.map +1 -0
- package/cjs/react-utils/withImmutableActions.js +29 -0
- package/cjs/react-utils/withImmutableActions.js.map +1 -0
- package/cjs/react-utils/withT.js +14 -0
- package/cjs/react-utils/withT.js.map +1 -0
- package/cjs/react-utils/withTitle.js +44 -0
- package/cjs/react-utils/withTitle.js.map +1 -0
- package/cjs/utils/axios.js +17 -0
- package/cjs/utils/axios.js.map +1 -0
- package/cjs/utils/createSubscription.js +22 -0
- package/cjs/utils/createSubscription.js.map +1 -0
- package/cjs/utils/currencyFormat.js +50 -0
- package/cjs/utils/currencyFormat.js.map +1 -0
- package/cjs/utils/datetime.js +69 -0
- package/cjs/utils/datetime.js.map +1 -0
- package/cjs/utils/general.js +193 -0
- package/cjs/utils/general.js.map +1 -0
- package/cjs/utils/index.js +72 -0
- package/cjs/utils/index.js.map +1 -0
- package/cjs/utils/permissions.js +25 -0
- package/cjs/utils/permissions.js.map +1 -0
- package/configs/scripts/getPkgTranslations.js +1 -1
- package/configs/scripts/jsdoc-builder/constants.mjs +1 -1
- package/configs/scripts/jsdoc-builder/index.mjs +1 -1
- package/configs/webpack/rules.js +2 -1
- package/constants/index.js +13 -0
- package/constants/index.js.map +1 -0
- package/cypress-utils/commands.js +268 -0
- package/cypress-utils/commands.js.map +1 -0
- package/cypress-utils/constants/index.js +7 -0
- package/cypress-utils/constants/index.js.map +1 -0
- package/cypress-utils/constants/routes.js +33 -0
- package/cypress-utils/constants/routes.js.map +1 -0
- package/cypress-utils/constants/selectors/common.js +94 -0
- package/cypress-utils/constants/selectors/common.js.map +1 -0
- package/cypress-utils/constants/selectors/editor.js +22 -0
- package/cypress-utils/constants/selectors/editor.js.map +1 -0
- package/cypress-utils/constants/selectors/ipRestriction.js +12 -0
- package/cypress-utils/constants/selectors/ipRestriction.js.map +1 -0
- package/cypress-utils/constants/selectors/login.js +14 -0
- package/cypress-utils/constants/selectors/login.js.map +1 -0
- package/cypress-utils/constants/selectors/member.js +56 -0
- package/cypress-utils/constants/selectors/member.js.map +1 -0
- package/cypress-utils/constants/selectors/navigation.js +20 -0
- package/cypress-utils/constants/selectors/navigation.js.map +1 -0
- package/cypress-utils/constants/selectors/roles.js +17 -0
- package/cypress-utils/constants/selectors/roles.js.map +1 -0
- package/cypress-utils/constants/selectors/signUp.js +16 -0
- package/cypress-utils/constants/selectors/signUp.js.map +1 -0
- package/cypress-utils/constants/selectors/tags.js +23 -0
- package/cypress-utils/constants/selectors/tags.js.map +1 -0
- package/cypress-utils/constants/texts/common.js +33 -0
- package/cypress-utils/constants/texts/common.js.map +1 -0
- package/cypress-utils/constants/texts/member.js +59 -0
- package/cypress-utils/constants/texts/member.js.map +1 -0
- package/cypress-utils/constants/texts/navigation.js +16 -0
- package/cypress-utils/constants/texts/navigation.js.map +1 -0
- package/cypress-utils/constants/texts/roles.js +18 -0
- package/cypress-utils/constants/texts/roles.js.map +1 -0
- package/cypress-utils/constants/texts/signUp.js +7 -0
- package/cypress-utils/constants/texts/signUp.js.map +1 -0
- package/cypress-utils/constants/texts/tags.js +21 -0
- package/cypress-utils/constants/texts/tags.js.map +1 -0
- package/cypress-utils/fixtures/fake.js +171 -0
- package/cypress-utils/fixtures/fake.js.map +1 -0
- package/cypress-utils/index.js +21 -0
- package/cypress-utils/index.js.map +1 -0
- package/cypress-utils/utils/authentication.js +38 -0
- package/cypress-utils/utils/authentication.js.map +1 -0
- package/cypress-utils/utils/common.js +75 -0
- package/cypress-utils/utils/common.js.map +1 -0
- package/cypress-utils/utils/date.js +20 -0
- package/cypress-utils/utils/date.js.map +1 -0
- package/cypress-utils/utils/email.js +156 -0
- package/cypress-utils/utils/email.js.map +1 -0
- package/cypress-utils/utils/member.js +344 -0
- package/cypress-utils/utils/member.js.map +1 -0
- package/cypress-utils/utils/navigation.js +200 -0
- package/cypress-utils/utils/navigation.js.map +1 -0
- package/cypress-utils/utils/organization.js +102 -0
- package/cypress-utils/utils/organization.js.map +1 -0
- package/cypress-utils/utils/validation.js +10 -0
- package/cypress-utils/utils/validation.js.map +1 -0
- package/initializers/axios/index.js +192 -0
- package/initializers/axios/index.js.map +1 -0
- package/initializers/axios/paramsSerializer.js +18 -0
- package/initializers/axios/paramsSerializer.js.map +1 -0
- package/initializers/constants.js +8 -0
- package/initializers/constants.js.map +1 -0
- package/initializers/globalProps.js +8 -0
- package/initializers/globalProps.js.map +1 -0
- package/initializers/i18n.js +61 -0
- package/initializers/i18n.js.map +1 -0
- package/initializers/index.js +28 -0
- package/initializers/index.js.map +1 -0
- package/initializers/logger.js +10 -0
- package/initializers/logger.js.map +1 -0
- package/initializers/reactDevTools.js +19 -0
- package/initializers/reactDevTools.js.map +1 -0
- package/initializers/utils/customFormatters.js +34 -0
- package/initializers/utils/customFormatters.js.map +1 -0
- package/initializers/utils/customPostProcessors.js +14 -0
- package/initializers/utils/customPostProcessors.js.map +1 -0
- package/initializers/utils.js +29 -0
- package/initializers/utils.js.map +1 -0
- package/package.json +51 -158
- package/pure.d.ts +384 -0
- package/react-utils/BrowserPushNotifications/devices.js +18 -0
- package/react-utils/BrowserPushNotifications/devices.js.map +1 -0
- package/react-utils/BrowserPushNotifications/index.js +1 -0
- package/react-utils/BrowserPushNotifications/index.js.map +1 -0
- package/react-utils/BrowserPushNotifications/pushHelper.js +107 -0
- package/react-utils/BrowserPushNotifications/pushHelper.js.map +1 -0
- package/react-utils/BrowserPushNotifications/registerServiceWorker.js +137 -0
- package/react-utils/BrowserPushNotifications/registerServiceWorker.js.map +1 -0
- package/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js +144 -0
- package/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js.map +1 -0
- package/react-utils/HoneybadgerErrorBoundary/constants.js +1 -0
- package/react-utils/HoneybadgerErrorBoundary/constants.js.map +1 -0
- package/react-utils/HoneybadgerErrorBoundary/index.js +52 -0
- package/react-utils/HoneybadgerErrorBoundary/index.js.map +1 -0
- package/react-utils/HoneybadgerErrorBoundary/utils.js +9 -0
- package/react-utils/HoneybadgerErrorBoundary/utils.js.map +1 -0
- package/react-utils/PrivateRoute.js +72 -0
- package/react-utils/PrivateRoute.js.map +1 -0
- package/react-utils/constants/constants.js +3 -0
- package/react-utils/constants/constants.js.map +1 -0
- package/react-utils/constants/index.js +3 -0
- package/react-utils/constants/index.js.map +1 -0
- package/react-utils/constants/query.js +4 -0
- package/react-utils/constants/query.js.map +1 -0
- package/react-utils/index.js +33 -0
- package/react-utils/index.js.map +1 -0
- package/react-utils/metaClick.js +8 -0
- package/react-utils/metaClick.js.map +1 -0
- package/react-utils/useDebounce.js +20 -0
- package/react-utils/useDebounce.js.map +1 -0
- package/react-utils/useDisplayErrorPage.js +15 -0
- package/react-utils/useDisplayErrorPage.js.map +1 -0
- package/react-utils/useFetchNeetoApps/apis/neeto_apps.js +9 -0
- package/react-utils/useFetchNeetoApps/apis/neeto_apps.js.map +1 -0
- package/react-utils/useFetchNeetoApps/index.js +1 -0
- package/react-utils/useFetchNeetoApps/index.js.map +1 -0
- package/react-utils/useFetchNeetoApps/useFetchNeetoApps.js +19 -0
- package/react-utils/useFetchNeetoApps/useFetchNeetoApps.js.map +1 -0
- package/react-utils/useFieldSubmit.js +26 -0
- package/react-utils/useFieldSubmit.js.map +1 -0
- package/react-utils/useFuncDebounce.js +20 -0
- package/react-utils/useFuncDebounce.js.map +1 -0
- package/react-utils/useHotKeys/constants.js +25 -0
- package/react-utils/useHotKeys/constants.js.map +1 -0
- package/react-utils/useHotKeys/index.js +1 -0
- package/react-utils/useHotKeys/index.js.map +1 -0
- package/react-utils/useHotKeys/useHotKeys.js +57 -0
- package/react-utils/useHotKeys/useHotKeys.js.map +1 -0
- package/react-utils/useHotKeys/utils.js +29 -0
- package/react-utils/useHotKeys/utils.js.map +1 -0
- package/react-utils/useIsElementVisibleInDom/index.js +1 -0
- package/react-utils/useIsElementVisibleInDom/index.js.map +1 -0
- package/react-utils/useIsElementVisibleInDom/useForceUpdate.js +15 -0
- package/react-utils/useIsElementVisibleInDom/useForceUpdate.js.map +1 -0
- package/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js +26 -0
- package/react-utils/useIsElementVisibleInDom/useIsElementVisibleInDom.js.map +1 -0
- package/react-utils/useKeyboardShortcutsPaneState.js +29 -0
- package/react-utils/useKeyboardShortcutsPaneState.js.map +1 -0
- package/react-utils/useLocalStorage.js +31 -0
- package/react-utils/useLocalStorage.js.map +1 -0
- package/react-utils/useMutationWithInvalidation.js +25 -0
- package/react-utils/useMutationWithInvalidation.js.map +1 -0
- package/react-utils/useOnClickOutside.js +25 -0
- package/react-utils/useOnClickOutside.js.map +1 -0
- package/react-utils/usePersistedQuery.js +51 -0
- package/react-utils/usePersistedQuery.js.map +1 -0
- package/react-utils/usePrevious.js +10 -0
- package/react-utils/usePrevious.js.map +1 -0
- package/react-utils/useQueryParams.js +8 -0
- package/react-utils/useQueryParams.js.map +1 -0
- package/react-utils/useRegisterNavigationCheckpoint.js +35 -0
- package/react-utils/useRegisterNavigationCheckpoint.js.map +1 -0
- package/react-utils/useStateWithDependency.js +15 -0
- package/react-utils/useStateWithDependency.js.map +1 -0
- package/react-utils/useTimer.js +43 -0
- package/react-utils/useTimer.js.map +1 -0
- package/react-utils/useUpdateEffect.js +14 -0
- package/react-utils/useUpdateEffect.js.map +1 -0
- package/react-utils/withImmutableActions.js +22 -0
- package/react-utils/withImmutableActions.js.map +1 -0
- package/react-utils/withT.js +7 -0
- package/react-utils/withT.js.map +1 -0
- package/react-utils/withTitle.js +36 -0
- package/react-utils/withTitle.js.map +1 -0
- package/react-utils.d.ts +14 -2
- package/utils/axios.js +10 -0
- package/utils/axios.js.map +1 -0
- package/utils/createSubscription.js +15 -0
- package/utils/createSubscription.js.map +1 -0
- package/utils/currencyFormat.js +42 -0
- package/utils/currencyFormat.js.map +1 -0
- package/utils/datetime.js +60 -0
- package/utils/datetime.js.map +1 -0
- package/utils/general.js +172 -0
- package/utils/general.js.map +1 -0
- package/utils/index.js +7 -0
- package/utils/index.js.map +1 -0
- package/utils/permissions.js +16 -0
- package/utils/permissions.js.map +1 -0
- package/utils.d.ts +18 -2
- package/README.md +0 -173
- package/constants.cjs.js.map +0 -1
- package/constants.js +0 -15
- package/constants.js.map +0 -1
- package/cypress-utils.cjs.js +0 -1819
- package/cypress-utils.cjs.js.map +0 -1
- package/cypress-utils.js +0 -1773
- package/cypress-utils.js.map +0 -1
- package/initializers.cjs.js +0 -2648
- package/initializers.cjs.js.map +0 -1
- package/initializers.js +0 -2634
- package/initializers.js.map +0 -1
- package/react-utils.cjs.js +0 -4915
- package/react-utils.cjs.js.map +0 -1
- package/react-utils.js +0 -4860
- package/react-utils.js.map +0 -1
- package/utils.cjs.js +0 -1280
- package/utils.cjs.js.map +0 -1
- package/utils.js +0 -1248
- package/utils.js.map +0 -1
- /package/{src/translations → translations}/en.json +0 -0
package/cypress-utils.cjs.js
DELETED
|
@@ -1,1819 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var faker = require('@faker-js/faker');
|
|
6
|
-
var dayjs = require('dayjs');
|
|
7
|
-
|
|
8
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
-
|
|
10
|
-
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
11
|
-
|
|
12
|
-
function _typeof(obj) {
|
|
13
|
-
"@babel/helpers - typeof";
|
|
14
|
-
|
|
15
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
16
|
-
return typeof obj;
|
|
17
|
-
} : function (obj) {
|
|
18
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
19
|
-
}, _typeof(obj);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function _toPrimitive(input, hint) {
|
|
23
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
24
|
-
var prim = input[Symbol.toPrimitive];
|
|
25
|
-
if (prim !== undefined) {
|
|
26
|
-
var res = prim.call(input, hint || "default");
|
|
27
|
-
if (_typeof(res) !== "object") return res;
|
|
28
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
29
|
-
}
|
|
30
|
-
return (hint === "string" ? String : Number)(input);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _toPropertyKey(arg) {
|
|
34
|
-
var key = _toPrimitive(arg, "string");
|
|
35
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function _defineProperty(obj, key, value) {
|
|
39
|
-
key = _toPropertyKey(key);
|
|
40
|
-
if (key in obj) {
|
|
41
|
-
Object.defineProperty(obj, key, {
|
|
42
|
-
value: value,
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
writable: true
|
|
46
|
-
});
|
|
47
|
-
} else {
|
|
48
|
-
obj[key] = value;
|
|
49
|
-
}
|
|
50
|
-
return obj;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _arrayLikeToArray(arr, len) {
|
|
54
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
55
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
56
|
-
return arr2;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function _arrayWithoutHoles(arr) {
|
|
60
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function _iterableToArray(iter) {
|
|
64
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
68
|
-
if (!o) return;
|
|
69
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
70
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
71
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
72
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
73
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function _nonIterableSpread() {
|
|
77
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function _toConsumableArray(arr) {
|
|
81
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
var environment = {
|
|
85
|
-
development: "development",
|
|
86
|
-
staging: "staging",
|
|
87
|
-
review: "review",
|
|
88
|
-
production: "production"
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
92
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
93
|
-
var getCountFromText = function getCountFromText(countText) {
|
|
94
|
-
return Number(countText.text().trim().split(" ")[0]);
|
|
95
|
-
};
|
|
96
|
-
var env = {
|
|
97
|
-
isDevelopment: Cypress.env("configFile") === environment.development,
|
|
98
|
-
isReview: Cypress.env("configFile") === environment.review,
|
|
99
|
-
isStaging: Cypress.env("configFile") === environment.staging,
|
|
100
|
-
isProduction: Cypress.env("configFile") === environment.production
|
|
101
|
-
};
|
|
102
|
-
env.isNightlyRun = env.isProduction || env.isStaging;
|
|
103
|
-
env.tld = env.isProduction ? "com" : "net";
|
|
104
|
-
var isStagingEnv = Cypress.env("configFile") === environment.staging;
|
|
105
|
-
var dataCy = function dataCy(value) {
|
|
106
|
-
var suffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
107
|
-
return "[data-cy='".concat(value, "']").concat(suffix);
|
|
108
|
-
};
|
|
109
|
-
var dataTestId = function dataTestId(value) {
|
|
110
|
-
var suffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
111
|
-
return "[data-testid='".concat(value, "']").concat(suffix);
|
|
112
|
-
};
|
|
113
|
-
var setListCount = function setListCount(countSelector, alias) {
|
|
114
|
-
return cy.get(countSelector).then(function (countText) {
|
|
115
|
-
cy.wrap(getCountFromText(countText)).as(alias);
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
var verifyListCount = function verifyListCount(countSelector, count) {
|
|
119
|
-
return cy.get(countSelector).then(function (countText) {
|
|
120
|
-
cy.wrap(getCountFromText(countText)).should("eq", count);
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
var getUrl = function getUrl(path) {
|
|
124
|
-
return "/api/v1/".concat(path);
|
|
125
|
-
};
|
|
126
|
-
var getTestTitle = function getTestTitle() {
|
|
127
|
-
var ctx = Cypress.mocha.getRunner().suite.ctx;
|
|
128
|
-
return ctx.currentTest.parent.title;
|
|
129
|
-
};
|
|
130
|
-
var joinHyphenCase = function joinHyphenCase() {
|
|
131
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
132
|
-
args[_key] = arguments[_key];
|
|
133
|
-
}
|
|
134
|
-
return args.join(" ").replace(/\s+/g, "-").toLowerCase();
|
|
135
|
-
};
|
|
136
|
-
var hyphenize = function hyphenize(input) {
|
|
137
|
-
var fallbackString = "";
|
|
138
|
-
if (typeof input === "number") return String(input);
|
|
139
|
-
if (input && typeof input === "string" && input.replace) {
|
|
140
|
-
return input.replace(/[\s_]/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/-+/g, "-").toLowerCase();
|
|
141
|
-
}
|
|
142
|
-
return fallbackString;
|
|
143
|
-
};
|
|
144
|
-
var initializeCredentials = function initializeCredentials(stagingData) {
|
|
145
|
-
cy.task("getGlobalState").then(function (state) {
|
|
146
|
-
var newState = _objectSpread$2(_objectSpread$2({}, state), {}, {
|
|
147
|
-
businessName: state.businessName || stagingData.businessName,
|
|
148
|
-
currentUserName: state.currentUserName || stagingData.currentUserName,
|
|
149
|
-
email: state.email || stagingData.email,
|
|
150
|
-
firstName: state.firstName || stagingData.firstName,
|
|
151
|
-
lastName: state.lastName || stagingData.lastName,
|
|
152
|
-
subdomainName: state.subdomainName || stagingData.subdomainName,
|
|
153
|
-
skipSetup: state.skipSetup
|
|
154
|
-
});
|
|
155
|
-
if (isStagingEnv) {
|
|
156
|
-
var baseUrl = "https://".concat(newState.subdomainName, ".").concat(stagingData.domain);
|
|
157
|
-
Cypress.config("baseUrl", baseUrl);
|
|
158
|
-
}
|
|
159
|
-
cy.task("bulkUpdateGlobalState", newState);
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
var allPath = function allPath() {
|
|
164
|
-
return "".concat(Cypress.config("baseUrl"), "/**");
|
|
165
|
-
};
|
|
166
|
-
var tld = env.isProduction ? "com" : "net";
|
|
167
|
-
var requestApis = {
|
|
168
|
-
countries: getUrl("countries"),
|
|
169
|
-
signUp: getUrl("signups/**"),
|
|
170
|
-
subdomainAvailability: getUrl("subdomain_availability/**"),
|
|
171
|
-
teamMembers: {
|
|
172
|
-
all: "/team_members*/**",
|
|
173
|
-
bulkUpdate: "/team_members/teams/bulk_update",
|
|
174
|
-
index: "/team_members/teams",
|
|
175
|
-
show: function show(id) {
|
|
176
|
-
return "/team_members/teams/".concat(id);
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
allChatPath: "https://*.neetochat.".concat(tld).concat(getUrl("**")),
|
|
180
|
-
myProfilePath: function myProfilePath(subdomain) {
|
|
181
|
-
return "https://".concat(subdomain, ".neetoauth.").concat(tld, "/my/profile");
|
|
182
|
-
},
|
|
183
|
-
settingsPath: function settingsPath(subdomain) {
|
|
184
|
-
return "https://".concat(subdomain, ".neetoauth.").concat(tld, "/settings");
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
var urlPaths = {
|
|
188
|
-
members: "/members"
|
|
189
|
-
};
|
|
190
|
-
Object.defineProperty(requestApis, "allPath", {
|
|
191
|
-
get: allPath
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
var commonSelectors = {
|
|
195
|
-
alertTitle: dataCy("alert-title"),
|
|
196
|
-
alertModalMessage: dataCy("alert-message"),
|
|
197
|
-
alertModalSubmitButton: dataCy("alert-submit-button"),
|
|
198
|
-
checkbox: dataCy("nui-checkbox-input"),
|
|
199
|
-
checkboxLabel: dataCy("nui-checkbox-label"),
|
|
200
|
-
dropdownContainer: dataCy("nui-dropdown-container"),
|
|
201
|
-
dropdownIcon: dataCy("nui-dropdown-icon"),
|
|
202
|
-
heading: dataCy("main-header"),
|
|
203
|
-
paneBody: dataCy("pane-body"),
|
|
204
|
-
paneHeader: dataCy("pane-header"),
|
|
205
|
-
profileSidebar: dataCy("profile-section"),
|
|
206
|
-
selectOption: function selectOption(label) {
|
|
207
|
-
return dataCy("".concat(hyphenize(label), "-select-option"));
|
|
208
|
-
},
|
|
209
|
-
toastMessage: dataCy("toastr-message-container"),
|
|
210
|
-
toastCloseButton: dataCy("toastr-close-button"),
|
|
211
|
-
windowAlert: "#alert-box",
|
|
212
|
-
body: "body",
|
|
213
|
-
toastIcon: ".Toastify__toast-icon",
|
|
214
|
-
paneModalCrossIcon: dataCy("pane-close-button"),
|
|
215
|
-
inputField: dataCy("nui-input-field"),
|
|
216
|
-
alertConfirmationText: dataCy("alert-confirmation-text"),
|
|
217
|
-
alertCancelButton: dataCy("alert-cancel-button"),
|
|
218
|
-
alertModalCrossIcon: dataCy("modal-close-button"),
|
|
219
|
-
saveChangesButton: dataCy("save-changes-button"),
|
|
220
|
-
cancelButton: dataCy("cancel-button"),
|
|
221
|
-
inputFieldError: dataCy("nui-input-error"),
|
|
222
|
-
selectDropDownError: dataCy("nui-select-error"),
|
|
223
|
-
subTitleHeading: function subTitleHeading(index) {
|
|
224
|
-
return dataCy("menubar-subtitle-heading", ":eq(".concat(index, ")"));
|
|
225
|
-
},
|
|
226
|
-
noDataTitle: dataCy("no-data-title"),
|
|
227
|
-
noDataDescription: dataCy("no-data-description"),
|
|
228
|
-
backdrop: dataCy("neeto-backdrop"),
|
|
229
|
-
menuBarHeading: dataCy("menubar-heading"),
|
|
230
|
-
nthTabItem: function nthTabItem(index) {
|
|
231
|
-
return dataCy("tab-item", ":eq(".concat(index, ")"));
|
|
232
|
-
},
|
|
233
|
-
dropdownWrapper: function dropdownWrapper(index) {
|
|
234
|
-
return dataCy("nui-select-container-wrapper", ":eq(".concat(index, ")"));
|
|
235
|
-
},
|
|
236
|
-
toggleButton: dataCy("menubar-toggle-button"),
|
|
237
|
-
tooltip: dataCy("tooltip-box"),
|
|
238
|
-
articlePageTitle: ".serene-article__title",
|
|
239
|
-
tabItem: dataCy("tab-item"),
|
|
240
|
-
labelInputError: dataCy("label-input-error"),
|
|
241
|
-
urlInputError: dataCy("url-input-error"),
|
|
242
|
-
noDataPrimaryButton: dataCy("no-data-primary-button"),
|
|
243
|
-
modalHeader: dataCy("modal-header"),
|
|
244
|
-
nameInputError: dataCy("name-input-error"),
|
|
245
|
-
selectContainer: dataCy("nui-select-container"),
|
|
246
|
-
dropdownMenu: dataCy("nui-select-menu"),
|
|
247
|
-
nthDropdownIcon: function nthDropdownIcon(index) {
|
|
248
|
-
return dataCy("nui-dropdown-icon", ":eq(".concat(index, ")"));
|
|
249
|
-
},
|
|
250
|
-
sidebarToggle: dataCy("neeto-molecules-sidebar-toggler"),
|
|
251
|
-
customDataCy: function customDataCy(name) {
|
|
252
|
-
return dataCy(name);
|
|
253
|
-
},
|
|
254
|
-
leftSubHeader: dataCy("subheader-left"),
|
|
255
|
-
subheader: dataCy("subheader"),
|
|
256
|
-
settingsLink: dataCy("Settings"),
|
|
257
|
-
nthInputField: function nthInputField(index) {
|
|
258
|
-
return dataCy("nui-input-field", ":eq(".concat(index, ")"));
|
|
259
|
-
},
|
|
260
|
-
ticketFieldTextInput: function ticketFieldTextInput(label) {
|
|
261
|
-
return dataCy("".concat(hyphenize(label), "-text-input"));
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
var tableSelectors = {
|
|
265
|
-
nthColumn: function nthColumn(n) {
|
|
266
|
-
return "td:nth-child(".concat(n, ")");
|
|
267
|
-
},
|
|
268
|
-
tableBody: ".ant-table-body",
|
|
269
|
-
tableHeader: ".ant-table-thead th",
|
|
270
|
-
tableRow: ".ant-table-tbody tr",
|
|
271
|
-
spinner: ".ant-spin",
|
|
272
|
-
nthHeading: function nthHeading(n) {
|
|
273
|
-
return "tr > th:nth-child(".concat(n, ")");
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
var profileSelectors = {
|
|
277
|
-
tab: dataCy("profile-section"),
|
|
278
|
-
logoutLink: dataCy("profile-logout-button"),
|
|
279
|
-
myProfileButton: dataCy("my-profile-button"),
|
|
280
|
-
organizationSettingsButton: dataCy("profile-organization-settings-button"),
|
|
281
|
-
loader: dataTestId("spinner"),
|
|
282
|
-
appSwitcherBody: dataCy("app-switcher-body-wrapper"),
|
|
283
|
-
sidebarInfo: dataCy("sidebar-info"),
|
|
284
|
-
appSwitcherBackButton: dataCy("app-switcher-back-button")
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
var commonTexts = {
|
|
288
|
-
activate: "Activate",
|
|
289
|
-
block: "Block",
|
|
290
|
-
copiedToClipboard: "Copied to clipboard!",
|
|
291
|
-
crossSiteScript: "<script>alert('XSS')</script>",
|
|
292
|
-
deactivate: "Deactivate",
|
|
293
|
-
"delete": "Delete",
|
|
294
|
-
edit: "Edit",
|
|
295
|
-
invalidEmailMessage: "Please enter a valid email.",
|
|
296
|
-
invalidSearchInput: "Invalid search input",
|
|
297
|
-
logout: "Log out",
|
|
298
|
-
"new": "New",
|
|
299
|
-
takeAction: "Take action",
|
|
300
|
-
unblock: "Unblock",
|
|
301
|
-
toastIcon: "👍",
|
|
302
|
-
emailRequiredError: "Email is required.",
|
|
303
|
-
emailTakenMessage: "Email is already taken",
|
|
304
|
-
nameTakenMessage: "Name has already been taken",
|
|
305
|
-
all: "All",
|
|
306
|
-
proceed: "Proceed",
|
|
307
|
-
settings: "Settings",
|
|
308
|
-
unsavedChangesAlertTitle: "You have unsaved changes!",
|
|
309
|
-
unsavedChangesAlertMessage: "Are you sure you want to continue? All of your unsaved changes will be lost.",
|
|
310
|
-
clearFilters: "Clear filters",
|
|
311
|
-
filters: "Filters",
|
|
312
|
-
descriptionRequiredMessage: "Description is required.",
|
|
313
|
-
active: "active",
|
|
314
|
-
deactivated: "deactivated",
|
|
315
|
-
nameExistsMsg: "Name already exists",
|
|
316
|
-
cancel: "Cancel",
|
|
317
|
-
"continue": "Continue"
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
321
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
322
|
-
var initCustomCommands = function initCustomCommands() {
|
|
323
|
-
Cypress.Commands.add("clearAndType", function (selector, text) {
|
|
324
|
-
cy.get(selector).clear().type(text);
|
|
325
|
-
});
|
|
326
|
-
Cypress.Commands.add("clearAndTypeFast", function (selector, text) {
|
|
327
|
-
cy.get(selector).clear().type(text, {
|
|
328
|
-
delay: 0
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
Cypress.Commands.add("clearByClickAndTypeFast", function (selector, text) {
|
|
332
|
-
cy.get(selector).click().clear().type(text, {
|
|
333
|
-
delay: 0
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
Cypress.Commands.add("typeFast", function (selector, text) {
|
|
337
|
-
cy.get(selector).type(text, {
|
|
338
|
-
delay: 0
|
|
339
|
-
});
|
|
340
|
-
});
|
|
341
|
-
Cypress.Commands.add("typeAndEnter", function (selector, text) {
|
|
342
|
-
cy.get(selector).clear().type("".concat(text, "{enter}"));
|
|
343
|
-
});
|
|
344
|
-
Cypress.Commands.add("verifyToastMessage", function (message) {
|
|
345
|
-
cy.get(commonSelectors.toastMessage).should("be.visible").should("have.text", message);
|
|
346
|
-
|
|
347
|
-
// close toast message
|
|
348
|
-
cy.get(commonSelectors.toastCloseButton).click();
|
|
349
|
-
cy.get(commonSelectors.toastMessage).should("not.exist");
|
|
350
|
-
});
|
|
351
|
-
Cypress.Commands.add("verifyToastIcon", function () {
|
|
352
|
-
var closeToastr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
353
|
-
cy.document().its("body").find(commonSelectors.toastIcon).should("have.text", "👍");
|
|
354
|
-
closeToastr && cy.document().its("body").find(commonSelectors.toastCloseButton).click();
|
|
355
|
-
cy.document().its("body").find(commonSelectors.toastIcon).should("not.exist");
|
|
356
|
-
});
|
|
357
|
-
Cypress.Commands.add("continueOnAlert", function (args) {
|
|
358
|
-
var props = _typeof(args) === "object" ? args : {
|
|
359
|
-
alias: args
|
|
360
|
-
};
|
|
361
|
-
var alias = props.alias,
|
|
362
|
-
title = props.title,
|
|
363
|
-
_props$requestCount = props.requestCount,
|
|
364
|
-
requestCount = _props$requestCount === void 0 ? 1 : _props$requestCount,
|
|
365
|
-
verifyToastIcon = props.verifyToastIcon,
|
|
366
|
-
toastMessage = props.toastMessage;
|
|
367
|
-
var hasMoreThanOneRequest = requestCount > 1;
|
|
368
|
-
title && cy.get(commonSelectors.alertTitle).should("have.text", title);
|
|
369
|
-
cy.interceptApi(alias, requestCount);
|
|
370
|
-
cy.get(commonSelectors.alertModalSubmitButton).click();
|
|
371
|
-
cy.wait("@".concat(alias));
|
|
372
|
-
verifyToastIcon && cy.verifyToastIcon();
|
|
373
|
-
toastMessage && cy.verifyToastMessage(toastMessage);
|
|
374
|
-
hasMoreThanOneRequest && cy.waitForMultipleRequest("@".concat(alias), requestCount - 1);
|
|
375
|
-
});
|
|
376
|
-
Cypress.Commands.add("interceptApi", function (alias) {
|
|
377
|
-
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
378
|
-
return times > 0 && cy.intercept({
|
|
379
|
-
url: requestApis.allPath,
|
|
380
|
-
resourceType: "xhr",
|
|
381
|
-
times: times
|
|
382
|
-
}).as(alias);
|
|
383
|
-
});
|
|
384
|
-
Cypress.Commands.add("waitForMultipleRequest", function (alias) {
|
|
385
|
-
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
386
|
-
return cy.wrap(_toConsumableArray(new Array(times))).each(function () {
|
|
387
|
-
return cy.wait(alias);
|
|
388
|
-
});
|
|
389
|
-
});
|
|
390
|
-
Cypress.Commands.add("apiRequest", function (options) {
|
|
391
|
-
return cy.get("@requestHeaders").then(function (requestHeaders) {
|
|
392
|
-
return requestHeaders ? cy.request(_objectSpread$1(_objectSpread$1({}, options), {}, {
|
|
393
|
-
headers: _objectSpread$1(_objectSpread$1({}, requestHeaders), {}, {
|
|
394
|
-
"accept-encoding": "gzip"
|
|
395
|
-
})
|
|
396
|
-
})) : cy.log("No request headers found");
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
Cypress.Commands.add("reloadAndWait", function () {
|
|
400
|
-
var requestCount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
401
|
-
if (requestCount > 0) {
|
|
402
|
-
cy.interceptApi("reloadAllRequests", requestCount);
|
|
403
|
-
cy.reload();
|
|
404
|
-
cy.waitForMultipleRequest("@reloadAllRequests", requestCount);
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
Cypress.Commands.add("selectOption", function (containerSelector, optionText) {
|
|
408
|
-
cy.get(containerSelector).click().type(optionText);
|
|
409
|
-
cy.get(commonSelectors.selectOption(optionText)).invoke("click");
|
|
410
|
-
});
|
|
411
|
-
Cypress.Commands.add("clickDropdownOption", function (optionText) {
|
|
412
|
-
var dropdownSelector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : commonSelectors.dropdownIcon;
|
|
413
|
-
cy.get(dropdownSelector).click();
|
|
414
|
-
cy.get(commonSelectors.dropdownContainer).contains(optionText).invoke("click");
|
|
415
|
-
});
|
|
416
|
-
Cypress.Commands.add("getText", function (selector) {
|
|
417
|
-
return cy.get(selector).invoke("text");
|
|
418
|
-
});
|
|
419
|
-
Cypress.Commands.add("getValue", function (selector) {
|
|
420
|
-
return cy.get(selector).invoke("val");
|
|
421
|
-
});
|
|
422
|
-
|
|
423
|
-
// Deprecated. Use withinIframe.
|
|
424
|
-
Cypress.Commands.add("getIframe", function (iframeSelector) {
|
|
425
|
-
return cy.get(iframeSelector).its("0.contentDocument.body").should("not.be.empty");
|
|
426
|
-
});
|
|
427
|
-
Cypress.Commands.add("withinIframe", function (selector, callback) {
|
|
428
|
-
cy.get(selector, {
|
|
429
|
-
timeout: 10000
|
|
430
|
-
}).its("0.contentDocument.body").should("be.visible").and("not.be.empty");
|
|
431
|
-
cy.get(selector, {
|
|
432
|
-
timeout: 10000
|
|
433
|
-
}).its("0.contentDocument.body").eq(0).within(callback);
|
|
434
|
-
});
|
|
435
|
-
Cypress.Commands.add("openInSameTabOnClick", function (_ref) {
|
|
436
|
-
var url = _ref.url,
|
|
437
|
-
alias = _ref.alias,
|
|
438
|
-
selector = _ref.selector;
|
|
439
|
-
cy.window().then(function (win) {
|
|
440
|
-
cy.stub(win, "open").as(alias).callsFake(function (newUrl) {
|
|
441
|
-
return win.location.href = newUrl;
|
|
442
|
-
});
|
|
443
|
-
});
|
|
444
|
-
cy.get(selector).click();
|
|
445
|
-
cy.get("@".concat(alias)).should("be.called");
|
|
446
|
-
cy.url().should("include", url);
|
|
447
|
-
});
|
|
448
|
-
Cypress.Commands.add("globalState", function (key) {
|
|
449
|
-
return cy.task("getGlobalState", key);
|
|
450
|
-
});
|
|
451
|
-
Cypress.Commands.add("ifExist", function (selector, callback) {
|
|
452
|
-
cy.get(commonSelectors.body).then(function ($body) {
|
|
453
|
-
if ($body.find(selector).length) callback();
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
Cypress.Commands.add("ifNotExist", function (selector, callback) {
|
|
457
|
-
cy.get(commonSelectors.body).then(function ($body) {
|
|
458
|
-
if (!$body.find(selector).length) callback();
|
|
459
|
-
});
|
|
460
|
-
});
|
|
461
|
-
Cypress.Commands.add("dragAndDrop", function (_ref2) {
|
|
462
|
-
var subject = _ref2.subject,
|
|
463
|
-
target = _ref2.target,
|
|
464
|
-
_ref2$dragIndex = _ref2.dragIndex,
|
|
465
|
-
dragIndex = _ref2$dragIndex === void 0 ? 0 : _ref2$dragIndex,
|
|
466
|
-
_ref2$dropIndex = _ref2.dropIndex,
|
|
467
|
-
dropIndex = _ref2$dropIndex === void 0 ? 0 : _ref2$dropIndex;
|
|
468
|
-
cy.get(subject).should("be.visible", {
|
|
469
|
-
timeout: 20000
|
|
470
|
-
});
|
|
471
|
-
Cypress.log({
|
|
472
|
-
name: "DRAGNDROP",
|
|
473
|
-
message: "Dragging element ".concat(subject, " to ").concat(target),
|
|
474
|
-
consoleProps: function consoleProps() {
|
|
475
|
-
return {
|
|
476
|
-
subject: subject,
|
|
477
|
-
target: target
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
cy.get(target).eq(dropIndex).then(function ($target) {
|
|
482
|
-
var coordsDrop = $target[0].getBoundingClientRect();
|
|
483
|
-
cy.get(subject).eq(dragIndex).then(function (subject) {
|
|
484
|
-
var coordsDrag = subject[0].getBoundingClientRect();
|
|
485
|
-
cy.wrap(subject).trigger("mousedown", {
|
|
486
|
-
button: 0,
|
|
487
|
-
// BUTTON_INDEX
|
|
488
|
-
clientX: coordsDrag.x,
|
|
489
|
-
clientY: coordsDrag.y,
|
|
490
|
-
force: true
|
|
491
|
-
}).trigger("mousemove", {
|
|
492
|
-
button: 0,
|
|
493
|
-
// BUTTON_INDEX
|
|
494
|
-
clientX: coordsDrag.x + 10,
|
|
495
|
-
// SLOPPY_CLICK_THRESHOLD
|
|
496
|
-
clientY: coordsDrag.y,
|
|
497
|
-
force: true
|
|
498
|
-
});
|
|
499
|
-
cy.get("body").trigger("mousemove", {
|
|
500
|
-
button: 0,
|
|
501
|
-
// BUTTON_INDEX
|
|
502
|
-
clientX: coordsDrop.x,
|
|
503
|
-
clientY: coordsDrop.y,
|
|
504
|
-
force: true
|
|
505
|
-
}).trigger("mouseup");
|
|
506
|
-
});
|
|
507
|
-
});
|
|
508
|
-
});
|
|
509
|
-
Cypress.Commands.add("verifyPlaceholder", function (textInputSelector, value) {
|
|
510
|
-
cy.get(textInputSelector).should("have.attr", "placeholder").and("eq", value);
|
|
511
|
-
});
|
|
512
|
-
Cypress.Commands.add("enableOrDisableSwitch", function (switchButton, value) {
|
|
513
|
-
cy.get(switchButton).invoke("click");
|
|
514
|
-
cy.get(switchButton).should("have.prop", "value").and("eq", value);
|
|
515
|
-
});
|
|
516
|
-
Cypress.Commands.add("interceptNonVersionedApi", function (_ref3) {
|
|
517
|
-
var _ref3$url = _ref3.url,
|
|
518
|
-
url = _ref3$url === void 0 ? "*" : _ref3$url,
|
|
519
|
-
alias = _ref3.alias,
|
|
520
|
-
_ref3$times = _ref3.times,
|
|
521
|
-
times = _ref3$times === void 0 ? 1 : _ref3$times;
|
|
522
|
-
cy.intercept({
|
|
523
|
-
url: url,
|
|
524
|
-
times: times
|
|
525
|
-
}).as(alias);
|
|
526
|
-
});
|
|
527
|
-
Cypress.Commands.add("typeOnSearchField", function (_ref4) {
|
|
528
|
-
var selector = _ref4.selector,
|
|
529
|
-
value = _ref4.value,
|
|
530
|
-
_ref4$skipSearchReque = _ref4.skipSearchRequest,
|
|
531
|
-
skipSearchRequest = _ref4$skipSearchReque === void 0 ? true : _ref4$skipSearchReque,
|
|
532
|
-
delay = _ref4.delay;
|
|
533
|
-
cy.get(selector).invoke("val").then(function (currentValue) {
|
|
534
|
-
if (currentValue !== value) {
|
|
535
|
-
!skipSearchRequest && cy.interceptApi("searchRequest");
|
|
536
|
-
cy.clearAndTypeFast(selector, value);
|
|
537
|
-
!skipSearchRequest && cy.wait("@searchRequest");
|
|
538
|
-
} else delay && cy.wait(delay);
|
|
539
|
-
});
|
|
540
|
-
});
|
|
541
|
-
Cypress.Commands.add("clickByRemoveTargetAttr", function (selector) {
|
|
542
|
-
cy.get(selector).invoke("removeAttr", "target").click();
|
|
543
|
-
});
|
|
544
|
-
Cypress.Commands.add("navigateToPreviewPage", function (selector) {
|
|
545
|
-
var fetchRequestCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
546
|
-
cy.interceptApi("fetchRequests", fetchRequestCount);
|
|
547
|
-
cy.clickByRemoveTargetAttr(selector);
|
|
548
|
-
fetchRequestCount === 1 ? cy.wait("@fetchRequests") : cy.waitForMultipleRequest("@fetchRequests", fetchRequestCount);
|
|
549
|
-
});
|
|
550
|
-
Cypress.Commands.add("saveChanges", function (aliasName) {
|
|
551
|
-
var requestCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
552
|
-
cy.interceptApi(aliasName, requestCount);
|
|
553
|
-
cy.get(commonSelectors.saveChangesButton).click();
|
|
554
|
-
cy.wait("@".concat(aliasName));
|
|
555
|
-
cy.verifyToastIcon();
|
|
556
|
-
requestCount > 1 && cy.waitForMultipleRequest("@".concat(aliasName), requestCount - 1);
|
|
557
|
-
});
|
|
558
|
-
Cypress.Commands.add("verifyAttribute", function (_ref5) {
|
|
559
|
-
var selector = _ref5.selector,
|
|
560
|
-
attr = _ref5.attr,
|
|
561
|
-
value = _ref5.value;
|
|
562
|
-
cy.get(selector).should("have.attr", attr).and("include", value);
|
|
563
|
-
});
|
|
564
|
-
Cypress.Commands.add("verifyUnsavedAlertModal", function (cancelButton) {
|
|
565
|
-
cy.get(cancelButton).click();
|
|
566
|
-
cy.get(commonSelectors.alertTitle).should("have.text", commonTexts.unsavedChangesAlertTitle);
|
|
567
|
-
cy.get(commonSelectors.alertMessage).should("have.text", commonTexts.unsavedChangesAlertMessage);
|
|
568
|
-
});
|
|
569
|
-
Cypress.Commands.add("verifyTooltip", function (selector, text) {
|
|
570
|
-
cy.get(selector).realHover();
|
|
571
|
-
cy.document().its("body").find(commonSelectors.tooltip).should("have.text", text);
|
|
572
|
-
cy.document().find("body").click("topRight", {
|
|
573
|
-
force: true
|
|
574
|
-
});
|
|
575
|
-
cy.document().its("body").find(commonSelectors.tooltip).should("not.exist");
|
|
576
|
-
});
|
|
577
|
-
Cypress.Commands.add("getEmailContent", function (props) {
|
|
578
|
-
return cy.mailosaurGetMessage(Cypress.env("MAILOSAUR_SERVER_ID"), props);
|
|
579
|
-
});
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
var loginSelectors = {
|
|
583
|
-
appleAuthenticationButton: dataCy("apple-authentication-button"),
|
|
584
|
-
emailTextField: dataCy("login-email-text-field"),
|
|
585
|
-
googleAuthenticationButton: dataCy("google-authentication-button"),
|
|
586
|
-
githubAuthenticationButton: dataCy("github-authentication-button"),
|
|
587
|
-
loginViaEmailButton: dataCy("login-via-email-button"),
|
|
588
|
-
otpField: dataCy("otpinput-otp-number"),
|
|
589
|
-
passwordTextField: dataCy("login-password-text-field"),
|
|
590
|
-
rememberMeCheckBox: dataCy("login-remember-me-check-box"),
|
|
591
|
-
submitButton: dataCy("login-submit-button"),
|
|
592
|
-
twitterAuthenticationButton: dataCy("twitter-authentication-button")
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
var memberSelectors = {
|
|
596
|
-
membersTab: dataCy("members-nav-tab"),
|
|
597
|
-
newButton: dataCy("ntm-add-member-button"),
|
|
598
|
-
continueButton: dataCy("ntm-manage-member-continue-button"),
|
|
599
|
-
submitButton: dataCy("ntm-manage-member-submit-button"),
|
|
600
|
-
searchTextField: dataCy("ntm-search-members-input"),
|
|
601
|
-
deactivatedAgentsButton: dataCy("ntm-members-menubar-deactivated-block"),
|
|
602
|
-
activatedMembersButton: dataCy("ntm-members-menubar-active-block"),
|
|
603
|
-
columnCheckBox: dataCy("neeto-ui-columns-checkbox"),
|
|
604
|
-
roleLabel: function roleLabel(role) {
|
|
605
|
-
return dataCy("".concat(joinHyphenCase(role), "-radio-label"));
|
|
606
|
-
},
|
|
607
|
-
dropDownIcon: dataCy("ntm-members-table-row-dropdown-button"),
|
|
608
|
-
editButton: dataCy("ntm-edit-member-button"),
|
|
609
|
-
menuBarHeading: dataCy("ntm-members-menubar-heading"),
|
|
610
|
-
activateOrDeactivateMember: dataCy("ntm-deactivate-member-button"),
|
|
611
|
-
columnsButton: dataCy("columns-dropdown-button"),
|
|
612
|
-
columnsDropdownContainer: dataCy("columns-dropdown-container"),
|
|
613
|
-
emailDropdownItemLabel: dataCy("email-checkbox-label"),
|
|
614
|
-
roleDropdownItemLabel: dataCy("role-checkbox-label"),
|
|
615
|
-
inviteStatusDropdownItemLabel: dataCy("invite-status-checkbox-label"),
|
|
616
|
-
heading: dataCy("ntm-manage-members-pane-header"),
|
|
617
|
-
activateButton: dataCy("ntm-activate-members-button"),
|
|
618
|
-
deactivateButton: dataCy("ntm-deactivate-members-button"),
|
|
619
|
-
rolesButton: function rolesButton(index) {
|
|
620
|
-
return dataCy("ntm-manage-member-roles-button", ":eq(".concat(index, ")"));
|
|
621
|
-
},
|
|
622
|
-
statusTag: dataCy("ntm-member-status-tag")
|
|
623
|
-
};
|
|
624
|
-
var memberFormSelectors = {
|
|
625
|
-
emailTextField: dataCy("email-select-input-field"),
|
|
626
|
-
firstNameTextField: dataCy("ntm-edit-member-first-name-text-field"),
|
|
627
|
-
lastNameTextField: dataCy("ntm-edit-member-last-name-text-field"),
|
|
628
|
-
emailInput: dataCy("ntm-manage-member-email-input"),
|
|
629
|
-
emailErrorField: dataCy("emails-input-error"),
|
|
630
|
-
cancelButton: dataCy("ntm-manage-member-cancel-button")
|
|
631
|
-
};
|
|
632
|
-
var neetoFiltersSelectors = {
|
|
633
|
-
emailSelectContainer: dataCy("email-select-container-wrapper"),
|
|
634
|
-
filterPaneHeading: dataCy("neeto-filters-pane-header"),
|
|
635
|
-
neetoFiltersEmailBlock: dataCy("neeto-filters-email-block"),
|
|
636
|
-
neetoFiltersRoleBlock: dataCy("neeto-filters-role-block"),
|
|
637
|
-
neetoFiltersBarClearButton: dataCy("neeto-filters-bar-clear-btn"),
|
|
638
|
-
neetoFiltersNameFilterField: dataCy("neeto-filters-name-filter"),
|
|
639
|
-
neetoFilterNameBlock: dataCy("neeto-filters-name-block"),
|
|
640
|
-
roleSelectContainer: dataCy("role-select-container-wrapper"),
|
|
641
|
-
filterButton: dataCy("neeto-filters-toggle-btn"),
|
|
642
|
-
filtersClearButton: dataCy("neeto-filters-clear-btn"),
|
|
643
|
-
filterDoneButton: dataCy("neeto-filters-done-btn"),
|
|
644
|
-
filteredMembersCount: dataCy("ntm-filtered-members-count"),
|
|
645
|
-
allMenubarBlock: dataCy("ntm-members-menubar-all-block"),
|
|
646
|
-
filtersEmailFilter: dataCy("neeto-filters-email-filter"),
|
|
647
|
-
paneModalCrossIcon: dataCy("neeto-filters-close-button")
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
var signUpSelectors = {
|
|
651
|
-
emailTextField: dataCy("signup-email-text-field"),
|
|
652
|
-
firstNameTextField: dataCy("signup-profile-first-name-text-field"),
|
|
653
|
-
lastNameTextField: dataCy("signup-profile-last-name-text-field"),
|
|
654
|
-
organizationNameTextField: dataCy("signup-organization-name-text-field"),
|
|
655
|
-
organizationSubmitButton: dataCy("signup-organization-submit-button"),
|
|
656
|
-
otpTextBox: dataCy("otpinput-otp-number"),
|
|
657
|
-
profileSubmitButton: dataCy("signup-profile-submit-button"),
|
|
658
|
-
signupViaEmailButton: dataCy("signup-via-email-button"),
|
|
659
|
-
submitButton: dataCy("signup-email-submit-button"),
|
|
660
|
-
subdomainNameTextField: dataCy("signup-organization-subdomain-text-field"),
|
|
661
|
-
subdomainError: dataCy("subdomain-input-error"),
|
|
662
|
-
tryFreeButton: dataCy("neeto-auth-signup-link")
|
|
663
|
-
};
|
|
664
|
-
|
|
665
|
-
var helpIconSelectors = {
|
|
666
|
-
helpButton: dataCy("help-button"),
|
|
667
|
-
documentationButton: dataCy("help-link-help-center-button"),
|
|
668
|
-
keyboardShortcutButton: dataCy("help-link-keyboard-shortcut-button"),
|
|
669
|
-
chatButton: dataCy("help-link-live-chat-button"),
|
|
670
|
-
whatsNewButton: dataCy("help-link-changelog-button"),
|
|
671
|
-
whatsNewWidgetInfo: "h1",
|
|
672
|
-
whatsNewWidgetCloseButton: ".nc-widget-header__btn",
|
|
673
|
-
keyboardShortcutPaneHeading: dataCy("keyboard-shortcuts-pane-title"),
|
|
674
|
-
keyboardShortcutPaneCrossIcon: dataCy("keyboard-shortcuts-pane-close-button")
|
|
675
|
-
};
|
|
676
|
-
var chatWidgetSelectors = {
|
|
677
|
-
chatWidgetHomeCard: dataCy("neeto-chat-widget-cta-title"),
|
|
678
|
-
widgetSubmitButton: dataCy("neeto-chat-widget-pre-chat-submit-btn"),
|
|
679
|
-
chatBubbleMessage: dataCy("neeto-chat-widget-chat-message-bubble"),
|
|
680
|
-
chatCloseButton: ".neeto-chat-widget-icon--close",
|
|
681
|
-
widgetIframe: "#neetochat-iframe"
|
|
682
|
-
};
|
|
683
|
-
|
|
684
|
-
var memberTexts = {
|
|
685
|
-
addMember: "Add new member",
|
|
686
|
-
admin: "Admin",
|
|
687
|
-
agent: "Agent",
|
|
688
|
-
agents: "Agents",
|
|
689
|
-
activeMembersHeading: "Active members",
|
|
690
|
-
accountActivatedToastMessage: function accountActivatedToastMessage(name) {
|
|
691
|
-
return "".concat(name, "'s account has been activated.");
|
|
692
|
-
},
|
|
693
|
-
activateMember: "Activate member?",
|
|
694
|
-
activateMemberAlertMessage: function activateMemberAlertMessage(email) {
|
|
695
|
-
return "You are activating the member ".concat(email, ".");
|
|
696
|
-
},
|
|
697
|
-
addMemberToProducts: function addMemberToProducts(email) {
|
|
698
|
-
return "Add ".concat(email, " to the following neeto products.");
|
|
699
|
-
},
|
|
700
|
-
deactivateAccountToastMessage: function deactivateAccountToastMessage(name) {
|
|
701
|
-
return "".concat(name, "'s account has been deactivated.");
|
|
702
|
-
},
|
|
703
|
-
deactivateMember: "Deactivate member?",
|
|
704
|
-
deactivateMemberAlertMessage: function deactivateMemberAlertMessage(email) {
|
|
705
|
-
return "You are deactivating the member ".concat(email, ".");
|
|
706
|
-
},
|
|
707
|
-
editMember: "Edit member",
|
|
708
|
-
inviteMessage: function inviteMessage(_ref) {
|
|
709
|
-
var email = _ref.email,
|
|
710
|
-
role = _ref.role,
|
|
711
|
-
appName = _ref.appName;
|
|
712
|
-
return "".concat(email, " will be invited to ").concat(appName, " with a role of ").concat(role, ".");
|
|
713
|
-
},
|
|
714
|
-
memberAddedMessage: "Added member successfully!",
|
|
715
|
-
members: "Members",
|
|
716
|
-
newHeading: "Add new member",
|
|
717
|
-
updatedMemberRole: function updatedMemberRole(email, role) {
|
|
718
|
-
return "Updated ".concat(email, "'s role to ").concat(role, ".");
|
|
719
|
-
},
|
|
720
|
-
searchMembers: "Search members",
|
|
721
|
-
noDataTitle: "There are no members to show",
|
|
722
|
-
editor: "Editor",
|
|
723
|
-
changeRole: "Change role?",
|
|
724
|
-
changeRoleAlertMsg: function changeRoleAlertMsg(member, role) {
|
|
725
|
-
return "You are changing the role of ".concat(member, " to ").concat(role, ".");
|
|
726
|
-
},
|
|
727
|
-
collaborator: "Collaborator"
|
|
728
|
-
};
|
|
729
|
-
var memberTableTexts = {
|
|
730
|
-
created: "Created",
|
|
731
|
-
email: "Email",
|
|
732
|
-
name: "Name",
|
|
733
|
-
role: "Role",
|
|
734
|
-
teams: "Teams",
|
|
735
|
-
inviteStatus: "Invite status"
|
|
736
|
-
};
|
|
737
|
-
var memberFormErrorTexts = {
|
|
738
|
-
emailRequired: "Please enter at least one email address.",
|
|
739
|
-
emailInvalid: "Please ensure that all email addresses are valid.",
|
|
740
|
-
removeInvalidEmail: "Click here to remove invalid emails."
|
|
741
|
-
};
|
|
742
|
-
|
|
743
|
-
var signUpTexts = {
|
|
744
|
-
email: "Email",
|
|
745
|
-
profile: "profile",
|
|
746
|
-
tryItFree: "Try it FREE",
|
|
747
|
-
loginCode: "login code"
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
var helpIconTexts = {
|
|
751
|
-
documentation: "Documentation",
|
|
752
|
-
welcome: "Welcome",
|
|
753
|
-
keyboardShortcuts: "Keyboard shortcuts",
|
|
754
|
-
liveChat: "Live chat",
|
|
755
|
-
whatsNew: "What's new"
|
|
756
|
-
};
|
|
757
|
-
var profileTexts = {
|
|
758
|
-
logout: "Log out",
|
|
759
|
-
productSwitcher: "Product switcher",
|
|
760
|
-
chooseYourNeetoProduct: "Choose your neeto product",
|
|
761
|
-
myProfile: "My profile",
|
|
762
|
-
profileSettings: "Profile settings",
|
|
763
|
-
myOrganization: "My organization"
|
|
764
|
-
};
|
|
765
|
-
|
|
766
|
-
var fake = {};
|
|
767
|
-
var email = function email() {
|
|
768
|
-
return faker.faker.internet.exampleEmail().toLowerCase();
|
|
769
|
-
};
|
|
770
|
-
var number = function number() {
|
|
771
|
-
return faker.faker.number["int"]({
|
|
772
|
-
min: 3,
|
|
773
|
-
max: 9
|
|
774
|
-
});
|
|
775
|
-
};
|
|
776
|
-
var amount = function amount() {
|
|
777
|
-
return faker.faker.number["int"]({
|
|
778
|
-
min: 1,
|
|
779
|
-
max: 5
|
|
780
|
-
});
|
|
781
|
-
};
|
|
782
|
-
var randomString = function randomString() {
|
|
783
|
-
return faker.faker.string.alphanumeric(10);
|
|
784
|
-
};
|
|
785
|
-
var quantity = function quantity() {
|
|
786
|
-
return faker.faker.number["int"]({
|
|
787
|
-
min: 1,
|
|
788
|
-
max: 3
|
|
789
|
-
});
|
|
790
|
-
};
|
|
791
|
-
var randomDay = function randomDay() {
|
|
792
|
-
return faker.faker.number["int"]({
|
|
793
|
-
min: 1,
|
|
794
|
-
max: 27
|
|
795
|
-
});
|
|
796
|
-
};
|
|
797
|
-
var percentage = function percentage() {
|
|
798
|
-
return faker.faker.number["int"]({
|
|
799
|
-
min: 1,
|
|
800
|
-
max: 2
|
|
801
|
-
});
|
|
802
|
-
};
|
|
803
|
-
var uniqueName = function uniqueName() {
|
|
804
|
-
return faker.faker.person.firstName() + faker.faker.number["int"]({
|
|
805
|
-
min: 1,
|
|
806
|
-
max: 100
|
|
807
|
-
});
|
|
808
|
-
};
|
|
809
|
-
var uniqueDepartment = function uniqueDepartment() {
|
|
810
|
-
return faker.faker.commerce.department() + faker.faker.number["int"]({
|
|
811
|
-
min: 1,
|
|
812
|
-
max: 100
|
|
813
|
-
});
|
|
814
|
-
};
|
|
815
|
-
var phoneNumber = function phoneNumber() {
|
|
816
|
-
var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "9#########";
|
|
817
|
-
return faker.faker.phone.number(format);
|
|
818
|
-
};
|
|
819
|
-
var secureUrl = function secureUrl() {
|
|
820
|
-
return faker.faker.internet.url().replace("http:", "https:");
|
|
821
|
-
};
|
|
822
|
-
var otp = function otp() {
|
|
823
|
-
return faker.faker.number["int"]({
|
|
824
|
-
min: 100000,
|
|
825
|
-
max: 999999
|
|
826
|
-
});
|
|
827
|
-
};
|
|
828
|
-
var longNumber = function longNumber() {
|
|
829
|
-
return faker.faker.number["int"]({
|
|
830
|
-
min: 1000,
|
|
831
|
-
max: 9999
|
|
832
|
-
});
|
|
833
|
-
};
|
|
834
|
-
var decimalNumber = function decimalNumber() {
|
|
835
|
-
return faker.faker.number["int"]({
|
|
836
|
-
min: 1000,
|
|
837
|
-
max: 9999
|
|
838
|
-
}) + Math.random();
|
|
839
|
-
};
|
|
840
|
-
Object.defineProperty(fake, "firstName", {
|
|
841
|
-
get: faker.faker.person.firstName
|
|
842
|
-
});
|
|
843
|
-
Object.defineProperty(fake, "middleName", {
|
|
844
|
-
get: faker.faker.person.middleName
|
|
845
|
-
});
|
|
846
|
-
Object.defineProperty(fake, "lastName", {
|
|
847
|
-
get: faker.faker.person.lastName
|
|
848
|
-
});
|
|
849
|
-
Object.defineProperty(fake, "fullName", {
|
|
850
|
-
get: faker.faker.person.fullName
|
|
851
|
-
});
|
|
852
|
-
Object.defineProperty(fake, "companyName", {
|
|
853
|
-
get: faker.faker.company.name
|
|
854
|
-
});
|
|
855
|
-
Object.defineProperty(fake, "streetName", {
|
|
856
|
-
get: faker.faker.location.street
|
|
857
|
-
});
|
|
858
|
-
Object.defineProperty(fake, "city", {
|
|
859
|
-
get: faker.faker.location.city
|
|
860
|
-
});
|
|
861
|
-
Object.defineProperty(fake, "zipCode", {
|
|
862
|
-
get: faker.faker.location.zipCode
|
|
863
|
-
});
|
|
864
|
-
Object.defineProperty(fake, "country", {
|
|
865
|
-
get: faker.faker.location.country
|
|
866
|
-
});
|
|
867
|
-
Object.defineProperty(fake, "sentence", {
|
|
868
|
-
get: faker.faker.lorem.sentence
|
|
869
|
-
});
|
|
870
|
-
Object.defineProperty(fake, "email", {
|
|
871
|
-
get: email
|
|
872
|
-
});
|
|
873
|
-
Object.defineProperty(fake, "number", {
|
|
874
|
-
get: number
|
|
875
|
-
});
|
|
876
|
-
Object.defineProperty(fake, "amount", {
|
|
877
|
-
get: amount
|
|
878
|
-
});
|
|
879
|
-
Object.defineProperty(fake, "projectName", {
|
|
880
|
-
get: faker.faker.commerce.productName
|
|
881
|
-
});
|
|
882
|
-
Object.defineProperty(fake, "department", {
|
|
883
|
-
get: faker.faker.commerce.department
|
|
884
|
-
});
|
|
885
|
-
Object.defineProperty(fake, "word", {
|
|
886
|
-
get: faker.faker.lorem.word
|
|
887
|
-
});
|
|
888
|
-
Object.defineProperty(fake, "words", {
|
|
889
|
-
get: faker.faker.lorem.words
|
|
890
|
-
});
|
|
891
|
-
Object.defineProperty(fake, "randomString", {
|
|
892
|
-
get: randomString
|
|
893
|
-
});
|
|
894
|
-
Object.defineProperty(fake, "state", {
|
|
895
|
-
get: faker.faker.location.state
|
|
896
|
-
});
|
|
897
|
-
Object.defineProperty(fake, "quantity", {
|
|
898
|
-
get: quantity
|
|
899
|
-
});
|
|
900
|
-
Object.defineProperty(fake, "randomDay", {
|
|
901
|
-
get: randomDay
|
|
902
|
-
});
|
|
903
|
-
Object.defineProperty(fake, "percentage", {
|
|
904
|
-
get: percentage
|
|
905
|
-
});
|
|
906
|
-
Object.defineProperty(fake, "uniqueName", {
|
|
907
|
-
get: uniqueName
|
|
908
|
-
});
|
|
909
|
-
Object.defineProperty(fake, "uniqueDepartment", {
|
|
910
|
-
get: uniqueDepartment
|
|
911
|
-
});
|
|
912
|
-
Object.defineProperty(fake, "url", {
|
|
913
|
-
get: faker.faker.internet.url
|
|
914
|
-
});
|
|
915
|
-
Object.defineProperty(fake, "secureUrl", {
|
|
916
|
-
get: secureUrl
|
|
917
|
-
});
|
|
918
|
-
Object.defineProperty(fake, "domain", {
|
|
919
|
-
get: faker.faker.internet.domainName
|
|
920
|
-
});
|
|
921
|
-
Object.defineProperty(fake, "otp", {
|
|
922
|
-
get: otp
|
|
923
|
-
});
|
|
924
|
-
Object.defineProperty(fake, "longNumber", {
|
|
925
|
-
get: longNumber
|
|
926
|
-
});
|
|
927
|
-
Object.defineProperty(fake, "decimalNumber", {
|
|
928
|
-
get: decimalNumber
|
|
929
|
-
});
|
|
930
|
-
Object.defineProperty(fake, "streetAddress", {
|
|
931
|
-
get: faker.faker.location.streetAddress
|
|
932
|
-
});
|
|
933
|
-
fake.phoneNumber = phoneNumber;
|
|
934
|
-
|
|
935
|
-
/* eslint-disable xss/no-location-href-assign */
|
|
936
|
-
var verifyTabMenu = function verifyTabMenu(_ref) {
|
|
937
|
-
var tabSelector = _ref.tabSelector,
|
|
938
|
-
_ref$alias = _ref.alias,
|
|
939
|
-
alias = _ref$alias === void 0 ? "fetchData" : _ref$alias,
|
|
940
|
-
_ref$requestCount = _ref.requestCount,
|
|
941
|
-
requestCount = _ref$requestCount === void 0 ? 1 : _ref$requestCount;
|
|
942
|
-
requestCount && cy.interceptApi(alias, requestCount);
|
|
943
|
-
cy.get(tabSelector).click();
|
|
944
|
-
requestCount && cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
945
|
-
cy.verifyAttribute({
|
|
946
|
-
selector: tabSelector,
|
|
947
|
-
attr: "class",
|
|
948
|
-
value: "active"
|
|
949
|
-
});
|
|
950
|
-
};
|
|
951
|
-
var clickOnHelpSubTab = function clickOnHelpSubTab(tabSelector, tabText) {
|
|
952
|
-
openProfileOrHelpCenter({
|
|
953
|
-
tabSelector: helpIconSelectors.helpButton,
|
|
954
|
-
subTabLink: helpIconSelectors.whatsNewButton,
|
|
955
|
-
count: 5
|
|
956
|
-
});
|
|
957
|
-
cy.get(tabSelector).should("have.text", tabText).invoke("click");
|
|
958
|
-
};
|
|
959
|
-
var verifyHelpDocumentationLink = function verifyHelpDocumentationLink(_ref2) {
|
|
960
|
-
var articleTitle = _ref2.articleTitle,
|
|
961
|
-
alias = _ref2.alias,
|
|
962
|
-
_ref2$requestCount = _ref2.requestCount,
|
|
963
|
-
requestCount = _ref2$requestCount === void 0 ? 3 : _ref2$requestCount;
|
|
964
|
-
openProfileOrHelpCenter({
|
|
965
|
-
tabSelector: helpIconSelectors.helpButton,
|
|
966
|
-
subTabLink: helpIconSelectors.whatsNewButton,
|
|
967
|
-
count: 5
|
|
968
|
-
});
|
|
969
|
-
cy.clickByRemoveTargetAttr(helpIconSelectors.documentationButton);
|
|
970
|
-
cy.get(commonSelectors.articlePageTitle, {
|
|
971
|
-
timeout: 10000
|
|
972
|
-
}).should("have.text", articleTitle);
|
|
973
|
-
cy.interceptApi(alias, requestCount);
|
|
974
|
-
cy.go("back");
|
|
975
|
-
cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
976
|
-
};
|
|
977
|
-
var verifyKeyboardShortcutsPane = function verifyKeyboardShortcutsPane() {
|
|
978
|
-
clickOnHelpSubTab(helpIconSelectors.keyboardShortcutButton, helpIconTexts.keyboardShortcuts);
|
|
979
|
-
cy.get(helpIconSelectors.keyboardShortcutPaneHeading).should("have.text", helpIconTexts.keyboardShortcuts);
|
|
980
|
-
cy.get(helpIconSelectors.keyboardShortcutPaneCrossIcon).click();
|
|
981
|
-
};
|
|
982
|
-
var verifyWhatsNewTab = function verifyWhatsNewTab(whatsNewHeading) {
|
|
983
|
-
openProfileOrHelpCenter({
|
|
984
|
-
tabSelector: helpIconSelectors.helpButton,
|
|
985
|
-
subTabLink: helpIconSelectors.whatsNewButton,
|
|
986
|
-
count: 5
|
|
987
|
-
});
|
|
988
|
-
cy.get(helpIconSelectors.whatsNewButton).should("contain.text", helpIconTexts.whatsNew);
|
|
989
|
-
openWhatsNewPane();
|
|
990
|
-
cy.get(helpIconSelectors.whatsNewWidgetInfo).should("have.text", whatsNewHeading);
|
|
991
|
-
cy.get(helpIconSelectors.whatsNewWidgetCloseButton).last().click();
|
|
992
|
-
cy.get(helpIconSelectors.whatsNewWidgetInfo).should("not.exist");
|
|
993
|
-
};
|
|
994
|
-
var waitForChatWidget = function waitForChatWidget() {
|
|
995
|
-
var timeOut = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
996
|
-
var defaultWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
997
|
-
if (timeOut === 0) return;
|
|
998
|
-
cy.ifNotExist(chatWidgetSelectors.widgetIframe, function () {
|
|
999
|
-
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
1000
|
-
cy.wait(defaultWait);
|
|
1001
|
-
navigationUtils.clickOnHelpSubTab(helpIconSelectors.chatButton, helpIconTexts.liveChat);
|
|
1002
|
-
cy.ifNotExist(chatWidgetSelectors.widgetIframe, function () {
|
|
1003
|
-
waitForChatWidget(timeOut - 1);
|
|
1004
|
-
});
|
|
1005
|
-
});
|
|
1006
|
-
};
|
|
1007
|
-
var verifyChatWithUsTab = function verifyChatWithUsTab(_ref3) {
|
|
1008
|
-
var alias = _ref3.alias,
|
|
1009
|
-
_ref3$requestCount = _ref3.requestCount,
|
|
1010
|
-
requestCount = _ref3$requestCount === void 0 ? 3 : _ref3$requestCount;
|
|
1011
|
-
requestCount && cy.interceptNonVersionedApi({
|
|
1012
|
-
url: requestApis.allChatPath,
|
|
1013
|
-
alias: alias,
|
|
1014
|
-
times: requestCount
|
|
1015
|
-
});
|
|
1016
|
-
clickOnHelpSubTab(helpIconSelectors.chatButton, helpIconTexts.liveChat);
|
|
1017
|
-
requestCount && cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
1018
|
-
waitForChatWidget();
|
|
1019
|
-
cy.withinIframe(chatWidgetSelectors.widgetIframe, function () {
|
|
1020
|
-
requestCount && cy.interceptNonVersionedApi({
|
|
1021
|
-
url: requestApis.allChatPath,
|
|
1022
|
-
alias: alias,
|
|
1023
|
-
times: requestCount
|
|
1024
|
-
});
|
|
1025
|
-
cy.get(chatWidgetSelectors.chatWidgetHomeCard, {
|
|
1026
|
-
timeout: 10000
|
|
1027
|
-
}).click({
|
|
1028
|
-
force: true
|
|
1029
|
-
});
|
|
1030
|
-
requestCount && cy.wait("@".concat(alias), requestCount);
|
|
1031
|
-
requestCount && cy.interceptNonVersionedApi({
|
|
1032
|
-
url: requestApis.allChatPath,
|
|
1033
|
-
alias: alias,
|
|
1034
|
-
times: requestCount
|
|
1035
|
-
});
|
|
1036
|
-
cy.get(chatWidgetSelectors.widgetSubmitButton).click();
|
|
1037
|
-
requestCount && cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
1038
|
-
cy.get(chatWidgetSelectors.chatBubbleMessage).should("be.visible");
|
|
1039
|
-
});
|
|
1040
|
-
cy.get(chatWidgetSelectors.chatCloseButton).click();
|
|
1041
|
-
cy.get(chatWidgetSelectors.widgetIframe).should("not.exist");
|
|
1042
|
-
};
|
|
1043
|
-
var verifyMyProfileTab = function verifyMyProfileTab(_ref4) {
|
|
1044
|
-
var alias = _ref4.alias,
|
|
1045
|
-
_ref4$requestCount = _ref4.requestCount,
|
|
1046
|
-
requestCount = _ref4$requestCount === void 0 ? 2 : _ref4$requestCount;
|
|
1047
|
-
openProfileOrHelpCenter({
|
|
1048
|
-
tabSelector: profileSelectors.tab,
|
|
1049
|
-
subTabLink: profileSelectors.logoutLink,
|
|
1050
|
-
count: 5
|
|
1051
|
-
});
|
|
1052
|
-
cy.get(profileSelectors.myProfileButton).should("have.text", profileTexts.myProfile);
|
|
1053
|
-
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1054
|
-
cy.window().then(function (win) {
|
|
1055
|
-
cy.stub(win, "open").as(alias).callsFake(function (newUrl) {
|
|
1056
|
-
return win.location.href = newUrl;
|
|
1057
|
-
});
|
|
1058
|
-
});
|
|
1059
|
-
cy.get(profileSelectors.myProfileButton).invoke("click");
|
|
1060
|
-
cy.get("@".concat(alias)).should("be.called");
|
|
1061
|
-
cy.url().should("include", requestApis.myProfilePath(subdomainName));
|
|
1062
|
-
});
|
|
1063
|
-
cy.get(commonSelectors.heading).should("have.text", profileTexts.profileSettings);
|
|
1064
|
-
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1065
|
-
return cy.url().should("include", requestApis.myProfilePath(subdomainName));
|
|
1066
|
-
});
|
|
1067
|
-
cy.interceptApi(alias, requestCount);
|
|
1068
|
-
cy.go("back");
|
|
1069
|
-
cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
1070
|
-
};
|
|
1071
|
-
var verifyOrganizationTab = function verifyOrganizationTab() {
|
|
1072
|
-
openProfileOrHelpCenter({
|
|
1073
|
-
tabSelector: profileSelectors.tab,
|
|
1074
|
-
subTabLink: profileSelectors.logoutLink,
|
|
1075
|
-
count: 5
|
|
1076
|
-
});
|
|
1077
|
-
cy.get(profileSelectors.organizationSettingsButton).should("have.text", profileTexts.myOrganization);
|
|
1078
|
-
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1079
|
-
cy.window().then(function (win) {
|
|
1080
|
-
cy.stub(win, "open").as("navigateToSettings").callsFake(function (newUrl) {
|
|
1081
|
-
return win.location.href = newUrl;
|
|
1082
|
-
});
|
|
1083
|
-
});
|
|
1084
|
-
cy.get(profileSelectors.organizationSettingsButton).invoke("click");
|
|
1085
|
-
cy.get("@navigateToSettings").should("be.called");
|
|
1086
|
-
cy.url().should("include", requestApis.settingsPath(subdomainName));
|
|
1087
|
-
});
|
|
1088
|
-
cy.get(commonSelectors.heading).should("have.text", commonTexts.settings);
|
|
1089
|
-
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1090
|
-
return cy.url().should("include", requestApis.settingsPath(subdomainName));
|
|
1091
|
-
});
|
|
1092
|
-
};
|
|
1093
|
-
var openProfileOrHelpCenter = function openProfileOrHelpCenter(_ref5) {
|
|
1094
|
-
var tabSelector = _ref5.tabSelector,
|
|
1095
|
-
subTabLink = _ref5.subTabLink,
|
|
1096
|
-
_ref5$count = _ref5.count,
|
|
1097
|
-
count = _ref5$count === void 0 ? 1 : _ref5$count,
|
|
1098
|
-
_ref5$timeout = _ref5.timeout,
|
|
1099
|
-
timeout = _ref5$timeout === void 0 ? 2000 : _ref5$timeout;
|
|
1100
|
-
if (count === 0) return;
|
|
1101
|
-
cy.get(tabSelector).click();
|
|
1102
|
-
cy.ifNotExist(subTabLink, function () {
|
|
1103
|
-
cy.wait(timeout); // eslint-disable-line cypress/no-unnecessary-waiting
|
|
1104
|
-
openProfileOrHelpCenter(count - 1);
|
|
1105
|
-
});
|
|
1106
|
-
};
|
|
1107
|
-
var openWhatsNewPane = function openWhatsNewPane() {
|
|
1108
|
-
var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
|
|
1109
|
-
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;
|
|
1110
|
-
if (count === 0) return;
|
|
1111
|
-
cy.get(helpIconSelectors.whatsNewButton).invoke("click");
|
|
1112
|
-
cy.ifNotExist(helpIconSelectors.whatsNewWidgetInfo, function () {
|
|
1113
|
-
cy.wait(timeout); // eslint-disable-line cypress/no-unnecessary-waiting
|
|
1114
|
-
openWhatsNewPane(count - 1);
|
|
1115
|
-
});
|
|
1116
|
-
};
|
|
1117
|
-
var navigationUtils = {
|
|
1118
|
-
verifyTabMenu: verifyTabMenu,
|
|
1119
|
-
clickOnHelpSubTab: clickOnHelpSubTab,
|
|
1120
|
-
verifyHelpDocumentationLink: verifyHelpDocumentationLink,
|
|
1121
|
-
verifyKeyboardShortcutsPane: verifyKeyboardShortcutsPane,
|
|
1122
|
-
verifyWhatsNewTab: verifyWhatsNewTab,
|
|
1123
|
-
verifyChatWithUsTab: verifyChatWithUsTab,
|
|
1124
|
-
verifyMyProfileTab: verifyMyProfileTab,
|
|
1125
|
-
verifyOrganizationTab: verifyOrganizationTab,
|
|
1126
|
-
openProfileOrHelpCenter: openProfileOrHelpCenter,
|
|
1127
|
-
openWhatsNewPane: openWhatsNewPane
|
|
1128
|
-
};
|
|
1129
|
-
|
|
1130
|
-
var verifySSOLoginPage = function verifySSOLoginPage() {
|
|
1131
|
-
cy.log("verify Login Page");
|
|
1132
|
-
cy.get(loginSelectors.githubAuthenticationButton).should("be.visible");
|
|
1133
|
-
cy.get(loginSelectors.twitterAuthenticationButton).should("be.visible");
|
|
1134
|
-
cy.get(loginSelectors.appleAuthenticationButton).should("be.visible");
|
|
1135
|
-
cy.get(loginSelectors.googleAuthenticationButton).should("be.visible");
|
|
1136
|
-
cy.log("verify Cross Site scripting");
|
|
1137
|
-
cy.clearAndType(loginSelectors.emailTextField, commonTexts.crossSiteScript);
|
|
1138
|
-
cy.get(loginSelectors.submitButton).click();
|
|
1139
|
-
cy.get(commonSelectors.windowAlert).should("not.exist");
|
|
1140
|
-
cy.log("verify email login");
|
|
1141
|
-
cy.get(commonSelectors.emailInputError).should("have.text", commonTexts.invalidEmailMessage);
|
|
1142
|
-
cy.get(loginSelectors.emailTextField).clear();
|
|
1143
|
-
cy.get(loginSelectors.submitButton).click();
|
|
1144
|
-
cy.get(commonSelectors.emailInputError).should("have.text", commonTexts.invalidEmailMessage);
|
|
1145
|
-
};
|
|
1146
|
-
var logout = function logout(homeUrl) {
|
|
1147
|
-
cy.get(profileSelectors.loader).should("not.exist");
|
|
1148
|
-
navigationUtils.openProfileOrHelpCenter({
|
|
1149
|
-
tabSelector: profileSelectors.tab,
|
|
1150
|
-
subTabLink: profileSelectors.logoutLink,
|
|
1151
|
-
count: 5
|
|
1152
|
-
});
|
|
1153
|
-
cy.get(profileSelectors.tab).click();
|
|
1154
|
-
cy.get(profileSelectors.logoutLink).should("have.text", commonTexts.logout).invoke("click");
|
|
1155
|
-
cy.url({
|
|
1156
|
-
timeout: 15000
|
|
1157
|
-
}).should("not.include", homeUrl);
|
|
1158
|
-
};
|
|
1159
|
-
var authUtils = {
|
|
1160
|
-
verifySSOLoginPage: verifySSOLoginPage,
|
|
1161
|
-
logout: logout
|
|
1162
|
-
};
|
|
1163
|
-
|
|
1164
|
-
var currentDate = function currentDate() {
|
|
1165
|
-
return dayjs__default["default"]().format("YYYY-MM-DD");
|
|
1166
|
-
};
|
|
1167
|
-
var futureDate = function futureDate() {
|
|
1168
|
-
var numberOfDays = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1169
|
-
var date = dayjs__default["default"]().add(numberOfDays, "day").format("YYYY-MM-DD");
|
|
1170
|
-
return date;
|
|
1171
|
-
};
|
|
1172
|
-
var pastDate = function pastDate() {
|
|
1173
|
-
var numberOfDays = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1174
|
-
var date = dayjs__default["default"]().subtract(numberOfDays, "day").format("YYYY-MM-DD");
|
|
1175
|
-
return date;
|
|
1176
|
-
};
|
|
1177
|
-
var dateUtils = {
|
|
1178
|
-
currentDate: currentDate,
|
|
1179
|
-
futureDate: futureDate,
|
|
1180
|
-
pastDate: pastDate
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1184
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1185
|
-
var interceptMemberApi = function interceptMemberApi(alias) {
|
|
1186
|
-
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1187
|
-
return cy.intercept({
|
|
1188
|
-
url: requestApis.teamMembers.all,
|
|
1189
|
-
times: times
|
|
1190
|
-
}).as(alias);
|
|
1191
|
-
};
|
|
1192
|
-
var navigateToMembersPage = function navigateToMembersPage() {
|
|
1193
|
-
var waitForRequest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
1194
|
-
waitForRequest && interceptMemberApi("fetchMembers", 2);
|
|
1195
|
-
cy.get(memberSelectors.membersTab).click();
|
|
1196
|
-
cy.url().should("include", urlPaths.members);
|
|
1197
|
-
waitForRequest && cy.waitForMultipleRequest("@fetchMembers", 2);
|
|
1198
|
-
cy.get(commonSelectors.heading).should("have.text", memberTexts.activeMembersHeading);
|
|
1199
|
-
};
|
|
1200
|
-
var addMemberViaUI = function addMemberViaUI(_ref) {
|
|
1201
|
-
var email = _ref.email,
|
|
1202
|
-
_ref$role = _ref.role,
|
|
1203
|
-
role = _ref$role === void 0 ? memberTexts.agent : _ref$role,
|
|
1204
|
-
appName = _ref.appName;
|
|
1205
|
-
var invalidEmail = "Invalid email";
|
|
1206
|
-
cy.get(memberSelectors.newButton).should("have.text", memberTexts.addMember).click();
|
|
1207
|
-
cy.get(commonSelectors.paneHeader).should("have.text", memberTexts.newHeading);
|
|
1208
|
-
cy.get(memberFormSelectors.emailTextField).should("be.focused");
|
|
1209
|
-
cy.get(memberFormSelectors.cancelButton).click();
|
|
1210
|
-
cy.get(commonSelectors.paneHeader).should("not.exist");
|
|
1211
|
-
|
|
1212
|
-
// form validation
|
|
1213
|
-
cy.get(memberSelectors.newButton).should("be.visible").click();
|
|
1214
|
-
cy.get(memberSelectors.continueButton).should("be.disabled");
|
|
1215
|
-
cy.get(memberSelectors.roleLabel(role)).click();
|
|
1216
|
-
cy.get(memberSelectors.continueButton).click();
|
|
1217
|
-
cy.get(memberFormSelectors.emailErrorField).should("contain.text", memberFormErrorTexts.emailRequired);
|
|
1218
|
-
cy.typeAndEnter(memberFormSelectors.emailTextField, invalidEmail);
|
|
1219
|
-
cy.get(memberFormSelectors.emailErrorField).should("contains.text", memberFormErrorTexts.emailInvalid);
|
|
1220
|
-
cy.get(memberFormSelectors.emailErrorField).should("contain.text", memberFormErrorTexts.removeInvalidEmail);
|
|
1221
|
-
cy.get(commonSelectors.paneModalCrossIcon).click();
|
|
1222
|
-
cy.get(commonSelectors.paneHeader).should("not.exist");
|
|
1223
|
-
|
|
1224
|
-
// form submission
|
|
1225
|
-
cy.get(memberSelectors.newButton).click();
|
|
1226
|
-
cy.typeAndEnter(memberFormSelectors.emailTextField, email);
|
|
1227
|
-
cy.get(memberSelectors.roleLabel(role)).click();
|
|
1228
|
-
cy.get(memberSelectors.continueButton).click();
|
|
1229
|
-
if (isStagingEnv) {
|
|
1230
|
-
cy.get(commonSelectors.checkboxLabel).should("have.text", memberTexts.addMemberToProducts(email));
|
|
1231
|
-
cy.get(commonSelectors.paneBody).within(function () {
|
|
1232
|
-
return cy.get(commonSelectors.checkbox).uncheck();
|
|
1233
|
-
});
|
|
1234
|
-
cy.get(memberSelectors.continueButton).click();
|
|
1235
|
-
}
|
|
1236
|
-
cy.get(commonSelectors.paneBody).should("contain.text", memberTexts.inviteMessage({
|
|
1237
|
-
email: email,
|
|
1238
|
-
role: role,
|
|
1239
|
-
appName: appName
|
|
1240
|
-
}));
|
|
1241
|
-
interceptMemberApi("createAndFetchMember", 2);
|
|
1242
|
-
cy.get(memberSelectors.submitButton).click();
|
|
1243
|
-
cy.wait("@createAndFetchMember");
|
|
1244
|
-
cy.verifyToastIcon();
|
|
1245
|
-
cy.wait("@createAndFetchMember");
|
|
1246
|
-
verifyMemberDetails({
|
|
1247
|
-
email: email,
|
|
1248
|
-
role: role,
|
|
1249
|
-
skipSearchRequest: false
|
|
1250
|
-
});
|
|
1251
|
-
};
|
|
1252
|
-
var editMemberViaUI = function editMemberViaUI(_ref2) {
|
|
1253
|
-
var email = _ref2.email,
|
|
1254
|
-
newRole = _ref2.newRole,
|
|
1255
|
-
firstName = _ref2.firstName,
|
|
1256
|
-
lastName = _ref2.lastName,
|
|
1257
|
-
skipSearchRequest = _ref2.skipSearchRequest,
|
|
1258
|
-
_ref2$updateCount = _ref2.updateCount,
|
|
1259
|
-
updateCount = _ref2$updateCount === void 0 ? 2 : _ref2$updateCount;
|
|
1260
|
-
var name = firstName && lastName ? [firstName, lastName].join(" ") : null;
|
|
1261
|
-
verifyMemberDetails({
|
|
1262
|
-
email: email,
|
|
1263
|
-
skipSearchRequest: skipSearchRequest
|
|
1264
|
-
}).within(function () {
|
|
1265
|
-
cy.get(memberSelectors.dropDownIcon).click();
|
|
1266
|
-
});
|
|
1267
|
-
cy.get(memberSelectors.editButton).should("have.text", commonTexts.edit).click();
|
|
1268
|
-
cy.get(commonSelectors.paneHeader).should("have.text", memberTexts.editMember);
|
|
1269
|
-
cy.get(memberFormSelectors.firstNameTextField).should("be.focused");
|
|
1270
|
-
cy.get(memberSelectors.roleLabel(newRole)).click();
|
|
1271
|
-
cy.get(memberFormSelectors.emailInput).should("be.disabled").should("have.value", email);
|
|
1272
|
-
firstName && cy.clearAndType(memberFormSelectors.firstNameTextField, firstName);
|
|
1273
|
-
lastName && cy.clearAndType(memberFormSelectors.lastNameTextField, lastName);
|
|
1274
|
-
interceptMemberApi("updateAndFetchMember", updateCount);
|
|
1275
|
-
cy.get(memberSelectors.submitButton).click();
|
|
1276
|
-
cy.wait("@updateAndFetchMember");
|
|
1277
|
-
cy.verifyToastIcon();
|
|
1278
|
-
cy.waitForMultipleRequest("@updateAndFetchMember", updateCount - 1);
|
|
1279
|
-
verifyMemberDetails({
|
|
1280
|
-
email: email,
|
|
1281
|
-
role: newRole,
|
|
1282
|
-
name: name,
|
|
1283
|
-
skipSearchRequest: true
|
|
1284
|
-
});
|
|
1285
|
-
};
|
|
1286
|
-
var verifyMemberDetails = function verifyMemberDetails(_ref3) {
|
|
1287
|
-
var email = _ref3.email,
|
|
1288
|
-
role = _ref3.role,
|
|
1289
|
-
name = _ref3.name,
|
|
1290
|
-
statusTag = _ref3.statusTag,
|
|
1291
|
-
_ref3$skipSearchReque = _ref3.skipSearchRequest,
|
|
1292
|
-
skipSearchRequest = _ref3$skipSearchReque === void 0 ? true : _ref3$skipSearchReque;
|
|
1293
|
-
!skipSearchRequest && interceptMemberApi("searchMember");
|
|
1294
|
-
cy.typeOnSearchField({
|
|
1295
|
-
selector: memberSelectors.searchTextField,
|
|
1296
|
-
value: email
|
|
1297
|
-
});
|
|
1298
|
-
!skipSearchRequest && cy.wait("@searchMember");
|
|
1299
|
-
return cy.contains(tableSelectors.tableRow, email).within(function () {
|
|
1300
|
-
cy.get(tableSelectors.nthColumn(3)).should("have.text", email);
|
|
1301
|
-
cy.get(tableSelectors.nthColumn(2)).within(function () {
|
|
1302
|
-
name && cy.get("p").should("have.text", name);
|
|
1303
|
-
});
|
|
1304
|
-
role && cy.get(tableSelectors.nthColumn(4)).should("have.text", role);
|
|
1305
|
-
statusTag && cy.get(memberSelectors.statusTag).should("have.text", statusTag);
|
|
1306
|
-
});
|
|
1307
|
-
};
|
|
1308
|
-
var updateMemberRole = function updateMemberRole(_ref4) {
|
|
1309
|
-
var email = _ref4.email,
|
|
1310
|
-
role = _ref4.role,
|
|
1311
|
-
skipSearchRequest = _ref4.skipSearchRequest;
|
|
1312
|
-
verifyMemberDetails({
|
|
1313
|
-
email: email,
|
|
1314
|
-
skipSearchRequest: skipSearchRequest
|
|
1315
|
-
}).within(function () {
|
|
1316
|
-
return cy.clickDropdownOption(commonTexts.edit);
|
|
1317
|
-
});
|
|
1318
|
-
cy.get(commonSelectors.paneHeader).should("have.text", memberTexts.updateMemberRole);
|
|
1319
|
-
cy.get(memberSelectors.roleLabel(role)).click();
|
|
1320
|
-
interceptMemberApi("updateAndFetchMember", 2);
|
|
1321
|
-
cy.get(memberSelectors.submitButton).click();
|
|
1322
|
-
cy.wait("@updateAndFetchMember");
|
|
1323
|
-
cy.verifyToastIcon();
|
|
1324
|
-
cy.wait("@updateAndFetchMember");
|
|
1325
|
-
verifyMemberDetails({
|
|
1326
|
-
email: email,
|
|
1327
|
-
role: role
|
|
1328
|
-
});
|
|
1329
|
-
};
|
|
1330
|
-
var verifyActivatedMember = function verifyActivatedMember(_ref5) {
|
|
1331
|
-
var email = _ref5.email,
|
|
1332
|
-
_ref5$skipFetchReques = _ref5.skipFetchRequest,
|
|
1333
|
-
skipFetchRequest = _ref5$skipFetchReques === void 0 ? false : _ref5$skipFetchReques,
|
|
1334
|
-
_ref5$skipSearchReque = _ref5.skipSearchRequest,
|
|
1335
|
-
skipSearchRequest = _ref5$skipSearchReque === void 0 ? true : _ref5$skipSearchReque;
|
|
1336
|
-
cy.get(commonSelectors.toggleButton).click();
|
|
1337
|
-
cy.get(memberSelectors.menuBarHeading).should("have.text", memberTexts.members);
|
|
1338
|
-
!skipFetchRequest && interceptMemberApi("fetchActivatedMembers");
|
|
1339
|
-
cy.get(memberSelectors.activatedMembersButton).click();
|
|
1340
|
-
!skipFetchRequest && cy.wait("@fetchActivatedMembers");
|
|
1341
|
-
verifyMemberDetails({
|
|
1342
|
-
email: email,
|
|
1343
|
-
skipSearchRequest: skipSearchRequest
|
|
1344
|
-
});
|
|
1345
|
-
cy.get(commonSelectors.toggleButton).click();
|
|
1346
|
-
};
|
|
1347
|
-
var verifyDeactivatedMember = function verifyDeactivatedMember(_ref6) {
|
|
1348
|
-
var email = _ref6.email,
|
|
1349
|
-
_ref6$skipFetchReques = _ref6.skipFetchRequest,
|
|
1350
|
-
skipFetchRequest = _ref6$skipFetchReques === void 0 ? false : _ref6$skipFetchReques,
|
|
1351
|
-
_ref6$skipSearchReque = _ref6.skipSearchRequest,
|
|
1352
|
-
skipSearchRequest = _ref6$skipSearchReque === void 0 ? true : _ref6$skipSearchReque;
|
|
1353
|
-
cy.get(commonSelectors.toggleButton).click();
|
|
1354
|
-
cy.get(memberSelectors.menuBarHeading).should("have.text", memberTexts.members);
|
|
1355
|
-
!skipFetchRequest && interceptMemberApi("fetchDeactivatedMembers");
|
|
1356
|
-
cy.get(memberSelectors.deactivatedAgentsButton).click();
|
|
1357
|
-
!skipFetchRequest && cy.wait("@fetchDeactivatedMembers");
|
|
1358
|
-
verifyMemberDetails({
|
|
1359
|
-
email: email,
|
|
1360
|
-
skipSearchRequest: skipSearchRequest
|
|
1361
|
-
});
|
|
1362
|
-
cy.get(commonSelectors.toggleButton).click();
|
|
1363
|
-
};
|
|
1364
|
-
var activateMember = function activateMember(_ref7) {
|
|
1365
|
-
var email = _ref7.email,
|
|
1366
|
-
name = _ref7.name,
|
|
1367
|
-
_ref7$skipSearchReque = _ref7.skipSearchRequest,
|
|
1368
|
-
skipSearchRequest = _ref7$skipSearchReque === void 0 ? true : _ref7$skipSearchReque;
|
|
1369
|
-
verifyMemberDetails({
|
|
1370
|
-
email: email,
|
|
1371
|
-
skipSearchRequest: skipSearchRequest
|
|
1372
|
-
}).within(function () {
|
|
1373
|
-
cy.get(memberSelectors.dropDownIcon).click();
|
|
1374
|
-
});
|
|
1375
|
-
cy.get(memberSelectors.activateOrDeactivateMember).should("have.text", commonTexts.activate).click();
|
|
1376
|
-
cy.get(commonSelectors.alertTitle).should("have.text", memberTexts.activateMember);
|
|
1377
|
-
cy.get(commonSelectors.alertModalMessage).should("have.text", memberTexts.activateMemberAlertMessage(name || email));
|
|
1378
|
-
interceptMemberApi("activateAndFetchMember", 2);
|
|
1379
|
-
cy.get(commonSelectors.alertModalSubmitButton).click();
|
|
1380
|
-
cy.wait("@activateAndFetchMember");
|
|
1381
|
-
cy.verifyToastIcon();
|
|
1382
|
-
cy.wait("@activateAndFetchMember");
|
|
1383
|
-
verifyActivatedMember({
|
|
1384
|
-
email: email
|
|
1385
|
-
});
|
|
1386
|
-
};
|
|
1387
|
-
var deactivateMember = function deactivateMember(_ref8) {
|
|
1388
|
-
var email = _ref8.email,
|
|
1389
|
-
name = _ref8.name,
|
|
1390
|
-
_ref8$skipSearchReque = _ref8.skipSearchRequest,
|
|
1391
|
-
skipSearchRequest = _ref8$skipSearchReque === void 0 ? true : _ref8$skipSearchReque;
|
|
1392
|
-
verifyMemberDetails({
|
|
1393
|
-
email: email,
|
|
1394
|
-
skipSearchRequest: skipSearchRequest
|
|
1395
|
-
}).within(function () {
|
|
1396
|
-
cy.get(memberSelectors.dropDownIcon).click();
|
|
1397
|
-
});
|
|
1398
|
-
cy.get(memberSelectors.activateOrDeactivateMember).should("have.text", commonTexts.deactivate).click();
|
|
1399
|
-
cy.get(commonSelectors.alertTitle).should("have.text", memberTexts.deactivateMember);
|
|
1400
|
-
cy.get(commonSelectors.alertModalMessage).should("have.text", memberTexts.deactivateMemberAlertMessage(name || email));
|
|
1401
|
-
interceptMemberApi("deactivateAndFetchMember", 2);
|
|
1402
|
-
cy.get(commonSelectors.alertModalSubmitButton).click();
|
|
1403
|
-
cy.wait("@deactivateAndFetchMember");
|
|
1404
|
-
cy.verifyToastIcon();
|
|
1405
|
-
cy.wait("@deactivateAndFetchMember");
|
|
1406
|
-
verifyDeactivatedMember({
|
|
1407
|
-
email: email
|
|
1408
|
-
});
|
|
1409
|
-
};
|
|
1410
|
-
var unCheckColumnAndVerifyTableHeader = function unCheckColumnAndVerifyTableHeader(fieldSelector, columnText) {
|
|
1411
|
-
clickOnColumnIcon();
|
|
1412
|
-
cy.get(fieldSelector).parent().within(function () {
|
|
1413
|
-
cy.get(memberSelectors.columnCheckBox).should("be.checked").uncheck().should("not.be.checked");
|
|
1414
|
-
});
|
|
1415
|
-
memberUtils.clickOnColumnIcon();
|
|
1416
|
-
cy.get(memberSelectors.columnsDropdownContainer).should("not.exist");
|
|
1417
|
-
cy.contains(tableSelectors.tableHeader, columnText).should("not.exist");
|
|
1418
|
-
};
|
|
1419
|
-
var checkColumnAndVerifyTableHeader = function checkColumnAndVerifyTableHeader(fieldSelector, columnText) {
|
|
1420
|
-
clickOnColumnIcon();
|
|
1421
|
-
cy.get(fieldSelector).parent().within(function () {
|
|
1422
|
-
cy.get(memberSelectors.columnCheckBox).should("not.be.checked").check().should("be.checked");
|
|
1423
|
-
});
|
|
1424
|
-
memberUtils.clickOnColumnIcon();
|
|
1425
|
-
cy.get(memberSelectors.columnsDropdownContainer).should("not.exist");
|
|
1426
|
-
cy.contains(tableSelectors.tableHeader, columnText).should("be.visible");
|
|
1427
|
-
};
|
|
1428
|
-
var addMemberViaRequest = function addMemberViaRequest(_ref9) {
|
|
1429
|
-
var email = _ref9.email,
|
|
1430
|
-
_ref9$role = _ref9.role,
|
|
1431
|
-
role = _ref9$role === void 0 ? memberTexts.agent : _ref9$role,
|
|
1432
|
-
_ref9$requestCount = _ref9.requestCount,
|
|
1433
|
-
requestCount = _ref9$requestCount === void 0 ? 0 : _ref9$requestCount,
|
|
1434
|
-
appName = _ref9.appName;
|
|
1435
|
-
cy.apiRequest({
|
|
1436
|
-
method: "POST",
|
|
1437
|
-
url: requestApis.teamMembers.index,
|
|
1438
|
-
body: {
|
|
1439
|
-
user: {
|
|
1440
|
-
emails: [email],
|
|
1441
|
-
organization_role: role,
|
|
1442
|
-
app_roles: [{
|
|
1443
|
-
app_name: appName,
|
|
1444
|
-
active_role: role,
|
|
1445
|
-
is_enabled: true
|
|
1446
|
-
}]
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
});
|
|
1450
|
-
cy.reloadAndWait(requestCount);
|
|
1451
|
-
};
|
|
1452
|
-
var editMemberViaRequest = function editMemberViaRequest(_ref10) {
|
|
1453
|
-
var email = _ref10.email,
|
|
1454
|
-
firstName = _ref10.firstName,
|
|
1455
|
-
lastName = _ref10.lastName,
|
|
1456
|
-
newRole = _ref10.newRole,
|
|
1457
|
-
_ref10$requestCount = _ref10.requestCount,
|
|
1458
|
-
requestCount = _ref10$requestCount === void 0 ? 0 : _ref10$requestCount;
|
|
1459
|
-
cy.apiRequest({
|
|
1460
|
-
method: "GET",
|
|
1461
|
-
url: requestApis.teamMembers.index,
|
|
1462
|
-
qs: {
|
|
1463
|
-
search: email
|
|
1464
|
-
}
|
|
1465
|
-
}).then(function (_ref11) {
|
|
1466
|
-
var body = _ref11.body;
|
|
1467
|
-
var memberDetails = body.members[0];
|
|
1468
|
-
cy.apiRequest({
|
|
1469
|
-
method: "PUT",
|
|
1470
|
-
url: requestApis.teamMembers.show(memberDetails.id),
|
|
1471
|
-
body: {
|
|
1472
|
-
team: _objectSpread({
|
|
1473
|
-
active: true,
|
|
1474
|
-
first_name: firstName,
|
|
1475
|
-
last_name: lastName
|
|
1476
|
-
}, newRole && {
|
|
1477
|
-
organization_role: newRole
|
|
1478
|
-
})
|
|
1479
|
-
}
|
|
1480
|
-
});
|
|
1481
|
-
});
|
|
1482
|
-
cy.reloadAndWait(requestCount);
|
|
1483
|
-
};
|
|
1484
|
-
var deactivateMemberViaRequest = function deactivateMemberViaRequest(email) {
|
|
1485
|
-
var requestCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1486
|
-
cy.apiRequest({
|
|
1487
|
-
method: "PATCH",
|
|
1488
|
-
url: requestApis.teamMembers.bulkUpdate,
|
|
1489
|
-
body: {
|
|
1490
|
-
users: {
|
|
1491
|
-
active: false,
|
|
1492
|
-
emails: [email]
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
});
|
|
1496
|
-
cy.reloadAndWait(requestCount);
|
|
1497
|
-
};
|
|
1498
|
-
var clickOnColumnIcon = function clickOnColumnIcon() {
|
|
1499
|
-
cy.get(commonSelectors.subheader).should("exist").within(function () {
|
|
1500
|
-
cy.get(memberSelectors.columnsButton).click();
|
|
1501
|
-
});
|
|
1502
|
-
};
|
|
1503
|
-
var memberUtils = {
|
|
1504
|
-
addMemberViaRequest: addMemberViaRequest,
|
|
1505
|
-
addMemberViaUI: addMemberViaUI,
|
|
1506
|
-
activateMember: activateMember,
|
|
1507
|
-
checkColumnAndVerifyTableHeader: checkColumnAndVerifyTableHeader,
|
|
1508
|
-
deactivateMember: deactivateMember,
|
|
1509
|
-
deactivateMemberViaRequest: deactivateMemberViaRequest,
|
|
1510
|
-
editMemberViaUI: editMemberViaUI,
|
|
1511
|
-
editMemberViaRequest: editMemberViaRequest,
|
|
1512
|
-
updateMemberRole: updateMemberRole,
|
|
1513
|
-
interceptMemberApi: interceptMemberApi,
|
|
1514
|
-
navigateToMembersPage: navigateToMembersPage,
|
|
1515
|
-
unCheckColumnAndVerifyTableHeader: unCheckColumnAndVerifyTableHeader,
|
|
1516
|
-
verifyMemberDetails: verifyMemberDetails,
|
|
1517
|
-
clickOnColumnIcon: clickOnColumnIcon
|
|
1518
|
-
};
|
|
1519
|
-
|
|
1520
|
-
var extractSubdomainFromError = function extractSubdomainFromError(inputString) {
|
|
1521
|
-
var regex = /cypresstest[a-zA-Z0-9-]+/g;
|
|
1522
|
-
var matches = inputString.match(regex);
|
|
1523
|
-
return matches[1];
|
|
1524
|
-
};
|
|
1525
|
-
var updateSubdomainIfExists = function updateSubdomainIfExists(appName) {
|
|
1526
|
-
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
1527
|
-
cy.get(signUpSelectors.subdomainError).invoke("text").then(function (text) {
|
|
1528
|
-
cy.intercept({
|
|
1529
|
-
url: requestApis.subdomainAvailability,
|
|
1530
|
-
times: 1
|
|
1531
|
-
}).as("subdomainRequest");
|
|
1532
|
-
var newOrganizationName = extractSubdomainFromError(text);
|
|
1533
|
-
cy.clearAndType(signUpSelectors.subdomainNameTextField, newOrganizationName);
|
|
1534
|
-
cy.wait("@subdomainRequest");
|
|
1535
|
-
cy.ifNotExist(signUpSelectors.subdomainError, function () {
|
|
1536
|
-
cy.task("updateGlobalState", {
|
|
1537
|
-
key: "subdomainName",
|
|
1538
|
-
value: newOrganizationName
|
|
1539
|
-
});
|
|
1540
|
-
cy.task("updateGlobalState", {
|
|
1541
|
-
key: "businessName",
|
|
1542
|
-
value: newOrganizationName
|
|
1543
|
-
});
|
|
1544
|
-
var newBaseUrl = "https://".concat(newOrganizationName, ".").concat(appName, ".").concat(env.tld);
|
|
1545
|
-
Cypress.config("baseUrl", newBaseUrl);
|
|
1546
|
-
cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
|
|
1547
|
-
});
|
|
1548
|
-
});
|
|
1549
|
-
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
1550
|
-
return updateSubdomainIfExists(appName);
|
|
1551
|
-
});
|
|
1552
|
-
});
|
|
1553
|
-
};
|
|
1554
|
-
var createOrganization = function createOrganization(_ref) {
|
|
1555
|
-
var email = _ref.email,
|
|
1556
|
-
businessName = _ref.businessName,
|
|
1557
|
-
subdomainName = _ref.subdomainName,
|
|
1558
|
-
firstName = _ref.firstName,
|
|
1559
|
-
lastName = _ref.lastName,
|
|
1560
|
-
appName = _ref.appName;
|
|
1561
|
-
var isMailosaurEmail = email.includes("mailosaur");
|
|
1562
|
-
var defaultOtp = "123456";
|
|
1563
|
-
var appNameInLowerCase = appName.toLowerCase();
|
|
1564
|
-
var isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
1565
|
-
var authUrl = "https://app.neetoauth.".concat(env.tld, "/signups/new");
|
|
1566
|
-
isNeetoAuth ? cy.visit(authUrl) : cy.visit("".concat(authUrl, "?redirect_uri=").concat(appNameInLowerCase, ".").concat(env.tld));
|
|
1567
|
-
cy.clearAndType(signUpSelectors.emailTextField, email);
|
|
1568
|
-
cy.intercept({
|
|
1569
|
-
url: requestApis.signUp,
|
|
1570
|
-
times: 2
|
|
1571
|
-
}).as("signupRequest");
|
|
1572
|
-
cy.get(signUpSelectors.submitButton).click();
|
|
1573
|
-
cy.wait("@signupRequest");
|
|
1574
|
-
if (isMailosaurEmail) {
|
|
1575
|
-
cy.getEmailContent({
|
|
1576
|
-
sentTo: email,
|
|
1577
|
-
subject: signUpTexts.loginCode
|
|
1578
|
-
}).then(function (emailBody) {
|
|
1579
|
-
var otp = emailBody.html.codes[0].value;
|
|
1580
|
-
cy.get(signUpSelectors.otpTextBox).type(otp);
|
|
1581
|
-
});
|
|
1582
|
-
} else cy.get(signUpSelectors.otpTextBox).type(defaultOtp);
|
|
1583
|
-
cy.wait("@signupRequest");
|
|
1584
|
-
cy.intercept({
|
|
1585
|
-
url: requestApis.subdomainAvailability,
|
|
1586
|
-
times: 1
|
|
1587
|
-
}).as("subdomainRequest");
|
|
1588
|
-
cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
|
|
1589
|
-
cy.clearAndType(signUpSelectors.subdomainNameTextField, subdomainName);
|
|
1590
|
-
cy.wait("@subdomainRequest");
|
|
1591
|
-
updateSubdomainIfExists(appNameInLowerCase);
|
|
1592
|
-
cy.intercept({
|
|
1593
|
-
url: requestApis.signUp,
|
|
1594
|
-
times: 1
|
|
1595
|
-
}).as("signupRequest");
|
|
1596
|
-
cy.intercept({
|
|
1597
|
-
url: requestApis.countries,
|
|
1598
|
-
times: 1
|
|
1599
|
-
}).as("fetchCountries");
|
|
1600
|
-
cy.get(signUpSelectors.organizationSubmitButton).click();
|
|
1601
|
-
cy.wait("@signupRequest");
|
|
1602
|
-
cy.url({
|
|
1603
|
-
timeout: 15000
|
|
1604
|
-
}).should("include", signUpTexts.profile);
|
|
1605
|
-
cy.wait("@fetchCountries");
|
|
1606
|
-
cy.clearAndType(signUpSelectors.firstNameTextField, firstName);
|
|
1607
|
-
cy.clearAndType(signUpSelectors.lastNameTextField, lastName);
|
|
1608
|
-
cy.get(commonSelectors.checkbox).click();
|
|
1609
|
-
cy.intercept({
|
|
1610
|
-
url: requestApis.signUp,
|
|
1611
|
-
times: 1
|
|
1612
|
-
}).as("setupProfile");
|
|
1613
|
-
cy.get(signUpSelectors.profileSubmitButton).click();
|
|
1614
|
-
cy.wait("@setupProfile");
|
|
1615
|
-
};
|
|
1616
|
-
|
|
1617
|
-
var verifyCrossSiteScript = function verifyCrossSiteScript(inputSelector, submitSelector) {
|
|
1618
|
-
cy.interceptApi("searchRequest");
|
|
1619
|
-
cy.clearAndType(inputSelector, commonTexts.crossSiteScript);
|
|
1620
|
-
submitSelector && cy.get(submitSelector).click();
|
|
1621
|
-
cy.wait("@searchRequest");
|
|
1622
|
-
cy.get(commonSelectors.windowAlert).should("not.exist");
|
|
1623
|
-
};
|
|
1624
|
-
|
|
1625
|
-
var hostname = "api.fastmail.com";
|
|
1626
|
-
var username = Cypress.env("CYPRESS_FASTMAIL_USERNAME") || "cypress@mixarrow.com";
|
|
1627
|
-
var token = Cypress.env("CYPRESS_FASTMAIL_TOKEN");
|
|
1628
|
-
var authUrl = "https://".concat(hostname, "/.well-known/jmap");
|
|
1629
|
-
var headers = {
|
|
1630
|
-
"Content-Type": "application/json",
|
|
1631
|
-
Authorization: "Bearer ".concat(token)
|
|
1632
|
-
};
|
|
1633
|
-
var getSession = function getSession() {
|
|
1634
|
-
return cy.request({
|
|
1635
|
-
url: authUrl,
|
|
1636
|
-
method: "GET",
|
|
1637
|
-
headers: headers
|
|
1638
|
-
});
|
|
1639
|
-
};
|
|
1640
|
-
var getDraftId = function getDraftId(_ref) {
|
|
1641
|
-
var apiUrl = _ref.apiUrl,
|
|
1642
|
-
accountId = _ref.accountId;
|
|
1643
|
-
cy.request({
|
|
1644
|
-
url: apiUrl,
|
|
1645
|
-
method: "POST",
|
|
1646
|
-
headers: headers,
|
|
1647
|
-
body: JSON.stringify({
|
|
1648
|
-
using: ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"],
|
|
1649
|
-
methodCalls: [["Mailbox/query", {
|
|
1650
|
-
accountId: accountId,
|
|
1651
|
-
filter: {
|
|
1652
|
-
name: "Drafts"
|
|
1653
|
-
}
|
|
1654
|
-
}, "a"]]
|
|
1655
|
-
})
|
|
1656
|
-
}).then(function (_ref2) {
|
|
1657
|
-
var data = _ref2.body;
|
|
1658
|
-
return cy.wrap(data["methodResponses"][0][1].ids[0]).as("draftId");
|
|
1659
|
-
});
|
|
1660
|
-
};
|
|
1661
|
-
var getIdentityId = function getIdentityId(_ref3) {
|
|
1662
|
-
var apiUrl = _ref3.apiUrl,
|
|
1663
|
-
accountId = _ref3.accountId;
|
|
1664
|
-
cy.request({
|
|
1665
|
-
url: apiUrl,
|
|
1666
|
-
method: "POST",
|
|
1667
|
-
headers: headers,
|
|
1668
|
-
body: JSON.stringify({
|
|
1669
|
-
using: ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail", "urn:ietf:params:jmap:submission"],
|
|
1670
|
-
methodCalls: [["Identity/get", {
|
|
1671
|
-
accountId: accountId,
|
|
1672
|
-
ids: null
|
|
1673
|
-
}, "a"]]
|
|
1674
|
-
})
|
|
1675
|
-
}).then(function (_ref4) {
|
|
1676
|
-
var data = _ref4.body;
|
|
1677
|
-
var identities = data["methodResponses"][0][1].list;
|
|
1678
|
-
var identityId = identities.find(function (_ref5) {
|
|
1679
|
-
var email = _ref5.email;
|
|
1680
|
-
return email === username;
|
|
1681
|
-
}).id;
|
|
1682
|
-
cy.wrap(identityId).as("identityId");
|
|
1683
|
-
});
|
|
1684
|
-
};
|
|
1685
|
-
var composeEmail = function composeEmail(_ref6) {
|
|
1686
|
-
var apiUrl = _ref6.apiUrl,
|
|
1687
|
-
accountId = _ref6.accountId,
|
|
1688
|
-
draftId = _ref6.draftId,
|
|
1689
|
-
identityId = _ref6.identityId,
|
|
1690
|
-
emailDetails = _ref6.emailDetails;
|
|
1691
|
-
var subject = emailDetails.subject,
|
|
1692
|
-
body = emailDetails.body,
|
|
1693
|
-
to = emailDetails.to,
|
|
1694
|
-
senderName = emailDetails.senderName;
|
|
1695
|
-
var draftObject = {
|
|
1696
|
-
from: [{
|
|
1697
|
-
email: username,
|
|
1698
|
-
name: senderName
|
|
1699
|
-
}],
|
|
1700
|
-
to: [{
|
|
1701
|
-
email: to
|
|
1702
|
-
}],
|
|
1703
|
-
subject: subject,
|
|
1704
|
-
keywords: {
|
|
1705
|
-
$draft: true
|
|
1706
|
-
},
|
|
1707
|
-
mailboxIds: _defineProperty({}, draftId, true),
|
|
1708
|
-
bodyValues: {
|
|
1709
|
-
body: {
|
|
1710
|
-
value: body,
|
|
1711
|
-
charset: "utf-8"
|
|
1712
|
-
}
|
|
1713
|
-
},
|
|
1714
|
-
textBody: [{
|
|
1715
|
-
partId: "body",
|
|
1716
|
-
type: "text/plain"
|
|
1717
|
-
}]
|
|
1718
|
-
};
|
|
1719
|
-
cy.request({
|
|
1720
|
-
url: apiUrl,
|
|
1721
|
-
method: "POST",
|
|
1722
|
-
headers: headers,
|
|
1723
|
-
body: JSON.stringify({
|
|
1724
|
-
using: ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail", "urn:ietf:params:jmap:submission"],
|
|
1725
|
-
methodCalls: [["Email/set", {
|
|
1726
|
-
accountId: accountId,
|
|
1727
|
-
create: {
|
|
1728
|
-
draft: draftObject
|
|
1729
|
-
}
|
|
1730
|
-
}, "a"], ["EmailSubmission/set", {
|
|
1731
|
-
accountId: accountId,
|
|
1732
|
-
onSuccessDestroyEmail: ["#sendIt"],
|
|
1733
|
-
create: {
|
|
1734
|
-
sendIt: {
|
|
1735
|
-
emailId: "#draft",
|
|
1736
|
-
identityId: identityId
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
}, "b"]]
|
|
1740
|
-
})
|
|
1741
|
-
});
|
|
1742
|
-
};
|
|
1743
|
-
var checkForEnvs = function checkForEnvs() {
|
|
1744
|
-
if (!username || !token) {
|
|
1745
|
-
throw new Error("Please provide CYPRESS_FASTMAIL_USERNAME and CYPRESS_FASTMAIL_TOKEN as environment variables");
|
|
1746
|
-
}
|
|
1747
|
-
};
|
|
1748
|
-
var sendEmail = function sendEmail(emailDetails) {
|
|
1749
|
-
checkForEnvs();
|
|
1750
|
-
getSession().then(function (_ref7) {
|
|
1751
|
-
var session = _ref7.body;
|
|
1752
|
-
var apiUrl = session.apiUrl,
|
|
1753
|
-
primaryAccounts = session.primaryAccounts;
|
|
1754
|
-
var accountId = primaryAccounts["urn:ietf:params:jmap:mail"];
|
|
1755
|
-
getDraftId({
|
|
1756
|
-
apiUrl: apiUrl,
|
|
1757
|
-
accountId: accountId
|
|
1758
|
-
});
|
|
1759
|
-
getIdentityId({
|
|
1760
|
-
apiUrl: apiUrl,
|
|
1761
|
-
accountId: accountId
|
|
1762
|
-
});
|
|
1763
|
-
cy.get("@draftId").then(function (draftId) {
|
|
1764
|
-
cy.get("@identityId").then(function (identityId) {
|
|
1765
|
-
return composeEmail({
|
|
1766
|
-
apiUrl: apiUrl,
|
|
1767
|
-
accountId: accountId,
|
|
1768
|
-
draftId: draftId,
|
|
1769
|
-
identityId: identityId,
|
|
1770
|
-
emailDetails: emailDetails
|
|
1771
|
-
});
|
|
1772
|
-
});
|
|
1773
|
-
});
|
|
1774
|
-
});
|
|
1775
|
-
};
|
|
1776
|
-
var emailUtils = {
|
|
1777
|
-
sendEmail: sendEmail
|
|
1778
|
-
};
|
|
1779
|
-
|
|
1780
|
-
exports.authUtils = authUtils;
|
|
1781
|
-
exports.chatWidgetSelectors = chatWidgetSelectors;
|
|
1782
|
-
exports.commonSelectors = commonSelectors;
|
|
1783
|
-
exports.commonTexts = commonTexts;
|
|
1784
|
-
exports.createOrganization = createOrganization;
|
|
1785
|
-
exports.dataCy = dataCy;
|
|
1786
|
-
exports.dataTestId = dataTestId;
|
|
1787
|
-
exports.dateUtils = dateUtils;
|
|
1788
|
-
exports.emailUtils = emailUtils;
|
|
1789
|
-
exports.env = env;
|
|
1790
|
-
exports.environment = environment;
|
|
1791
|
-
exports.fake = fake;
|
|
1792
|
-
exports.getTestTitle = getTestTitle;
|
|
1793
|
-
exports.getUrl = getUrl;
|
|
1794
|
-
exports.helpIconSelectors = helpIconSelectors;
|
|
1795
|
-
exports.helpIconTexts = helpIconTexts;
|
|
1796
|
-
exports.hyphenize = hyphenize;
|
|
1797
|
-
exports.initCustomCommands = initCustomCommands;
|
|
1798
|
-
exports.initializeCredentials = initializeCredentials;
|
|
1799
|
-
exports.isStagingEnv = isStagingEnv;
|
|
1800
|
-
exports.joinHyphenCase = joinHyphenCase;
|
|
1801
|
-
exports.loginSelectors = loginSelectors;
|
|
1802
|
-
exports.memberFormErrorTexts = memberFormErrorTexts;
|
|
1803
|
-
exports.memberFormSelectors = memberFormSelectors;
|
|
1804
|
-
exports.memberSelectors = memberSelectors;
|
|
1805
|
-
exports.memberTableTexts = memberTableTexts;
|
|
1806
|
-
exports.memberTexts = memberTexts;
|
|
1807
|
-
exports.memberUtils = memberUtils;
|
|
1808
|
-
exports.navigationUtils = navigationUtils;
|
|
1809
|
-
exports.neetoFiltersSelectors = neetoFiltersSelectors;
|
|
1810
|
-
exports.profileSelectors = profileSelectors;
|
|
1811
|
-
exports.profileTexts = profileTexts;
|
|
1812
|
-
exports.sendEmail = sendEmail;
|
|
1813
|
-
exports.setListCount = setListCount;
|
|
1814
|
-
exports.signUpSelectors = signUpSelectors;
|
|
1815
|
-
exports.signUpTexts = signUpTexts;
|
|
1816
|
-
exports.tableSelectors = tableSelectors;
|
|
1817
|
-
exports.verifyCrossSiteScript = verifyCrossSiteScript;
|
|
1818
|
-
exports.verifyListCount = verifyListCount;
|
|
1819
|
-
//# sourceMappingURL=cypress-utils.cjs.js.map
|