From 5e4b02645227aa82b74e9fdb06c16cb486e9bed2 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Fri, 18 Oct 2024 12:49:53 +0530 Subject: [PATCH 1/6] chore: fix markdown styles (#36959) ## Summary by CodeRabbit - **New Features** - Updated Markdown rendering components to streamline available elements. - **Bug Fixes** - Adjusted CSS styles for lists and anchor tags to improve layout and appearance. - **Chores** - Removed unused components related to paragraphs and lists to enhance code maintainability. --- .../components/Markdown/src/components.tsx | 6 ---- .../Markdown/src/mdComponents/List.tsx | 28 ------------------- .../Markdown/src/mdComponents/Paragraph.tsx | 22 --------------- .../components/Markdown/src/styles.module.css | 13 ++++----- 4 files changed, 5 insertions(+), 64 deletions(-) delete mode 100644 app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/List.tsx delete mode 100644 app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/Paragraph.tsx diff --git a/app/client/packages/design-system/widgets/src/components/Markdown/src/components.tsx b/app/client/packages/design-system/widgets/src/components/Markdown/src/components.tsx index 14c014fe1c0..e74321e4aa9 100644 --- a/app/client/packages/design-system/widgets/src/components/Markdown/src/components.tsx +++ b/app/client/packages/design-system/widgets/src/components/Markdown/src/components.tsx @@ -2,8 +2,6 @@ import type { Components } from "react-markdown"; import { a } from "./mdComponents/Link"; import { code } from "./mdComponents/Code"; -import { p } from "./mdComponents/Paragraph"; -import { ul, ol, li } from "./mdComponents/List"; import { h1, h2, h3, h4, h5, h6 } from "./mdComponents/Heading"; export const components: Components = { @@ -14,9 +12,5 @@ export const components: Components = { h4, h5, h6, - p, - ul, - ol, - li, code, }; diff --git a/app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/List.tsx b/app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/List.tsx deleted file mode 100644 index aeaab257c80..00000000000 --- a/app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/List.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from "react"; -import type { ExtraProps } from "react-markdown"; - -type ULProps = React.ClassAttributes & - React.HTMLAttributes & - ExtraProps; - -export const ul = (props: ULProps) => { - const { children } = props; - - return
    {children}
; -}; - -type LIProps = React.ClassAttributes & - React.HTMLAttributes & - ExtraProps; - -export const li = (props: LIProps) => { - const { children } = props; - - return
  • {children}
  • ; -}; - -export const ol = (props: ULProps) => { - const { children } = props; - - return
      {children}
    ; -}; diff --git a/app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/Paragraph.tsx b/app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/Paragraph.tsx deleted file mode 100644 index 8d0e6bdf728..00000000000 --- a/app/client/packages/design-system/widgets/src/components/Markdown/src/mdComponents/Paragraph.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React, { type Ref } from "react"; -import { Text } from "@appsmith/wds"; -import type { ExtraProps } from "react-markdown"; - -type ParagraphProps = React.ClassAttributes & - React.HTMLAttributes & - ExtraProps; - -export const p = (props: ParagraphProps) => { - const { children, ref } = props; - - return ( - } - size="body" - > - {children} - - ); -}; diff --git a/app/client/packages/design-system/widgets/src/components/Markdown/src/styles.module.css b/app/client/packages/design-system/widgets/src/components/Markdown/src/styles.module.css index 48096c3a126..96036ed4d17 100644 --- a/app/client/packages/design-system/widgets/src/components/Markdown/src/styles.module.css +++ b/app/client/packages/design-system/widgets/src/components/Markdown/src/styles.module.css @@ -74,26 +74,23 @@ margin-bottom: var(--inner-spacing-1); } - [data-component="p"] { - margin-bottom: var(--inner-spacing-3); - } - /* Lists */ :is(ul, ol) { margin-top: var(--inner-spacing-2); - margin-bottom: var(--inner-spacing-4); + margin-bottom: var(--inner-spacing-3); padding-left: 0; + list-style: initial; } li { margin-bottom: var(--inner-spacing-2); margin-left: 1em; position: relative; + list-style-type: auto; } - [data-component="a"]:before, - [data-component="a"]:after { - content: none; + a { + display: inline-block; } [data-component="code"] { From f547821362b20924971fa07476ffd12344a0fd61 Mon Sep 17 00:00:00 2001 From: Rudraprasad Das Date: Fri, 18 Oct 2024 16:36:30 +0800 Subject: [PATCH 2/6] fix: adding branch in url for search entities (#36938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fixes application redirection issue from search bar ~ 1. Appends branch to the url Fixes https://github.com/appsmithorg/appsmith/issues/36782 ## Automation /ok-to-test tags="@tag.Git" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 02eb26e4911a4854daeb068f1c80004cec66de96 > Cypress dashboard. > Tags: `@tag.Git` > Spec: >
    Thu, 17 Oct 2024 18:34:15 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --- .../common/SearchBar/EntitySearchBar.tsx | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx b/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx index 319c4e5bfe0..71e2c00ce52 100644 --- a/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx +++ b/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx @@ -36,6 +36,7 @@ import { getPackagesList } from "ee/selectors/packageSelectors"; import Fuse from "fuse.js"; import { useOutsideClick } from "ee/hooks"; import type { PageDefaultMeta } from "ee/api/ApplicationApi"; +import log from "loglevel"; const HeaderSection = styled.div` display: flex; @@ -135,12 +136,34 @@ function EntitySearchBar(props: any) { (app: ApplicationPayload) => app.id === applicationId, ); - const defaultPage = searchedApplication?.pages.find( + let defaultPage = searchedApplication?.pages.find( (page: PageDefaultMeta) => page.isDefault === true, ); - const viewURL = viewerURL({ - basePageId: defaultPage.baseId, - }); + + if (!defaultPage) { + defaultPage = searchedApplication?.pages[0]; + } + + if (!defaultPage) { + log.error("No default page or pages found for the application"); + } + + const isGitEnabled = !!searchedApplication?.gitApplicationMetadata; + let viewURL = null; + + if (isGitEnabled) { + const defaultBranch = + searchedApplication?.gitApplicationMetadata?.defaultBranchName; + + viewURL = viewerURL({ + basePageId: defaultPage.baseId, + branch: defaultBranch, + }); + } else { + viewURL = viewerURL({ + basePageId: defaultPage.baseId, + }); + } window.location.href = `${viewURL}`; } From 5d5d9f4212364e706feee20ecd6f36a9445015ee Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Fri, 18 Oct 2024 17:47:25 +0530 Subject: [PATCH 3/6] feat: JS Editor Toolbar (#36921) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Adds the redesigned toolbar in the JS editor experience. This change is behind a feature flag. You would notice that there is a lot of repeated code, it is an intentional choice to repeat code instead of refactor and reuse as we essentially want to do a re design and not include any change in logic. All new components are created using the same logic blocks / components and just wrapped with our new design. This makes us debug issues during the transition easy and eventual removal of the old code much easier Fixes #36920 ## Automation /ok-to-test tags="@tag.JS" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: e61000b5229a934e4d264849401ca630691b87cb > Cypress dashboard. > Tags: `@tag.JS` > Spec: >
    Fri, 18 Oct 2024 11:41:43 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit ## Release Notes - **New Features** - Introduced a new JavaScript editor settings configuration for enhanced customization. - Added a custom React hook to manage application state effectively. - Launched the `JSEditorToolbar` component, consolidating editing functionalities. - New components for JavaScript function execution and settings management, including `JSFunctionRun` and `JSFunctionSettings`. - Added the `ToolbarSettingsPopover` component for improved settings management in the toolbar. - Enhanced the JavaScript editor with a feature flag for action redesign. - **Bug Fixes** - Improved rendering logic based on feature flags in the context menu and toolbar. - **Tests** - Implemented new test suites for various components to ensure functionality and rendering accuracy. - **Chores** - Cleaned up imports and constants, streamlining the codebase for better maintainability. --- .../IDE/Components/ToolbarSettingsPopover.tsx | 62 ++++++++++ app/client/src/IDE/index.ts | 5 + .../PluginActionSettings/SettingsPopover.tsx | 111 ++++++----------- app/client/src/ce/constants/messages.ts | 5 + app/client/src/pages/Editor/JSEditor/Form.tsx | 70 +++++------ .../Editor/JSEditor/JSEditorContextMenu.tsx | 12 +- .../JSEditor/JSEditorForm/JSEditorForm.tsx | 2 +- .../JSEditorForm/old/JSEditorForm.tsx | 7 +- .../JSEditorToolbar/JSEditorToolbar.test.tsx | 109 +++++++++++++++++ .../JSEditorToolbar/JSEditorToolbar.tsx | 85 +++++++++++++ .../JSEditor/JSEditorToolbar/JSHeader.tsx | 59 +++++++++ .../components/JSFunctionRun.test.tsx | 83 +++++++++++++ .../components/JSFunctionRun.tsx | 96 +++++++++++++++ .../components/JSFunctionSettings.test.tsx | 85 +++++++++++++ .../components/JSFunctionSettings.tsx | 112 ++++++++++++++++++ .../components/old}/JSFunctionRun.tsx | 4 +- .../components/old}/JSFunctionSettings.tsx | 18 ++- .../JSEditor/JSEditorToolbar/constants.ts | 15 +++ .../Editor/JSEditor/JSEditorToolbar/index.ts | 8 ++ .../Editor/JSEditor/JSEditorToolbar/types.ts | 12 ++ .../Editor/JSEditor/JSEditorToolbar/utils.ts | 33 ++++++ .../src/pages/Editor/JSEditor/constants.ts | 24 ---- .../src/pages/Editor/JSEditor/index.tsx | 2 +- .../pages/Editor/JSEditor/styledComponents.ts | 14 ++- .../src/pages/Editor/JSEditor/utils.test.ts | 11 +- app/client/src/pages/Editor/JSEditor/utils.ts | 45 +------ 26 files changed, 877 insertions(+), 212 deletions(-) create mode 100644 app/client/src/IDE/Components/ToolbarSettingsPopover.tsx create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSEditorToolbar.test.tsx create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSEditorToolbar.tsx create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSHeader.tsx create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.test.tsx create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx rename app/client/src/pages/Editor/JSEditor/{ => JSEditorToolbar/components/old}/JSFunctionRun.tsx (96%) rename app/client/src/pages/Editor/JSEditor/{ => JSEditorToolbar/components/old}/JSFunctionSettings.tsx (96%) create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/constants.ts create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/index.ts create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts create mode 100644 app/client/src/pages/Editor/JSEditor/JSEditorToolbar/utils.ts diff --git a/app/client/src/IDE/Components/ToolbarSettingsPopover.tsx b/app/client/src/IDE/Components/ToolbarSettingsPopover.tsx new file mode 100644 index 00000000000..4783e6c1f3e --- /dev/null +++ b/app/client/src/IDE/Components/ToolbarSettingsPopover.tsx @@ -0,0 +1,62 @@ +import React, { useCallback } from "react"; +import { + Popover, + PopoverBody, + PopoverContent, + PopoverHeader, + PopoverTrigger, + ToggleButton, +} from "@appsmith/ads"; +import styled, { css } from "styled-components"; + +interface Props { + isOpen: boolean; + handleOpenChange: (isOpen: boolean) => void; + title: string; + children: React.ReactNode; + dataTestId?: string; +} + +const Variables = css` + --popover-width: 280px; +`; +const StyledPopoverHeader = styled(PopoverHeader)` + margin-bottom: var(--ads-v2-spaces-5); +`; + +const StyledPopoverContent = styled(PopoverContent)` + ${Variables}; +`; + +export const ToolbarSettingsPopover = (props: Props) => { + const { handleOpenChange, isOpen, title } = props; + const handleButtonClick = useCallback(() => { + handleOpenChange(true); + }, [handleOpenChange]); + + const handleEscapeKeyDown = useCallback(() => { + handleOpenChange(false); + }, [handleOpenChange]); + + return ( + + + + + + {title} + {props.children} + + + ); +}; diff --git a/app/client/src/IDE/index.ts b/app/client/src/IDE/index.ts index c57c8ea1872..358b1f2da97 100644 --- a/app/client/src/IDE/index.ts +++ b/app/client/src/IDE/index.ts @@ -55,6 +55,11 @@ export { default as IDEBottomView } from "./Components/BottomView"; */ export { default as IDESidebar } from "./Components/Sidebar"; +/** + * ToolbarSettingsPopover is a popover attached to a settings toggle button in the toolbar + */ +export { ToolbarSettingsPopover } from "./Components/ToolbarSettingsPopover"; + /* ==================================================== **** Interfaces **** Common types that are used by the different components of the IDE diff --git a/app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx b/app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx index ef4045f0191..77edc839d8c 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx @@ -1,16 +1,8 @@ import React, { useCallback, useEffect, useState } from "react"; -import { - Link, - Popover, - PopoverBody, - PopoverContent, - PopoverHeader, - PopoverTrigger, - ToggleButton, -} from "@appsmith/ads"; +import { Link } from "@appsmith/ads"; import ActionSettings from "pages/Editor/ActionSettings"; import { usePluginActionContext } from "../../PluginActionContext"; -import styled, { css } from "styled-components"; +import styled from "styled-components"; import { API_EDITOR_TAB_TITLES, createMessage, @@ -23,16 +15,13 @@ import { } from "../../store"; import { THEME } from "../../constants/PluginActionConstants"; import { type DocsLink, openDoc } from "constants/DocumentationLinks"; +import { ToolbarSettingsPopover } from "IDE"; export interface SettingsProps { formName: string; docsLink?: DocsLink; } -const Variables = css` - --popover-width: 280px; -`; - /* TODO: Remove this after removing custom width from server side (Ankita) */ const SettingsWrapper = styled.div` display: flex; @@ -48,14 +37,6 @@ const SettingsWrapper = styled.div` } `; -const StyledPopoverHeader = styled(PopoverHeader)` - margin-bottom: var(--ads-v2-spaces-5); -`; - -const StyledPopoverContent = styled(PopoverContent)` - ${Variables}; -`; - const LearnMoreLink = styled(Link)` span { font-weight: bold; @@ -68,12 +49,6 @@ const PluginActionSettingsPopover = (props: SettingsProps) => { const [isOpen, setIsOpen] = useState(false); const dispatch = useDispatch(); - useEffect(() => { - if (openSettings) { - handleOpenChange(true); - } - }, [openSettings]); - const handleOpenChange = useCallback( (open: boolean) => { setIsOpen(open); @@ -82,60 +57,46 @@ const PluginActionSettingsPopover = (props: SettingsProps) => { dispatch(openPluginActionSettings(false)); } }, - [openSettings], + [dispatch, openSettings], ); - const handleEscapeKeyDown = () => { - handleOpenChange(false); - }; - - const handleButtonClick = () => { - handleOpenChange(true); - }; + useEffect( + function syncOpenState() { + if (openSettings) { + handleOpenChange(true); + } + }, + [handleOpenChange, openSettings], + ); - const handleLearnMoreClick = () => { + const handleLearnMoreClick = useCallback(() => { openDoc(props.docsLink as DocsLink); - }; + }, [props.docsLink]); return ( - - - + + - - - - {createMessage(API_EDITOR_TAB_TITLES.SETTINGS)} - - - - - {props.docsLink && ( - - {createMessage(LEARN_MORE)} - - )} - - - - + {props.docsLink && ( + + {createMessage(LEARN_MORE)} + + )} + + ); }; diff --git a/app/client/src/ce/constants/messages.ts b/app/client/src/ce/constants/messages.ts index 7c2c72475a6..46e2c4aa91b 100644 --- a/app/client/src/ce/constants/messages.ts +++ b/app/client/src/ce/constants/messages.ts @@ -2512,3 +2512,8 @@ export const PREPARED_STATEMENT_WARNING = { "Prepared statements are currently enabled, which may be causing the query error. Turn them off and try running the query again", LINK: () => "Open settings", }; + +export const JS_EDITOR_SETTINGS = { + TITLE: () => "Settings", + ON_LOAD_TITLE: () => "Choose functions to run on page load", +}; diff --git a/app/client/src/pages/Editor/JSEditor/Form.tsx b/app/client/src/pages/Editor/JSEditor/Form.tsx index 1d7d07db652..6eabdd90963 100644 --- a/app/client/src/pages/Editor/JSEditor/Form.tsx +++ b/app/client/src/pages/Editor/JSEditor/Form.tsx @@ -4,7 +4,6 @@ import type { JSAction } from "entities/JSCollection"; import type { DropdownOnSelect } from "@appsmith/ads-old"; import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig"; import type { JSObjectNameEditorProps } from "./JSObjectNameEditor"; -import JSObjectNameEditor from "./JSObjectNameEditor"; import { setActiveJSAction, setJsPaneConfigSelectedTab, @@ -17,7 +16,6 @@ import { useLocation } from "react-router"; import JSResponseView from "components/editorComponents/JSResponseView"; import { isEmpty } from "lodash"; import equal from "fast-deep-equal/es6"; -import { JSFunctionRun } from "./JSFunctionRun"; import type { AppState } from "ee/reducers"; import { getActiveJSActionId, @@ -25,24 +23,13 @@ import { getJSActions, getJSCollectionParseErrors, } from "ee/selectors/entitiesSelector"; -import type { JSActionDropdownOption } from "./utils"; import { - convertJSActionsToDropdownOptions, - convertJSActionToDropdownOption, getActionFromJsCollection, - getJSActionOption, getJSFunctionLineGutter, getJSPropertyLineFromName, } from "./utils"; -import type { JSFunctionSettingsProps } from "./JSFunctionSettings"; import JSObjectHotKeys from "./JSObjectHotKeys"; -import { - ActionButtons, - Form, - FormWrapper, - NameWrapper, - StyledFormRow, -} from "./styledComponents"; +import { Form, FormWrapper } from "./styledComponents"; import { getJSPaneConfigSelectedTab } from "selectors/jsPaneSelectors"; import type { EventLocation } from "ee/utils/analyticsUtilTypes"; import { @@ -63,6 +50,13 @@ import type { JSCollectionData } from "ee/reducers/entityReducers/jsActionsReduc import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/constants"; import RunHistory from "ee/components/RunHistory"; import { JSEditorForm as EditorForm } from "./JSEditorForm"; +import { + JSEditorToolbar, + type JSActionDropdownOption, + convertJSActionToDropdownOption, + getJSActionOption, +} from "./JSEditorToolbar"; +import type { JSFunctionSettingsProps } from "./JSEditorToolbar/components/old/JSFunctionSettings"; interface JSFormProps { jsCollectionData: JSCollectionData; @@ -340,33 +334,27 @@ function JSEditorForm({ > {backLink}
    event.preventDefault()}> - - - - - - {!hideContextMenuOnEditor && contextMenu} - - | KeyboardEvent, - ) => { - handleRunAction(event, "JS_OBJECT_MAIN_RUN_BUTTON"); - }} - onSelect={handleJSActionOptionSelection} - options={convertJSActionsToDropdownOptions(jsActions)} - selected={selectedJSActionOption} - showTooltip={!selectedJSActionOption.data} - /> - - + | KeyboardEvent, + ) => { + handleRunAction(event, "JS_OBJECT_MAIN_RUN_BUTTON"); + }} + onSelect={handleJSActionOptionSelection} + onUpdateSettings={onUpdateSettings} + saveJSObjectName={saveJSObjectName} + selected={selectedJSActionOption} + showSettings={showSettings} + /> {notification && ( {notification} diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorContextMenu.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorContextMenu.tsx index 058cd9ee4ac..1341754a9cf 100644 --- a/app/client/src/pages/Editor/JSEditor/JSEditorContextMenu.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSEditorContextMenu.tsx @@ -12,6 +12,8 @@ import { MenuTrigger, Text, } from "@appsmith/ads"; +import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; +import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; export interface ContextMenuOption { id?: string; @@ -35,6 +37,10 @@ export function JSEditorContextMenu({ onMenuClose, options, }: EntityContextMenuProps) { + const isActionRedesignEnabled = useFeatureFlag( + FEATURE_FLAG.release_actions_redesign_enabled, + ); + if (options.length === 0) { return null; } @@ -53,11 +59,11 @@ export function JSEditorContextMenu({ data-testid="more-action-trigger" isIconButton kind="tertiary" - size="md" - startIcon="context-menu" + size={isActionRedesignEnabled ? "sm" : "md"} + startIcon={isActionRedesignEnabled ? "more-2-fill" : "context-menu"} /> - + {options.map((option, index) => { if (option.children) { return ( diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorForm/JSEditorForm.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorForm/JSEditorForm.tsx index 24a375f234d..9b6f1323940 100644 --- a/app/client/src/pages/Editor/JSEditor/JSEditorForm/JSEditorForm.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSEditorForm/JSEditorForm.tsx @@ -13,7 +13,7 @@ import { import type { CodeEditorGutter } from "components/editorComponents/CodeEditor"; import type { JSAction, JSCollection } from "entities/JSCollection"; import { OldJSEditorForm } from "./old/JSEditorForm"; -import type { OnUpdateSettingsProps } from "../JSFunctionSettings"; +import type { OnUpdateSettingsProps } from "../JSEditorToolbar"; import LazyCodeEditor from "components/editorComponents/LazyCodeEditor"; import { Flex } from "@appsmith/ads"; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorForm/old/JSEditorForm.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorForm/old/JSEditorForm.tsx index cc5cb680fb1..69ddf446b37 100644 --- a/app/client/src/pages/Editor/JSEditor/JSEditorForm/old/JSEditorForm.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSEditorForm/old/JSEditorForm.tsx @@ -13,11 +13,10 @@ import { import { TabbedViewContainer } from "../../styledComponents"; import { Tab, TabPanel, Tabs, TabsList } from "@appsmith/ads"; import LazyCodeEditor from "components/editorComponents/LazyCodeEditor"; -import JSFunctionSettingsView, { - type OnUpdateSettingsProps, -} from "../../JSFunctionSettings"; import type { CodeEditorGutter } from "components/editorComponents/CodeEditor"; import type { JSAction, JSCollection } from "entities/JSCollection"; +import { type OnUpdateSettingsProps } from "../../JSEditorToolbar"; +import { JSFunctionSettings } from "../../JSEditorToolbar/components/JSFunctionSettings"; interface Props { executing: boolean; @@ -91,7 +90,7 @@ export function OldJSEditorForm(props: Props) { {props.showSettings && (
    - ContextMenu
    , + disableRunFunctionality: false, + executePermitted: true, + loading: false, + jsCollection: JSObject, + onButtonClick: jest.fn(), + onSelect: jest.fn(), + jsActions: JSObject.actions, + selected: { + label: "JSObject1.myFun1", + value: "myFunc1_id", + data: JSObject.actions[0], + }, + onUpdateSettings: jest.fn(), + showSettings: true, +}; + +describe("JSEditorToolbar", () => { + it("renders JSHeader when action redesign is disabled", () => { + mockUseFeatureFlag.mockReturnValue(false); + render(); + // Old header shows the name of the JS object + // since we don't provide the name via props, it has the placeholder text + expect( + screen.getByText("Name of the JS Object in camelCase"), + ).toBeInTheDocument(); + }); + + it("renders IDEToolbar with JSFunctionRun and JSFunctionSettings when action redesign is enabled", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + + // Assert the Function select is a popup menu + expect(screen.getByText("JSObject1.myFun1")).toBeInTheDocument(); + expect( + screen.getByRole("button", { name: "JSObject1.myFun1" }), + ).toHaveAttribute("aria-haspopup", "menu"); + + // Assert the Run button is rendered + expect(screen.getByRole("button", { name: "Run" })).toBeInTheDocument(); + + // Assert the settings button is present + expect(screen.getByTestId("t--js-editor-SETTINGS")).toHaveAttribute( + "aria-haspopup", + "dialog", + ); + + // Assert that the context menu is present + expect(screen.getByText("ContextMenu")).toBeInTheDocument(); + }); + + it("does not render JSFunctionSettings when showSettings is false", () => { + mockUseFeatureFlag.mockReturnValue(true); + // Props can control the settings button visibility + render(); + expect( + screen.queryByTestId("t--js-editor-SETTINGS"), + ).not.toBeInTheDocument(); + }); + + it("does not render context menu when hideContextMenuOnEditor is true", () => { + mockUseFeatureFlag.mockReturnValue(true); + // Props can control the context menu visibility + render(); + expect(screen.queryByText("ContextMenu")).not.toBeInTheDocument(); + }); + + it("disables JSFunctionRun when disableRunFunctionality is true", () => { + mockUseFeatureFlag.mockReturnValue(true); + // Props can control the run button's disabled state + render(); + expect(screen.getByRole("button", { name: "Run" })).toHaveAttribute( + "disabled", + ); + }); + + it("disables JSFunctionRun when executePermitted is false", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + expect(screen.getByRole("button", { name: "Run" })).toHaveAttribute( + "disabled", + ); + }); + + it("calls onButtonClick when JSFunctionRun button is clicked", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + fireEvent.click(screen.getByRole("button", { name: "Run" })); + expect(defaultProps.onButtonClick).toHaveBeenCalled(); + }); +}); diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSEditorToolbar.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSEditorToolbar.tsx new file mode 100644 index 00000000000..f4455a59cad --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSEditorToolbar.tsx @@ -0,0 +1,85 @@ +import React from "react"; +import { IDEToolbar } from "IDE"; +import { JSFunctionRun } from "./components/JSFunctionRun"; +import type { JSActionDropdownOption } from "./types"; +import type { SaveActionNameParams } from "PluginActionEditor"; +import type { ReduxAction } from "ee/constants/ReduxActionConstants"; +import type { JSAction, JSCollection } from "entities/JSCollection"; +import type { DropdownOnSelect } from "@appsmith/ads-old"; +import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; +import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; +import { JSHeader } from "./JSHeader"; +import { JSFunctionSettings } from "./components/JSFunctionSettings"; +import type { JSFunctionSettingsProps } from "./components/old/JSFunctionSettings"; +import { convertJSActionsToDropdownOptions } from "./utils"; + +interface Props { + changePermitted: boolean; + hideEditIconOnEditor?: boolean; + saveJSObjectName: ( + params: SaveActionNameParams, + ) => ReduxAction; + hideContextMenuOnEditor?: boolean; + contextMenu: React.ReactNode; + disableRunFunctionality: boolean; + executePermitted: boolean; + loading: boolean; + jsCollection: JSCollection; + onButtonClick: ( + event: React.MouseEvent | KeyboardEvent, + ) => void; + onSelect: DropdownOnSelect; + jsActions: JSAction[]; + selected: JSActionDropdownOption; + onUpdateSettings: JSFunctionSettingsProps["onUpdateSettings"]; + showSettings: boolean; +} + +/** + * JSEditorToolbar component. + * + * This component renders a toolbar for the JS editor. It conditionally renders + * different components based on the `release_actions_redesign_enabled` feature flag. + * + */ +export const JSEditorToolbar = (props: Props) => { + // Check if the action redesign feature flag is enabled + const isActionRedesignEnabled = useFeatureFlag( + FEATURE_FLAG.release_actions_redesign_enabled, + ); + + // If the action redesign is not enabled, render the JSHeader component + if (!isActionRedesignEnabled) { + return ; + } + + // Render the IDEToolbar with JSFunctionRun and JSFunctionSettings components + return ( + + + +
    + +
    + {props.showSettings ? ( + + ) : null} + + {props.hideContextMenuOnEditor ? null : props.contextMenu} +
    +
    + ); +}; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSHeader.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSHeader.tsx new file mode 100644 index 00000000000..400a6237afb --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/JSHeader.tsx @@ -0,0 +1,59 @@ +import React from "react"; +import { JSFunctionRun } from "./components/JSFunctionRun"; +import type { JSActionDropdownOption } from "./types"; +import { ActionButtons, NameWrapper, StyledFormRow } from "../styledComponents"; +import type { SaveActionNameParams } from "PluginActionEditor"; +import type { ReduxAction } from "ee/constants/ReduxActionConstants"; +import type { JSAction, JSCollection } from "entities/JSCollection"; +import type { DropdownOnSelect } from "@appsmith/ads-old"; +import JSObjectNameEditor from "../JSObjectNameEditor"; +import { Flex } from "@appsmith/ads"; +import { convertJSActionsToDropdownOptions } from "./utils"; + +interface Props { + changePermitted: boolean; + hideEditIconOnEditor?: boolean; + saveJSObjectName: ( + params: SaveActionNameParams, + ) => ReduxAction; + hideContextMenuOnEditor?: boolean; + contextMenu: React.ReactNode; + disableRunFunctionality: boolean; + executePermitted: boolean; + loading: boolean; + jsCollection: JSCollection; + onButtonClick: ( + event: React.MouseEvent | KeyboardEvent, + ) => void; + onSelect: DropdownOnSelect; + jsActions: JSAction[]; + selected: JSActionDropdownOption; +} + +export const JSHeader = (props: Props) => { + return ( + + + + + + + {!props.hideContextMenuOnEditor && props.contextMenu} + + + + + ); +}; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.test.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.test.tsx new file mode 100644 index 00000000000..18df40c66a7 --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.test.tsx @@ -0,0 +1,83 @@ +import React from "react"; +import "@testing-library/jest-dom"; +import { render, screen, fireEvent } from "test/testUtils"; +import { JSFunctionRun } from "./JSFunctionRun"; +import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; +import { JSObjectFactory } from "test/factories/Actions/JSObject"; +import { convertJSActionsToDropdownOptions } from "../utils"; + +jest.mock("utils/hooks/useFeatureFlag"); +const mockUseFeatureFlag = useFeatureFlag as jest.Mock; + +const JSObject = JSObjectFactory.build(); + +const mockProps = { + disabled: false, + isLoading: false, + jsCollection: JSObject, + onButtonClick: jest.fn(), + onSelect: jest.fn(), + options: convertJSActionsToDropdownOptions(JSObject.actions), + selected: { + label: JSObject.actions[0].name, + value: JSObject.actions[0].name, + data: JSObject.actions[0], + }, + showTooltip: false, +}; + +describe("JSFunctionRun", () => { + it("renders OldJSFunctionRun when feature flag is disabled", () => { + mockUseFeatureFlag.mockReturnValue(false); + render(); + expect(screen.getByText("myFun1")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Run" })).toBeInTheDocument(); + }); + + it("renders new JSFunctionRun when feature flag is enabled", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + // Assert the Function select is a popup menu + expect(screen.getByText("myFun1")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "myFun1" })).toHaveAttribute( + "aria-haspopup", + "menu", + ); + }); + + // This test is skipped because menu does not open in the test environment + // eslint-disable-next-line jest/no-disabled-tests + it.skip("calls onSelect when a menu item is selected", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + // click the button to open the menu + fireEvent.click(screen.getByRole("button", { name: "myFun1" })); + + fireEvent.click(screen.getByText("myFun2")); + expect(mockProps.onSelect).toHaveBeenCalledWith("myFun2"); + }); + + it("disables the button when props.disabled is true", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + expect(screen.getByRole("button", { name: "myFun1" })).toBeDisabled(); + }); + + // This test is skipped because tooltip does not show in the test environment + // eslint-disable-next-line jest/no-disabled-tests + it.skip("shows tooltip when showTooltip is true", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + fireEvent.mouseOver(screen.getByText("Run")); + expect( + screen.getByText("No JS function to run in TestCollection"), + ).toBeInTheDocument(); + }); + + it("calls onButtonClick when run button is clicked", () => { + mockUseFeatureFlag.mockReturnValue(true); + render(); + fireEvent.click(screen.getByText("Run")); + expect(mockProps.onButtonClick).toHaveBeenCalled(); + }); +}); diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx new file mode 100644 index 00000000000..6f5f1c14c96 --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx @@ -0,0 +1,96 @@ +import React, { useCallback } from "react"; +import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; +import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; +import { JSFunctionRun as OldJSFunctionRun } from "./old/JSFunctionRun"; +import type { JSCollection } from "entities/JSCollection"; +import { + Button, + Flex, + Menu, + MenuContent, + MenuItem, + MenuTrigger, + Tooltip, +} from "@appsmith/ads"; +import type { JSActionDropdownOption } from "../types"; +import { RUN_BUTTON_DEFAULTS, testLocators } from "../constants"; +import { createMessage, NO_JS_FUNCTION_TO_RUN } from "ee/constants/messages"; + +interface Props { + disabled: boolean; + isLoading: boolean; + jsCollection: JSCollection; + onButtonClick: (event: React.MouseEvent) => void; + onSelect: (value: string | undefined) => void; + options: JSActionDropdownOption[]; + selected: JSActionDropdownOption; + showTooltip: boolean; +} + +/** + * JSFunctionRun component renders a button and a dropdown menu for running JS functions. + * It conditionally renders the old or new version of the component based on a feature flag. + * + */ +export const JSFunctionRun = (props: Props) => { + const isActionRedesignEnabled = useFeatureFlag( + FEATURE_FLAG.release_actions_redesign_enabled, + ); + + // Callback function to handle function selection from the dropdown menu + const onFunctionSelect = useCallback((option: JSActionDropdownOption) => { + if (props.onSelect) { + props.onSelect(option.value); + } + }, []); + + if (!isActionRedesignEnabled) { + return ; + } + + // Render the new version of the component + return ( + + + + + + + {props.options.map((option) => ( + onFunctionSelect(option)} + size="sm" + > + {option.label} + + ))} + + + + + + + + ); +}; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx new file mode 100644 index 00000000000..f5a54149d5b --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx @@ -0,0 +1,85 @@ +import React from "react"; +import "@testing-library/jest-dom"; +import { render, screen, fireEvent } from "test/testUtils"; +import { JSFunctionSettings } from "./JSFunctionSettings"; +import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; +import { JSObjectFactory } from "test/factories/Actions/JSObject"; + +// Mock the useFeatureFlag hook +jest.mock("utils/hooks/useFeatureFlag"); +const mockUseFeatureFlag = useFeatureFlag as jest.Mock; + +const JSObject = JSObjectFactory.build(); + +const actions = JSObject.actions; + +describe("JSFunctionSettings", () => { + const onUpdateSettings = jest.fn(); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("disables the switch when the component is disabled", () => { + mockUseFeatureFlag.mockReturnValue(true); + + render( + , + ); + + fireEvent.click(screen.getByRole("button")); + + expect(screen.getByLabelText(actions[0].name)).toBeDisabled(); + }); + + it("renders the correct number of switches for the actions", () => { + mockUseFeatureFlag.mockReturnValue(true); + + render( + , + ); + + fireEvent.click(screen.getByRole("button")); + + expect(screen.getAllByRole("switch")).toHaveLength(actions.length); + }); + + it("renders the switch state correctly", () => { + mockUseFeatureFlag.mockReturnValue(true); + + const updatedJSActions = [ + { + ...actions[0], + executeOnLoad: true, + }, + { + ...actions[1], + executeOnLoad: false, + }, + ]; + + render( + , + ); + + fireEvent.click(screen.getByRole("button")); + + const switchElement1 = screen.getByLabelText(updatedJSActions[0].name); + const switchElement2 = screen.getByLabelText(updatedJSActions[1].name); + + expect(switchElement1).toBeChecked(); + expect(switchElement2).not.toBeChecked(); + }); +}); diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx new file mode 100644 index 00000000000..da28d4a826c --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx @@ -0,0 +1,112 @@ +import React, { useCallback, useState } from "react"; +import { Flex, Switch, Text } from "@appsmith/ads"; +import JSFunctionSettingsView, { + type JSFunctionSettingsProps, +} from "./old/JSFunctionSettings"; +import type { JSAction } from "entities/JSCollection"; +import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; +import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; +import { createMessage, JS_EDITOR_SETTINGS } from "ee/constants/messages"; +import AnalyticsUtil from "ee/utils/AnalyticsUtil"; +import { ToolbarSettingsPopover } from "IDE"; + +interface Props { + disabled: boolean; + actions: JSAction[]; + onUpdateSettings: JSFunctionSettingsProps["onUpdateSettings"]; +} + +interface FunctionSettingsRowProps extends Omit { + action: JSAction; +} + +const FunctionSettingRow = (props: FunctionSettingsRowProps) => { + const [executeOnPageLoad, setExecuteOnPageLoad] = useState( + String(props.action.executeOnLoad), + ); + + const onChange = useCallback( + (isSelected: boolean) => { + const value = String(isSelected); + + setExecuteOnPageLoad(value); + props.onUpdateSettings?.({ + value: value === "true", + propertyName: "executeOnLoad", + action: props.action, + }); + + AnalyticsUtil.logEvent("JS_OBJECT_SETTINGS_CHANGED", { + toggleSetting: "ON_PAGE_LOAD", + toggleValue: value, + }); + }, + [props], + ); + + return ( + + + {props.action.name} + + + ); +}; + +/** + * JSFunctionSettings component renders a button and a popover for configuring JS function settings. + * It conditionally renders the old or new version of the component based on a feature flag. + */ +export const JSFunctionSettings = (props: Props) => { + const isActionRedesignEnabled = useFeatureFlag( + FEATURE_FLAG.release_actions_redesign_enabled, + ); + + const [isOpen, setIsOpen] = useState(false); + + // If the feature flag is disabled, render the old version of the component + if (!isActionRedesignEnabled) { + return ( + + ); + } + + // Render the new version of the component + return ( + + + + {createMessage(JS_EDITOR_SETTINGS.ON_LOAD_TITLE)} + + {props.actions.map((action) => ( + + ))} + + + ); +}; diff --git a/app/client/src/pages/Editor/JSEditor/JSFunctionRun.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/old/JSFunctionRun.tsx similarity index 96% rename from app/client/src/pages/Editor/JSEditor/JSFunctionRun.tsx rename to app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/old/JSFunctionRun.tsx index 43083bc612a..aa1d28f99ba 100644 --- a/app/client/src/pages/Editor/JSEditor/JSFunctionRun.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/old/JSFunctionRun.tsx @@ -4,8 +4,8 @@ import type { JSCollection } from "entities/JSCollection"; import type { SelectProps } from "@appsmith/ads"; import { Button, Option, Select, Tooltip, Text } from "@appsmith/ads"; import { createMessage, NO_JS_FUNCTION_TO_RUN } from "ee/constants/messages"; -import type { JSActionDropdownOption } from "./utils"; -import { RUN_BUTTON_DEFAULTS, testLocators } from "./constants"; +import type { JSActionDropdownOption } from "../../types"; +import { RUN_BUTTON_DEFAULTS, testLocators } from "../../constants"; interface Props { disabled: boolean; diff --git a/app/client/src/pages/Editor/JSEditor/JSFunctionSettings.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/old/JSFunctionSettings.tsx similarity index 96% rename from app/client/src/pages/Editor/JSEditor/JSFunctionSettings.tsx rename to app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/old/JSFunctionSettings.tsx index 07d7bdaa1f5..07c2235c605 100644 --- a/app/client/src/pages/Editor/JSEditor/JSFunctionSettings.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/old/JSFunctionSettings.tsx @@ -1,15 +1,19 @@ import { + createMessage, FUNCTION_SETTINGS_HEADING, NO_JS_FUNCTIONS, - createMessage, } from "ee/constants/messages"; import type { JSAction } from "entities/JSCollection"; import React, { useCallback, useState } from "react"; import styled from "styled-components"; -import { CONFIRM_BEFORE_CALLING_HEADING, SETTINGS_HEADINGS } from "./constants"; +import { + CONFIRM_BEFORE_CALLING_HEADING, + SETTINGS_HEADINGS, +} from "../../../constants"; import AnalyticsUtil from "ee/utils/AnalyticsUtil"; -import { Icon, Tooltip, Switch } from "@appsmith/ads"; -import RemoveConfirmationModal from "./RemoveConfirmBeforeCallingDialog"; +import { Icon, Switch, Tooltip } from "@appsmith/ads"; +import RemoveConfirmationModal from "../../../RemoveConfirmBeforeCallingDialog"; +import type { OnUpdateSettingsProps } from "../../types"; interface SettingsHeadingProps { text: string; @@ -20,12 +24,6 @@ interface SettingsHeadingProps { hidden?: boolean; } -export interface OnUpdateSettingsProps { - value: boolean | number; - propertyName: string; - action: JSAction; -} - interface SettingsItemProps { headingCount: number; action: JSAction; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/constants.ts b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/constants.ts new file mode 100644 index 00000000000..474a0615204 --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/constants.ts @@ -0,0 +1,15 @@ +export const RUN_BUTTON_DEFAULTS = { + HEIGHT: "30px", + CTA_TEXT: "Run", + // space between button and dropdown + GAP_SIZE: "10px", + DROPDOWN_HIGHLIGHT_BG: "#E7E7E7", +}; +export const testLocators = { + runJSAction: "run-js-action", +}; +export const NO_FUNCTION_DROPDOWN_OPTION = { + label: "No function available", + value: "", + data: null, +}; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/index.ts b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/index.ts new file mode 100644 index 00000000000..88dc44b167c --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/index.ts @@ -0,0 +1,8 @@ +export { JSEditorToolbar } from "./JSEditorToolbar"; + +export { + type OnUpdateSettingsProps, + type JSActionDropdownOption, +} from "./types"; + +export { convertJSActionToDropdownOption, getJSActionOption } from "./utils"; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts new file mode 100644 index 00000000000..8b15f8f2671 --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts @@ -0,0 +1,12 @@ +import type { JSAction } from "entities/JSCollection"; +import type { DropdownOption } from "@appsmith/ads-old"; + +export interface OnUpdateSettingsProps { + value: boolean | number; + propertyName: string; + action: JSAction; +} + +export interface JSActionDropdownOption extends DropdownOption { + data: JSAction | null; +} diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/utils.ts b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/utils.ts new file mode 100644 index 00000000000..4fe6a993d80 --- /dev/null +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/utils.ts @@ -0,0 +1,33 @@ +import type { JSAction } from "entities/JSCollection"; +import type { JSActionDropdownOption } from "./types"; +import { NO_FUNCTION_DROPDOWN_OPTION } from "./constants"; + +export const convertJSActionsToDropdownOptions = ( + JSActions: JSAction[], +): JSActionDropdownOption[] => { + return JSActions.map(convertJSActionToDropdownOption); +}; +export const convertJSActionToDropdownOption = ( + JSAction: JSAction, +): JSActionDropdownOption => ({ + label: JSAction.name, + value: JSAction.id, + data: JSAction, +}); +/** + * Returns dropdown option based on priority and availability + */ +export const getJSActionOption = ( + activeJSAction: JSAction | null, + jsActions: JSAction[], +): JSActionDropdownOption => { + let jsActionOption: JSActionDropdownOption = NO_FUNCTION_DROPDOWN_OPTION; + + if (activeJSAction) { + jsActionOption = convertJSActionToDropdownOption(activeJSAction); + } else if (jsActions.length) { + jsActionOption = convertJSActionToDropdownOption(jsActions[0]); + } + + return jsActionOption; +}; diff --git a/app/client/src/pages/Editor/JSEditor/constants.ts b/app/client/src/pages/Editor/JSEditor/constants.ts index da8b12eb319..06974b6fc5d 100644 --- a/app/client/src/pages/Editor/JSEditor/constants.ts +++ b/app/client/src/pages/Editor/JSEditor/constants.ts @@ -1,23 +1,3 @@ -import type { JSActionDropdownOption } from "./utils"; - -export const RUN_BUTTON_DEFAULTS = { - HEIGHT: "30px", - CTA_TEXT: "Run", - // space between button and dropdown - GAP_SIZE: "10px", - DROPDOWN_HIGHLIGHT_BG: "#E7E7E7", -}; -export const NO_SELECTION_DROPDOWN_OPTION: JSActionDropdownOption = { - label: "No function selected", - value: "", - data: null, -}; -export const NO_FUNCTION_DROPDOWN_OPTION: JSActionDropdownOption = { - label: "No function available", - value: "", - data: null, -}; - export const CONFIRM_BEFORE_CALLING_HEADING = { text: "Confirm before calling ", hasInfo: true, @@ -47,7 +27,3 @@ export const RUN_GUTTER_ID = "run-gutter"; export const RUN_GUTTER_CLASSNAME = "run-marker-gutter"; export const JS_OBJECT_HOTKEYS_CLASSNAME = "js-object-hotkeys"; export const ANIMATE_RUN_GUTTER = "animate-run-marker"; - -export const testLocators = { - runJSAction: "run-js-action", -}; diff --git a/app/client/src/pages/Editor/JSEditor/index.tsx b/app/client/src/pages/Editor/JSEditor/index.tsx index b9893d17f7d..e625d505701 100644 --- a/app/client/src/pages/Editor/JSEditor/index.tsx +++ b/app/client/src/pages/Editor/JSEditor/index.tsx @@ -13,7 +13,7 @@ import styled from "styled-components"; import EntityNotFoundPane from "../EntityNotFoundPane"; import AppJSEditorContextMenu from "./AppJSEditorContextMenu"; import { updateFunctionProperty } from "actions/jsPaneActions"; -import type { OnUpdateSettingsProps } from "./JSFunctionSettings"; +import type { OnUpdateSettingsProps } from "./JSEditorToolbar"; import { saveJSObjectName } from "actions/jsActionActions"; const LoadingContainer = styled(CenteredWrapper)` diff --git a/app/client/src/pages/Editor/JSEditor/styledComponents.ts b/app/client/src/pages/Editor/JSEditor/styledComponents.ts index d0ac8808b8f..f84f96e2a06 100644 --- a/app/client/src/pages/Editor/JSEditor/styledComponents.ts +++ b/app/client/src/pages/Editor/JSEditor/styledComponents.ts @@ -14,13 +14,16 @@ export const CodeEditorWithGutterStyles = css` background: var(--ads-v2-color-bg-subtle); margin-left: 5px; } + .${RUN_GUTTER_CLASSNAME} { cursor: pointer; color: var(--ads-v2-color-fg-brand); } + .CodeMirror-linenumbers { width: max-content; } + .CodeMirror-linenumber { text-align: right; padding-left: 0; @@ -34,6 +37,7 @@ export const CodeEditorWithGutterStyles = css` export const FormWrapper = styled.div` height: calc(100vh - ${IDE_HEADER_HEIGHT}px); overflow: hidden; + .${JS_OBJECT_HOTKEYS_CLASSNAME} { width: 100%; height: 100%; @@ -45,17 +49,18 @@ export const Form = styled.form` flex-direction: column; height: 100%; overflow: hidden; + .t--no-binding-prompt { display: none; } + flex: 1; - padding: var(--ads-v2-spaces-5) 0 0; `; export const StyledFormRow = styled(FormRow)` padding: 0 var(--ads-v2-spaces-7) var(--ads-v2-spaces-5) var(--ads-v2-spaces-7); - flex: 0; + flex: 1; `; export const NameWrapper = styled.div` @@ -96,24 +101,29 @@ export const TabbedViewContainer = styled.div<{ isExecuting: boolean }>` ${FormRow} { min-height: auto; padding: ${(props) => props.theme.spaces[0]}px; + & > * { margin-right: 0px; } } + &&&& { ul.ads-v2-tabs__list { padding: 0px ${(props) => props.theme.spaces[11]}px; background-color: ${(props) => props.theme.colors.apiPane.responseBody.bg}; } + .ads-v2-tabs__panel { ${CodeEditorWithGutterStyles}; height: calc(100% - 38px); margin-top: 0px; background-color: var(--ads-v2-color-bg); + .CodeEditorTarget { outline: none; } + ${(props) => props.isExecuting && ` diff --git a/app/client/src/pages/Editor/JSEditor/utils.test.ts b/app/client/src/pages/Editor/JSEditor/utils.test.ts index d661dae1088..7c6926fd5fc 100644 --- a/app/client/src/pages/Editor/JSEditor/utils.test.ts +++ b/app/client/src/pages/Editor/JSEditor/utils.test.ts @@ -1,12 +1,11 @@ import type { JSAction } from "entities/JSCollection"; import { uniqueId } from "lodash"; -import { NO_FUNCTION_DROPDOWN_OPTION } from "./constants"; +import { getJSFunctionStartLineFromCode, isCursorWithinNode } from "./utils"; import { convertJSActionToDropdownOption, getJSActionOption, - getJSFunctionStartLineFromCode, - isCursorWithinNode, -} from "./utils"; +} from "./JSEditorToolbar/utils"; +import { NO_FUNCTION_DROPDOWN_OPTION } from "./JSEditorToolbar/constants"; const BASE_JS_OBJECT_BODY = `export default { myVar1: [], @@ -20,7 +19,7 @@ const BASE_JS_OBJECT_BODY = `export default { await Api3.run() await Api3.run() return Api3.data - } + } }`; const BASE_JS_OBJECT_BODY_WITH_LITERALS = `export default { @@ -35,7 +34,7 @@ const BASE_JS_OBJECT_BODY_WITH_LITERALS = `export default { await Api3.run() await Api3.run() return Api3.data - } + } }`; const BASE_JS_ACTION = (useLiterals = false) => { diff --git a/app/client/src/pages/Editor/JSEditor/utils.ts b/app/client/src/pages/Editor/JSEditor/utils.ts index 879b83494e9..ae88de91d66 100644 --- a/app/client/src/pages/Editor/JSEditor/utils.ts +++ b/app/client/src/pages/Editor/JSEditor/utils.ts @@ -3,18 +3,13 @@ import { parse } from "acorn"; import { ancestor } from "acorn-walk"; import type { CodeEditorGutter } from "components/editorComponents/CodeEditor"; import type { JSAction, JSCollection } from "entities/JSCollection"; -import { - RUN_GUTTER_CLASSNAME, - RUN_GUTTER_ID, - NO_FUNCTION_DROPDOWN_OPTION, -} from "./constants"; -import type { DropdownOption } from "@appsmith/ads-old"; +import { RUN_GUTTER_CLASSNAME, RUN_GUTTER_ID } from "./constants"; import { find, memoize } from "lodash"; import type { PropertyNode } from "@shared/ast"; import { + ECMA_VERSION, isLiteralNode, isPropertyNode, - ECMA_VERSION, NodeTypes, SourceType, } from "@shared/ast"; @@ -22,10 +17,6 @@ import type { EventLocation } from "ee/utils/analyticsUtilTypes"; import log from "loglevel"; import type CodeMirror from "codemirror"; -export interface JSActionDropdownOption extends DropdownOption { - data: JSAction | null; -} - export const getAST = memoize((code: string, sourceType: SourceType) => parse(code, { ecmaVersion: ECMA_VERSION, @@ -224,20 +215,6 @@ export const getJSFunctionLineGutter = ( }; }; -export const convertJSActionsToDropdownOptions = ( - JSActions: JSAction[], -): JSActionDropdownOption[] => { - return JSActions.map(convertJSActionToDropdownOption); -}; - -export const convertJSActionToDropdownOption = ( - JSAction: JSAction, -): JSActionDropdownOption => ({ - label: JSAction.name, - value: JSAction.id, - data: JSAction, -}); - export const getActionFromJsCollection = ( actionId: string | null, jsCollection: JSCollection, @@ -246,21 +223,3 @@ export const getActionFromJsCollection = ( return jsCollection.actions.find((action) => action.id === actionId) || null; }; - -/** - * Returns dropdown option based on priority and availability - */ -export const getJSActionOption = ( - activeJSAction: JSAction | null, - jsActions: JSAction[], -): JSActionDropdownOption => { - let jsActionOption = NO_FUNCTION_DROPDOWN_OPTION; - - if (activeJSAction) { - jsActionOption = convertJSActionToDropdownOption(activeJSAction); - } else if (jsActions.length) { - jsActionOption = convertJSActionToDropdownOption(jsActions[0]); - } - - return jsActionOption; -}; From a29f9cadee18fd8279b7e25c844cab33c269741b Mon Sep 17 00:00:00 2001 From: Sagar Khalasi Date: Fri, 18 Oct 2024 18:19:08 +0530 Subject: [PATCH 4/6] chore: Addding dependent tags (#36965) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description It is for increasing test coverage with tags Fixes #`36929` ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 9f238070acaf07cb674cb5e1cdd0171e2d671bb3 > Cypress dashboard. > Tags: `@tag.All` > Spec: >
    Fri, 18 Oct 2024 09:35:03 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No --- .../cypress/e2e/GSheet/AllAccess_Spec.ts | 4 +- .../cypress/e2e/GSheet/GsheetMisc_Spec.ts | 4 +- .../e2e/GSheet/ReadNWrite_Access_Spec.ts | 4 +- .../e2e/GSheet/ReadOnly_Access_Spec.ts | 4 +- .../e2e/GSheet/SelectedSheet_Access_Spec.ts | 4 +- .../GSheet/WidgetBinding_AllAccess_Spec.ts | 4 +- .../WidgetBinding_SelectedAccess_Spec.ts | 4 +- .../Regression/Apps/CommunityIssues_Spec.ts | 2 +- .../Apps/CurrencyInputIssue_Spec.js | 2 +- .../e2e/Regression/Apps/EchoApiCMS_spec.js | 2 +- .../Apps/ImportExportForkApplication_spec.js | 2 +- .../Apps/MongoDBShoppingCart_spec.ts | 4 +- .../e2e/Regression/Apps/PgAdmin_spec.js | 167 +- .../e2e/Regression/Apps/PromisesApp_spec.js | 2 +- .../ActionSelectorCreateShouldBind_spec.ts | 2 +- .../ActionSelector_JsToNonJSMode_1_spec.ts | 1012 ++++++------ .../ActionSelector_JsToNonJSMode_2_spec.ts | 1310 +++++++-------- .../ActionSelector_JsToNonJSMode_3_spec.ts | 564 ++++--- .../ActionSelector_JsToNonJSMode_4_spec.ts | 82 +- .../ActionExecution/Bug23345_spec.ts | 2 +- .../ActionExecution/ClearStore_spec.ts | 100 +- .../ActionExecution/Error_handling_spec.ts | 2 +- .../ActionExecution/FieldEvaluation_spec.ts | 26 +- .../ActionExecution/NavigateTo_spec.ts | 132 +- .../ActionExecution/PostWindowMessage_spec.ts | 76 +- .../ActionExecution/RemoveValue_spec.ts | 108 +- .../ActionExecution/StoreValue_spec.ts | 324 ++-- .../ActionExecution/disableJSToggle_spec.ts | 2 +- .../ActionExecution/setInterval_spec.js | 2 +- .../ActionExecution/uiToCode_spec.ts | 2 +- .../Anvil/AnvilAppNavigation_spec.ts | 2 +- .../AppNavigationWithAutoLayout_spec.ts | 2 +- .../AppNavigationWithGit_spec.ts | 16 +- .../AppNavigationWithMultiplePages_spec.ts | 2 +- .../AppNavigation/AppNavigation_spec.ts | 2 +- .../AppNavigation/NavigationSettings_spec.ts | 2 +- .../AppNavigation/SidebarCollapse_spec.ts | 58 +- .../ClientSide/AppNavigation/Sidebar_spec.ts | 2 +- .../AppNavigation/TopInline_spec.ts | 2 +- .../AppNavigation/TopStacked_spec.ts | 2 +- .../Autocomplete/Autocomplete_setters_spec.ts | 158 +- .../Autocomplete/BracketNotation_AC_spec.ts | 2 +- .../ClientSide/Autocomplete/Bug23641_Spec.ts | 52 +- .../ClientSide/Autocomplete/Bugs_AC_Spec.ts | 292 ++-- .../ClientSide/Autocomplete/JS_AC1_spec.ts | 2 +- .../ClientSide/Autocomplete/JS_AC2_spec.ts | 2 +- .../PropertyPaneSlashCommand_spec.ts | 94 +- .../PropertyPaneSuggestion_spec.ts | 78 +- .../ClientSide/Autocomplete/Sql_AC_Spec.ts | 2 +- .../Autocomplete/autocomplete_spec.ts | 2 +- .../ClientSide/BugTests/AbortAction_Spec.ts | 74 +- .../BugTests/AllWidgets_Reset_Spec.ts | 2 +- .../ClientSide/BugTests/ApiBug6732_Spec.ts | 2 +- .../ClientSide/BugTests/ApiBugs_Spec.ts | 200 +-- .../BugTests/Binding_Bug28731_Spec.ts | 2 +- .../ClientSide/BugTests/Bug14987_spec.js | 9 +- .../ClientSide/BugTests/CatchBlock_Spec.ts | 2 +- .../ClientSide/BugTests/DSDiscardBugs_spec.ts | 2 +- .../ClientSide/BugTests/DS_Bug18035_Spec.ts | 9 +- .../ClientSide/BugTests/DS_Bug19893_spec.ts | 2 +- .../ClientSide/BugTests/DS_Bug21734_Spec.ts | 2 +- .../ClientSide/BugTests/DS_Bug25148_Spec.ts | 2 +- .../ClientSide/BugTests/DS_Bug25982_Spec.ts | 52 +- .../ClientSide/BugTests/DS_Bug26126_spec.ts | 2 +- .../ClientSide/BugTests/DS_Bug26716_Spec.ts | 9 +- .../ClientSide/BugTests/DS_Bug26941_Spec.ts | 2 +- .../ClientSide/BugTests/DS_Bug27817_Spec.ts | 2 +- .../ClientSide/BugTests/DS_Bug28750_Spec.ts | 9 +- .../ClientSide/BugTests/DS_Bug28985_spec.ts | 2 +- .../ClientSide/BugTests/DS_Bugs26410_spec.ts | 9 +- .../BugTests/DatasourceSchema_spec.ts | 2 +- .../ClientSide/BugTests/GitBugs_Spec.ts | 293 ++-- .../BugTests/GraphQL_Binding_Bug16702_Spec.ts | 4 +- .../ClientSide/BugTests/InvalidURL_Spec.ts | 2 +- .../ClientSide/BugTests/JSParse_Spec.ts | 2 +- .../ClientSide/BugTests/JS_Bug14002_Spec.ts | 2 +- .../ClientSide/BugTests/JS_Bug15056_Spec.ts | 46 +- .../ClientSide/BugTests/JS_Bug15909_Spec.ts | 50 +- .../ClientSide/BugTests/JS_Bug18369_Spec.ts | 24 +- .../ClientSide/BugTests/JS_Bug19982_Spec.ts | 2 +- .../ClientSide/BugTests/JS_Bug20841_Spec.ts | 2 +- .../ClientSide/BugTests/JS_Bug24194_Spec.ts | 50 +- .../ClientSide/BugTests/JS_Bug25894_spec.ts | 2 +- .../ClientSide/BugTests/JS_Bug28764_Spec.ts | 80 +- .../ClientSide/BugTests/JS_Bug29131_spec.ts | 78 +- .../BugTests/ListWidgetOnPageLoad_Spec.ts | 2 +- .../ClientSide/BugTests/Moment_Spec.ts | 4 +- .../BugTests/SelectWidget_Bug9334_Spec.ts | 2 +- .../BugTests/Widget_Bug27119_Spec.ts | 114 +- .../BugTests/defaultFilterTextValue_Spec.ts | 20 +- .../BugTests/formHasChanged_Spec.ts | 24 +- .../BugTests/invalidLintError_Spec.ts | 2 +- .../PropertyPaneCodeComment_spec.ts | 36 +- .../PublishCommunityTemplatesFlow_spec.ts | 10 +- .../Debugger/Api_pane_navigation_spec.ts | 9 +- .../Widget_property_navigation_spec.ts | 2 +- .../ClientSide/ExplorerTests/API_Pane_spec.js | 2 +- .../ExplorerTests/Admin_settings_1_spec.js | 282 ++-- .../ExplorerTests/Admin_settings_2_spec.js | 99 +- .../ExplorerTests/Admin_settings_3_spec.ts | 2 +- .../ExplorerTests/Bindings_Widgets_spec.ts | 2 +- .../CopyQuery_RenameDatasource_spec.js | 2 +- .../ExplorerTests/DragAndDropWidget_spec.js | 2 +- .../Drag_Drop_Building_Blocks_spec.ts | 5 + .../Entity_Naming_conflict_spec.js | 46 +- .../ExplorerTests/Hide_Page_spec.js | 2 +- .../ExplorerTests/JSEditorContextMenu_Spec.ts | 2 +- .../ExplorerTests/Long_Name_Tooltip_spec.js | 2 +- .../ExplorerTests/Page_Load_Spec.js | 2 +- .../ClientSide/ExplorerTests/Pages_spec.js | 2 +- .../ExplorerTests/Query_Datasource_spec.js | 2 +- .../ClientSide/ExplorerTests/Renaming_spec.js | 2 +- .../ExplorerTests/Select_Widget_spec.js | 179 +- .../ExplorerTests/Tab_rename_Delete_spec.ts | 58 +- .../Widgets_Copy_Delete_Undo_spec.js | 2 +- ...y_Paste_Delete_Undo_Keyboard_Event_spec.js | 2 +- .../ClientSide/ExplorerTests/Widgets_spec.js | 2 +- .../Fork/ForkAppWithMultipleDS_Spec.ts | 4 +- .../ForkApplicationInDeployedMode_spec.ts | 4 +- .../ForkApplicationReconnectModal_spec.ts | 11 +- .../ForkApplicationWithinAppEditor_spec.ts | 4 +- .../ClientSide/Fork/ForkApplication_spec.ts | 4 +- .../v1.9.24/DSCrudAndBindings_Spec.ts | 15 +- .../ClientSide/Git/GitAutocommit_spec.ts | 7 + .../GitDiscardChange/DiscardChanges_spec.js | 14 +- .../Git/GitImport/GitImport_spec.js | 14 +- .../Git/GitImport/ImportEmptyRepo_spec.js | 79 +- .../Git/GitSync/DeleteBranch_spec.js | 198 ++- .../ClientSide/Git/GitSync/Deploy_spec.js | 14 +- .../Git/GitSync/DisconnectGit_spec.js | 205 +-- .../Git/GitSync/GitBranchProtect_spec.ts | 105 +- .../Git/GitSync/GitConnectV2_spec.ts | 88 +- .../Git/GitSync/GitStatusLite_spec.ts | 71 +- .../Git/GitSync/GitSyncGitBugs_spec.js | 14 +- .../Git/GitSync/GitSyncedApps_spec.js | 761 ++++----- .../Git/GitSync/MergeViaRemote_spec.ts | 13 +- .../ClientSide/Git/GitSync/Merge_spec.js | 14 +- .../ClientSide/Git/GitSync/PreConnect_spec.ts | 73 +- .../RepoLimitExceededErrorModal_spec.js | 13 +- .../Git/GitSync/SwitchBranches_spec.js | 460 +++--- .../conversion_of_git_connected_apps_spec.js | 131 +- .../GitwithCustomJSLibrary_spec.js | 15 +- .../Git/GitWithTheming/GitWithTheming_spec.js | 14 +- .../Homepage/HomepageExperienceV2_spec.ts | 2 +- .../Canvas_Context_Property_Pane_1_spec.js | 316 ++-- .../Canvas_Context_Property_Pane_2_spec.js | 322 ++-- .../Canvas_Context_Selected_Widgets_spec.js | 2 +- .../IDE/Command_Click_Navigation_spec.js | 330 ++-- .../Editor_Segment_Context_Switching_spec.ts | 2 +- .../IDE/IDE_Add_Pane_Interactions_spec.ts | 156 +- .../ClientSide/JSLibrary/Library_spec.ts | 2 +- .../JSObject/JSObjectMutation_spec.ts | 2 +- ...tor_Assert_NoFunctionAvailableText_spec.ts | 34 +- .../AsyncFunctionsBoundInSyncFields_Spec.ts | 2 +- .../ClientSide/Linting/BasicLint_spec.ts | 2 +- .../Linting/EntityPropertiesLint_spec.ts | 174 +- .../ClientSide/Linting/ErrorReporting_spec.ts | 2 +- .../Onboarding/StartFromData_spec.ts | 9 +- .../TableWidget/OneClickBindingMysql_spec.ts | 2 +- .../OtherUIFeatures/ApiError_spec.ts | 52 +- .../OtherUIFeatures/EntityBottomBar_spec.ts | 291 ++-- .../OtherUIFeatures/ExportApplication_spec.js | 2 +- .../OtherUIFeatures/Inspect_Element_spec.js | 4 +- .../ClientSide/OtherUIFeatures/Logs1_spec.js | 212 +-- .../ClientSide/OtherUIFeatures/Logs2_spec.js | 366 ++-- .../OtherUIFeatures/PageOnLoad_spec.ts | 2 +- .../OtherUIFeatures/PreviewMode_spec.js | 2 +- .../OtherUIFeatures/Replay_Editor_spec.js | 10 +- .../ClientSide/OtherUIFeatures/Replay_spec.js | 2 +- .../ClientSide/OtherUIFeatures/Resize_spec.js | 2 +- .../OtherUIFeatures/Unique_key_spec.js | 96 +- .../OtherUIFeatures/ViewMode_spec.js | 92 +- .../OtherUIFeatures/Widget_Error_spec.js | 143 +- .../PartialExport_Widgets_spec.ts | 2 +- .../PartialImportExport/PartialExport_spec.ts | 2 +- .../PartialImportExport/PartialImport_spec.ts | 2 +- .../PeekOverlay/PeekOverlay_Spec.ts | 2 +- .../Performance/LinkRelPreload_Spec.js | 2 +- .../PublishedModeToastToggle_Spec.ts | 2 +- .../Refactoring/Refactoring_spec.ts | 2 +- .../ClientSide/SetProperty/SetOptions_Spec.ts | 2 +- .../WidgetPropertySetters1_spec.ts | 2 +- .../WidgetPropertySetters2_spec.ts | 2 +- .../CreateNewAppFromTemplates_spec.ts | 4 + .../TemplatesModal_filtering_spec.ts | 10 +- .../Fork_Template_Existing_app_spec.js | 11 +- .../Templates/Fork_Template_To_App_spec.ts | 10 +- .../Templates/TemplatesPage_spec.ts | 11 +- .../ThemingTests/ThemeReset_spec.js | 77 +- .../ThemingTests/Theme_Basic_spec.js | 1470 +++++++++-------- .../ThemingTests/Theme_FormWidget_spec.js | 436 ++--- .../Theme_MultiSelectWidget_spec.js | 2 +- .../Widgets/Audio/AudioRecorder1_spec.ts | 2 +- .../Widgets/Audio/AudioRecorder_spec.js | 2 +- .../ClientSide/Widgets/Audio/audio_spec.js | 2 +- .../ClientSide/Widgets/Button/Button2_spec.ts | 2 +- .../Widgets/Button/ButtonGroup2_spec.ts | 2 +- .../ButtonGroup_MenuButton_Width_spec.js | 2 +- .../Widgets/Button/ButtonGroup_spec.js | 2 +- .../Button/ButtonLintErrorValidation_spec.js | 2 +- .../Button/Button_onClickAction_spec.js | 2 +- .../ClientSide/Widgets/Button/Button_spec.js | 2 +- .../Widgets/Button/Button_tooltip_spec.js | 2 +- .../Widgets/Camera/CameraImage_Spec.ts | 2 +- .../Widgets/Camera/CameraVideo_Spec.ts | 2 +- .../Widgets/Chart/ChartDataPoint_Spec.ts | 2 +- .../Widgets/Chart/ChartWidgetErrors_spec.ts | 2 +- .../Chart/Chart_Widget_Loading_spec.js | 2 +- .../Widgets/Chart/Custom3DChartSpec.ts | 2 +- .../Widgets/Chart/Custom_Chart_Data_spec.js | 2 +- .../Widgets/Chart/Custom_Chart_spec.js | 2 +- ...kBoxLintErrorMultipleRowValidation_spec.js | 2 +- .../CheckBoxMultipleLintError_spec.js | 2 +- .../Widgets/Checkbox/CheckBox_spec.js | 2 +- .../Widgets/Checkbox/CheckboxGroup1_spec.js | 2 +- .../Widgets/Checkbox/CheckboxGroup2_spec.js | 2 +- .../Checkbox/CheckboxGroup_withQuery_spec.js | 2 +- .../Widgets/CodeScanner/CodeScanner1_spec.ts | 2 +- .../Widgets/CodeScanner/CodeScanner2_spec.ts | 2 +- .../ClientSide/Widgets/ContainerTest2_spec.ts | 4 +- .../ClientSide/Widgets/Container_spec.js | 4 +- .../CurrencyInputDynamicCurrencyCode_spec.js | 2 +- .../CurrencyInput_ShowStepArrows_spec.js | 2 +- .../CurrencyInput/CurrencyInput_spec.js | 2 +- .../CustomWidgetDefaultComponent_spec.ts | 2 +- .../CustomWidgetEditorPropertyPane_spec.ts | 2 +- .../Widgets/Datepicker/DatePicker1_spec.js | 2 +- .../Widgets/Datepicker/DatePicker2_spec.js | 2 +- .../Widgets/Datepicker/DatePicker3_spec.ts | 2 +- .../Datepicker/DatePickerV2Updated_spec.js | 2 +- .../Widgets/Datepicker/DatePickerV2_spec.js | 2 +- .../Datepicker/DatePicker_Toggle_js_spec.js | 2 +- .../Datepicker/DatePicker_With_Switch_spec.js | 2 +- .../Disabled_Widgets_drag_validation_spec.js | 2 +- .../Widgets/Divider/Widget_Divider_spec.ts | 2 +- .../DocumentViewer/DocumentViewer_spec.ts | 2 +- .../DropDownWidget_value_reset_spec.js | 2 +- .../Dropdown/Dropdown_onOptionChange_spec.js | 2 +- .../Widgets/Dropdown/Dropdown_spec.js | 2 +- .../Widgets/Filepicker/FilePicker2_spec.js | 2 +- .../Widgets/Filepicker/FilePicker3_spec.ts | 2 +- .../Filepicker/FilePickerV2_CSV_spec.js | 2 +- .../FilePickerV2_Widget_Reskinning_spec.js | 2 +- .../FilePickerV2_Widget_reset_spec.js | 2 +- .../Widgets/Filepicker/FilePickerV2_spec.js | 2 +- .../FilePicker_with_fileTypes_spec.js | 2 +- .../Widgets/Filepicker/Filepicker1_spec.js | 2 +- .../ClientSide/Widgets/Form/FormData_spec.js | 46 +- .../ClientSide/Widgets/Form/FormReset_spec.js | 2 +- .../Form/FormWidget_Nested_HasChanges_spec.js | 32 +- .../Form/FormWidget_Select_TreeSelect_spec.js | 2 +- .../FormWidget_With_RichTextEditor_spec.js | 2 +- .../Widgets/Form/FormWidget_spec.js | 2 +- .../Widgets/Form/FormWithSwitch_spec.js | 2 +- .../Widgets/Form/Form_With_CheckBox_spec.js | 2 +- .../Widgets/Iframe/IframeTest_spec.ts | 2 +- .../Iframe/Iframe_onSrcDocChange_spec.js | 2 +- .../ClientSide/Widgets/Iframe/Iframe_spec.js | 2 +- .../ClientSide/Widgets/Image/Image2_Spec.ts | 2 +- .../ClientSide/Widgets/Image/Image3_Spec.ts | 2 +- .../Widgets/Image/Image_base64_spec.js | 2 +- .../ClientSide/Widgets/Image/Image_spec.js | 2 +- .../Widgets/Image/Image_validation_spec.js | 2 +- .../ClientSide/Widgets/Input/Input2_Spec.ts | 2 +- .../ClientSide/Widgets/Input/Input3_Spec.ts | 2 +- .../Widgets/Input/Input_MaxChar_spec.js | 2 +- .../Widgets/Input/Input_Multiline_spec.js | 2 +- .../Input/Input_OnFocus_OnBlur_spec.js | 2 +- .../ClientSide/Widgets/Input/Input_spec.js | 2 +- .../Input/Inputv2_ShowStepArrows_spec.js | 2 +- .../Widgets/Input/Inputv2_inside_List_spec.js | 332 ++-- .../ClientSide/Widgets/Input/Inputv2_spec.js | 967 +++++------ .../JSONForm/JSONForm_ArrayField_spec.js | 2 +- .../JSONForm_AutoGenerateFormDisabled_spec.js | 2 +- .../JSONForm_AutoGenerateFormEnabled_spec.js | 2 +- .../Widgets/JSONForm/JSONForm_Basic_spec.js | 2 +- .../JSONForm/JSONForm_CurrencyField_spec.ts | 2 +- .../JSONForm/JSONForm_CustomField_spec.js | 2 +- .../JSONForm/JSONForm_FieldChange_spec.js | 2 +- .../JSONForm/JSONForm_FieldEvents_1_spec.js | 2 +- .../JSONForm/JSONForm_FieldEvents_2_spec.js | 2 +- .../JSONForm_FieldProperties_1_spec.js | 2 +- .../JSONForm_FieldProperties_2_spec.js | 2 +- .../JSONForm/JSONForm_FilterText_spec.js | 2 +- .../Widgets/JSONForm/JSONForm_Footer_spec.js | 2 +- .../JSONForm/JSONForm_FormBindings_spec.js | 2 +- .../JSONForm/JSONForm_FormProperties_spec.js | 2 +- .../JSONForm/JSONForm_HiddenFields_1_spec.js | 2 +- .../JSONForm/JSONForm_HiddenFields_2_spec.js | 2 +- .../JSONForm_MultipleSourceData_spec.js | 2 +- .../JSONForm/JSONForm_RadioGroupField_spec.js | 2 +- .../Widgets/JSONForm/JSONForm_Reset_spec.js | 277 ++-- .../JSONForm/JSONForm_UnicodeKeys_spec.js | 2 +- .../Widgets/JSONForm/JSONFrom_Modal_spec.js | 2 +- .../ClientSide/Widgets/List/List1_spec.js | 2 +- .../ClientSide/Widgets/List/List3_spec.js | 2 +- .../ClientSide/Widgets/List/List4_1_spec.ts | 2 +- .../ClientSide/Widgets/List/List4_2_spec.js | 2 +- .../ClientSide/Widgets/List/List5_spec.js | 2 +- .../ClientSide/Widgets/List/List6_spec.js | 2 +- .../ClientSide/Widgets/List/List7_spec.js | 2 +- .../Childwigets/List_FilePicker_spec.js | 2 +- .../ListV2/Childwigets/List_Inputs_spec.js | 400 ++--- .../List_Modal_Stats_Check_Radio_spec.js | 2 +- .../Childwigets/List_Select_Widgets_spec.js | 322 ++-- .../Childwigets/List_Table_Widgets_spec.js | 110 +- .../Childwigets/Listv2_Button_Widget_spec.ts | 48 +- .../Childwigets/Listv2_Tabs_Widget_spec.js | 48 +- .../ListV2/DataIdentifierProperty_spec.ts | 2 +- .../Widgets/ListV2/DataIdentifier_spec.ts | 2 +- .../Widgets/ListV2/DefaultSelectItem_spec.ts | 2 +- .../Widgets/ListV2/Event_Bindings_spec.ts | 2 +- .../Widgets/ListV2/ListV2_NestedList_spec.ts | 2 +- .../ListV2/ListV2_PageNo_PageSize_spec.js | 2 +- .../ListV2/ListV2_SerververSide_spec.js | 2 +- .../ListV2/ListV2_WithOtherWidget_spec.ts | 2 +- .../ListV2/ListV2_nested_List_widget_spec.js | 2 +- ...Listv2_BasicChildWidgetInteraction_spec.js | 2 +- .../ListV2/Listv2_BasicClientSideData_spec.js | 2 +- .../ListV2/Listv2_BasicServerSideData_spec.js | 2 +- .../ListV2/Listv2_Copy_Paste_Delete_spec.js | 2 +- .../ListV2/Listv2_EvaluatedPopup_spec.js | 2 +- .../Listv2_Meta_Hydration_ClientSide_spec.js | 2 +- .../Listv2_Meta_Hydration_ServerSide_spec.js | 2 +- .../Listv2_Nested_EventBindings_spec.js | 2 +- .../Listv2_WithButtonGroupIconWidget_spec.ts | 2 +- .../ListV2/Listv2_autocomplete_spec.js | 2 +- .../Widgets/ListV2/Listv2_container_spec.js | 2 +- .../Widgets/ListV2/Listv2_onItemClick_spec.js | 2 +- .../ListV2/Listv2_regression_fix_spec.js | 2 +- .../ClientSide/Widgets/ListV2/Listv2_spec.js | 2 +- .../ListV2/Listv2_vulnerability_spec.js | 2 +- .../Widgets/ListV2/PropertyPane_spec.ts | 2 +- .../ClientSide/Widgets/Migration_Spec.js | 546 +++--- .../Modal/Modal_On_Table_Filter_Pane_spec.ts | 2 +- .../Modal/Modal_Widget_With_Button_spec.ts | 2 +- .../Widgets/Modal/Modal_background_spec.ts | 2 +- .../Widgets/Modal/Modal_focus_spec.js | 146 +- .../Widgets/Modal/Modal_functionaliy_spec.js | 2 +- .../ClientSide/Widgets/Modal/Modal_spec.ts | 2 +- .../Widgets/Multiselect/MultiSelect1_spec.js | 2 +- .../Widgets/Multiselect/MultiSelect2_spec.js | 2 +- .../Widgets/Multiselect/MultiSelect4_spec.js | 2 +- .../Widgets/Multiselect/MultiSelect5_spec.ts | 2 +- .../Multiselect/MultiTreeSelect_2_spec.ts | 2 +- .../Multiselect/MultiTreeSelect_spec.js | 2 +- .../Multiselect/Multi_Select_Tree_spec.js | 2 +- .../ClientSide/Widgets/Others/Camera_spec.js | 92 +- .../Widgets/Others/Canvas_scrolling_spec.js | 2 +- .../ClientSide/Widgets/Others/Divider_spec.js | 2 +- .../Widgets/Others/IconButton_2_spec.ts | 2 +- .../Widgets/Others/IconButton_spec.js | 2 +- .../Widgets/Others/MapChart_Spec.ts | 2 +- .../Widgets/Others/MapWidget_Spec.ts | 2 +- .../Widgets/Others/MapWidget_loading_Spec.ts | 2 +- .../Widgets/Others/MenuButton_spec.js | 2 +- .../Widgets/Others/OthersAutocomplete_spec.js | 2 +- .../Widgets/Others/Progress_spec.js | 2 +- .../Others/StatBox_DragAndDrop_spec.js | 2 +- .../Widgets/Others/StatboxDsl_spec.js | 2 +- .../PhoneInput/PhoneInputDynamicValue_spec.js | 2 +- .../PhoneInput/PhoneInput_Part2_spec.ts | 2 +- .../Widgets/PhoneInput/Phone_input_spec.js | 2 +- .../Widgets/RTE/RichTextEditor3_spec.ts | 2 +- .../Widgets/RTE/RichTextEditor_1_spec.js | 2 +- .../Widgets/RTE/RichTextEditor_2_spec.js | 2 +- .../RTE/RichTextEditor_Validation_spec.js | 2 +- .../ClientSide/Widgets/Radio/Radio2_spec.ts | 2 +- .../Widgets/Radio/RadioGroup1_spec.js | 2 +- .../Widgets/Radio/RadioGroup2_spec.js | 51 +- .../Radio/RadioGroup_Int_Value_spec.js | 2 +- .../ClientSide/Widgets/Radio/Radio_spec.js | 2 +- .../Widgets/Rating/Rating_Widget_spec.ts | 2 +- .../ClientSide/Widgets/Select/Select2_Spec.ts | 2 +- .../ClientSide/Widgets/Select/Select3_Spec.ts | 2 +- ...eSelect_MultiSelect_OnFocus_OnBlur_spec.js | 2 +- .../Widgets/Select/Select_Validation_spec.js | 2 +- .../ClientSide/Widgets/Select/Select_spec.js | 222 +-- .../Widgets/Select/Select_widget1_spec.js | 2 +- .../Widgets/Select/select_Widget_Bug_spec.js | 2 +- .../Widgets/Sliders/CategorySlider_spec.ts | 2 +- .../Widgets/Sliders/NumberSlider_spec.ts | 902 +++++----- .../Widgets/Sliders/RangeSlider_spec.ts | 760 ++++----- .../Widgets/Statbox/Statbox_spec.ts | 256 +-- .../ClientSide/Widgets/Switch/Switch2_spec.ts | 2 +- .../Widgets/Switch/SwitchGroup1_spec.ts | 2 +- .../Widgets/Switch/SwitchGroup2_spec.js | 2 +- .../ClientSide/Widgets/Switch/Switch_spec.js | 2 +- .../Widgets/Tab/Tab_Duplicate_TabName_spec.js | 2 +- .../Tab/Tab_OnEvent_Navigation_spec.js | 2 +- .../Widgets/Tab/Tab_new_scenario_spec.js | 52 +- .../ClientSide/Widgets/Tab/Tabs_2_spec.ts | 2 +- .../ClientSide/Widgets/Tab/Widget_Tab_spec.js | 272 +-- .../ClientSide/Widgets/Tab_reset_spec.js | 2 +- .../Widgets/TableV1/TableBugs_Spec.ts | 2 +- .../Widgets/TableV1/TableFilter1_1_Spec.ts | 2 +- .../Widgets/TableV1/TableFilter1_2_Spec.ts | 2 +- .../Widgets/TableV1/TableFilter2_1_Spec.ts | 2 +- .../Widgets/TableV1/TableFilter2_2_Spec.ts | 2 +- .../Table_Button_Icon_validation_spec.js | 2 +- .../Widgets/TableV1/Table_Color_spec.js | 2 +- .../TableV1/Table_Column_Resize_spec.js | 2 +- ...ble_Derived_Column_Data_validation_spec.js | 2 +- .../TableV1/Table_EmptyRow_Color_spec.js | 2 +- .../TableV1/Table_FilteredTableData_spec.js | 2 +- .../TableV1/Table_GeneralProperty_spec.js | 2 +- .../Table_MultiRowSelect_dataUpdation_spec.js | 2 +- .../TableV1/Table_MultiRowSelect_spec.js | 2 +- .../TableV1/Table_Number_column_spec.js | 2 +- .../TableV1/Table_PropertyPane_1_spec.js | 2 +- .../TableV1/Table_PropertyPane_2_spec.js | 2 +- .../Table_PropertyPane_IconName_spec.js | 2 +- .../TableV1/Table_Property_JsonUpdate_spec.js | 2 +- .../Widgets/TableV1/Table_Switch_spec.js | 2 +- .../TableV1/Table_Widget_Add_button_spec.js | 2 +- .../TableV1/Table_Widget_Copy_Paste_spec.js | 2 +- .../TableV1/Table_Widget_Default_Row_spec.js | 2 +- ...dget_Derived_Column_Computed_value_spec.js | 2 +- .../TableV1/Table_Widget_Selected_row_spec.js | 2 +- .../ClientSide/Widgets/TableV1/Table_spec.js | 2 +- .../TableV1/Table_tabledata_schema_spec.js | 88 +- .../table_with_text_no_2dArray_spec.js | 2 +- .../table_with_text_selRowIndices_spec.js | 2 +- .../Widgets/TableV2/AddNewRow1_spec.js | 2 +- .../Widgets/TableV2/AddNewRow2_spec.js | 2 +- .../Widgets/TableV2/AddNewRow3_spec.js | 2 +- .../TableV2/Custom_column_alias_spec.js | 2 +- .../TableV2/Date_column_editing_1_spec.ts | 2 +- .../TableV2/Date_column_editing_2_spec.ts | 2 +- .../Widgets/TableV2/Edge_case_spec.js | 2 +- .../Widgets/TableV2/Image_resize_spec.js | 2 +- .../Widgets/TableV2/Inline_editing_1_spec.js | 2 +- .../Widgets/TableV2/Inline_editing_2_spec.js | 2 +- .../Widgets/TableV2/Inline_editing_3_spec.js | 2 +- .../Widgets/TableV2/Pagesize_spec.ts | 2 +- .../Widgets/TableV2/TableV2Filter1_1_Spec.ts | 2 +- .../Widgets/TableV2/TableV2Filter1_2_Spec.ts | 2 +- .../Widgets/TableV2/TableV2Filter2_1_Spec.ts | 2 +- .../Widgets/TableV2/TableV2Filter2_2_Spec.ts | 2 +- .../TableV2_Button_Icon_validation_spec.js | 2 +- .../Widgets/TableV2/TableV2_Color_spec.js | 2 +- .../TableV2/TableV2_Column_Order_spec.js | 2 +- .../TableV2/TableV2_Column_Resize_spec.js | 2 +- ...eV2_Derived_Column_Data_validation_spec.js | 2 +- .../TableV2/TableV2_DisplayText_spec.ts | 2 +- .../TableV2/TableV2_FilteredTableData_spec.ts | 2 +- .../TableV2/TableV2_GeneralProperty_spec.js | 2 +- ...ableV2_MultiRowSelect_dataUpdation_spec.js | 2 +- .../TableV2/TableV2_MultiRowSelect_spec.js | 2 +- .../TableV2/TableV2_PropertyPane_1_spec.js | 2 +- .../TableV2/TableV2_PropertyPane_2_spec.js | 2 +- .../TableV2_PropertyPane_IconName_spec.js | 2 +- .../TableV2_Property_JsonUpdate_spec.js | 2 +- .../Widgets/TableV2/TableV2_Sorting_spec.js | 2 +- .../Widgets/TableV2/TableV2_Switch_spec.js | 2 +- .../TableV2/TableV2_Url_Column_spec.ts | 2 +- .../TableV2/TableV2_Widget_Add_button_spec.js | 2 +- .../TableV2/TableV2_Widget_Copy_Paste_spec.js | 2 +- .../TableV2_Widget_Default_Row_spec.js | 2 +- ...dget_Derived_Column_Computed_value_spec.js | 2 +- .../TableV2_Widget_Selected_row_spec.js | 2 +- .../TableV2_header_menu_visibility_spec.ts | 2 +- .../TableV2/TableV2_pagination_spec.js | 2 +- .../Widgets/TableV2/TableV2_spec.js | 2 +- .../TableV2/TableV2_tabledata_schema_spec.js | 94 +- .../Widgets/TableV2/Text_wrapping_spec.js | 2 +- .../Widgets/TableV2/VirtualRow_spec.js | 2 +- .../columnTypes/ColumnTypeMenubutton_spec.js | 2 +- .../columnTypes/ColumnTypesSelect2_spec.ts | 2 +- .../TableV2/columnTypes/Select1_spec.ts | 2 +- .../TableV2/columnTypes/checkboxCell_spec.js | 2 +- .../TableV2/columnTypes/currency_spec.ts | 171 +- .../TableV2/columnTypes/switchCell_spec.js | 2 +- .../Widgets/TableV2/freeze_column1_spec.js | 2 +- .../Widgets/TableV2/freeze_column2_spec.js | 2 +- .../Widgets/TableV2/freeze_column3_spec.js | 2 +- .../freeze_column_query_change_spec.js | 2 +- .../inline_editing_validations_spec.js | 2 +- .../TableV2/non_ascii_column_name_spec.js | 2 +- .../Widgets/TableV2/scrollbar_spec.ts | 2 +- .../Widgets/TableV2/table_data_change_spec.ts | 2 +- .../ClientSide/Widgets/Text/Text2_Spec.ts | 2 +- .../Text/TextWidget_BgColor_TextSize_spec.js | 2 +- .../TextWidget_LintErrorValidation_spec.js | 2 +- .../Widgets/Text/Text_new_feature_spec.js | 2 +- .../ClientSide/Widgets/Text/Text_spec.js | 2 +- .../Widgets/Text/Text_truncate_spec.js | 2 +- ...elect_TreeSelect_MultiSelect_Empty_spec.ts | 2 +- .../TreeSelect/Single_Select_Tree_spec.ts | 2 +- .../Widgets/TreeSelect/Tree_Select_2_spec.ts | 2 +- .../Widgets/TreeSelect/Tree_Select_spec.ts | 2 +- .../ClientSide/Widgets/Video/Video2_Spec.ts | 2 +- .../ClientSide/Widgets/Video/Video_spec.ts | 2 +- .../Widgets/WidgetCopyPaste_spec.js | 294 ++-- .../ClientSide/Widgets/WidgetGrouping_spec.js | 88 +- .../Widgets/WidgetSelection_spec.js | 108 +- .../ClientSide/Widgets/Widgets_Labels_spec.js | 2 +- .../Widgets/deprecatedWidgets_spec.js | 41 +- .../CreateAppWithSameNameInWorkspace_spec.js | 2 +- .../CreateSameAppInDiffWorkspace_spec.js | 2 +- .../Workspace/DeleteWorkspace_spec.ts | 2 +- .../Workspace/LeaveWorkspaceTest_spec.js | 2 +- .../Workspace/LoginFromUIApp_spec.js | 2 +- .../ClientSide/Workspace/MemberRoles_Spec.ts | 2 +- .../Workspace/ShareAppTests_Spec.ts | 2 +- .../Workspace/UpdateWorkspaceTests_spec.js | 164 +- .../WorkspaceImportApplication_spec.js | 2 +- .../Workspace/Workspace_validation_spec.js | 2 +- .../ServerSide/ApiTests/API_All_Verb_spec.js | 2 +- .../API_Auto_Generated_Header_spec.ts | 2 +- .../ServerSide/ApiTests/API_Bugs_Spec.js | 412 ++--- .../ApiTests/API_ContextMenu_spec.js | 2 +- .../ApiTests/API_CurlPOSTImport_spec.js | 80 +- .../ApiTests/API_DefaultContentType_spec.js | 112 +- .../ServerSide/ApiTests/API_Edit_spec.js | 2 +- .../ApiTests/API_EvaluatedValue_spec.ts | 2 +- .../ServerSide/ApiTests/API_MultiPart_Spec.ts | 2 +- .../ServerSide/ApiTests/API_Mustache_spec.js | 2 +- .../ApiTests/API_RequestBody_spec.ts | 28 +- .../ApiTests/API_Response_View_spec.js | 2 +- .../ServerSide/ApiTests/API_Search_spec.js | 2 +- .../ServerSide/ApiTests/API_Styles_spec.js | 2 +- ...TestExecuteWithDynamicBindingInUrl_spec.ts | 4 +- .../ApiTests/API_Unique_name_spec.js | 26 +- .../ApiTests/Api_XSS_Vulnerability_spec.ts | 2 +- .../ApiTests/CurlImportFlow_spec.js | 60 +- .../AppLevelImport/AppImportwithDS_Spec.ts | 2 +- .../Datasources/ConnectionErrors_Spec.ts | 2 +- .../Datasources/ElasticSearch_Basic_Spec.ts | 402 ++--- .../Datasources/Firestore_Basic_Spec.ts | 588 +++---- .../ServerSide/Datasources/Oracle_Spec.ts | 581 +++---- .../Datasources/Redis_Basic_Spec.ts | 194 +-- .../ServerSide/GenerateCRUD/MongoURI_Spec.ts | 2 +- .../ServerSide/GenerateCRUD/Mongo_Spec.ts | 4 +- .../ServerSide/GenerateCRUD/MySQL1_Spec.ts | 2 +- .../ServerSide/GenerateCRUD/MySQL2_Spec.ts | 2 +- .../ServerSide/GenerateCRUD/Postgres1_Spec.ts | 2 +- .../ServerSide/GenerateCRUD/Postgres2_Spec.ts | 2 +- .../ServerSide/GenerateCRUD/S3_Spec.js | 2 +- .../JsFunctionExecution/Fetch_Spec.ts | 2 +- .../JSFunctionExecution_spec.ts | 2 +- .../JsFunctionExecution/PlatformFn_spec.ts | 2 +- .../JsFunctionExecution/SetTimeout_spec.ts | 296 ++-- .../ServerSide/MySQL_Datatypes/Basic_Spec.ts | 242 +-- .../ServerSide/MySQL_Datatypes/False_Spec.ts | 116 +- .../ServerSide/OnLoadTests/APIOnLoad_Spec.ts | 2 +- .../OnLoadTests/ExecuteAction_Spec.ts | 2 +- .../ServerSide/OnLoadTests/JSOnLoad2_Spec.ts | 10 +- .../ServerSide/OnLoadTests/JSOnLoad4_Spec.ts | 2 +- .../JSOnLoad_cyclic_dependency_errors_spec.js | 2 +- .../ServerSide/OnLoadTests/JsOnLoad3_Spec.ts | 2 +- .../OnLoadTests/OnLoadActions_Spec.ts | 2 +- .../OnLoadTests/PostgresConnections_spec.ts | 2 +- .../ServerSide/Params/ExecutionParams_spec.js | 2 +- .../ServerSide/Params/PassingParams_Spec.ts | 2 +- .../Postgres_DataTypes/Array_Spec.ts | 980 +++++------ .../Postgres_DataTypes/Binary_Spec.ts | 680 ++++---- .../Postgres_DataTypes/BooleanEnum_Spec.ts | 2 +- .../Postgres_DataTypes/Character_Spec.ts | 2 +- .../Postgres_DataTypes/DateTime_Spec.ts | 564 ++++--- .../Postgres_DataTypes/Json_Spec.ts | 2 +- .../Postgres_DataTypes/Numeric_Spec.ts | 546 +++--- .../Postgres_DataTypes/UUID_Spec.ts | 716 ++++---- .../QueryPane/AddWidgetTableAndBind_spec.js | 2 +- .../ServerSide/QueryPane/AddWidget_spec.js | 2 +- .../ServerSide/QueryPane/DSDocs_Spec.ts | 2 +- .../QueryPane/EmptyDataSource_spec.js | 2 +- .../QueryPane/EvaluatedValuePopUp_spec.ts | 2 +- .../ServerSide/QueryPane/GoogleSheets_spec.ts | 10 +- .../ServerSide/QueryPane/Mongo1_spec.ts | 4 +- .../QueryPane/QueryPane_MySQL_Spec.ts | 2 +- .../QueryPane/QueryPane_Postgres_Spec.js | 2 +- .../QueryPane/Querypane_Mongo_Spec.js | 4 +- .../ServerSide/QueryPane/S3_1_spec.js | 2 +- .../ServerSide/QueryPane/S3_2_spec.ts | 2 +- .../QueryPane/SwitchDatasource_spec.js | 78 +- .../Sanity/Datasources/Airtable_Basic_Spec.ts | 10 +- .../Datasources/ArangoDataSourceStub_spec.js | 4 +- .../Sanity/Datasources/Arango_Basic_Spec.ts | 9 +- .../AuthenticatedApiDatasource_spec.js | 4 +- .../AuthenticatedApiWithOAuth_spec.ts | 4 +- .../DSAutosaveImprovements_spec.ts | 4 +- .../Sanity/Datasources/DatasourceForm_spec.js | 4 +- .../ElasticSearchDatasource_spec.js | 4 +- .../e2e/Sanity/Datasources/GraphQL_spec.ts | 4 +- .../e2e/Sanity/Datasources/MockDBs_Spec.ts | 9 +- .../Datasources/MongoDatasourceURI_spec.ts | 4 +- .../Datasources/MsSQLDataSourceStub_spec.js | 4 +- .../Sanity/Datasources/MsSQL_Basic_Spec.ts | 4 +- .../Datasources/MySQLDataSourceStub_spec.js | 4 +- .../Sanity/Datasources/MySQLNoiseTest_spec.js | 4 +- .../e2e/Sanity/Datasources/MySQL_spec.js | 4 +- .../Port_Number_Placeholder_Spec.ts | 4 +- .../RedshiftDataSourceStub_spec.js | 4 +- .../Datasources/RestApiDatasource_spec.js | 4 +- .../RestApiOAuth2Validation_spec.ts | 4 +- .../Sanity/Datasources/SMTPDatasource_spec.js | 4 +- .../e2e/Sanity/Datasources/Styles_spec.js | 10 +- .../Smoke/Apps/ReconnectDatasource_spec.js | 4 +- .../Generate_Crud_New_Page_spec.ts | 4 +- 600 files changed, 14736 insertions(+), 13432 deletions(-) diff --git a/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts b/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts index aca3a5ab40d..b40e773c0e6 100644 --- a/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts +++ b/app/client/cypress/e2e/GSheet/AllAccess_Spec.ts @@ -17,7 +17,9 @@ let appName = "gsheet-app"; let spreadSheetName = "test-sheet"; describe.skip( "GSheet-Functional Tests With All Access", - { tags: ["@tag.Datasource", "@tag.GSheet"] }, + { + tags: ["@tag.Datasource", "@tag.GSheet", "@tag.Git", "@tag.AccessControl"], + }, function () { before("Setup app and spreadsheet", function () { //Add a new app and an add new spreadsheet query diff --git a/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts b/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts index b54a27b257c..e217201be66 100644 --- a/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts +++ b/app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts @@ -23,7 +23,9 @@ let appName = "gsheet-app"; let spreadSheetName = "test-sheet"; describe.skip( "GSheet Miscellaneous Tests", - { tags: ["@tag.Datasource", "@tag.GSheet"] }, + { + tags: ["@tag.Datasource", "@tag.GSheet", "@tag.Git", "@tag.AccessControl"], + }, function () { const columnHeaders = [ "uniq_id", diff --git a/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts b/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts index 8d5a72c78b3..a9d8d681824 100644 --- a/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts @@ -13,7 +13,9 @@ import { describe.skip( "GSheet-Functional Tests With Read/Write Access", - { tags: ["@tag.Datasource", "@tag.GSheet"] }, + { + tags: ["@tag.Datasource", "@tag.GSheet", "@tag.Git", "@tag.AccessControl"], + }, function () { const workspaceName = "gsheet apps"; const dataSourceName = { diff --git a/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts b/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts index e90840f7d3c..ed651b75fcc 100644 --- a/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts @@ -13,7 +13,9 @@ import { describe.skip( "GSheet-Functional Tests With Read Access", - { tags: ["@tag.Datasource", "@tag.GSheet"] }, + { + tags: ["@tag.Datasource", "@tag.GSheet", "@tag.Git", "@tag.AccessControl"], + }, function () { const workspaceName = "gsheet apps"; const dataSourceName = { diff --git a/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts b/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts index 5e058b803da..62f0423f2d2 100644 --- a/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts +++ b/app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts @@ -17,7 +17,9 @@ let appName = "gsheet-app"; let spreadSheetName = "test-sheet-automation-selected"; describe( "GSheet-Functional Tests With Selected Access", - { tags: ["@tag.Datasource", "@tag.GSheet"] }, + { + tags: ["@tag.Datasource", "@tag.GSheet", "@tag.Git", "@tag.AccessControl"], + }, function () { before("Setup app", function () { //Setting up app name diff --git a/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts b/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts index a3afbd77610..43576a8b15e 100644 --- a/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts +++ b/app/client/cypress/e2e/GSheet/WidgetBinding_AllAccess_Spec.ts @@ -23,7 +23,9 @@ let appName = "gsheet-app"; let spreadSheetName = "test-sheet"; describe.skip( "GSheet-widget binding", - { tags: ["@tag.Datasource", "@tag.GSheet"] }, + { + tags: ["@tag.Datasource", "@tag.GSheet", "@tag.Git", "@tag.AccessControl"], + }, function () { before("Setup app and spreadsheet", function () { //Setting up the app name diff --git a/app/client/cypress/e2e/GSheet/WidgetBinding_SelectedAccess_Spec.ts b/app/client/cypress/e2e/GSheet/WidgetBinding_SelectedAccess_Spec.ts index a039279a49e..7a768d834a5 100644 --- a/app/client/cypress/e2e/GSheet/WidgetBinding_SelectedAccess_Spec.ts +++ b/app/client/cypress/e2e/GSheet/WidgetBinding_SelectedAccess_Spec.ts @@ -23,7 +23,9 @@ let appName = "gsheet-app"; let spreadSheetName = "test-sheet-automation-selected"; describe( "GSheet-widget binding for selected sheet access", - { tags: ["@tag.Datasource", "@tag.GSheet"] }, + { + tags: ["@tag.Datasource", "@tag.GSheet", "@tag.Git", "@tag.AccessControl"], + }, function () { before("Setup app and spreadsheet", function () { //Setting up the app name diff --git a/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts b/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts index 4b178cfd0c0..4f16bf6fc3b 100644 --- a/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts +++ b/app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "AForce - Community Issues page validations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(function () { agHelper.ClearLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/Apps/CurrencyInputIssue_Spec.js b/app/client/cypress/e2e/Regression/Apps/CurrencyInputIssue_Spec.js index 516cdccbdc4..beb99404b17 100644 --- a/app/client/cypress/e2e/Regression/Apps/CurrencyInputIssue_Spec.js +++ b/app/client/cypress/e2e/Regression/Apps/CurrencyInputIssue_Spec.js @@ -9,7 +9,7 @@ const widgetInput = `${wiggetClass} input`; describe("Currency Input Issue", function () { it( "1. Import application json &should check that the widget input is not showing any error", - { tags: ["@tag.Widget", "@tag.CurrencyInput"] }, + { tags: ["@tag.Widget", "@tag.CurrencyInput", "@tag.Binding"] }, function () { agHelper.VisitNAssert("/applications", "getAllWorkspaces"); homePage.ImportApp("CurrencyInputIssueExport.json"); diff --git a/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js b/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js index 197d01bc3c8..1034df29379 100644 --- a/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js +++ b/app/client/cypress/e2e/Regression/Apps/EchoApiCMS_spec.js @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Content Management System App", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { before(() => { homePage.RenameApplication("EchoApiCMSApp"); diff --git a/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js b/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js index 8ae788c61da..9a28386d1b5 100644 --- a/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js +++ b/app/client/cypress/e2e/Regression/Apps/ImportExportForkApplication_spec.js @@ -9,7 +9,7 @@ import { describe( "Import, Export and Fork application and validate data binding", - { tags: ["@tag.ImportExport", "@tag.Sanity"] }, + { tags: ["@tag.ImportExport", "@tag.Sanity", "@tag.Git"] }, function () { let workspaceId; let newWorkspaceName; diff --git a/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts b/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts index 1e9ad7dbd2a..213c40d0754 100644 --- a/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts +++ b/app/client/cypress/e2e/Regression/Apps/MongoDBShoppingCart_spec.ts @@ -12,7 +12,9 @@ import { describe( "Shopping cart App", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { let datasourceName: string, repoName: any; diff --git a/app/client/cypress/e2e/Regression/Apps/PgAdmin_spec.js b/app/client/cypress/e2e/Regression/Apps/PgAdmin_spec.js index 65cc8b4ba29..fd1cded24be 100644 --- a/app/client/cypress/e2e/Regression/Apps/PgAdmin_spec.js +++ b/app/client/cypress/e2e/Regression/Apps/PgAdmin_spec.js @@ -9,92 +9,99 @@ import { const widgetsPage = require("../../../locators/Widgets.json"); const appPage = require("../../../locators/PgAdminlocators.json"); -describe("PgAdmin Clone App", { tags: ["@tag.Datasource"] }, function () { - let datasourceName, tableName; +describe( + "PgAdmin Clone App", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + let datasourceName, tableName; - before("Add dsl and create datasource", () => { - agHelper.AddDsl("PgAdmindsl"); - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - datasourceName = $dsName; + before("Add dsl and create datasource", () => { + agHelper.AddDsl("PgAdmindsl"); + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + datasourceName = $dsName; + }); }); - }); - it("1. Create queries", function () { - // writing query to get all schema - dataSources.CreateQueryAfterDSSaved( - "SELECT schema_name FROM information_schema.schemata;", - "get_schema", - ); - // switching off Use Prepared Statement toggle - dataSources.ToggleUsePreparedStatement(false); - dataSources.RunQuery(); + it("1. Create queries", function () { + // writing query to get all schema + dataSources.CreateQueryAfterDSSaved( + "SELECT schema_name FROM information_schema.schemata;", + "get_schema", + ); + // switching off Use Prepared Statement toggle + dataSources.ToggleUsePreparedStatement(false); + dataSources.RunQuery(); - // writing query to get all the tables - dataSources.CreateQueryFromOverlay( - datasourceName, - `select * from pg_catalog.pg_tables where schemaname = {{schema_select.selectedOptionValue || "public"}};`, - "get_tables", - 2000, - ); - dataSources.RunQuery(); + // writing query to get all the tables + dataSources.CreateQueryFromOverlay( + datasourceName, + `select * from pg_catalog.pg_tables where schemaname = {{schema_select.selectedOptionValue || "public"}};`, + "get_tables", + 2000, + ); + dataSources.RunQuery(); - // writing query to get all the columns - dataSources.CreateQueryFromOverlay( - datasourceName, - `SELECT column_name, data_type, table_name, ordinal_position, is_nullable FROM information_schema.COLUMNS`, - "get_columns", - ); - dataSources.RunQuery(); + // writing query to get all the columns + dataSources.CreateQueryFromOverlay( + datasourceName, + `SELECT column_name, data_type, table_name, ordinal_position, is_nullable FROM information_schema.COLUMNS`, + "get_columns", + ); + dataSources.RunQuery(); - // writing query to get create table - dataSources.CreateQueryFromOverlay( - datasourceName, - `CREATE TABLE {{schema_select.selectedOptionValue}}.{{nt_name.text.replaceAll(" ","_")}}({{appsmith.store.nt_col.map((c)=> c.name.replaceAll(" ","_") + " " + c.dtype + (c.nnull ? " NOT NULL " : "") + (c.pkey ? " PRIMARY KEY " : "")).join(" , ")}})`, - "create_table", - ); - dataSources.ToggleUsePreparedStatement(false); + // writing query to get create table + dataSources.CreateQueryFromOverlay( + datasourceName, + `CREATE TABLE {{schema_select.selectedOptionValue}}.{{nt_name.text.replaceAll(" ","_")}}({{appsmith.store.nt_col.map((c)=> c.name.replaceAll(" ","_") + " " + c.dtype + (c.nnull ? " NOT NULL " : "") + (c.pkey ? " PRIMARY KEY " : "")).join(" , ")}})`, + "create_table", + ); + dataSources.ToggleUsePreparedStatement(false); - // writing query to get drop table - dataSources.CreateQueryFromOverlay( - datasourceName, - `DROP TABLE {{schema_select.selectedOptionValue}}.{{nt_name.text.replaceAll(" ","_")}}({{appsmith.store.nt_col.map((c)=>c.name.replaceAll(" ","_") + " " + c.dtype + (c.nnull ? " NOT NULL " : "") + (c.pkey ? " PRIMARY KEY " : "")).join(" , ")}});`, - "drop_table", - ); - }); + // writing query to get drop table + dataSources.CreateQueryFromOverlay( + datasourceName, + `DROP TABLE {{schema_select.selectedOptionValue}}.{{nt_name.text.replaceAll(" ","_")}}({{appsmith.store.nt_col.map((c)=>c.name.replaceAll(" ","_") + " " + c.dtype + (c.nnull ? " NOT NULL " : "") + (c.pkey ? " PRIMARY KEY " : "")).join(" , ")}});`, + "drop_table", + ); + }); - it("2. Add new table from app page, View and Delete table", function () { - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON)); - // adding new table - agHelper.GetNClick(appPage.addNewtable, 0, true); - agHelper.AssertElementAbsence(appPage.loadButton, 40000); //for CI - agHelper.WaitUntilEleAppear(appPage.addTablename); - cy.generateUUID().then((UUID) => { - cy.xpath(appPage.addTablename).clear().type(`table${UUID}`); - tableName = `table${UUID}`; + it("2. Add new table from app page, View and Delete table", function () { + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON)); + // adding new table + agHelper.GetNClick(appPage.addNewtable, 0, true); + agHelper.AssertElementAbsence(appPage.loadButton, 40000); //for CI + agHelper.WaitUntilEleAppear(appPage.addTablename); + cy.generateUUID().then((UUID) => { + cy.xpath(appPage.addTablename).clear().type(`table${UUID}`); + tableName = `table${UUID}`; + }); + // adding column to the table + cy.xpath(appPage.addColumn).click({ force: true }); + cy.xpath(appPage.columnNamefield).should("be.visible"); + cy.xpath(appPage.datatypefield).should("be.visible"); + agHelper.GetNClick(appPage.addColumnName); + agHelper.TypeText( + appPage.addColumnName + " " + locators._inputField, + "ID", + ); + agHelper.SelectFromDropDown("Varchar", "", 1); + // switching on the Primary Key toggle + cy.get(widgetsPage.switchWidgetInactive).first().click(); + // switching on the Not Null toggle + cy.get(widgetsPage.switchWidgetInactive).last().click(); + cy.xpath(appPage.submitButton).click({ force: true }); + agHelper.AssertElementVisibility(appPage.addColumn); + cy.xpath(appPage.submitButton).first().click({ force: true }); + assertHelper.AssertNetworkStatus("@postExecute"); + cy.xpath(appPage.closeButton).click({ force: true }); + cy.xpath(appPage.addNewtable).should("be.visible"); + // viewing the table's columns by clicking on view button + cy.xpath(appPage.viewButton).first().click({ force: true }); + // deleting the table through modal + cy.xpath(appPage.deleteButton).last().click({ force: true }); + cy.xpath(appPage.confirmButton).click({ force: true }); + cy.xpath(appPage.closeButton).click({ force: true }); }); - // adding column to the table - cy.xpath(appPage.addColumn).click({ force: true }); - cy.xpath(appPage.columnNamefield).should("be.visible"); - cy.xpath(appPage.datatypefield).should("be.visible"); - agHelper.GetNClick(appPage.addColumnName); - agHelper.TypeText(appPage.addColumnName + " " + locators._inputField, "ID"); - agHelper.SelectFromDropDown("Varchar", "", 1); - // switching on the Primary Key toggle - cy.get(widgetsPage.switchWidgetInactive).first().click(); - // switching on the Not Null toggle - cy.get(widgetsPage.switchWidgetInactive).last().click(); - cy.xpath(appPage.submitButton).click({ force: true }); - agHelper.AssertElementVisibility(appPage.addColumn); - cy.xpath(appPage.submitButton).first().click({ force: true }); - assertHelper.AssertNetworkStatus("@postExecute"); - cy.xpath(appPage.closeButton).click({ force: true }); - cy.xpath(appPage.addNewtable).should("be.visible"); - // viewing the table's columns by clicking on view button - cy.xpath(appPage.viewButton).first().click({ force: true }); - // deleting the table through modal - cy.xpath(appPage.deleteButton).last().click({ force: true }); - cy.xpath(appPage.confirmButton).click({ force: true }); - cy.xpath(appPage.closeButton).click({ force: true }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/Apps/PromisesApp_spec.js b/app/client/cypress/e2e/Regression/Apps/PromisesApp_spec.js index 2a348e14a2c..2d26ab8949f 100644 --- a/app/client/cypress/e2e/Regression/Apps/PromisesApp_spec.js +++ b/app/client/cypress/e2e/Regression/Apps/PromisesApp_spec.js @@ -14,7 +14,7 @@ const commonlocators = require("../../../locators/commonlocators.json"); describe( "Promises App tests", - { tags: ["@tag.Widget", "@tag.JS"] }, + { tags: ["@tag.Widget", "@tag.JS", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("promisesStoreValueDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelectorCreateShouldBind_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelectorCreateShouldBind_spec.ts index 4e4b96e3e11..fcd07b535a1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelectorCreateShouldBind_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelectorCreateShouldBind_spec.ts @@ -10,7 +10,7 @@ import EditorNavigation, { describe( "Creations via action selector should bind to the property", - { tags: ["@tag.JS", "@tag.PropertyPane"] }, + { tags: ["@tag.JS", "@tag.PropertyPane", "@tag.Binding"] }, () => { it.skip("binds newly created query / api to the button onClick", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_1_spec.ts index 8b739f964cc..ca77452c0d4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_1_spec.ts @@ -9,150 +9,153 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => { - it("1. should not show any fields with a blank JS field", () => { - agHelper.AddDsl("promisesBtnDsl", locators._buttonByText("Submit")); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext("onClick", `{{}}`, true, false); - propPane.ToggleJSMode("onClick", false); - agHelper.AssertElementAbsence(".action"); - }); - - it("2. should show Api fields when Api1.run is entered", () => { - apiPage.CreateApi("Api1"); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext("onClick", `{{Api1.run()}}`, true, false); - propPane.ToggleJSMode("onClick", false); - agHelper.GetNAssertElementText( - propPane._actionCard, - "GETExecute a queryApi1.run", - ); - propPane.SelectActionByTitleAndValue("Execute a query", "Api1.run"); - propPane.AssertSelectValue("Api1.run"); - }); - - it("3. should show Api fields when an Api with then/catch is entered", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{Api1.run().then(() => {}).catch(() => {});}}`, - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - agHelper.GetNAssertElementText( - propPane._actionCard, - "GETExecute a queryApi1.run", - ); - }); - - it("4. should show Api fields when an Api with then/catch is entered", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{Api1.run().then(() => { showAlert(); }).catch(() => { showModal(); });}}`, - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - agHelper.GetNAssertElementText( - propPane._actionCard, - "GETExecute a queryApi1.run+2", - ); - agHelper.GetNClick(propPane._actionCard); - - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On success", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show alertAdd message", - "have.text", - 1, - ); - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On failure", - "have.text", - 1, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show modalnone", - "have.text", - 2, - ); - }); - - it("5. should show Api fields when an Api with then/catch is entered", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{Api1.run().then(() => { showAlert('Hello world!', 'info'); storeValue('a', 18); }).catch(() => { showModal(Modal1.name); });}}`, - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - agHelper.GetNAssertElementText( - propPane._actionCard, - "GETExecute a queryApi1.run+3", - ); - agHelper.GetNClick(propPane._actionCard); - - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On success", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show alertHello world!", - "have.text", - 1, - ); - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On failure", - "have.text", - 1, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Store valuea", - "have.text", - 2, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show modalModal1", - "have.text", - 3, - ); - - agHelper.GetNClick(propPane._actionCard, 1); - agHelper.ValidateCodeEditorContent(propPane._textView, "Hello world!"); - agHelper.GetNAssertElementText(propPane._selectorViewButton, "Info"); - - agHelper.GetNClick(propPane._actionCard, 2); - agHelper.ValidateCodeEditorContent(propPane._textView, "a{{18}}"); - - agHelper.GetNClick(propPane._actionCard, 3); - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "Select modal", - ); - }); - - it("6. should show Api related fields appropriately with platform functions with callbacks", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{Api1.run().then(() => { +describe( + "JS to non-JS mode in Action Selector", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + it("1. should not show any fields with a blank JS field", () => { + agHelper.AddDsl("promisesBtnDsl", locators._buttonByText("Submit")); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext("onClick", `{{}}`, true, false); + propPane.ToggleJSMode("onClick", false); + agHelper.AssertElementAbsence(".action"); + }); + + it("2. should show Api fields when Api1.run is entered", () => { + apiPage.CreateApi("Api1"); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext("onClick", `{{Api1.run()}}`, true, false); + propPane.ToggleJSMode("onClick", false); + agHelper.GetNAssertElementText( + propPane._actionCard, + "GETExecute a queryApi1.run", + ); + propPane.SelectActionByTitleAndValue("Execute a query", "Api1.run"); + propPane.AssertSelectValue("Api1.run"); + }); + + it("3. should show Api fields when an Api with then/catch is entered", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{Api1.run().then(() => {}).catch(() => {});}}`, + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + agHelper.GetNAssertElementText( + propPane._actionCard, + "GETExecute a queryApi1.run", + ); + }); + + it("4. should show Api fields when an Api with then/catch is entered", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{Api1.run().then(() => { showAlert(); }).catch(() => { showModal(); });}}`, + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + agHelper.GetNAssertElementText( + propPane._actionCard, + "GETExecute a queryApi1.run+2", + ); + agHelper.GetNClick(propPane._actionCard); + + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On success", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show alertAdd message", + "have.text", + 1, + ); + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On failure", + "have.text", + 1, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show modalnone", + "have.text", + 2, + ); + }); + + it("5. should show Api fields when an Api with then/catch is entered", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{Api1.run().then(() => { showAlert('Hello world!', 'info'); storeValue('a', 18); }).catch(() => { showModal(Modal1.name); });}}`, + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + agHelper.GetNAssertElementText( + propPane._actionCard, + "GETExecute a queryApi1.run+3", + ); + agHelper.GetNClick(propPane._actionCard); + + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On success", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show alertHello world!", + "have.text", + 1, + ); + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On failure", + "have.text", + 1, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Store valuea", + "have.text", + 2, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show modalModal1", + "have.text", + 3, + ); + + agHelper.GetNClick(propPane._actionCard, 1); + agHelper.ValidateCodeEditorContent(propPane._textView, "Hello world!"); + agHelper.GetNAssertElementText(propPane._selectorViewButton, "Info"); + + agHelper.GetNClick(propPane._actionCard, 2); + agHelper.ValidateCodeEditorContent(propPane._textView, "a{{18}}"); + + agHelper.GetNClick(propPane._actionCard, 3); + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "Select modal", + ); + }); + + it("6. should show Api related fields appropriately with platform functions with callbacks", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{Api1.run().then(() => { appsmith.geolocation.getCurrentPosition(location => { showAlert(location); }); @@ -161,109 +164,109 @@ describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => { showAlert('hi'); }, 5000, '1'); });}}`, - true, - true, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "GETExecute a queryApi1.run+2", - ); - - agHelper.GetNClick(propPane._actionCard); - - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On success", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On failure", - "have.text", - 1, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Set interval5000ms", - "have.text", - 2, - ); - }); - - it("7. should show Api related fields appropriately with platform functions with catch callback", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - "{{Api1.run().catch(() => copyToClipboard('hi'))}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "GETExecute a queryApi1.run+1", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard); - - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On failure", - "have.text", - 1, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Copy to clipboardhi", - "have.text", - 1, - ); - - agHelper.GetNClick(propPane._actionCard, 1); - agHelper.ValidateCodeEditorContent(propPane._textView, "hi"); - }); - - it("8. should show Api related fields appropriately with platform functions with catch callback", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - "{{Api1.run().then(() => clearStore())}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "GETExecute a queryApi1.run+1", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard); - - agHelper.GetNAssertElementText( - propPane._actionCallbackTitle, - "On success", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Clear store", - "have.text", - 1, - ); - }); - - it("9. shows fields appropriately for JS Object functions with/without arguments", () => { - const JS_OBJECT_BODY = `export default { + true, + true, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "GETExecute a queryApi1.run+2", + ); + + agHelper.GetNClick(propPane._actionCard); + + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On success", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On failure", + "have.text", + 1, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Set interval5000ms", + "have.text", + 2, + ); + }); + + it("7. should show Api related fields appropriately with platform functions with catch callback", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + "{{Api1.run().catch(() => copyToClipboard('hi'))}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "GETExecute a queryApi1.run+1", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard); + + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On failure", + "have.text", + 1, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Copy to clipboardhi", + "have.text", + 1, + ); + + agHelper.GetNClick(propPane._actionCard, 1); + agHelper.ValidateCodeEditorContent(propPane._textView, "hi"); + }); + + it("8. should show Api related fields appropriately with platform functions with catch callback", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + "{{Api1.run().then(() => clearStore())}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "GETExecute a queryApi1.run+1", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard); + + agHelper.GetNAssertElementText( + propPane._actionCallbackTitle, + "On success", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Clear store", + "have.text", + 1, + ); + }); + + it("9. shows fields appropriately for JS Object functions with/without arguments", () => { + const JS_OBJECT_BODY = `export default { funcWithoutArgsSync: () => { console.log("hi"); }, @@ -278,113 +281,113 @@ describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => { } }`; - jsEditor.CreateJSObject(JS_OBJECT_BODY, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, + jsEditor.CreateJSObject(JS_OBJECT_BODY, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext( + "onClick", + "{{JSObject1.funcWithoutArgsSync()}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject1.funcWithoutArgsSync()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard); + agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); + + propPane.EnterJSContext( + "onClick", + "{{JSObject1.funcWithArgsSync(18,26)}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject1.funcWithArgsSync(18, 26)", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard); + agHelper.ValidateCodeEditorContent(propPane._textView, "{{18}}{{26}}"); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "a", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "b", + "have.text", + 1, + ); + + propPane.EnterJSContext( + "onClick", + "{{JSObject1.funcWithoutArgsAsync()}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject1.funcWithoutArgsAsync()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); + + propPane.EnterJSContext( + "onClick", + "{{JSObject1.funcWithArgsAsync()}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject1.funcWithArgsAsync()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "a", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "b", + "have.text", + 1, + ); }); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext( - "onClick", - "{{JSObject1.funcWithoutArgsSync()}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject1.funcWithoutArgsSync()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard); - agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); - - propPane.EnterJSContext( - "onClick", - "{{JSObject1.funcWithArgsSync(18,26)}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject1.funcWithArgsSync(18, 26)", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard); - agHelper.ValidateCodeEditorContent(propPane._textView, "{{18}}{{26}}"); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "a", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "b", - "have.text", - 1, - ); - - propPane.EnterJSContext( - "onClick", - "{{JSObject1.funcWithoutArgsAsync()}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject1.funcWithoutArgsAsync()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); - - propPane.EnterJSContext( - "onClick", - "{{JSObject1.funcWithArgsAsync()}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject1.funcWithArgsAsync()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "a", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "b", - "have.text", - 1, - ); - }); - - it("10. shows fields appropriately for JS Object functions with/without arguments and then/catch blocks", () => { - const JS_OBJECT_BODY = `export default { + + it("10. shows fields appropriately for JS Object functions with/without arguments and then/catch blocks", () => { + const JS_OBJECT_BODY = `export default { promiseFuncNoArgs: () => { return new Promise((resolve) => { resolve("hi"); @@ -401,155 +404,156 @@ describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => { }, }`; - jsEditor.CreateJSObject(JS_OBJECT_BODY, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, + jsEditor.CreateJSObject(JS_OBJECT_BODY, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext( + "onClick", + '{{JSObject2.promiseFuncNoArgs().then(() => showAlert("then"))}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject2.promiseFuncNoArgs()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); + + propPane.EnterJSContext( + "onClick", + '{{JSObject2.promiseFuncNoArgs().catch(() => showAlert("catch"))}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject2.promiseFuncNoArgs()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); + + propPane.EnterJSContext( + "onClick", + '{{JSObject2.promiseFuncNoArgs().then(() => showAlert("then")).catch(() => showAlert("catch"));}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject2.promiseFuncNoArgs()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); + + propPane.EnterJSContext( + "onClick", + '{{JSObject2.promiseFuncNoArgs().catch(() => showAlert("catch")).then(() => showAlert("then"));}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject2.promiseFuncNoArgs()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); + + propPane.EnterJSContext( + "onClick", + '{{JSObject2.promiseFuncWithArgs("hi").then(() => showAlert("hi")).catch(() => showAlert("bye"));}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + 'Execute a JS functionJSObject2.promiseFuncWithArgs("hi")', + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "a", + "have.text", + 0, + ); + agHelper.ValidateCodeEditorContent(propPane._textView, "hi"); + + propPane.EnterJSContext( + "onClick", + '{{JSObject2.promiseFuncWithArgs().catch(() => showAlert("catch"));}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject2.promiseFuncWithArgs()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "a", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + '{{JSObject2.promiseFuncWithArgs().then(() => showAlert("hi")).catch(() => showAlert("bye"));}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Execute a JS functionJSObject2.promiseFuncWithArgs()", + "have.text", + 0, + ); + + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "a", + "have.text", + 0, + ); }); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext( - "onClick", - '{{JSObject2.promiseFuncNoArgs().then(() => showAlert("then"))}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject2.promiseFuncNoArgs()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); - - propPane.EnterJSContext( - "onClick", - '{{JSObject2.promiseFuncNoArgs().catch(() => showAlert("catch"))}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject2.promiseFuncNoArgs()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); - - propPane.EnterJSContext( - "onClick", - '{{JSObject2.promiseFuncNoArgs().then(() => showAlert("then")).catch(() => showAlert("catch"));}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject2.promiseFuncNoArgs()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); - - propPane.EnterJSContext( - "onClick", - '{{JSObject2.promiseFuncNoArgs().catch(() => showAlert("catch")).then(() => showAlert("then"));}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject2.promiseFuncNoArgs()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.AssertElementAbsence(propPane._actionPopupTextLabel, 0); - - propPane.EnterJSContext( - "onClick", - '{{JSObject2.promiseFuncWithArgs("hi").then(() => showAlert("hi")).catch(() => showAlert("bye"));}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - 'Execute a JS functionJSObject2.promiseFuncWithArgs("hi")', - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "a", - "have.text", - 0, - ); - agHelper.ValidateCodeEditorContent(propPane._textView, "hi"); - - propPane.EnterJSContext( - "onClick", - '{{JSObject2.promiseFuncWithArgs().catch(() => showAlert("catch"));}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject2.promiseFuncWithArgs()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "a", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - '{{JSObject2.promiseFuncWithArgs().then(() => showAlert("hi")).catch(() => showAlert("bye"));}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Execute a JS functionJSObject2.promiseFuncWithArgs()", - "have.text", - 0, - ); - - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "a", - "have.text", - 0, - ); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_2_spec.ts index f51ad098c73..96e76a479f6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_2_spec.ts @@ -8,651 +8,665 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); - }); - - it("1. shows fields for navigate to from js to non-js mode", () => { - propPane.EnterJSContext("onClick", "{{navigateTo()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Navigate toSelect page", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.AssertElementVisibility(propPane._navigateToType("Page name")); - - agHelper.GetNAssertElementText( - propPane._actionOpenDropdownSelectPage, - "Select page", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Query params", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._sameWindowDropdownOption, - "Same window", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - "{{navigateTo('Page1', {a:1}, 'NEW_WINDOW')}}", - true, - true, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Navigate toPage1", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.AssertElementVisibility(propPane._navigateToType("Page name")); - - agHelper.GetNAssertElementText( - propPane._actionOpenDropdownSelectPage, - "Page1", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Query params", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._sameWindowDropdownOption, - "New window", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - "{{navigateTo('google.com', {a:1}, 'SAME_WINDOW')}}", - true, - true, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Navigate togoogle.com", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.AssertElementVisibility(propPane._navigateToType("URL")); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Enter URL", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Query params", - "have.text", - 1, - ); - - agHelper.GetNAssertElementText( - propPane._sameWindowDropdownOption, - "Same window", - "have.text", - 0, - ); - }); - - it("2. shows fields for show alert from js to non-js mode", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{showAlert()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show alertAdd message", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Message", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._dropdownSelectType, - "Select type", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - "{{showAlert('hello', 'info')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show alerthello", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Message", - "have.text", - 0, - ); - agHelper.ValidateCodeEditorContent(propPane._textView, "hello"); - - agHelper.GetNAssertElementText( - propPane._dropdownSelectType, - "Info", - "have.text", - 0, - ); - }); - - it("3. shows fields for show modal from js to non-js mode", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - - entityExplorer.DragDropWidgetNVerify("modalwidget", 300, 400); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{showModal()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show modalnone", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionOpenDropdownSelectModal, - "Select modal", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - "{{showModal(Modal1.name)}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Show modalModal1", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionOpenDropdownSelectModal, - "Modal1", - "have.text", - 0, - ); - }); - - it("4. shows fields for remove modal from js to non-js mode", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{closeModal()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Close modalnone", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionOpenDropdownSelectModal, - "Select modal", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - "{{closeModal(Modal1.name)}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Close modalModal1", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionOpenDropdownSelectModal, - "Modal1", - "have.text", - 0, - ); - }); - - it("5. should shows appropriate fields for store value", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{storeValue()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Store valueAdd key", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Key", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Value", - "have.text", - 1, - ); - - propPane.EnterJSContext("onClick", "{{storeValue('a', '')}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Store valuea", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - propPane.EnterJSContext("onClick", "{{storeValue('a', 1)}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Store valuea", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.ValidateCodeEditorContent(propPane._textView, "a{{1}}"); - - propPane.EnterJSContext("onClick", "{{storeValue('', 1)}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Store valueAdd key", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - }); - - it("6. shows fields for remove value appropriately", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{removeValue()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Remove valueAdd key", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Key", - "have.text", - 0, - ); - - propPane.EnterJSContext("onClick", "{{removeValue('a')}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Remove valuea", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.ValidateCodeEditorContent(propPane._textView, "a"); - }); - - it("7. shows fields appropriately for the download function", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{download()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "DownloadAdd data to download", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Data to download", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "File name with extension", - "have.text", - 1, - ); - agHelper.GetNAssertElementText( - propPane._selectorViewLabel, - "Type", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "Select file type (optional)", - ); - - propPane.EnterJSContext( - "onClick", - "{{download('a', '', '')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "DownloadAdd data to download", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - "{{download('a', 'b', '')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Downloadb", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - "{{download('a', 'b', 'image/png')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Downloadb", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.ValidateCodeEditorContent(propPane._textView, "ab"); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "PNG", - "have.text", - 0, - ); - }); - - it("8. shows fields for copyToClipboard appropriately", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{copyToClipboard()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Copy to clipboardAdd text", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Text to be copied to clipboard", - "have.text", - 0, - ); - - propPane.EnterJSContext("onClick", "{{copyToClipboard('a')}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Copy to clipboarda", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.ValidateCodeEditorContent(propPane._textView, "a"); - agHelper.TypeText( - propPane._actionSelectorFieldByLabel("Text to be copied to clipboard"), - "line1{enter}line2{enter}line3", - { parseSpecialCharSeq: true }, - ); - propPane.ToggleJSMode("onClick"); - propPane.ValidatePropertyFieldValue( - "onClick", - `{{copyToClipboard('aline1\\nline2\\nline3');}}`, - ); - }); - - it("9. shows fields for reset widget appropriately", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{resetWidget()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Reset widgetSelect widget", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._selectorViewLabel, - "Widget", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._selectorViewLabel, - "Reset Children", - "have.text", - 1, - ); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "Select widget", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "true", - "have.text", - 1, - ); - - propPane.EnterJSContext( - "onClick", - '{{resetWidget("Modal1", false)}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Reset widgetModal1", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "Modal1", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "false", - "have.text", - 1, - ); - - propPane.EnterJSContext( - "onClick", - '{{resetWidget("Modal1")}}', - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Reset widgetModal1", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "Modal1", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "true", - "have.text", - 1, - ); - - propPane.EnterJSContext( - "onClick", - "{{resetWidget('', false)}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Reset widgetSelect widget", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "Select widget", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._selectorViewButton, - "false", - "have.text", - 1, - ); - }); -}); +describe( + "JS to non-JS mode in Action Selector", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); + }); + + it("1. shows fields for navigate to from js to non-js mode", () => { + propPane.EnterJSContext("onClick", "{{navigateTo()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Navigate toSelect page", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.AssertElementVisibility(propPane._navigateToType("Page name")); + + agHelper.GetNAssertElementText( + propPane._actionOpenDropdownSelectPage, + "Select page", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Query params", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._sameWindowDropdownOption, + "Same window", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{navigateTo('Page1', {a:1}, 'NEW_WINDOW')}}", + true, + true, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Navigate toPage1", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.AssertElementVisibility(propPane._navigateToType("Page name")); + + agHelper.GetNAssertElementText( + propPane._actionOpenDropdownSelectPage, + "Page1", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Query params", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._sameWindowDropdownOption, + "New window", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{navigateTo('google.com', {a:1}, 'SAME_WINDOW')}}", + true, + true, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Navigate togoogle.com", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.AssertElementVisibility(propPane._navigateToType("URL")); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Enter URL", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Query params", + "have.text", + 1, + ); + + agHelper.GetNAssertElementText( + propPane._sameWindowDropdownOption, + "Same window", + "have.text", + 0, + ); + }); + + it("2. shows fields for show alert from js to non-js mode", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{showAlert()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show alertAdd message", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Message", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._dropdownSelectType, + "Select type", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{showAlert('hello', 'info')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show alerthello", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Message", + "have.text", + 0, + ); + agHelper.ValidateCodeEditorContent(propPane._textView, "hello"); + + agHelper.GetNAssertElementText( + propPane._dropdownSelectType, + "Info", + "have.text", + 0, + ); + }); + + it("3. shows fields for show modal from js to non-js mode", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + + entityExplorer.DragDropWidgetNVerify("modalwidget", 300, 400); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{showModal()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show modalnone", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionOpenDropdownSelectModal, + "Select modal", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{showModal(Modal1.name)}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Show modalModal1", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionOpenDropdownSelectModal, + "Modal1", + "have.text", + 0, + ); + }); + + it("4. shows fields for remove modal from js to non-js mode", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{closeModal()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Close modalnone", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionOpenDropdownSelectModal, + "Select modal", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{closeModal(Modal1.name)}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Close modalModal1", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionOpenDropdownSelectModal, + "Modal1", + "have.text", + 0, + ); + }); + + it("5. should shows appropriate fields for store value", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{storeValue()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Store valueAdd key", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Key", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Value", + "have.text", + 1, + ); + + propPane.EnterJSContext( + "onClick", + "{{storeValue('a', '')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Store valuea", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + propPane.EnterJSContext("onClick", "{{storeValue('a', 1)}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Store valuea", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.ValidateCodeEditorContent(propPane._textView, "a{{1}}"); + + propPane.EnterJSContext("onClick", "{{storeValue('', 1)}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Store valueAdd key", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + }); + + it("6. shows fields for remove value appropriately", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{removeValue()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Remove valueAdd key", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Key", + "have.text", + 0, + ); + + propPane.EnterJSContext("onClick", "{{removeValue('a')}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Remove valuea", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.ValidateCodeEditorContent(propPane._textView, "a"); + }); + + it("7. shows fields appropriately for the download function", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{download()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "DownloadAdd data to download", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Data to download", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "File name with extension", + "have.text", + 1, + ); + agHelper.GetNAssertElementText( + propPane._selectorViewLabel, + "Type", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "Select file type (optional)", + ); + + propPane.EnterJSContext( + "onClick", + "{{download('a', '', '')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "DownloadAdd data to download", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{download('a', 'b', '')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Downloadb", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{download('a', 'b', 'image/png')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Downloadb", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.ValidateCodeEditorContent(propPane._textView, "ab"); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "PNG", + "have.text", + 0, + ); + }); + + it("8. shows fields for copyToClipboard appropriately", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{copyToClipboard()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Copy to clipboardAdd text", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Text to be copied to clipboard", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{copyToClipboard('a')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Copy to clipboarda", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.ValidateCodeEditorContent(propPane._textView, "a"); + agHelper.TypeText( + propPane._actionSelectorFieldByLabel("Text to be copied to clipboard"), + "line1{enter}line2{enter}line3", + { parseSpecialCharSeq: true }, + ); + propPane.ToggleJSMode("onClick"); + propPane.ValidatePropertyFieldValue( + "onClick", + `{{copyToClipboard('aline1\\nline2\\nline3');}}`, + ); + }); + + it("9. shows fields for reset widget appropriately", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{resetWidget()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Reset widgetSelect widget", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._selectorViewLabel, + "Widget", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._selectorViewLabel, + "Reset Children", + "have.text", + 1, + ); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "Select widget", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "true", + "have.text", + 1, + ); + + propPane.EnterJSContext( + "onClick", + '{{resetWidget("Modal1", false)}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Reset widgetModal1", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "Modal1", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "false", + "have.text", + 1, + ); + + propPane.EnterJSContext( + "onClick", + '{{resetWidget("Modal1")}}', + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Reset widgetModal1", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "Modal1", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "true", + "have.text", + 1, + ); + + propPane.EnterJSContext( + "onClick", + "{{resetWidget('', false)}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Reset widgetSelect widget", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "Select widget", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._selectorViewButton, + "false", + "have.text", + 1, + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_3_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_3_spec.ts index fc866652ea6..1acb2ec201c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_3_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_3_spec.ts @@ -7,280 +7,294 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => { - before(() => { - agHelper.AddDsl("promisesBtnDsl", locators._buttonByText("Submit")); - }); - - it("1. should show fields appropriately for setinterval", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{setInterval()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Set intervalms", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Callback function", - "have.text", - 0, - ); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Delay (ms)", - "have.text", - 1, - ); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Id", - "have.text", - 2, - ); - - propPane.EnterJSContext( - "onClick", - "{{setInterval(() => {}, 200, '')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Set interval200ms", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - propPane.EnterJSContext( - "onClick", - "{{setInterval(() => {showAlert('hi')}, 200, 'id1')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Set interval200ms", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - }); - - it("2. should show fields appropriately for clearInterval", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{clearInterval()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Clear intervalAdd Id", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Id", - "have.text", - 0, - ); - - propPane.EnterJSContext("onClick", "{{clearInterval('Id1')}}", true, true); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Clear intervalId1", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.ValidateCodeEditorContent(propPane._textView, "Id1"); - }); - - it("3. should show no fields for clear store", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{clearStore()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Clear store", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.AssertElementAbsence(propPane._textView); - agHelper.AssertElementAbsence(propPane._selectorView); - }); - - it("4. should show no fields for watch geolocation position", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext( - "onClick", - "{{appsmith.geolocation.watchPosition()}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Watch geolocation", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.AssertElementAbsence(propPane._textView); - agHelper.AssertElementAbsence(propPane._selectorView); - }); - - it("5. should show no fields for stop watching geolocation position", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext( - "onClick", - "{{appsmith.geolocation.clearWatch()}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Stop watching geolocation", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.AssertElementAbsence(propPane._textView); - agHelper.AssertElementAbsence(propPane._selectorView); - }); - - it("6. should show appropriate fields for get geolocation", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext( - "onClick", - "{{appsmith.geolocation.getCurrentPosition()}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Get geolocationAdd callback", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Callback function", - "have.text", - 0, - ); - - propPane.EnterJSContext( - "onClick", - `{{appsmith.geolocation.getCurrentPosition((location) => { +describe( + "JS to non-JS mode in Action Selector", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + agHelper.AddDsl("promisesBtnDsl", locators._buttonByText("Submit")); + }); + + it("1. should show fields appropriately for setinterval", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{setInterval()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Set intervalms", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Callback function", + "have.text", + 0, + ); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Delay (ms)", + "have.text", + 1, + ); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Id", + "have.text", + 2, + ); + + propPane.EnterJSContext( + "onClick", + "{{setInterval(() => {}, 200, '')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Set interval200ms", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + propPane.EnterJSContext( + "onClick", + "{{setInterval(() => {showAlert('hi')}, 200, 'id1')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Set interval200ms", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + }); + + it("2. should show fields appropriately for clearInterval", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{clearInterval()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Clear intervalAdd Id", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Id", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + "{{clearInterval('Id1')}}", + true, + true, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Clear intervalId1", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.ValidateCodeEditorContent(propPane._textView, "Id1"); + }); + + it("3. should show no fields for clear store", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext("onClick", "{{clearStore()}}", true, false); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Clear store", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.AssertElementAbsence(propPane._textView); + agHelper.AssertElementAbsence(propPane._selectorView); + }); + + it("4. should show no fields for watch geolocation position", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext( + "onClick", + "{{appsmith.geolocation.watchPosition()}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Watch geolocation", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.AssertElementAbsence(propPane._textView); + agHelper.AssertElementAbsence(propPane._selectorView); + }); + + it("5. should show no fields for stop watching geolocation position", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext( + "onClick", + "{{appsmith.geolocation.clearWatch()}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Stop watching geolocation", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.AssertElementAbsence(propPane._textView); + agHelper.AssertElementAbsence(propPane._selectorView); + }); + + it("6. should show appropriate fields for get geolocation", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext( + "onClick", + "{{appsmith.geolocation.getCurrentPosition()}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Get geolocationAdd callback", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Callback function", + "have.text", + 0, + ); + + propPane.EnterJSContext( + "onClick", + `{{appsmith.geolocation.getCurrentPosition((location) => { // add code here });}}`, - true, - true, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Callback function", - "have.text", - 0, - ); - }); - - it("7. should show post message fields appropriately", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - - propPane.EnterJSContext("onClick", "{{postWindowMessage()}}", true, false); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Post messageAdd message", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Message", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._windowTargetDropdown, - "Window", - "have.text", - 0, - ); - agHelper.GetNAssertElementText( - propPane._actionPopupTextLabel, - "Allowed origins", - "have.text", - 1, - ); - - propPane.EnterJSContext( - "onClick", - "{{postWindowMessage('hello', 'window', '*')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - - agHelper.GetNAssertElementText( - propPane._actionCard, - "Post messagehello", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); - - agHelper.ValidateCodeEditorContent(propPane._textView, "hellowindow*"); - }); -}); + true, + true, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Callback function", + "have.text", + 0, + ); + }); + + it("7. should show post message fields appropriately", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + + propPane.EnterJSContext( + "onClick", + "{{postWindowMessage()}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Post messageAdd message", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Message", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._windowTargetDropdown, + "Window", + "have.text", + 0, + ); + agHelper.GetNAssertElementText( + propPane._actionPopupTextLabel, + "Allowed origins", + "have.text", + 1, + ); + + propPane.EnterJSContext( + "onClick", + "{{postWindowMessage('hello', 'window', '*')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + + agHelper.GetNAssertElementText( + propPane._actionCard, + "Post messagehello", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); + + agHelper.ValidateCodeEditorContent(propPane._textView, "hellowindow*"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts index d55f39bb83e..b4af0af9435 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts @@ -7,47 +7,51 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("JS to non-JS mode in Action Selector", { tags: ["@tag.JS"] }, () => { - before(() => { - agHelper.AddDsl("promisesBtnDsl", locators._buttonByText("Submit")); - }); +describe( + "JS to non-JS mode in Action Selector", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + agHelper.AddDsl("promisesBtnDsl", locators._buttonByText("Submit")); + }); - it("10. Bug 23167 - Message field in PostMessage should accept all type of values", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + it("10. Bug 23167 - Message field in PostMessage should accept all type of values", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - "{{postWindowMessage(Input1.text, 'window', '*')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); + propPane.EnterJSContext( + "onClick", + "{{postWindowMessage(Input1.text, 'window', '*')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); - agHelper.GetNAssertElementText( - propPane._actionCard, - "Post message{{Input1.text}}", - "have.text", - 0, - ); - agHelper.GetNClick(propPane._actionCard, 0); + agHelper.GetNAssertElementText( + propPane._actionCard, + "Post message{{Input1.text}}", + "have.text", + 0, + ); + agHelper.GetNClick(propPane._actionCard, 0); - agHelper.ValidateCodeEditorContent( - propPane._textView, - "{{Input1.text}}window*", - ); + agHelper.ValidateCodeEditorContent( + propPane._textView, + "{{Input1.text}}window*", + ); - propPane.EnterJSContext( - "onClick", - "{{postWindowMessage({ x: Input1.text }, 'window', '*')}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - agHelper.GetNClick(propPane._actionCard, 0); - agHelper.ValidateCodeEditorContent( - propPane._textView, - "{{{\n x: Input1.text \n}}}window*", - ); - }); -}); + propPane.EnterJSContext( + "onClick", + "{{postWindowMessage({ x: Input1.text }, 'window', '*')}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + agHelper.GetNClick(propPane._actionCard, 0); + agHelper.ValidateCodeEditorContent( + propPane._textView, + "{{{\n x: Input1.text \n}}}window*", + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Bug23345_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Bug23345_spec.ts index 1a2e4c9205b..8b082f38963 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Bug23345_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Bug23345_spec.ts @@ -7,7 +7,7 @@ import { describe( "Delete No Action card without any error", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Bug 23345", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 200, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts index b8f7c7b3872..988a497ac1f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ClearStore_spec.ts @@ -9,13 +9,16 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("clearStore Action test", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); - }); +describe( + "clearStore Action test", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); + }); - it("1. Feature 11639 : Clear all store value", function () { - const JS_OBJECT_BODY = `export default { + it("1. Feature 11639 : Clear all store value", function () { + const JS_OBJECT_BODY = `export default { storeValue: async () => { let values = [ @@ -32,49 +35,50 @@ describe("clearStore Action test", { tags: ["@tag.JS"] }, () => { } }`; - // Create js object - jsEditor.CreateJSObject(JS_OBJECT_BODY, { - paste: true, - completeReplace: true, - toRun: false, - prettify: false, - shouldCreateNewJSObj: true, - }); + // Create js object + jsEditor.CreateJSObject(JS_OBJECT_BODY, { + paste: true, + completeReplace: true, + toRun: false, + prettify: false, + shouldCreateNewJSObj: true, + }); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", ""); - propPane.TypeTextIntoField("Label", "StoreValue"); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecute( - "onClick", - jsObj as string, - "storeValue", - ); - }); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", ""); + propPane.TypeTextIntoField("Label", "StoreValue"); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecute( + "onClick", + jsObj as string, + "storeValue", + ); + }); + + entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 200); + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", ""); + propPane.TypeTextIntoField("Label", "ClearStore"); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecute( + "onClick", + jsObj as string, + "clearStore", + ); + }); - entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 200); - EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", ""); - propPane.TypeTextIntoField("Label", "ClearStore"); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecute( - "onClick", - jsObj as string, - "clearStore", + deployMode.DeployApp(); + agHelper.ClickButton("StoreValue"); + agHelper.AssertContains( + JSON.stringify({ + val1: "value 1", + val2: "value 2", + val3: "value 3", + }), ); + agHelper.ClickButton("ClearStore"); + agHelper.AssertContains(JSON.stringify({})); + deployMode.NavigateBacktoEditor(); }); - - deployMode.DeployApp(); - agHelper.ClickButton("StoreValue"); - agHelper.AssertContains( - JSON.stringify({ - val1: "value 1", - val2: "value 2", - val3: "value 3", - }), - ); - agHelper.ClickButton("ClearStore"); - agHelper.AssertContains(JSON.stringify({})); - deployMode.NavigateBacktoEditor(); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Error_handling_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Error_handling_spec.ts index eef35878edc..68671cd03f0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Error_handling_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/Error_handling_spec.ts @@ -14,7 +14,7 @@ import EditorNavigation, { describe( "Test Create Api and Bind to Button widget", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { before("Test_Add users api and execute api", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FieldEvaluation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FieldEvaluation_spec.ts index 1d1ad43a581..afc733e00bc 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FieldEvaluation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FieldEvaluation_spec.ts @@ -8,15 +8,19 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Field value evaluation", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); - }); +describe( + "Field value evaluation", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); + }); - it("1. Evaluation works for fields", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.SelectPlatformFunction("onClick", "Show alert"); - agHelper.EnterActionValue("Message", "{{Button1.text}}"); - agHelper.VerifyEvaluatedValue("Submit"); - }); -}); + it("1. Evaluation works for fields", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.SelectPlatformFunction("onClick", "Show alert"); + agHelper.EnterActionValue("Message", "{{Button1.text}}"); + agHelper.VerifyEvaluatedValue("Submit"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts index 827cb3f9614..4f75807dd35 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/NavigateTo_spec.ts @@ -13,74 +13,82 @@ import EditorNavigation, { } from "../../../../support/Pages/EditorNavigation"; import PageList from "../../../../support/Pages/PageList"; -describe("Navigate To feature", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { - it("1. Navigates to page name clicked from the page name tab of navigate to", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 600); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", "{{appsmith.URL.queryParams.test}}"); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.SelectPlatformFunction("onClick", "Navigate to"); - dataSources.ValidateNSelectDropdown("Choose page", "Select page", "Page1"); - agHelper.GetNClick(propPane._actionCollapsibleHeader("Query params")); - propPane.UpdatePropertyFieldValue( - "Query params", - `{{ +describe( + "Navigate To feature", + { tags: ["@tag.JS", "@tag.Sanity", "@tag.Binding"] }, + () => { + it("1. Navigates to page name clicked from the page name tab of navigate to", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 600); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.TypeTextIntoField("Text", "{{appsmith.URL.queryParams.test}}"); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.SelectPlatformFunction("onClick", "Navigate to"); + dataSources.ValidateNSelectDropdown( + "Choose page", + "Select page", + "Page1", + ); + agHelper.GetNClick(propPane._actionCollapsibleHeader("Query params")); + propPane.UpdatePropertyFieldValue( + "Query params", + `{{ { test: '123' } }}`, - ); - agHelper.GetNClick(propPane._actionSelectorPopupClose); - agHelper.ClickButton("Submit"); + ); + agHelper.GetNClick(propPane._actionSelectorPopupClose); + agHelper.ClickButton("Submit"); - agHelper.GetNAssertElementText( - WIDGETSKIT.textWidgetContainer, - "123", - "have.text", - 0, - ); + agHelper.GetNAssertElementText( + WIDGETSKIT.textWidgetContainer, + "123", + "have.text", + 0, + ); - cy.url().should("include", "a=b").and("include", "test=123"); - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON)); - agHelper.WaitUntilEleAppear( - locators._widgetInDeployed(draggableWidgets.BUTTON), - ); - agHelper.ClickButton("Submit"); - cy.url().then(($url) => { - cy.log("deploy url is" + $url); - expect($url).to.contain("test=123"); + cy.url().should("include", "a=b").and("include", "test=123"); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON)); + agHelper.WaitUntilEleAppear( + locators._widgetInDeployed(draggableWidgets.BUTTON), + ); + agHelper.ClickButton("Submit"); + cy.url().then(($url) => { + cy.log("deploy url is" + $url); + expect($url).to.contain("test=123"); + }); + deployMode.NavigateBacktoEditor(); + propPane.DeleteWidgetFromPropertyPane("Button1"); }); - deployMode.NavigateBacktoEditor(); - propPane.DeleteWidgetFromPropertyPane("Button1"); - }); - it("2. Gives error message when invalid word is entered in the url tab of navigate to", () => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.SelectPlatformFunction("onClick", "Navigate to"); - agHelper.GetNClick(propPane._navigateToType("URL")); - agHelper.TypeText( - propPane._actionSelectorFieldByLabel("Enter URL"), - "wrongPage", - ); - agHelper.ClickButton("Submit"); - agHelper.ValidateToastMessage("Enter a valid URL or page name"); - propPane.DeleteWidgetFromPropertyPane("Button1"); - }); + it("2. Gives error message when invalid word is entered in the url tab of navigate to", () => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.SelectPlatformFunction("onClick", "Navigate to"); + agHelper.GetNClick(propPane._navigateToType("URL")); + agHelper.TypeText( + propPane._actionSelectorFieldByLabel("Enter URL"), + "wrongPage", + ); + agHelper.ClickButton("Submit"); + agHelper.ValidateToastMessage("Enter a valid URL or page name"); + propPane.DeleteWidgetFromPropertyPane("Button1"); + }); - it("3. Navigates to url entered from the url tab of navigate to", () => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.SelectPlatformFunction("onClick", "Navigate to"); - agHelper.GetNClick(propPane._navigateToType("URL")); - agHelper.TypeText( - propPane._actionSelectorFieldByLabel("Enter URL"), - "www.google.com", - ); - deployMode.DeployApp(); - agHelper.ClickButton("Submit"); - cy.url().should("include", "google.com"); - }); -}); + it("3. Navigates to url entered from the url tab of navigate to", () => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.SelectPlatformFunction("onClick", "Navigate to"); + agHelper.GetNClick(propPane._navigateToType("URL")); + agHelper.TypeText( + propPane._actionSelectorFieldByLabel("Enter URL"), + "www.google.com", + ); + deployMode.DeployApp(); + agHelper.ClickButton("Submit"); + cy.url().should("include", "google.com"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts index 87ee86ff315..21827b0f56e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/PostWindowMessage_spec.ts @@ -10,21 +10,24 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Post window message", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { - it("1. Posts message to an iframe within Appsmith", () => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 200, 200); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.IFRAME, 200, 300); +describe( + "Post window message", + { tags: ["@tag.JS", "@tag.Sanity", "@tag.Binding"] }, + () => { + it("1. Posts message to an iframe within Appsmith", () => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 200, 200); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.IFRAME, 200, 300); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.SelectPlatformFunction("onClick", "Post message"); - agHelper.EnterActionValue("Message", "After postMessage"); - agHelper.GetNClick(propPane._windowTargetDropdown); - agHelper.GetNClick(locators._dropDownValue("Iframe1"), 0, true); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.SelectPlatformFunction("onClick", "Post message"); + agHelper.EnterActionValue("Message", "After postMessage"); + agHelper.GetNClick(propPane._windowTargetDropdown); + agHelper.GetNClick(locators._dropDownValue("Iframe1"), 0, true); - EditorNavigation.SelectEntityByName("Iframe1", EntityType.Widget); - propPane.UpdatePropertyFieldValue( - "srcDoc", - ` + EditorNavigation.SelectEntityByName("Iframe1", EntityType.Widget); + propPane.UpdatePropertyFieldValue( + "srcDoc", + ` post msg @@ -42,28 +45,31 @@ describe("Post window message", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { `, - ); - propPane.SelectPlatformFunction("onMessageReceived", "Show alert"); - agHelper.EnterActionValue("Message", "I got a message from iframe"); - deployMode.DeployApp(locators._buttonByText("Submit")); - agHelper.WaitUntilEleAppear(locators._buttonByText("Submit")); - agHelper.WaitUntilEleAppear("#iframe-Iframe1"); - agHelper.AssertElementVisibility("#iframe-Iframe1"); - cy.get("#iframe-Iframe1").then((element) => { - element.contents().find("body").find("#iframe-button").click(); - }); - agHelper.ValidateToastMessage("I got a message from iframe"); + ); + propPane.SelectPlatformFunction("onMessageReceived", "Show alert"); + agHelper.EnterActionValue("Message", "I got a message from iframe"); + deployMode.DeployApp(locators._buttonByText("Submit")); + agHelper.WaitUntilEleAppear(locators._buttonByText("Submit")); + agHelper.WaitUntilEleAppear("#iframe-Iframe1"); + agHelper.AssertElementVisibility("#iframe-Iframe1"); + cy.get("#iframe-Iframe1").then((element) => { + element.contents().find("body").find("#iframe-button").click(); + }); + agHelper.ValidateToastMessage("I got a message from iframe"); - cy.get("#iframe-Iframe1").then(($element) => { - const $body = $element.contents().find("body"); - cy.wrap($body).find("#txtMsg").should("have.text", "Before postMessage"); - }); + cy.get("#iframe-Iframe1").then(($element) => { + const $body = $element.contents().find("body"); + cy.wrap($body) + .find("#txtMsg") + .should("have.text", "Before postMessage"); + }); - agHelper.ClickButton("Submit"); - cy.get("#iframe-Iframe1").then(($element) => { - const $body = $element.contents().find("body"); - cy.wrap($body).find("#txtMsg").should("have.text", "After postMessage"); + agHelper.ClickButton("Submit"); + cy.get("#iframe-Iframe1").then(($element) => { + const $body = $element.contents().find("body"); + cy.wrap($body).find("#txtMsg").should("have.text", "After postMessage"); + }); + deployMode.NavigateBacktoEditor(); }); - deployMode.NavigateBacktoEditor(); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/RemoveValue_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/RemoveValue_spec.ts index b2f03e558fa..f570db0e327 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/RemoveValue_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/RemoveValue_spec.ts @@ -11,14 +11,17 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../support/Pages/EditorNavigation"; -describe("removeValue Action test", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); - PageLeftPane.switchSegment(PagePaneSegment.JS); - }); +describe( + "removeValue Action test", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); + PageLeftPane.switchSegment(PagePaneSegment.JS); + }); - it("1. Feature 11639 : Remove store value", function () { - const JS_OBJECT_BODY = `export default { + it("1. Feature 11639 : Remove store value", function () { + const JS_OBJECT_BODY = `export default { storeValue: async () => { await storeValue('val1', 'value 1'); await storeValue('val2', 'value 2'); @@ -30,52 +33,53 @@ describe("removeValue Action test", { tags: ["@tag.JS"] }, () => { } }`; - // Create js object - jsEditor.CreateJSObject(JS_OBJECT_BODY, { - paste: true, - completeReplace: true, - toRun: false, - prettify: false, - shouldCreateNewJSObj: true, - }); + // Create js object + jsEditor.CreateJSObject(JS_OBJECT_BODY, { + paste: true, + completeReplace: true, + toRun: false, + prettify: false, + shouldCreateNewJSObj: true, + }); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", ""); - propPane.TypeTextIntoField("Label", "StoreValue"); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecute( - "onClick", - jsObj as string, - "storeValue", - ); - }); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", ""); + propPane.TypeTextIntoField("Label", "StoreValue"); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecute( + "onClick", + jsObj as string, + "storeValue", + ); + }); - entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 200); - EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", ""); - propPane.TypeTextIntoField("Label", "RemoveValue"); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecute( - "onClick", - jsObj as string, - "removeValue", + entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 200); + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", ""); + propPane.TypeTextIntoField("Label", "RemoveValue"); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecute( + "onClick", + jsObj as string, + "removeValue", + ); + }); + + deployMode.DeployApp(); + agHelper.ClickButton("StoreValue"); + agHelper.AssertContains( + JSON.stringify({ + val1: "value 1", + val2: "value 2", + }), + ); + agHelper.ClickButton("RemoveValue"); + agHelper.AssertContains( + JSON.stringify({ + val2: "value 2", + }), ); + deployMode.NavigateBacktoEditor(); }); - - deployMode.DeployApp(); - agHelper.ClickButton("StoreValue"); - agHelper.AssertContains( - JSON.stringify({ - val1: "value 1", - val2: "value 2", - }), - ); - agHelper.ClickButton("RemoveValue"); - agHelper.AssertContains( - JSON.stringify({ - val2: "value 2", - }), - ); - deployMode.NavigateBacktoEditor(); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts index 683fcc7bd66..fcc4d49b2b4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/StoreValue_spec.ts @@ -14,14 +14,17 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../support/Pages/EditorNavigation"; -describe("storeValue Action test", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); - PageLeftPane.switchSegment(PagePaneSegment.JS); - }); - - it("1. Bug 14653: Running consecutive storeValue actions and await", function () { - const jsObjectBody = `export default { +describe( + "storeValue Action test", + { tags: ["@tag.JS", "@tag.Sanity", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 100); + PageLeftPane.switchSegment(PagePaneSegment.JS); + }); + + it("1. Bug 14653: Running consecutive storeValue actions and await", function () { + const jsObjectBody = `export default { storeTest: () => { let values = [ @@ -40,48 +43,48 @@ describe("storeValue Action test", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { } }`; - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }); + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", ""); - propPane.TypeTextIntoField("Label", "StoreTest"); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecute( - "onClick", - jsObj as string, - "storeTest", + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", ""); + propPane.TypeTextIntoField("Label", "StoreTest"); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecute( + "onClick", + jsObj as string, + "storeTest", + ); + }); + + deployMode.DeployApp(); + agHelper.AssertElementVisibility( + locators._widgetInDeployed(draggableWidgets.BUTTON), + ); + agHelper.ClickButton("StoreTest"); + agHelper.AssertContains( + JSON.stringify({ + val1: "number 1", + val2: "number 2", + val3: "number 3", + val4: "number 4", + }), ); + deployMode.NavigateBacktoEditor(); }); - deployMode.DeployApp(); - agHelper.AssertElementVisibility( - locators._widgetInDeployed(draggableWidgets.BUTTON), - ); - agHelper.ClickButton("StoreTest"); - agHelper.AssertContains( - JSON.stringify({ - val1: "number 1", - val2: "number 2", - val3: "number 3", - val4: "number 4", - }), - ); - deployMode.NavigateBacktoEditor(); - }); - - it("2. Bug 14827 : Accepts paths as keys and doesn't update paths in store but creates a new field with path as key", function () { - const DEFAULT_STUDENT_OBJECT = { - details: { isTopper: true, name: "Abhah", grade: 1 }, - }; - const MODIFIED_STUDENT_OBJECT = { - details: { isTopper: false, name: "Alia", grade: 3 }, - }; - const JS_OBJECT_BODY = `export default { + it("2. Bug 14827 : Accepts paths as keys and doesn't update paths in store but creates a new field with path as key", function () { + const DEFAULT_STUDENT_OBJECT = { + details: { isTopper: true, name: "Abhah", grade: 1 }, + }; + const MODIFIED_STUDENT_OBJECT = { + details: { isTopper: false, name: "Alia", grade: 3 }, + }; + const JS_OBJECT_BODY = `export default { storePathTest: async ()=> { await storeValue("student", ${JSON.stringify( DEFAULT_STUDENT_OBJECT, @@ -103,63 +106,67 @@ describe("storeValue Action test", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { } `; - // Create js object - jsEditor.CreateJSObject(JS_OBJECT_BODY, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }); + // Create js object + jsEditor.CreateJSObject(JS_OBJECT_BODY, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); + + // Button1 + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", "StorePathTest"); + cy.get(".action-block-tree").click({ force: true }); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecuteInExistingActionBlock( + jsObj, + "storePathTest", + ); + }); + + // Button 2 + entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 200); + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", "modifyStorePath"); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecute( + "onClick", + jsObj as string, + "modifyStorePath", + ); + }); - // Button1 - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", "StorePathTest"); - cy.get(".action-block-tree").click({ force: true }); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecuteInExistingActionBlock( - jsObj, - "storePathTest", + deployMode.DeployApp(); + agHelper.ClickButton("StorePathTest"); + agHelper.ValidateToastMessage( + JSON.stringify(DEFAULT_STUDENT_OBJECT), + 0, + 1, ); - }); + agHelper.ValidateToastMessage(DEFAULT_STUDENT_OBJECT.details.name, 1, 2); + agHelper.ValidateToastMessage("Annah", 2, 3); - // Button 2 - entityExplorer.DragDropWidgetNVerify("buttonwidget", 100, 200); - EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", "modifyStorePath"); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecute( - "onClick", - jsObj as string, - "modifyStorePath", + agHelper.WaitUntilAllToastsDisappear(); + agHelper.ClickButton("modifyStorePath"); + agHelper.ValidateToastMessage( + JSON.stringify(MODIFIED_STUDENT_OBJECT.details), + 0, + 1, + ); + agHelper.ValidateToastMessage( + `${MODIFIED_STUDENT_OBJECT.details.isTopper}`, + 1, + 2, ); + agHelper.ValidateToastMessage(`true`, 2, 3); + deployMode.NavigateBacktoEditor(); }); - deployMode.DeployApp(); - agHelper.ClickButton("StorePathTest"); - agHelper.ValidateToastMessage(JSON.stringify(DEFAULT_STUDENT_OBJECT), 0, 1); - agHelper.ValidateToastMessage(DEFAULT_STUDENT_OBJECT.details.name, 1, 2); - agHelper.ValidateToastMessage("Annah", 2, 3); - - agHelper.WaitUntilAllToastsDisappear(); - agHelper.ClickButton("modifyStorePath"); - agHelper.ValidateToastMessage( - JSON.stringify(MODIFIED_STUDENT_OBJECT.details), - 0, - 1, - ); - agHelper.ValidateToastMessage( - `${MODIFIED_STUDENT_OBJECT.details.isTopper}`, - 1, - 2, - ); - agHelper.ValidateToastMessage(`true`, 2, 3); - deployMode.NavigateBacktoEditor(); - }); - - it("3. Bug 14827 : Accepts paths as keys and doesn't update paths in store but creates a new field with path as key - object keys", function () { - const TEST_OBJECT = { a: 1, two: {} }; - - const JS_OBJECT_BODY = `export default { + it("3. Bug 14827 : Accepts paths as keys and doesn't update paths in store but creates a new field with path as key - object keys", function () { + const TEST_OBJECT = { a: 1, two: {} }; + + const JS_OBJECT_BODY = `export default { setStore: async () => { await storeValue("test", ${JSON.stringify(TEST_OBJECT)}, false); await showAlert(JSON.stringify(appsmith.store.test)); @@ -171,47 +178,47 @@ describe("storeValue Action test", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { showAlert(JSON.stringify(appsmith.store.test));} }`; - // create js object - jsEditor.CreateJSObject(JS_OBJECT_BODY, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }); + // create js object + jsEditor.CreateJSObject(JS_OBJECT_BODY, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", "SetStore"); - cy.get(".action-block-tree").click({ force: true }); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecuteInExistingActionBlock( - jsObj, - "setStore", - ); - }); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", "SetStore"); + cy.get(".action-block-tree").click({ force: true }); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecuteInExistingActionBlock( + jsObj, + "setStore", + ); + }); - EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", "ShowStore"); - cy.get(".action-block-tree").click({ force: true }); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecuteInExistingActionBlock( - jsObj, - "showStore", - ); - }); + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", "ShowStore"); + cy.get(".action-block-tree").click({ force: true }); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecuteInExistingActionBlock( + jsObj, + "showStore", + ); + }); - deployMode.DeployApp(); - agHelper.ClickButton("SetStore"); - agHelper.ValidateToastMessage(JSON.stringify(TEST_OBJECT), 0, 1); - agHelper.ValidateToastMessage(JSON.stringify(TEST_OBJECT.two), 1, 2); - agHelper.ValidateToastMessage(`{"b":2}`, 2, 3); + deployMode.DeployApp(); + agHelper.ClickButton("SetStore"); + agHelper.ValidateToastMessage(JSON.stringify(TEST_OBJECT), 0, 1); + agHelper.ValidateToastMessage(JSON.stringify(TEST_OBJECT.two), 1, 2); + agHelper.ValidateToastMessage(`{"b":2}`, 2, 3); - agHelper.ClickButton("ShowStore"); - agHelper.ValidateToastMessage(JSON.stringify(TEST_OBJECT), 0); - deployMode.NavigateBacktoEditor(); - }); + agHelper.ClickButton("ShowStore"); + agHelper.ValidateToastMessage(JSON.stringify(TEST_OBJECT), 0); + deployMode.NavigateBacktoEditor(); + }); - it("4. Bug 24882. StoreValue, removeValue and clearStore should emit platform generated logs", function () { - const jsObjectBody = `export default { + it("4. Bug 24882. StoreValue, removeValue and clearStore should emit platform generated logs", function () { + const jsObjectBody = `export default { storeFns: () => { storeValue("xyz", 123); removeValue("xyz"); @@ -219,30 +226,31 @@ describe("storeValue Action test", { tags: ["@tag.JS", "@tag.Sanity"] }, () => { } }`; - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: true, - shouldCreateNewJSObj: true, - }); + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: true, + shouldCreateNewJSObj: true, + }); - entityExplorer.DragDropWidgetNVerify("buttonwidget", 400, 400); - EditorNavigation.SelectEntityByName("Button3", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Label", "Test store logs"); - cy.get("@jsObjName").then((jsObj: any) => { - propPane.SelectJSFunctionToExecute( - "onClick", - jsObj as string, - "storeFns", - ); + entityExplorer.DragDropWidgetNVerify("buttonwidget", 400, 400); + EditorNavigation.SelectEntityByName("Button3", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Label", "Test store logs"); + cy.get("@jsObjName").then((jsObj: any) => { + propPane.SelectJSFunctionToExecute( + "onClick", + jsObj as string, + "storeFns", + ); + }); + agHelper.ClickButton("Test store logs"); + + debuggerHelper.OpenDebugger(); + debuggerHelper.ClickLogsTab(); + debuggerHelper.changeLogsGroup("System logs"); + debuggerHelper.DoesConsoleLogExist("storeValue('xyz', '123', true)"); + debuggerHelper.DoesConsoleLogExist("removeValue('xyz')"); + debuggerHelper.DoesConsoleLogExist("clearStore()"); }); - agHelper.ClickButton("Test store logs"); - - debuggerHelper.OpenDebugger(); - debuggerHelper.ClickLogsTab(); - debuggerHelper.changeLogsGroup("System logs"); - debuggerHelper.DoesConsoleLogExist("storeValue('xyz', '123', true)"); - debuggerHelper.DoesConsoleLogExist("removeValue('xyz')"); - debuggerHelper.DoesConsoleLogExist("clearStore()"); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/disableJSToggle_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/disableJSToggle_spec.ts index 85c141bc79a..6c9d1d7ca8d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/disableJSToggle_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/disableJSToggle_spec.ts @@ -11,7 +11,7 @@ import EditorNavigation, { describe( "Disable JS toggle when Action selector code is not parsable", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 200, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/setInterval_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/setInterval_spec.js index debf75e8d1a..de27e31520e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/setInterval_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/setInterval_spec.js @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Test Create Api and Bind to Button widget", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { before("Test_Add users api and execute api", () => { agHelper.AddDsl("buttonApiDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts index 375553cbb9a..07381359fcb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/uiToCode_spec.ts @@ -11,7 +11,7 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("UI to Code", { tags: ["@tag.JS"] }, () => { +describe("UI to Code", { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); apiPage.CreateApi(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Anvil/AnvilAppNavigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Anvil/AnvilAppNavigation_spec.ts index 01942fda608..0919d36625d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Anvil/AnvilAppNavigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Anvil/AnvilAppNavigation_spec.ts @@ -12,7 +12,7 @@ import { anvilLocators } from "../../../../support/Pages/Anvil/Locators"; describe( `${ANVIL_EDITOR_TEST}: Validating multiple widgets in anvil layout mode with App navigation settings`, - { tags: ["@tag.Anvil", "@tag.IDE"] }, + { tags: ["@tag.Anvil", "@tag.IDE", "@tag.PropertyPane"] }, function () { beforeEach(() => { // intercept features call for Anvil + WDS tests diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithAutoLayout_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithAutoLayout_spec.ts index 88e5caf99d3..7c4f6e6fa5a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithAutoLayout_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithAutoLayout_spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Validating multiple widgets in auto layout mode with App navigation settings", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { it("1. Drag and Drop multiple widgets in auto layout mode", function () { autoLayout.ConvertToAutoLayoutAndVerify(false); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts index 477cc3c87dd..f5ced5a0c99 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithGit_spec.ts @@ -12,7 +12,21 @@ import PageList from "../../../../support/Pages/PageList"; describe( "General checks for app navigation with Git", - { tags: ["@tag.IDE", "@tag.Git", "@tag.Sanity"] }, + { + tags: [ + "@tag.IDE", + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + "@tag.PropertyPane", + ], + }, function () { it("Issue #32050 - Branch parameter should not be removed when navigating from the inline nav more dropdown", () => { gitSync.CreateNConnectToGit(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts index d3e11d7f5d7..26761b4f4a5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts @@ -18,7 +18,7 @@ let currentUrl: string; describe( "Page orientation and navigation related usecases ", - { tags: ["@tag.IDE", "@tag.Sanity"] }, + { tags: ["@tag.IDE", "@tag.Sanity", "@tag.PropertyPane"] }, function () { it("1. Change 'Orientation' to 'Side', sidebar should appear", () => { AppSidebar.navigate(AppSidebarButton.Settings); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigation_spec.ts index 6d45b8df590..de59164a339 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigation_spec.ts @@ -10,7 +10,7 @@ import PageList from "../../../../support/Pages/PageList"; describe( "General checks for app navigation", - { tags: ["@tag.IDE", "@tag.ImportExport"] }, + { tags: ["@tag.IDE", "@tag.ImportExport", "@tag.PropertyPane", "@tag.Git"] }, function () { it("1. App header should appear when there is a single page in the application, and navigation should appear alongside app header when there are two pages", () => { // App header should appear when there is a single page in the application diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts index b1abc8d29f1..ef140d3a073 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/NavigationSettings_spec.ts @@ -12,7 +12,7 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Test app's navigation settings", - { tags: ["@tag.IDE", "@tag.Sanity"] }, + { tags: ["@tag.IDE", "@tag.Sanity", "@tag.PropertyPane"] }, function () { it("1. Open app settings and navigation tab should be there and when the navigation tab is selected, navigation preview should be visible", () => { AppSidebar.navigate(AppSidebarButton.Settings); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/SidebarCollapse_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/SidebarCollapse_spec.ts index 1d30a1219b4..191da075595 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/SidebarCollapse_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/SidebarCollapse_spec.ts @@ -8,30 +8,34 @@ import { AppSidebarButton, } from "../../../../support/Pages/EditorNavigation"; -describe("Test Sidebar Collapse", { tags: ["@tag.IDE"] }, function () { - it("1. Sidebar collapse button should be there", () => { - // First make sure that nav orientation is set to side - AppSidebar.navigate(AppSidebarButton.Settings); - agHelper.GetNClick(appSettings.locators._navigationSettingsTab); - agHelper.GetNClick( - appSettings.locators._navigationSettings._orientationOptions._side, - 0, - true, - ); - deployMode.DeployApp(); - agHelper.AssertElementVisibility( - appSettings.locators._sidebarCollapseButton, - ); - //Sidebar should collapse and open on click of collapse button again - // Collapse - agHelper.GetNClick(appSettings.locators._sidebarCollapseButton, 0, true); - agHelper - .GetElement(appSettings.locators._sideNavbar) - .should("not.have.class", "is-open"); - // Open - agHelper.GetNClick(appSettings.locators._sidebarCollapseButton); - agHelper - .GetElement(appSettings.locators._sideNavbar) - .should("have.class", "is-open"); - }); -}); +describe( + "Test Sidebar Collapse", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + it("1. Sidebar collapse button should be there", () => { + // First make sure that nav orientation is set to side + AppSidebar.navigate(AppSidebarButton.Settings); + agHelper.GetNClick(appSettings.locators._navigationSettingsTab); + agHelper.GetNClick( + appSettings.locators._navigationSettings._orientationOptions._side, + 0, + true, + ); + deployMode.DeployApp(); + agHelper.AssertElementVisibility( + appSettings.locators._sidebarCollapseButton, + ); + //Sidebar should collapse and open on click of collapse button again + // Collapse + agHelper.GetNClick(appSettings.locators._sidebarCollapseButton, 0, true); + agHelper + .GetElement(appSettings.locators._sideNavbar) + .should("not.have.class", "is-open"); + // Open + agHelper.GetNClick(appSettings.locators._sidebarCollapseButton); + agHelper + .GetElement(appSettings.locators._sideNavbar) + .should("have.class", "is-open"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/Sidebar_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/Sidebar_spec.ts index 47f5ece9013..41f24a20551 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/Sidebar_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/Sidebar_spec.ts @@ -13,7 +13,7 @@ import { describe( "Test Sidebar navigation style", - { tags: ["@tag.IDE", "@tag.ImportExport"] }, + { tags: ["@tag.IDE", "@tag.ImportExport", "@tag.PropertyPane", "@tag.Git"] }, function () { before(() => { // Import an application diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopInline_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopInline_spec.ts index c3fe5429ea1..887639ff733 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopInline_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopInline_spec.ts @@ -13,7 +13,7 @@ import { describe( "Test Top + Inline navigation style", - { tags: ["@tag.IDE", "@tag.ImportExport"] }, + { tags: ["@tag.IDE", "@tag.ImportExport", "@tag.PropertyPane", "@tag.Git"] }, function () { before(() => { // Import an application diff --git a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopStacked_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopStacked_spec.ts index 42f80ccb584..b1dc6ba298c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopStacked_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/AppNavigation/TopStacked_spec.ts @@ -13,7 +13,7 @@ import { describe( "Test Top + Stacked navigation style", - { tags: ["@tag.IDE", "@tag.ImportExport"] }, + { tags: ["@tag.IDE", "@tag.ImportExport", "@tag.PropertyPane", "@tag.Git"] }, function () { before(() => { // Import an application diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Autocomplete_setters_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Autocomplete_setters_spec.ts index 3a026157851..9685a068612 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Autocomplete_setters_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Autocomplete_setters_spec.ts @@ -21,90 +21,98 @@ const jsObjectBody = `export default { } }`; -describe("Autocomplete tests for setters", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 100, 100); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 200, 200); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.CHECKBOX, 300, 300); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.SWITCH, 400, 400); - }); - - it("1. Check if setters are present in autocomplete for widgets in JsObject", () => { - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, +describe( + "Autocomplete tests for setters", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 100, 100); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 200, 200); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.CHECKBOX, 300, 300); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.SWITCH, 400, 400); }); - agHelper.GetNClick(jsEditor._lineinJsEditor(5)); - agHelper.TypeText(locators._codeMirrorTextArea, "Button1"); + it("1. Check if setters are present in autocomplete for widgets in JsObject", () => { + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + agHelper.GetNClick(jsEditor._lineinJsEditor(5)); + agHelper.TypeText(locators._codeMirrorTextArea, "Button1"); - agHelper.GetElementsNAssertTextPresence( - locators._hints, - "Button1.setColor", - ); - agHelper.GetElementsNAssertTextPresence( - locators._hints, - "Button1.setDisabled", - ); - agHelper.GetElementsNAssertTextPresence( - locators._hints, - "Button1.setVisibility", - ); + agHelper.GetElementsNAssertTextPresence( + locators._hints, + "Button1.setColor", + ); + agHelper.GetElementsNAssertTextPresence( + locators._hints, + "Button1.setDisabled", + ); + agHelper.GetElementsNAssertTextPresence( + locators._hints, + "Button1.setVisibility", + ); - agHelper.RemoveCharsNType(locators._codeMirrorTextArea, 7, "Input1.set"); + agHelper.RemoveCharsNType(locators._codeMirrorTextArea, 7, "Input1.set"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setValue"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setVisibility"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setValue"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setVisibility"); - agHelper.RemoveCharsNType( - locators._codeMirrorTextArea, - 10, - "Checkbox1.set", - ); + agHelper.RemoveCharsNType( + locators._codeMirrorTextArea, + 10, + "Checkbox1.set", + ); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setValue"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setVisibility"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setValue"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setVisibility"); - agHelper.RemoveCharsNType(locators._codeMirrorTextArea, 13, "Switch1.set"); + agHelper.RemoveCharsNType( + locators._codeMirrorTextArea, + 13, + "Switch1.set", + ); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setRequired"); - }); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setRequired"); + }); - it("2. Check if setters are present in autocomplete for widgets in property Pane", () => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 500, 500); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext("onClick", "{{Input1.set", true, false); - agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); - }); + it("2. Check if setters are present in autocomplete for widgets in property Pane", () => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 500, 500); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext("onClick", "{{Input1.set", true, false); + agHelper.GetElementsNAssertTextPresence(locators._hints, "setDisabled"); + }); - it("3. function arguments hint shows up", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext("onClick", "{{", true, false); - agHelper.GetNClickByContains(locators._hints, "appsmith", 0, false); - agHelper.AssertElementVisibility(locators._evalValuePopover); - propPane.EnterJSContext("onClick", "{{showAlert", true, false); - agHelper.GetElementsNAssertTextPresence(locators._hints, "showAlert"); - agHelper.AssertElementAbsence(locators._evalValuePopover); - agHelper.GetNClickByContains(locators._hints, "showAlert", 0, false); - agHelper.GetNAssertElementText( - locators._argHintFnName, - "showAlert", - "contain.text", - ); - agHelper.AssertElementAbsence(locators._evalValuePopover); - }); + it("3. function arguments hint shows up", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext("onClick", "{{", true, false); + agHelper.GetNClickByContains(locators._hints, "appsmith", 0, false); + agHelper.AssertElementVisibility(locators._evalValuePopover); + propPane.EnterJSContext("onClick", "{{showAlert", true, false); + agHelper.GetElementsNAssertTextPresence(locators._hints, "showAlert"); + agHelper.AssertElementAbsence(locators._evalValuePopover); + agHelper.GetNClickByContains(locators._hints, "showAlert", 0, false); + agHelper.GetNAssertElementText( + locators._argHintFnName, + "showAlert", + "contain.text", + ); + agHelper.AssertElementAbsence(locators._evalValuePopover); + }); - it("4. function description tooltip shows up", () => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 100, 100); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext("onClick", "{{showAlert", true, false); - agHelper.GetElementsNAssertTextPresence(locators._hints, "showAlert"); - agHelper.AssertElementExist(locators._tern_doc); - }); -}); + it("4. function description tooltip shows up", () => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 100, 100); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext("onClick", "{{showAlert", true, false); + agHelper.GetElementsNAssertTextPresence(locators._hints, "showAlert"); + agHelper.AssertElementExist(locators._tern_doc); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/BracketNotation_AC_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/BracketNotation_AC_spec.ts index bfbc91ef3d1..d7979bbf777 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/BracketNotation_AC_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/BracketNotation_AC_spec.ts @@ -6,7 +6,7 @@ import { describe( "Test cases around bracket notation", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { const jsObjectBody = `export default { "my variable 1": [], diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bug23641_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bug23641_Spec.ts index 3275e4c483c..103f3cca08f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bug23641_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bug23641_Spec.ts @@ -9,22 +9,38 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Autocomplete bug fixes", { tags: ["@tag.JS"] }, function () { - it("1. Bug #23641 Verifies if 'children' shows up in autocomplete list", function () { - entityExplorer.DragDropWidgetNVerify( - draggableWidgets.MULTITREESELECT, - 200, - 200, - ); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TREESELECT, 200, 400); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 200, 600); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", "{{TreeSelect1.options[0].c"); - agHelper.AssertElementExist(locators._hints); - agHelper.GetNAssertElementText(locators._hints, "children", "contain.text"); +describe( + "Autocomplete bug fixes", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + it("1. Bug #23641 Verifies if 'children' shows up in autocomplete list", function () { + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.MULTITREESELECT, + 200, + 200, + ); + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.TREESELECT, + 200, + 400, + ); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 200, 600); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.TypeTextIntoField("Text", "{{TreeSelect1.options[0].c"); + agHelper.AssertElementExist(locators._hints); + agHelper.GetNAssertElementText( + locators._hints, + "children", + "contain.text", + ); - propPane.TypeTextIntoField("Text", "{{MultiTreeSelect1.options[0].c"); - agHelper.AssertElementExist(locators._hints); - agHelper.GetNAssertElementText(locators._hints, "children", "contain.text"); - }); -}); + propPane.TypeTextIntoField("Text", "{{MultiTreeSelect1.options[0].c"); + agHelper.AssertElementExist(locators._hints); + agHelper.GetNAssertElementText( + locators._hints, + "children", + "contain.text", + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bugs_AC_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bugs_AC_Spec.ts index 3a31df30341..6f149a7b49e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bugs_AC_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Bugs_AC_Spec.ts @@ -14,163 +14,167 @@ import EditorNavigation, { AppSidebar, } from "../../../../support/Pages/EditorNavigation"; -describe("Autocomplete bug fixes", { tags: ["@tag.JS"] }, function () { - it("1. Bug #12790 Verifies if selectedRow is in best match", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 200, 200); - table.AddSampleTableData(); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 200, 600); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", "{{Table1."); - agHelper.AssertElementExist(locators._hints); - agHelper.GetNAssertElementText(locators._hints, "Best match"); - agHelper.GetNAssertElementText( - locators._hints, - "selectedRow", - "have.text", - 1, - ); - }); - - it("2. Bug #13983 Verifies if object properties are in autocomplete list", function () { - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", '{{Table1.selectedRow["'); - agHelper.AssertElementExist(locators._hints); - agHelper.GetNAssertElementText(locators._hints, "status", "contain.text"); - - propPane.TypeTextIntoField("Text", "{{Table1.selectedRow['"); - agHelper.AssertElementExist(locators._hints); - agHelper.GetNAssertElementText(locators._hints, "status", "contain.text"); - }); - - it("3. Bug #13983 Verifies if object properties are in autocomplete list", function () { - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", '{{Table1.selectedRo"'); - agHelper.AssertElementAbsence(locators._hints); - - propPane.TypeTextIntoField("Text", '{{"'); - agHelper.AssertElementAbsence(locators._hints); - }); - - it("4. Bug #14990 Checks if copied widget show up on autocomplete suggestions", function () { - entityExplorer.CopyPasteWidget("Text1"); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Text", ""); - propPane.TypeTextIntoField("Text", "{{Te"); - agHelper.AssertElementExist(locators._hints); - agHelper.GetNAssertElementText(locators._hints, "Best match"); - agHelper.GetNAssertElementText( - locators._hints, - "Text1Copy.text", - "have.text", - 1, - ); - }); - - it("5. Bug #14100 Custom columns name label change should reflect in autocomplete", function () { - // select table widget - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - // add new column - cy.get(".t--add-column-btn").click(); - // edit column name - cy.get( - "[data-rbd-draggable-id='customColumn1'] .t--edit-column-btn", - ).click(); - - propPane.UpdatePropertyFieldValue("Property Name", "columnAlias"); - // select text widget - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - - // type {{Table1.selectedRow. and check for autocompletion suggestion having edited column name - propPane.TypeTextIntoField("Text", "{{Table1.selectedRow."); - agHelper.GetNAssertElementText( - locators._hints, - "columnAlias", - "have.text", - 0, - ); - }); - - it( - "7. Installed library should show up in autocomplete", - { tags: ["@tag.excludeForAirgap"] }, - function () { - AppSidebar.navigate(AppSidebarButton.Libraries); - installer.OpenInstaller(); - installer.InstallLibrary("uuidjs", "UUID"); - installer.CloseInstaller(); - AppSidebar.navigate(AppSidebarButton.Editor); +describe( + "Autocomplete bug fixes", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + it("1. Bug #12790 Verifies if selectedRow is in best match", function () { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 200, 200); + table.AddSampleTableData(); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 200, 600); EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", "{{UUI"); - agHelper.GetNAssertElementText(locators._hints, "UUID"); - }, - ); - - it( - "8. No autocomplete for Removed libraries", - { tags: ["@tag.excludeForAirgap"] }, - function () { - entityExplorer.RenameEntityFromExplorer("Text1Copy", "UUIDTEXT"); - AppSidebar.navigate(AppSidebarButton.Libraries); - installer.uninstallLibrary("uuidjs"); - AppSidebar.navigate(AppSidebarButton.Editor); - propPane.TypeTextIntoField("Text", "{{UUID."); + propPane.TypeTextIntoField("Text", "{{Table1."); + agHelper.AssertElementExist(locators._hints); + agHelper.GetNAssertElementText(locators._hints, "Best match"); + agHelper.GetNAssertElementText( + locators._hints, + "selectedRow", + "have.text", + 1, + ); + }); + + it("2. Bug #13983 Verifies if object properties are in autocomplete list", function () { + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.TypeTextIntoField("Text", '{{Table1.selectedRow["'); + agHelper.AssertElementExist(locators._hints); + agHelper.GetNAssertElementText(locators._hints, "status", "contain.text"); + + propPane.TypeTextIntoField("Text", "{{Table1.selectedRow['"); + agHelper.AssertElementExist(locators._hints); + agHelper.GetNAssertElementText(locators._hints, "status", "contain.text"); + }); + + it("3. Bug #13983 Verifies if object properties are in autocomplete list", function () { + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.TypeTextIntoField("Text", '{{Table1.selectedRo"'); agHelper.AssertElementAbsence(locators._hints); - }, - ); - it("9. Bug #20449 Cursor should be between parenthesis when function is autocompleted (Property Pane)", function () { - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", "{{console.l"); + propPane.TypeTextIntoField("Text", '{{"'); + agHelper.AssertElementAbsence(locators._hints); + }); - agHelper.GetNClickByContains(locators._hints, "log"); + it("4. Bug #14990 Checks if copied widget show up on autocomplete suggestions", function () { + entityExplorer.CopyPasteWidget("Text1"); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Text", ""); + propPane.TypeTextIntoField("Text", "{{Te"); + agHelper.AssertElementExist(locators._hints); + agHelper.GetNAssertElementText(locators._hints, "Best match"); + agHelper.GetNAssertElementText( + locators._hints, + "Text1Copy.text", + "have.text", + 1, + ); + }); + + it("5. Bug #14100 Custom columns name label change should reflect in autocomplete", function () { + // select table widget + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + // add new column + cy.get(".t--add-column-btn").click(); + // edit column name + cy.get( + "[data-rbd-draggable-id='customColumn1'] .t--edit-column-btn", + ).click(); + + propPane.UpdatePropertyFieldValue("Property Name", "columnAlias"); + // select text widget + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.TypeTextIntoField("Text", '"hello"', false); + // type {{Table1.selectedRow. and check for autocompletion suggestion having edited column name + propPane.TypeTextIntoField("Text", "{{Table1.selectedRow."); + agHelper.GetNAssertElementText( + locators._hints, + "columnAlias", + "have.text", + 0, + ); + }); + + it( + "7. Installed library should show up in autocomplete", + { tags: ["@tag.excludeForAirgap"] }, + function () { + AppSidebar.navigate(AppSidebarButton.Libraries); + installer.OpenInstaller(); + installer.InstallLibrary("uuidjs", "UUID"); + installer.CloseInstaller(); + AppSidebar.navigate(AppSidebarButton.Editor); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.TypeTextIntoField("Text", "{{UUI"); + agHelper.GetNAssertElementText(locators._hints, "UUID"); + }, + ); - // If the cursor was not between parenthesis, the following command will fail - propPane.ValidatePropertyFieldValue("Text", '{{console.log("hello")}}'); - }); + it( + "8. No autocomplete for Removed libraries", + { tags: ["@tag.excludeForAirgap"] }, + function () { + entityExplorer.RenameEntityFromExplorer("Text1Copy", "UUIDTEXT"); + AppSidebar.navigate(AppSidebarButton.Libraries); + installer.uninstallLibrary("uuidjs"); + AppSidebar.navigate(AppSidebarButton.Editor); + propPane.TypeTextIntoField("Text", "{{UUID."); + agHelper.AssertElementAbsence(locators._hints); + }, + ); + + it("9. Bug #20449 Cursor should be between parenthesis when function is autocompleted (Property Pane)", function () { + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.TypeTextIntoField("Text", "{{console.l"); + + agHelper.GetNClickByContains(locators._hints, "log"); + + propPane.TypeTextIntoField("Text", '"hello"', false); + + // If the cursor was not between parenthesis, the following command will fail + propPane.ValidatePropertyFieldValue("Text", '{{console.log("hello")}}'); + }); - it("10. Bug #20449 Cursor should be between parenthesis when function is autocompleted (JS Object)", function () { - jsEditor.CreateJSObject( - `export default { + it("10. Bug #20449 Cursor should be between parenthesis when function is autocompleted (JS Object)", function () { + jsEditor.CreateJSObject( + `export default { myFun1: () => { }, }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); - agHelper.GetNClick(jsEditor._lineinJsEditor(3)); + agHelper.GetNClick(jsEditor._lineinJsEditor(3)); - agHelper.TypeText(locators._codeMirrorTextArea, "console.l"); + agHelper.TypeText(locators._codeMirrorTextArea, "console.l"); - agHelper.GetNClickByContains(locators._hints, "log"); + agHelper.GetNClickByContains(locators._hints, "log"); - agHelper.TypeText(locators._codeMirrorTextArea, "'hello'"); + agHelper.TypeText(locators._codeMirrorTextArea, "'hello'"); - // If the cursor was not between parenthesis, the following command will fail - agHelper.GetNAssertContains( - jsEditor._lineinJsEditor(3), - "console.log('hello')", - ); - }); - - it("11. Bug #31114 Verify Object Properties in Autocomplete List for isVisible Field in JSONForm Widget", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.JSONFORM, 400, 800); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.EnterJSContext("Visible", ""); - propPane.TypeTextIntoField("Visible", "{{JSONForm1.isVis"); - agHelper.AssertElementExist(locators._hints); - agHelper.GetNAssertElementText( - locators._hints, - "isVisible", - "contain.text", - ); - }); -}); + // If the cursor was not between parenthesis, the following command will fail + agHelper.GetNAssertContains( + jsEditor._lineinJsEditor(3), + "console.log('hello')", + ); + }); + + it("11. Bug #31114 Verify Object Properties in Autocomplete List for isVisible Field in JSONForm Widget", function () { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.JSONFORM, 400, 800); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.EnterJSContext("Visible", ""); + propPane.TypeTextIntoField("Visible", "{{JSONForm1.isVis"); + agHelper.AssertElementExist(locators._hints); + agHelper.GetNAssertElementText( + locators._hints, + "isVisible", + "contain.text", + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts index 37fd2bbaf4f..f8190d48f01 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts @@ -29,7 +29,7 @@ const jsObjectBody = `export default { } }`; -describe("Autocomplete tests", { tags: ["@tag.JS"] }, () => { +describe("Autocomplete tests", { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Bug #13613 Verify widgets autocomplete: ButtonGroup & Document viewer widget", () => { entityExplorer.DragDropWidgetNVerify( draggableWidgets.BUTTON_GROUP, diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts index ee83327369a..dfc8bfaedd0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts @@ -22,7 +22,7 @@ const jsObjectBody = `export default { } }`; -describe("Autocomplete tests", { tags: ["@tag.JS"] }, () => { +describe("Autocomplete tests", { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Bug #17059 Autocomplete does not suggest same function name that belongs to a different object", () => { // create js object - JSObject1 jsEditor.CreateJSObject(jsObjectBody, { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts index 4271fef029d..919b1c39aab 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSlashCommand_spec.ts @@ -9,57 +9,61 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Property Pane Suggestions", { tags: ["@tag.JS"] }, () => { - before(function () { - agHelper.ClearLocalStorageCache(); - }); +describe( + "Property Pane Suggestions", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(function () { + agHelper.ClearLocalStorageCache(); + }); - beforeEach(() => { - agHelper.RestoreLocalStorageCache(); - }); + beforeEach(() => { + agHelper.RestoreLocalStorageCache(); + }); - afterEach(() => { - agHelper.SaveLocalStorageCache(); - }); + afterEach(() => { + agHelper.SaveLocalStorageCache(); + }); - it("1. Should show Property Pane Suggestions on / command & when typing {{}}", () => { - homePage.NavigateToHome(); - homePage.ImportApp("PropertyPaneSlashMenuBindings.json"); - assertHelper.WaitForNetworkCall("importNewApplication"); + it("1. Should show Property Pane Suggestions on / command & when typing {{}}", () => { + homePage.NavigateToHome(); + homePage.ImportApp("PropertyPaneSlashMenuBindings.json"); + assertHelper.WaitForNetworkCall("importNewApplication"); - // Select table and check for slash menu command popup - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - propPane.ToggleJSMode("Table data", true); - propPane.FocusIntoTextField("Table data"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); - agHelper.GetNClickByContains(locators._hints, "Add a binding"); - propPane.ValidatePropertyFieldValue("Table data", "{{}}"); + // Select table and check for slash menu command popup + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ToggleJSMode("Table data", true); + propPane.FocusIntoTextField("Table data"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); + agHelper.GetNClickByContains(locators._hints, "Add a binding"); + propPane.ValidatePropertyFieldValue("Table data", "{{}}"); - // Select json form widget and check for slash menu command popup - EditorNavigation.SelectEntityByName("JSONForm1", EntityType.Widget); - propPane.ToggleJSMode("Source data", true); - propPane.FocusIntoTextField("Source data"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); - agHelper.GetNClickByContains(locators._hints, "Add a binding"); - propPane.ValidatePropertyFieldValue("Source data", "{{}}"); - }); + // Select json form widget and check for slash menu command popup + EditorNavigation.SelectEntityByName("JSONForm1", EntityType.Widget); + propPane.ToggleJSMode("Source data", true); + propPane.FocusIntoTextField("Source data"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); + agHelper.GetNClickByContains(locators._hints, "Add a binding"); + propPane.ValidatePropertyFieldValue("Source data", "{{}}"); + }); - it("2. Should show `load more` option in case number of queries are more than 5", () => { - // Navigate to table and open slash menu command - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - propPane.ToggleJSMode("Table data", true); - propPane.UpdatePropertyFieldValue("Table data", ""); - propPane.FocusIntoTextField("Table data"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); + it("2. Should show `load more` option in case number of queries are more than 5", () => { + // Navigate to table and open slash menu command + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + propPane.ToggleJSMode("Table data", true); + propPane.UpdatePropertyFieldValue("Table data", ""); + propPane.FocusIntoTextField("Table data"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); - // Assert that count of Codemirror-hints is 10, as the whole list is not expanded yet - agHelper.AssertElementLength(locators._hints_apis, 5); - agHelper.GetElementsNAssertTextPresence(locators._hints, "Load 3 more"); + // Assert that count of Codemirror-hints is 10, as the whole list is not expanded yet + agHelper.AssertElementLength(locators._hints_apis, 5); + agHelper.GetElementsNAssertTextPresence(locators._hints, "Load 3 more"); - // Click on load more to expand all options - agHelper.GetNClickByContains(locators._hints, "Load 3 more"); + // Click on load more to expand all options + agHelper.GetNClickByContains(locators._hints, "Load 3 more"); - // Assert that all elements are visible now - agHelper.AssertElementLength(locators._hints_apis, 8); - }); -}); + // Assert that all elements are visible now + agHelper.AssertElementLength(locators._hints_apis, 8); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSuggestion_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSuggestion_spec.ts index f93026f9ee5..60407e48079 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSuggestion_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/PropertyPaneSuggestion_spec.ts @@ -10,44 +10,48 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Property Pane Suggestions", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); - }); +describe( + "Property Pane Suggestions", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); + }); - it("1. Should show Property Pane Suggestions on / command & when typing {{}}", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.TypeTextIntoField("Label", "/"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); - agHelper.GetNClickByContains(locators._hints, "Add a binding"); - propPane.ValidatePropertyFieldValue("Label", "{{}}"); + it("1. Should show Property Pane Suggestions on / command & when typing {{}}", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.TypeTextIntoField("Label", "/"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "Add a binding"); + agHelper.GetNClickByContains(locators._hints, "Add a binding"); + propPane.ValidatePropertyFieldValue("Label", "{{}}"); - //typing {{}} - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.TypeTextIntoField("Label", "{{"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "appsmith"); - agHelper.GetNClickByContains(locators._hints, "appsmith"); - propPane.ValidatePropertyFieldValue("Label", "{{appsmith}}"); - }); + //typing {{}} + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.TypeTextIntoField("Label", "{{"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "appsmith"); + agHelper.GetNClickByContains(locators._hints, "appsmith"); + propPane.ValidatePropertyFieldValue("Label", "{{appsmith}}"); + }); - it("2. [Bug]-[2040]: undefined binding on / command dropdown", () => { - // Create js object - jsEditor.CreateJSObject(""); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.TypeTextIntoField("Label", "/"); - agHelper.GetElementsNAssertTextPresence( - locators._slashCommandHintText, - "JSObject1", - ); - }); + it("2. [Bug]-[2040]: undefined binding on / command dropdown", () => { + // Create js object + jsEditor.CreateJSObject(""); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.TypeTextIntoField("Label", "/"); + agHelper.GetElementsNAssertTextPresence( + locators._slashCommandHintText, + "JSObject1", + ); + }); - it("3. Should add Autocomplete Suggestions on Tab press", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.TypeTextIntoField("Label", "{{"); - agHelper.GetElementsNAssertTextPresence(locators._hints, "appsmith"); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - cy.get("body").tab(); - propPane.ValidatePropertyFieldValue("Label", "{{JSObject1}}"); - }); -}); + it("3. Should add Autocomplete Suggestions on Tab press", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.TypeTextIntoField("Label", "{{"); + agHelper.GetElementsNAssertTextPresence(locators._hints, "appsmith"); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + cy.get("body").tab(); + propPane.ValidatePropertyFieldValue("Label", "{{JSObject1}}"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Sql_AC_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Sql_AC_Spec.ts index bc0f17e737b..bc4d9917497 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Sql_AC_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/Sql_AC_Spec.ts @@ -6,7 +6,7 @@ import { let dsName: any; -describe("SQL Autocompletion", { tags: ["@tag.JS"] }, () => { +describe("SQL Autocompletion", { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Create DS for SQL autocompletion testing", () => { dataSources.CreateDataSource("Postgres"); cy.get("@dsName").then(($dsName) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts index d5525d2dc54..017172ca76c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Autocomplete/autocomplete_spec.ts @@ -7,7 +7,7 @@ const dynamicInputLocators = require("../../../../locators/DynamicInput.json"); describe( "Dynamic input autocomplete", - { tags: ["@tag.JS", "@tag.Sanity"] }, + { tags: ["@tag.JS", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("autocomp"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts index 3030cd8521f..244efea2281 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/AbortAction_Spec.ts @@ -7,47 +7,51 @@ import { entityItems, } from "../../../../support/Objects/ObjectsCore"; -describe("Abort Action Execution", { tags: ["@tag.Datasource"] }, function () { - it("1. Bug #14006, #16093 - Cancel request button should abort API action execution", function () { - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl + "00", - "AbortApi", - 0, - ); - apiPage.RunAPI(false, 0); - agHelper.GetNClick(locators._cancelActionExecution, 0, true); - agHelper.AssertContains( - Cypress.env("MESSAGES").ACTION_EXECUTION_CANCELLED("AbortApi"), - ); - agHelper.AssertElementAbsence(locators._specificToast("{}")); //Assert that empty toast does not appear - Bug #16093 - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Api, - }); - }); - - // Queries were resolving quicker than we could cancel them - // Commenting this out till we can find a query that resolves slow enough for us to cancel its execution. - - it("2. Bug #14006, #16093 Cancel request button should abort Query action execution", function () { - dataSources.CreateDataSource("MySql"); - cy.get("@dsName").then(($dsName) => { - dataSources.CreateQueryAfterDSSaved( - "SELECT * FROM worldCountryInfo wc join countryFlags cf on wc.Name = cf.Country CROSS JOIN customers cc", - "AbortQuery", +describe( + "Abort Action Execution", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. Bug #14006, #16093 - Cancel request button should abort API action execution", function () { + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl + "00", + "AbortApi", + 0, ); - dataSources.SetQueryTimeout(0); - agHelper.GetNClick(dataSources._runQueryBtn, 0, true, 0); + apiPage.RunAPI(false, 0); agHelper.GetNClick(locators._cancelActionExecution, 0, true); agHelper.AssertContains( - Cypress.env("MESSAGES").ACTION_EXECUTION_CANCELLED("AbortQuery"), + Cypress.env("MESSAGES").ACTION_EXECUTION_CANCELLED("AbortApi"), ); agHelper.AssertElementAbsence(locators._specificToast("{}")); //Assert that empty toast does not appear - Bug #16093 agHelper.ActionContextMenuWithInPane({ action: "Delete", - entityType: entityItems.Query, + entityType: entityItems.Api, + }); + }); + + // Queries were resolving quicker than we could cancel them + // Commenting this out till we can find a query that resolves slow enough for us to cancel its execution. + + it("2. Bug #14006, #16093 Cancel request button should abort Query action execution", function () { + dataSources.CreateDataSource("MySql"); + cy.get("@dsName").then(($dsName) => { + dataSources.CreateQueryAfterDSSaved( + "SELECT * FROM worldCountryInfo wc join countryFlags cf on wc.Name = cf.Country CROSS JOIN customers cc", + "AbortQuery", + ); + dataSources.SetQueryTimeout(0); + agHelper.GetNClick(dataSources._runQueryBtn, 0, true, 0); + agHelper.GetNClick(locators._cancelActionExecution, 0, true); + agHelper.AssertContains( + Cypress.env("MESSAGES").ACTION_EXECUTION_CANCELLED("AbortQuery"), + ); + agHelper.AssertElementAbsence(locators._specificToast("{}")); //Assert that empty toast does not appear - Bug #16093 + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + dataSources.DeleteDatasourceFromWithinDS($dsName as unknown as string); }); - dataSources.DeleteDatasourceFromWithinDS($dsName as unknown as string); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts index 523dd65efee..88e09e31a43 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/AllWidgets_Reset_Spec.ts @@ -414,7 +414,7 @@ function filePickerWidgetAndReset() { Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig]) => { describe( `${testConfig.widgetName} widget test for validating reset assertWidgetReset`, - { tags: ["@tag.Widget", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Sanity", "@tag.Binding"] }, () => { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBug6732_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBug6732_Spec.ts index 3df84846bca..a859be45aaf 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBug6732_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBug6732_Spec.ts @@ -4,7 +4,7 @@ const { apiPage } = _; describe( "Bug 6732 - this.params in IIFE function in API editor", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { it("1. this.params should be available in IIFE function in API editor", () => { apiPage.CreateApi("Api1", "GET"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts index a31c13ac81e..2402bbe3ab7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/ApiBugs_Spec.ts @@ -17,111 +17,117 @@ import { AppSidebarButton, } from "../../../../support/Pages/EditorNavigation"; -describe("API Bugs", { tags: ["@tag.Datasource"] }, function () { - it("1. Bug 14037, 25432: User gets an error even when table widget is added from the API page successfully", function () { - // Case where api returns array response - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - ); - apiPage.RunAPI(); - dataSources.AddSuggestedWidget(Widgets.Table); - debuggerHelper.AssertErrorCount(0); - table.WaitUntilTableLoad(0, 0, "v2"); - propPane.AssertPropertiesDropDownCurrentValue("Table data", "Api1"); +describe( + "API Bugs", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. Bug 14037, 25432: User gets an error even when table widget is added from the API page successfully", function () { + // Case where api returns array response + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + ); + apiPage.RunAPI(); + dataSources.AddSuggestedWidget(Widgets.Table); + debuggerHelper.AssertErrorCount(0); + table.WaitUntilTableLoad(0, 0, "v2"); + propPane.AssertPropertiesDropDownCurrentValue("Table data", "Api1"); - // Create another API so that it returns object response - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiObjectUrl, - ); - apiPage.RunAPI(); - dataSources.AddSuggestedWidget(Widgets.Table); - table.WaitUntilTableLoad(0, 0, "v2"); - propPane.ValidatePropertyFieldValue("Table data", "{{Api2.data.users}}"); - }); + // Create another API so that it returns object response + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiObjectUrl, + ); + apiPage.RunAPI(); + dataSources.AddSuggestedWidget(Widgets.Table); + table.WaitUntilTableLoad(0, 0, "v2"); + propPane.ValidatePropertyFieldValue("Table data", "{{Api2.data.users}}"); + }); - it("2. Bug 16377, When Api url has dynamic binding expressions, ensure the url and path derived is not corrupting Api execution", function () { - //Since the specified expression always returns true - it will never run mock-apis - which actually doesn't exist - const apiUrl = `http://host.docker.internal:5001/v1/{{true ? 'mock-api' : 'mock-apis'}}?records=10`; + it("2. Bug 16377, When Api url has dynamic binding expressions, ensure the url and path derived is not corrupting Api execution", function () { + //Since the specified expression always returns true - it will never run mock-apis - which actually doesn't exist + const apiUrl = `http://host.docker.internal:5001/v1/{{true ? 'mock-api' : 'mock-apis'}}?records=10`; - apiPage.CreateAndFillApi(apiUrl, "BindingExpressions"); - agHelper.VerifyEvaluatedValue( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - ); - apiPage.RunAPI(); - agHelper.AssertElementAbsence( - locators._specificToast( - Cypress.env("MESSAGES").ERROR_ACTION_EXECUTE_FAIL("BindingExpressions"), - ), - ); //Assert that an error is not returned. - apiPage.ResponseStatusCheck("200 OK"); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Api, + apiPage.CreateAndFillApi(apiUrl, "BindingExpressions"); + agHelper.VerifyEvaluatedValue( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + ); + apiPage.RunAPI(); + agHelper.AssertElementAbsence( + locators._specificToast( + Cypress.env("MESSAGES").ERROR_ACTION_EXECUTE_FAIL( + "BindingExpressions", + ), + ), + ); //Assert that an error is not returned. + apiPage.ResponseStatusCheck("200 OK"); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Api, + }); + AppSidebar.navigate(AppSidebarButton.Editor); }); - AppSidebar.navigate(AppSidebarButton.Editor); - }); - it("3. Bug 18876 Ensures application does not crash when saving datasource", () => { - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - "FirstAPI", - 10000, - "POST", - ); - apiPage.SelectPaneTab("Authentication"); - cy.get(apiPage._saveAsDS).last().click({ force: true }); - cy.go("back"); - cy.get(dataSources._datasourceModalSave).click(); - // ensures app does not crash and datasource is saved. - cy.contains("Edit datasource to access authentication settings").should( - "exist", - ); - }); + it("3. Bug 18876 Ensures application does not crash when saving datasource", () => { + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + "FirstAPI", + 10000, + "POST", + ); + apiPage.SelectPaneTab("Authentication"); + cy.get(apiPage._saveAsDS).last().click({ force: true }); + cy.go("back"); + cy.get(dataSources._datasourceModalSave).click(); + // ensures app does not crash and datasource is saved. + cy.contains("Edit datasource to access authentication settings").should( + "exist", + ); + }); - it("4. Bug 16683, When Api url has dynamic binding expressions, ensures the query params is not truncated", function () { - const apiUrl = `http://host.docker.internal:5001/v1/mock-api?records=4{{Math.random() > 0.5 ? '¶m1=5' : '¶m2=6'}}`; + it("4. Bug 16683, When Api url has dynamic binding expressions, ensures the query params is not truncated", function () { + const apiUrl = `http://host.docker.internal:5001/v1/mock-api?records=4{{Math.random() > 0.5 ? '¶m1=5' : '¶m2=6'}}`; - apiPage.CreateAndFillApi(apiUrl, "BindingExpressions"); - apiPage.ValidateQueryParams({ - key: "records", - value: "4{{Math.random() > 0.5 ? '¶m1=5' : '¶m2=6'}}", + apiPage.CreateAndFillApi(apiUrl, "BindingExpressions"); + apiPage.ValidateQueryParams({ + key: "records", + value: "4{{Math.random() > 0.5 ? '¶m1=5' : '¶m2=6'}}", + }); }); - }); - it("5. Bug 26897, Invalid binding of table data when used existing suggested widgets for an action returning object & array", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE); + it("5. Bug 26897, Invalid binding of table data when used existing suggested widgets for an action returning object & array", function () { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE); - // Case where api returns array response - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - "ARRAY_RESPONSE", - ); - apiPage.RunAPI(); - dataSources.AddSuggestedWidget( - Widgets.Table, - dataSources._addSuggestedExisting, - ); - debuggerHelper.AssertErrorCount(0); - table.WaitUntilTableLoad(0, 0, "v2"); - propPane.AssertPropertiesDropDownCurrentValue( - "Table data", - "ARRAY_RESPONSE", - ); + // Case where api returns array response + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + "ARRAY_RESPONSE", + ); + apiPage.RunAPI(); + dataSources.AddSuggestedWidget( + Widgets.Table, + dataSources._addSuggestedExisting, + ); + debuggerHelper.AssertErrorCount(0); + table.WaitUntilTableLoad(0, 0, "v2"); + propPane.AssertPropertiesDropDownCurrentValue( + "Table data", + "ARRAY_RESPONSE", + ); - // Create API so that it returns object response - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiObjectUrl, - "OBJECT_RESPONSE", - ); - apiPage.RunAPI(); - dataSources.AddSuggestedWidget( - Widgets.Table, - dataSources._addSuggestedExisting, - ); - table.WaitUntilTableLoad(0, 0, "v2"); - propPane.ValidatePropertyFieldValue( - "Table data", - "{{OBJECT_RESPONSE.data.users}}", - ); - }); -}); + // Create API so that it returns object response + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiObjectUrl, + "OBJECT_RESPONSE", + ); + apiPage.RunAPI(); + dataSources.AddSuggestedWidget( + Widgets.Table, + dataSources._addSuggestedExisting, + ); + table.WaitUntilTableLoad(0, 0, "v2"); + propPane.ValidatePropertyFieldValue( + "Table data", + "{{OBJECT_RESPONSE.data.users}}", + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28731_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28731_Spec.ts index ed61181c8f5..824cb29695f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28731_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Binding_Bug28731_Spec.ts @@ -10,7 +10,7 @@ import { describe( "transformed one-click binding", - { tags: ["@tag.JS", "@tag.Binding"] }, + { tags: ["@tag.JS", "@tag.Binding", "@tag.Binding"] }, function () { it("Transforms API data to match widget exppected type ", function () { // Create anAPI that mreturns object response diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js index 4d73e1c3f2c..1c5addd1534 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js @@ -7,7 +7,14 @@ import { describe( "Verify setting tab form controls not to have tooltip and tooltip (underline) styles", - { tags: ["@tag.Datasource", "@tag.Settings"] }, + { + tags: [ + "@tag.Datasource", + "@tag.Settings", + "@tag.Git", + "@tag.AccessControl", + ], + }, function () { let guid, datasourceName; diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts index 2b912acca43..14e12af8c70 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/CatchBlock_Spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Bug #15372 Catch block was not triggering in Safari/firefox", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { it("1. Triggers the catch block when the API hits a 404", () => { apiPage.CreateAndFillApi( diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DSDiscardBugs_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DSDiscardBugs_spec.ts index c8142f9bf7a..fa47f87c3aa 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DSDiscardBugs_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DSDiscardBugs_spec.ts @@ -9,7 +9,7 @@ const testString = "test"; describe( "datasource unsaved changes popup shows even without changes", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { // In case of postgres and other plugins, host address and port key values are initialized by default making form dirty it("1. Bug 18664: Create postgres datasource, save it and edit it and go back, now unsaved changes popup should not be shown", () => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug18035_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug18035_Spec.ts index 70ee2c89789..b1f8170cfb7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug18035_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug18035_Spec.ts @@ -9,7 +9,14 @@ const dataSources = ObjectsRegistry.DataSources, describe( "Bug 18035: Updates save button text on datasource discard popup", - { tags: ["@tag.Datasource", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, function () { it("1. Create gsheet datasource, click on back button, discard popup should contain save and authorize", function () { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug19893_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug19893_spec.ts index e309a25afc0..a82491e9c6c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug19893_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug19893_spec.ts @@ -4,7 +4,7 @@ let dsName: any; describe( "Bug 19893: Authenticated API DS in case of OAuth2, should have save and authorise button enabled all the times", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("1. Create Auth API DS, save i, now edit again and check the save and authorise button state", function () { _.dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug21734_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug21734_Spec.ts index 3ec5cd9906c..d798a36bc31 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug21734_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug21734_Spec.ts @@ -11,7 +11,7 @@ const dataSources = ObjectsRegistry.DataSources, describe( "Bug 21734: On exiting from the Datasources page without saving changes, an error is thrown and the app becomes unresponsive.", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("1. Navigating from intermediary datasource to new page", function () { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25148_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25148_Spec.ts index 96c6aaf84c6..6002c827a39 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25148_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25148_Spec.ts @@ -5,7 +5,7 @@ let dsName: any; describe( "Bug 25148 - Edit Datasource button was disabled on Authentication tab of Api action", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { it("1. Checking if the Edit datasource button is enabled or not", () => { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25982_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25982_Spec.ts index a2607fb6a0d..07e2107300b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25982_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug25982_Spec.ts @@ -3,28 +3,32 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Fix UQI query switching", { tags: ["@tag.Datasource"] }, function () { - it("1. The command of the query must be preserved and should not default to initial value after changed.", function () { - dataSources.NavigateToDSCreateNew(); - dataSources.CreateDataSource("Mongo", false, false); - dataSources.CreateQueryAfterDSSaved("", "MongoQuery"); - dataSources.ValidateNSelectDropdown( - "Command", - "Find document(s)", - "Insert document(s)", - ); - dataSources.NavigateToDSCreateNew(); - dataSources.CreateDataSource("S3", false, false); - dataSources.CreateQueryAfterDSSaved("", "S3Query"); - dataSources.ValidateNSelectDropdown( - "Command", - "List files in bucket", - "Create a new file", - ); - EditorNavigation.SelectEntityByName("MongoQuery", EntityType.Query); - dataSources.ValidateNSelectDropdown("Command", "Insert document(s)"); +describe( + "Fix UQI query switching", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. The command of the query must be preserved and should not default to initial value after changed.", function () { + dataSources.NavigateToDSCreateNew(); + dataSources.CreateDataSource("Mongo", false, false); + dataSources.CreateQueryAfterDSSaved("", "MongoQuery"); + dataSources.ValidateNSelectDropdown( + "Command", + "Find document(s)", + "Insert document(s)", + ); + dataSources.NavigateToDSCreateNew(); + dataSources.CreateDataSource("S3", false, false); + dataSources.CreateQueryAfterDSSaved("", "S3Query"); + dataSources.ValidateNSelectDropdown( + "Command", + "List files in bucket", + "Create a new file", + ); + EditorNavigation.SelectEntityByName("MongoQuery", EntityType.Query); + dataSources.ValidateNSelectDropdown("Command", "Insert document(s)"); - EditorNavigation.SelectEntityByName("S3Query", EntityType.Query); - dataSources.ValidateNSelectDropdown("Command", "Create a new file"); - }); -}); + EditorNavigation.SelectEntityByName("S3Query", EntityType.Query); + dataSources.ValidateNSelectDropdown("Command", "Create a new file"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26126_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26126_spec.ts index 0d87bb6561a..6945c429b86 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26126_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26126_spec.ts @@ -5,7 +5,7 @@ import { describe( "Bug 26126: Fix DS button disability", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("ensures save button is correctly updated when DS required fields change", function () { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26716_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26716_Spec.ts index daefc982b73..0c4e9bea299 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26716_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26716_Spec.ts @@ -10,7 +10,14 @@ let dsName: any, userMock: string, movieMock: string; describe( "Bug 26716: Datasource selected from entity explorer should be correctly highlighted", - { tags: ["@tag.Datasource", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, function () { it("1. Create users and movies mock datasources and switch between them through entity explorer, check the active state", function () { dataSources.CreateMockDB("Users").then((mockDBName) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts index 1293b4c16f0..3dcc34f0788 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug26941_Spec.ts @@ -7,7 +7,7 @@ import { describe( "Inconsistent Api error after the invalid chars are removed from header key", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("1. Checking whether the appropriate error is displayed even after the removal of invalid chars in header key.", function () { const randomApi = `${ diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug27817_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug27817_Spec.ts index 9ea04dc143a..a72076e663a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug27817_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug27817_Spec.ts @@ -7,7 +7,7 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; describe( "Datasource structure schema preview data", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { before(() => { dataSources.CreateDataSource("Postgres"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28750_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28750_Spec.ts index 18b2f9b146c..faccd077654 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28750_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28750_Spec.ts @@ -3,7 +3,14 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; describe( "Datasource structure schema preview data", - { tags: ["@tag.Datasource", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, () => { before(() => { dataSources.CreateMockDB("Users"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28985_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28985_spec.ts index e5f2c97cacf..e5f126865a3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28985_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bug28985_spec.ts @@ -7,7 +7,7 @@ import EditorNavigation, { describe( "Api execution results test cases", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { it("1. Check to see if API execution results are preserved after it is renamed", () => { const { diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bugs26410_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bugs26410_spec.ts index a9bea83f71d..32dc87074a7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bugs26410_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DS_Bugs26410_spec.ts @@ -5,7 +5,14 @@ import EditorNavigation, { describe( "Fix UQI query switching", - { tags: ["@tag.Datasource", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, function () { it("1. The command of the Mongo query must be preserved and should not default to initial value after changed.", function () { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts index d0a02c28e0b..9608ee564cb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts @@ -15,7 +15,7 @@ let guid; let dataSourceName: string; describe( "Datasource form related tests", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { before(() => { homePage.CreateNewWorkspace("FetchSchemaOnce", true); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts index f7bc432e1cf..722cbe524d3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts @@ -13,158 +13,173 @@ let tempBranch1: any; let tempBranch2: any; let tempBranch3: any; -describe("Git Bugs", { tags: ["@tag.Git"] }, function () { - before(() => { - _.agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - _.homePage.CreateNewWorkspace("GitBugs" + uid, true); - _.homePage.CreateAppInWorkspace("GitBugs" + uid); +describe( + "Git Bugs", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + before(() => { + _.agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + _.homePage.CreateNewWorkspace("GitBugs" + uid, true); + _.homePage.CreateAppInWorkspace("GitBugs" + uid); + }); }); - }); - it("1. Bug 16248, When GitSync modal is open, block shortcut action execution", function () { - const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; - _.apiPage.CreateAndFillApi( - _.dataManager.dsValues[_.dataManager.defaultEnviorment].mockApiUrl, - "GitSyncTest", - ); - _.gitSync.OpenGitSyncModal(); - cy.get("body").type(`{${modifierKey}}{enter}`); - cy.get("@postExecute").should("not.exist"); - _.gitSync.CloseGitSyncModal(); - cy.get("body").type(`{${modifierKey}}{enter}`); - _.assertHelper.AssertNetworkStatus("@postExecute"); - }); + it("1. Bug 16248, When GitSync modal is open, block shortcut action execution", function () { + const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; + _.apiPage.CreateAndFillApi( + _.dataManager.dsValues[_.dataManager.defaultEnviorment].mockApiUrl, + "GitSyncTest", + ); + _.gitSync.OpenGitSyncModal(); + cy.get("body").type(`{${modifierKey}}{enter}`); + cy.get("@postExecute").should("not.exist"); + _.gitSync.CloseGitSyncModal(); + cy.get("body").type(`{${modifierKey}}{enter}`); + _.assertHelper.AssertNetworkStatus("@postExecute"); + }); - it("2. Bug 18665 : Creates a new Git branch, Create datasource, discard it and check current branch", function () { - _.gitSync.CreateNConnectToGit(); - _.gitSync.CreateGitBranch(tempBranch, false); + it("2. Bug 18665 : Creates a new Git branch, Create datasource, discard it and check current branch", function () { + _.gitSync.CreateNConnectToGit(); + _.gitSync.CreateGitBranch(tempBranch, false); - cy.get("@gitbranchName").then((branchName) => { - tempBranch = branchName; - _.dataSources.NavigateToDSCreateNew(); - _.dataSources.CreatePlugIn("PostgreSQL"); - _.dataSources.FillPostgresDSForm(); - _.dataSources.SaveDSFromDialog(false); - _.agHelper.AssertElementVisibility(_.gitSync._branchButton); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + cy.get("@gitbranchName").then((branchName) => { + tempBranch = branchName; + _.dataSources.NavigateToDSCreateNew(); + _.dataSources.CreatePlugIn("PostgreSQL"); + _.dataSources.FillPostgresDSForm(); + _.dataSources.SaveDSFromDialog(false); + _.agHelper.AssertElementVisibility(_.gitSync._branchButton); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); }); }); - }); - - it("3. Bug 18376: navigateTo fails to set queryParams if the app is connected to Git", () => { - PageList.AddNewPage(); - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.BUTTON); - _.propPane.EnterJSContext( - "onClick", - "{{navigateTo('Page2', {testQP: 'Yes'}, 'SAME_WINDOW')}}", - true, - true, - ); - _.propPane.ToggleJSMode("onClick", false); - _.agHelper.Sleep(500); - EditorNavigation.SelectEntityByName("Page2", EntityType.Page); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - _.propPane.UpdatePropertyFieldValue( - "Text", - "{{appsmith.URL.queryParams.testQP}}", - ); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - _.agHelper.ClickButton("Submit"); - _.agHelper.Sleep(500); - _.agHelper - .GetText(_.locators._textWidget) - .then(($qp) => expect($qp).to.eq("Yes")); - _.agHelper.AssertURL("branch=" + tempBranch); //Validate we are still in Git branch - _.agHelper.AssertURL("testQP=Yes"); //Validate we also ve the Query Params from Page1 - }); - it("4. Bug 24946 : Discard message is missing when only navigation settings are changed", function () { - _.gitSync.SwitchGitBranch("master"); - _.gitSync.CreateGitBranch(`b24946`, true); - cy.get("@gitbranchName").then((branchName) => { - statusBranch = branchName; - AppSidebar.navigate(AppSidebarButton.Settings); - _.agHelper.GetNClick(_.locators._appNavigationSettings); - _.agHelper.GetNClick(_.locators._appNavigationSettingsShowTitle); - AppSidebar.navigate(AppSidebarButton.Editor); - _.agHelper.GetNClick(_.locators._publishButton); - _.agHelper.WaitUntilEleAppear(_.gitSync._gitStatusChanges); - _.agHelper.GetNClick(_.gitSync._discardChanges); - _.agHelper.WaitUntilEleAppear(_.gitSync._discardCallout); - _.agHelper.AssertContains( - Cypress.env("MESSAGES").DISCARD_CHANGES_WARNING(), - "exist", - _.gitSync._discardCallout, + it("3. Bug 18376: navigateTo fails to set queryParams if the app is connected to Git", () => { + PageList.AddNewPage(); + _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.BUTTON); + _.propPane.EnterJSContext( + "onClick", + "{{navigateTo('Page2', {testQP: 'Yes'}, 'SAME_WINDOW')}}", + true, + true, ); - _.agHelper.AssertContains( - Cypress.env("MESSAGES").DISCARD_MESSAGE(), - "exist", - _.gitSync._discardCallout, + _.propPane.ToggleJSMode("onClick", false); + _.agHelper.Sleep(500); + EditorNavigation.SelectEntityByName("Page2", EntityType.Page); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + _.propPane.UpdatePropertyFieldValue( + "Text", + "{{appsmith.URL.queryParams.testQP}}", ); - _.agHelper.GetNClick(_.locators._dialogCloseButton); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + _.agHelper.ClickButton("Submit"); + _.agHelper.Sleep(500); + _.agHelper + .GetText(_.locators._textWidget) + .then(($qp) => expect($qp).to.eq("Yes")); + _.agHelper.AssertURL("branch=" + tempBranch); //Validate we are still in Git branch + _.agHelper.AssertURL("testQP=Yes"); //Validate we also ve the Query Params from Page1 + }); + + it("4. Bug 24946 : Discard message is missing when only navigation settings are changed", function () { + _.gitSync.SwitchGitBranch("master"); + _.gitSync.CreateGitBranch(`b24946`, true); + cy.get("@gitbranchName").then((branchName) => { + statusBranch = branchName; + AppSidebar.navigate(AppSidebarButton.Settings); + _.agHelper.GetNClick(_.locators._appNavigationSettings); + _.agHelper.GetNClick(_.locators._appNavigationSettingsShowTitle); + AppSidebar.navigate(AppSidebarButton.Editor); + _.agHelper.GetNClick(_.locators._publishButton); + _.agHelper.WaitUntilEleAppear(_.gitSync._gitStatusChanges); + _.agHelper.GetNClick(_.gitSync._discardChanges); + _.agHelper.WaitUntilEleAppear(_.gitSync._discardCallout); + _.agHelper.AssertContains( + Cypress.env("MESSAGES").DISCARD_CHANGES_WARNING(), + "exist", + _.gitSync._discardCallout, + ); + _.agHelper.AssertContains( + Cypress.env("MESSAGES").DISCARD_MESSAGE(), + "exist", + _.gitSync._discardCallout, + ); + _.agHelper.GetNClick(_.locators._dialogCloseButton); + }); }); - }); - it("5. Bug 24486 : Loading state for remote branches", function () { - _.gitSync.CreateRemoteBranch(repoName, "test-24486"); - _.gitSync.SwitchGitBranch("origin/test-24486", false, true); - }); + it("5. Bug 24486 : Loading state for remote branches", function () { + _.gitSync.CreateRemoteBranch(repoName, "test-24486"); + _.gitSync.SwitchGitBranch("origin/test-24486", false, true); + }); - it("6. Bug 24920: Not able to discard app settings changes for the first time in git connected app ", function () { - _.gitSync.SwitchGitBranch("master", false, true); - // add navigation settings changes - AppSidebar.navigate(AppSidebarButton.Settings); - _.agHelper.GetNClick(_.appSettings.locators._navigationSettingsTab); - _.agHelper.GetNClick( - _.appSettings.locators._navigationSettings._orientationOptions._side, - ); - _.agHelper.AssertElementExist(_.appSettings.locators._sideNavbar); - // discard changes and verify - _.gitSync.DiscardChanges(); - _.gitSync.VerifyChangeLog(false); - }); + it("6. Bug 24920: Not able to discard app settings changes for the first time in git connected app ", function () { + _.gitSync.SwitchGitBranch("master", false, true); + // add navigation settings changes + AppSidebar.navigate(AppSidebarButton.Settings); + _.agHelper.GetNClick(_.appSettings.locators._navigationSettingsTab); + _.agHelper.GetNClick( + _.appSettings.locators._navigationSettings._orientationOptions._side, + ); + _.agHelper.AssertElementExist(_.appSettings.locators._sideNavbar); + // discard changes and verify + _.gitSync.DiscardChanges(); + _.gitSync.VerifyChangeLog(false); + }); - it("7. Bug 23858 : Branch list in git sync modal is not scrollable", function () { - // create git branches - _.gitSync.CreateGitBranch(tempBranch1, true); - _.gitSync.CreateGitBranch(tempBranch2, true); - _.gitSync.CreateGitBranch(tempBranch3, true); - _.agHelper.AssertElementExist(_.gitSync._bottomBarPull); - _.agHelper.GetNClick(_.gitSync._bottomBarMergeButton); - _.agHelper.AssertElementEnabledDisabled( - _.gitSync._mergeBranchDropdownDestination, - 0, - false, - ); - _.agHelper.Sleep(6000); // adding wait for branch list to load - _.agHelper.GetNClick(_.gitSync._mergeBranchDropdownDestination); - // to verify scroll works and clicks on last branch in list - _.agHelper.GetNClick(_.gitSync._dropdownmenu, 5); - _.gitSync.CloseGitSyncModal(); - }); + it("7. Bug 23858 : Branch list in git sync modal is not scrollable", function () { + // create git branches + _.gitSync.CreateGitBranch(tempBranch1, true); + _.gitSync.CreateGitBranch(tempBranch2, true); + _.gitSync.CreateGitBranch(tempBranch3, true); + _.agHelper.AssertElementExist(_.gitSync._bottomBarPull); + _.agHelper.GetNClick(_.gitSync._bottomBarMergeButton); + _.agHelper.AssertElementEnabledDisabled( + _.gitSync._mergeBranchDropdownDestination, + 0, + false, + ); + _.agHelper.Sleep(6000); // adding wait for branch list to load + _.agHelper.GetNClick(_.gitSync._mergeBranchDropdownDestination); + // to verify scroll works and clicks on last branch in list + _.agHelper.GetNClick(_.gitSync._dropdownmenu, 5); + _.gitSync.CloseGitSyncModal(); + }); - it("8. Bug 24206 : Open repository button is not functional in git sync modal", function () { - _.gitSync.SwitchGitBranch("master"); - _.appSettings.OpenPaneAndChangeTheme("Moon"); - _.gitSync.CommitAndPush(); - _.gitSync.SwitchGitBranch(tempBranch); - _.appSettings.OpenPaneAndChangeTheme("Pampas"); - _.gitSync.CommitAndPush(); - _.gitSync.CheckMergeConflicts("master"); - cy.window().then((win) => { - cy.stub(win, "open", (url) => { - win.location.href = "http://host.docker.internal/"; - }).as("repoURL"); + it("8. Bug 24206 : Open repository button is not functional in git sync modal", function () { + _.gitSync.SwitchGitBranch("master"); + _.appSettings.OpenPaneAndChangeTheme("Moon"); + _.gitSync.CommitAndPush(); + _.gitSync.SwitchGitBranch(tempBranch); + _.appSettings.OpenPaneAndChangeTheme("Pampas"); + _.gitSync.CommitAndPush(); + _.gitSync.CheckMergeConflicts("master"); + cy.window().then((win) => { + cy.stub(win, "open", (url) => { + win.location.href = "http://host.docker.internal/"; + }).as("repoURL"); + }); + _.gitSync.OpenRepositoryAndVerify(); + cy.get("@repoURL").should("be.called"); }); - _.gitSync.OpenRepositoryAndVerify(); - cy.get("@repoURL").should("be.called"); - }); - after(() => { - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts index 4fc0e617f10..60b440114b7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts @@ -18,7 +18,9 @@ const GRAPHQL_RESPONSE = { describe( "Binding Expressions should not be truncated in Url and path extraction", - { tags: ["@tag.Datasource", "@tag.Binding"] }, + { + tags: ["@tag.Datasource", "@tag.Binding", "@tag.Git", "@tag.AccessControl"], + }, function () { it("Bug 16702, Moustache+Quotes formatting goes wrong in graphql body resulting in autocomplete failure", function () { const jsObjectBody = `export default { diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/InvalidURL_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/InvalidURL_Spec.ts index eb68c390450..61f94ea3b77 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/InvalidURL_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/InvalidURL_Spec.ts @@ -3,7 +3,7 @@ import { ObjectsRegistry } from "../../../../support/Objects/Registry"; const jsEditor = ObjectsRegistry.JSEditor, agHelper = ObjectsRegistry.AggregateHelper; -describe("Invalid page routing", { tags: ["@tag.JS"] }, () => { +describe("Invalid page routing", { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Bug #16047 - Shows Invalid URL UI for invalid JS Object page url", () => { const JS_OBJECT_BODY = `export default { myVar1: [], diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JSParse_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JSParse_Spec.ts index 674e9b33457..728d4410e3d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JSParse_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JSParse_Spec.ts @@ -29,7 +29,7 @@ const assertLintErrorAndOutput = ( describe( "Bug #15283 - Correctly parses JS Function", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { ee.DragDropWidgetNVerify("singleselecttreewidget", 300, 500); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug14002_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug14002_Spec.ts index 58fb3672aa9..13b84feab23 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug14002_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug14002_Spec.ts @@ -2,7 +2,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Invalid JSObject export statement", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { it("1. Shows error toast for invalid js object export statement", function () { const JSObjectWithInvalidExport = `{ diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15056_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15056_Spec.ts index 8b2bd104cab..85dfc41dff8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15056_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15056_Spec.ts @@ -9,18 +9,21 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("JS data update on button click", { tags: ["@tag.JS"] }, function () { - before(() => { - agHelper.AddDsl("jsFunctionTriggerDsl"); - }); +describe( + "JS data update on button click", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + before(() => { + agHelper.AddDsl("jsFunctionTriggerDsl"); + }); - it("1. Populates js function data when triggered via button click", function () { - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - "Api1", - ); + it("1. Populates js function data when triggered via button click", function () { + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + "Api1", + ); - const jsObjectString = `export default { + const jsObjectString = `export default { myVar1: [], myVar2: {}, myFun1: async () => { @@ -35,15 +38,16 @@ describe("JS data update on button click", { tags: ["@tag.JS"] }, function () { } }`; - jsEditor.CreateJSObject(jsObjectString, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, + jsEditor.CreateJSObject(jsObjectString, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); + agHelper.ClickButton("Submit"); + agHelper.AssertContains("myFun1 Data", "exist"); + agHelper.AssertContains("myFun2 Data", "exist"); }); - EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); - agHelper.ClickButton("Submit"); - agHelper.AssertContains("myFun1 Data", "exist"); - agHelper.AssertContains("myFun2 Data", "exist"); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15909_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15909_Spec.ts index ba4be814289..257586a5d03 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15909_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug15909_Spec.ts @@ -3,13 +3,20 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { - before(() => { - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.BUTTON, 200, 200); - }); - it("1. Shows js function data as part of autocompletion hints", function () { - _.jsEditor.CreateJSObject( - `export default { +describe( + "JS Function Execution", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + before(() => { + _.entityExplorer.DragDropWidgetNVerify( + _.draggableWidgets.BUTTON, + 200, + 200, + ); + }); + it("1. Shows js function data as part of autocompletion hints", function () { + _.jsEditor.CreateJSObject( + `export default { myFun1: ()=>{ return "yes" }, @@ -17,17 +24,18 @@ describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { return [{name: "test"}] } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - _.propPane.EnterJSContext("onClick", `{{JSObject1.`, true, false); - _.agHelper.AssertContains("myFun1.data"); - _.agHelper.AssertContains("myFun2.data"); - }); -}); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + _.propPane.EnterJSContext("onClick", `{{JSObject1.`, true, false); + _.agHelper.AssertContains("myFun1.data"); + _.agHelper.AssertContains("myFun2.data"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug18369_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug18369_Spec.ts index f09e1c097a0..4ec8686dbc1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug18369_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug18369_Spec.ts @@ -6,14 +6,18 @@ import EditorNavigation, { const locator = ObjectsRegistry.CommonLocators, agHelper = ObjectsRegistry.AggregateHelper; -describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { - before(() => { - agHelper.AddDsl("formWithtabdsl"); - }); +describe( + "JS Function Execution", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + before(() => { + agHelper.AddDsl("formWithtabdsl"); + }); - it("1. Doesn't show lint errors for 'form.hasChanges' for form in inactive tab", () => { - EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); - agHelper.Sleep(4000); - agHelper.AssertElementAbsence(locator._lintErrorElement); - }); -}); + it("1. Doesn't show lint errors for 'form.hasChanges' for form in inactive tab", () => { + EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); + agHelper.Sleep(4000); + agHelper.AssertElementAbsence(locator._lintErrorElement); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug19982_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug19982_Spec.ts index a63330f6685..61e43c40920 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug19982_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug19982_Spec.ts @@ -5,7 +5,7 @@ const jsEditor = ObjectsRegistry.JSEditor, describe( "JS Execution of Higher-order-functions", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { it("1. Completes execution properly", function () { const JSObjectWithHigherOrderFunction = `export default{ diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug20841_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug20841_Spec.ts index 105ea013df4..ee72668e438 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug20841_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug20841_Spec.ts @@ -6,7 +6,7 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Evaluations causing error when page is cloned", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { it("1. Bug: 20841: JSObjects | Sync methods | Not run consistently when Page is cloned", function () { const JS_OBJECT_BODY = `export default{ diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug24194_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug24194_Spec.ts index 5c9be26ffae..d09b978db3d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug24194_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug24194_Spec.ts @@ -9,12 +9,15 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Responsiveness of linting", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify("buttonwidget", 300, 300); - }); - it("Should update linting when entity is added/renamed", () => { - const JS_OBJECT = `export default { +describe( + "Responsiveness of linting", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify("buttonwidget", 300, 300); + }); + it("Should update linting when entity is added/renamed", () => { + const JS_OBJECT = `export default { myFun1: () => { return ""; }, @@ -22,21 +25,22 @@ describe("Responsiveness of linting", { tags: ["@tag.JS"] }, () => { return "" } }`; - propPane.UpdatePropertyFieldValue("Tooltip", "{{JSObject1.myFun1}}"); - agHelper.AssertElementExist(locators._lintErrorElement); - jsEditor.CreateJSObject(JS_OBJECT, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }); + propPane.UpdatePropertyFieldValue("Tooltip", "{{JSObject1.myFun1}}"); + agHelper.AssertElementExist(locators._lintErrorElement); + jsEditor.CreateJSObject(JS_OBJECT, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - agHelper.AssertElementAbsence(locators._lintErrorElement); - agHelper.RefreshPage(); - EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); - jsEditor.RenameJSObjFromPane("JSObject2"); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - agHelper.AssertElementAbsence(locators._lintErrorElement); - }); -}); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + agHelper.AssertElementAbsence(locators._lintErrorElement); + agHelper.RefreshPage(); + EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); + jsEditor.RenameJSObjFromPane("JSObject2"); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + agHelper.AssertElementAbsence(locators._lintErrorElement); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug25894_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug25894_spec.ts index c45dd898b84..4eb8874dd86 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug25894_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug25894_spec.ts @@ -10,7 +10,7 @@ import EditorNavigation, { describe( "Bug 25894 - Moustache brackets should be highlighted", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. should show {{ }} in bold", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug28764_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug28764_Spec.ts index 3083962c588..5885ba6da5a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug28764_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug28764_Spec.ts @@ -7,11 +7,14 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { - it("Retains lint errors after navigation", function () { - // JS Object 1 - jsEditor.CreateJSObject( - `export default { +describe( + "JS Function Execution", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + it("Retains lint errors after navigation", function () { + // JS Object 1 + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1 () { @@ -24,17 +27,17 @@ describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { fff } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); - // JS Object 2 - jsEditor.CreateJSObject( - `export default { + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); + // JS Object 2 + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1 () { @@ -45,28 +48,29 @@ describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { // use async-await or promises } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); - EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); - // Assert lint error - agHelper.AssertElementLength(locators._lintErrorElement, 1); - agHelper.HoverElement(locators._lintErrorElement); - agHelper.AssertContains(`'fff' is not defined`); + EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); + // Assert lint error + agHelper.AssertElementLength(locators._lintErrorElement, 1); + agHelper.HoverElement(locators._lintErrorElement); + agHelper.AssertContains(`'fff' is not defined`); - EditorNavigation.SelectEntityByName("JSObject2", EntityType.JSObject); - agHelper.AssertElementAbsence(locators._lintErrorElement); + EditorNavigation.SelectEntityByName("JSObject2", EntityType.JSObject); + agHelper.AssertElementAbsence(locators._lintErrorElement); - EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); - // Assert lint error - agHelper.AssertElementLength(locators._lintErrorElement, 1); - agHelper.HoverElement(locators._lintErrorElement); - agHelper.AssertContains(`'fff' is not defined`); - }); -}); + EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); + // Assert lint error + agHelper.AssertElementLength(locators._lintErrorElement, 1); + agHelper.HoverElement(locators._lintErrorElement); + agHelper.AssertContains(`'fff' is not defined`); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug29131_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug29131_spec.ts index 0f424f4845d..a2743b4a4d2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug29131_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/JS_Bug29131_spec.ts @@ -13,41 +13,45 @@ const jsObjectBody = `export default { } }`; -describe("Verifies JS object rename bug", { tags: ["@tag.JS"] }, () => { - it("Verify that a JS Object name is up for taking after it is deleted", () => { - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, +describe( + "Verifies JS object rename bug", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + it("Verify that a JS Object name is up for taking after it is deleted", () => { + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + jsEditor.RenameJSObjFromPane("JSObj2"); + + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: EntityItems.JSObject, + }); + + jsEditor.CreateJSObject(jsObjectBody, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: false, + }); + + jsEditor.RenameJSObjFromPane("JSObj2"); + + PageLeftPane.assertPresence("JSObj2"); }); - - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); - - jsEditor.RenameJSObjFromPane("JSObj2"); - - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: EntityItems.JSObject, - }); - - jsEditor.CreateJSObject(jsObjectBody, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: false, - }); - - jsEditor.RenameJSObjFromPane("JSObj2"); - - PageLeftPane.assertPresence("JSObj2"); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/ListWidgetOnPageLoad_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/ListWidgetOnPageLoad_Spec.ts index 4826088ab6d..f53f3a2e2c1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/ListWidgetOnPageLoad_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/ListWidgetOnPageLoad_Spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "JS Function execution data mutation", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("Listv2/simpleList"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts index a17f26f0953..95b189ec2a5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Moment_Spec.ts @@ -21,7 +21,9 @@ let dsName: any, query: string; describe( "Bug #14299 - The data from the query does not show up on the widget", - { tags: ["@tag.Widget", "@tag.Datasource"] }, + { + tags: ["@tag.Widget", "@tag.Datasource", "@tag.Git", "@tag.AccessControl"], + }, function () { before("Create Postgress DS & set theme", () => { agHelper.AddDsl("Bugs/14299dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/SelectWidget_Bug9334_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/SelectWidget_Bug9334_Spec.ts index 4ebc73776bc..f1840e1bb54 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/SelectWidget_Bug9334_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/SelectWidget_Bug9334_Spec.ts @@ -17,7 +17,7 @@ let dsName: any; describe( "Bug 9334: The Select widget value is sent as null when user switches between the pages", - { tags: ["@tag.Widget"] }, + { tags: ["@tag.Widget", "@tag.Binding"] }, function () { before("Change Theme & Create Postgress DS", () => { appSettings.OpenPaneAndChangeTheme("Pampas"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Widget_Bug27119_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Widget_Bug27119_Spec.ts index e9aa3e6cb90..f971ac85c02 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Widget_Bug27119_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Widget_Bug27119_Spec.ts @@ -8,51 +8,54 @@ import { jsEditor, } from "../../../../support/Objects/ObjectsCore"; -describe("Reset widget action", { tags: ["@tag.Widget"] }, () => { - it("Reset widget to default after setValue has been applied", () => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); - propPane.UpdatePropertyFieldValue("Default value", "John"); +describe( + "Reset widget action", + { tags: ["@tag.Widget", "@tag.Binding"] }, + () => { + it("Reset widget to default after setValue has been applied", () => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); + propPane.UpdatePropertyFieldValue("Default value", "John"); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); - propPane.EnterJSContext("onClick", `{{Input1.setValue('Hello!')}}`); - propPane.UpdatePropertyFieldValue("Label", "Set value"); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); + propPane.EnterJSContext("onClick", `{{Input1.setValue('Hello!')}}`); + propPane.UpdatePropertyFieldValue("Label", "Set value"); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 500, 100); - propPane.EnterJSContext("onClick", `{{resetWidget("Input1")}}`); - propPane.UpdatePropertyFieldValue("Label", "Reset value"); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 500, 100); + propPane.EnterJSContext("onClick", `{{resetWidget("Input1")}}`); + propPane.UpdatePropertyFieldValue("Label", "Reset value"); - deployMode.DeployApp(); + deployMode.DeployApp(); - agHelper.ClickButton("Set value"); - agHelper.AssertText( - locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", - "val", - "Hello!", - ); + agHelper.ClickButton("Set value"); + agHelper.AssertText( + locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", + "val", + "Hello!", + ); - agHelper.ClickButton("Reset value"); - agHelper.AssertText( - locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", - "val", - "John", - ); + agHelper.ClickButton("Reset value"); + agHelper.AssertText( + locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", + "val", + "John", + ); - agHelper.ClearNType( - locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", - "Testing", - ); - agHelper.ClickButton("Reset value"); - agHelper.AssertText( - locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", - "val", - "John", - ); - }); - it("Reset value is accessible after 'awaiting'", () => { - deployMode.NavigateBacktoEditor(); - agHelper.ClearNType(locators._input, "Meta Text"); + agHelper.ClearNType( + locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", + "Testing", + ); + agHelper.ClickButton("Reset value"); + agHelper.AssertText( + locators._widgetInDeployed(draggableWidgets.INPUT_V2) + " input", + "val", + "John", + ); + }); + it("Reset value is accessible after 'awaiting'", () => { + deployMode.NavigateBacktoEditor(); + agHelper.ClearNType(locators._input, "Meta Text"); - const JS_OBJECT_BODY = `export default { + const JS_OBJECT_BODY = `export default { async resetInputWithoutAwait () { resetWidget('Input1') showAlert(Input1.text) @@ -63,21 +66,22 @@ describe("Reset widget action", { tags: ["@tag.Widget"] }, () => { } }`; - // Create js object - jsEditor.CreateJSObject(JS_OBJECT_BODY, { - paste: true, - completeReplace: true, - toRun: false, - prettify: false, - shouldCreateNewJSObj: true, - }); - agHelper.Sleep(4000); - jsEditor.SelectFunctionDropdown("resetInputWithoutAwait"); - agHelper.ClickButton("Run"); - agHelper.AssertContains("Meta Text"); + // Create js object + jsEditor.CreateJSObject(JS_OBJECT_BODY, { + paste: true, + completeReplace: true, + toRun: false, + prettify: false, + shouldCreateNewJSObj: true, + }); + agHelper.Sleep(4000); + jsEditor.SelectFunctionDropdown("resetInputWithoutAwait"); + agHelper.ClickButton("Run"); + agHelper.AssertContains("Meta Text"); - jsEditor.SelectFunctionDropdown("resetInputWithAwait"); - agHelper.ClickButton("Run"); - agHelper.AssertContains("John"); - }); -}); + jsEditor.SelectFunctionDropdown("resetInputWithAwait"); + agHelper.ClickButton("Run"); + agHelper.AssertContains("John"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/defaultFilterTextValue_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/defaultFilterTextValue_Spec.ts index 0a6e6665b9a..4f457f88602 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/defaultFilterTextValue_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/defaultFilterTextValue_Spec.ts @@ -2,12 +2,16 @@ import { ObjectsRegistry } from "../../../../support/Objects/Registry"; const agHelper = ObjectsRegistry.AggregateHelper; -describe("Select widget filterText", { tags: ["@tag.Widget"] }, () => { - before(() => { - agHelper.AddDsl("defaultFilterText"); - }); +describe( + "Select widget filterText", + { tags: ["@tag.Widget", "@tag.Binding"] }, + () => { + before(() => { + agHelper.AddDsl("defaultFilterText"); + }); - it("1. default value should be an empty string", () => { - agHelper.AssertContains("string"); - }); -}); + it("1. default value should be an empty string", () => { + agHelper.AssertContains("string"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/formHasChanged_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/formHasChanged_Spec.ts index 46dca4c2624..3949f061545 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/formHasChanged_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/formHasChanged_Spec.ts @@ -7,14 +7,18 @@ const ee = ObjectsRegistry.EntityExplorer, locator = ObjectsRegistry.CommonLocators, agHelper = ObjectsRegistry.AggregateHelper; -describe("JS Function Execution", { tags: ["@tag.JS"] }, function () { - before(() => { - agHelper.AddDsl("formChangeDSL"); - }); +describe( + "JS Function Execution", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + before(() => { + agHelper.AddDsl("formChangeDSL"); + }); - it("1. Doesn't show lint errors for 'form.hasChanges'", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - agHelper.Sleep(4000); - agHelper.AssertElementAbsence(locator._lintErrorElement); - }); -}); + it("1. Doesn't show lint errors for 'form.hasChanges'", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + agHelper.Sleep(4000); + agHelper.AssertElementAbsence(locator._lintErrorElement); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/invalidLintError_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/invalidLintError_Spec.ts index 7ccf899196a..7d6d52e3fa0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/BugTests/invalidLintError_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/invalidLintError_Spec.ts @@ -5,7 +5,7 @@ const jsEditor = ObjectsRegistry.JSEditor, ee = ObjectsRegistry.EntityExplorer, agHelper = ObjectsRegistry.AggregateHelper; -describe("Linting", { tags: ["@tag.JS"] }, () => { +describe("Linting", { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { ee.DragDropWidgetNVerify("buttonwidget", 300, 300); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/CodeComment/PropertyPaneCodeComment_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/CodeComment/PropertyPaneCodeComment_spec.ts index cd3fd14d61d..cdf97d94a7e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/CodeComment/PropertyPaneCodeComment_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/CodeComment/PropertyPaneCodeComment_spec.ts @@ -3,22 +3,26 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Property Pane Code Commenting", { tags: ["@tag.JS"] }, () => { - before(() => { - agHelper.AddDsl("buttondsl"); - }); +describe( + "Property Pane Code Commenting", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + agHelper.AddDsl("buttondsl"); + }); - it("1. Should comment code in Property Pane", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.TypeTextIntoField("Label", "{{appsmith}}"); - propPane.ToggleCommentInTextField("Label"); + it("1. Should comment code in Property Pane", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.TypeTextIntoField("Label", "{{appsmith}}"); + propPane.ToggleCommentInTextField("Label"); - propPane.ValidatePropertyFieldValue("Label", "{{// appsmith}}"); + propPane.ValidatePropertyFieldValue("Label", "{{// appsmith}}"); - //Uncomment - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.TypeTextIntoField("Label", "{{// appsmith}}"); - propPane.ToggleCommentInTextField("Label"); - propPane.ValidatePropertyFieldValue("Label", "{{appsmith}}"); - }); -}); + //Uncomment + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.TypeTextIntoField("Label", "{{// appsmith}}"); + propPane.ToggleCommentInTextField("Label"); + propPane.ValidatePropertyFieldValue("Label", "{{appsmith}}"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/CommunityTemplate/PublishCommunityTemplatesFlow_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/CommunityTemplate/PublishCommunityTemplatesFlow_spec.ts index 97b3537d98d..e0c464b3b8b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/CommunityTemplate/PublishCommunityTemplatesFlow_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/CommunityTemplate/PublishCommunityTemplatesFlow_spec.ts @@ -8,7 +8,15 @@ import { const communityForm = communityTemplates.locators._communityForm; describe( "Publish app to Community flow", - { tags: ["@tag.Templates", " @tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Templates", + " @tag.excludeForAirgap", + "@tag.Git", + "@tag.ImportExport", + "@tag.Fork", + ], + }, () => { afterEach(() => { agHelper.RefreshPage(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts index 5bacf30fa3d..094d5fd8f87 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Api_pane_navigation_spec.ts @@ -11,7 +11,14 @@ import EditorNavigation from "../../../../support/Pages/EditorNavigation"; describe( "Api pane navigation", - { tags: ["@tag.Datasource", " @tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + " @tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, () => { it("1. Navigation to Graphql pagination field", () => { apiPage.CreateGraphqlApi("Api1"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts index 30a27209444..dd4821a3e66 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Debugger/Widget_property_navigation_spec.ts @@ -6,7 +6,7 @@ import EditorNavigation, { describe( "Widget property navigation", - { tags: ["@tag.Widget", "@tag.excludeForAirgap"] }, + { tags: ["@tag.Widget", "@tag.excludeForAirgap", "@tag.Binding"] }, () => { it("1. Collapsed field navigation", () => { _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.AUDIO); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js index 23c509869dd..11e9fd975b1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/API_Pane_spec.js @@ -17,7 +17,7 @@ let ee = ObjectsRegistry.EntityExplorer, describe( "Entity explorer API pane related testcases", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { it("1. Empty Message validation for Widgets/API/Queries", function () { homePage.CreateNewWorkspace("EmptyMsgCheck", true); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_1_spec.js index 95c62141598..058193b1279 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_1_spec.js @@ -2,155 +2,161 @@ import adminsSettings from "../../../../locators/AdminsSettings"; import { adminSettings as adminSettingsHelper } from "../../../../support/Objects/ObjectsCore"; -describe("Admin settings page", { tags: ["@tag.IDE"] }, function () { - beforeEach(() => { - cy.intercept("GET", "/api/v1/admin/env", { - body: { responseMeta: { status: 200, success: true }, data: {} }, - }).as("getEnvVariables"); - cy.intercept("PUT", "/api/v1/admin/env", { - body: { responseMeta: { status: 200, success: true }, data: {} }, - }).as("postEnvVariables"); - cy.intercept("PUT", "/api/v1/tenants", { - body: { responseMeta: { status: 200, success: true }, data: {} }, - }).as("postTenantConfig"); - }); - - it("1. should test that settings page is accessible to super user", () => { - cy.LogOut(); - cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); - cy.get(".admin-settings-menu-option").should("be.visible"); - cy.get(".admin-settings-menu-option").click(); - cy.url().should("contain", adminSettingsHelper.routes.GENERAL); - cy.wait("@getEnvVariables"); - }); +describe( + "Admin settings page", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + beforeEach(() => { + cy.intercept("GET", "/api/v1/admin/env", { + body: { responseMeta: { status: 200, success: true }, data: {} }, + }).as("getEnvVariables"); + cy.intercept("PUT", "/api/v1/admin/env", { + body: { responseMeta: { status: 200, success: true }, data: {} }, + }).as("postEnvVariables"); + cy.intercept("PUT", "/api/v1/tenants", { + body: { responseMeta: { status: 200, success: true }, data: {} }, + }).as("postTenantConfig"); + }); - it("2. should test that page header is visible", () => { - cy.get(adminsSettings.appsmithHeader).should("be.visible"); - cy.visit(adminSettingsHelper.routes.DEVELOPER_SETTINGS, { timeout: 60000 }); - cy.url().should("contain", "/developer-settings"); - cy.wait(2000); //page to load properly - cy.get(adminsSettings.appsmithHeader).should("be.visible"); - cy.visit(adminSettingsHelper.routes.GOOGLEAUTH, { timeout: 60000 }); - cy.url().should("contain", "/google-auth"); - cy.wait(2000); //page to load properly - cy.get(adminsSettings.appsmithHeader).should("be.visible"); - }); + it("1. should test that settings page is accessible to super user", () => { + cy.LogOut(); + cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); + cy.get(".admin-settings-menu-option").should("be.visible"); + cy.get(".admin-settings-menu-option").click(); + cy.url().should("contain", adminSettingsHelper.routes.GENERAL); + cy.wait("@getEnvVariables"); + }); - it("3. should test that clicking on logo should redirect to applications page", () => { - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - cy.get(adminsSettings.appsmithHeader).should("be.visible"); - cy.get(adminsSettings.appsmithLogo).should("be.visible"); - cy.get(adminsSettings.appsmithLogo).click(); - cy.url().should("contain", adminSettingsHelper.routes.APPLICATIONS); - }); + it("2. should test that page header is visible", () => { + cy.get(adminsSettings.appsmithHeader).should("be.visible"); + cy.visit(adminSettingsHelper.routes.DEVELOPER_SETTINGS, { + timeout: 60000, + }); + cy.url().should("contain", "/developer-settings"); + cy.wait(2000); //page to load properly + cy.get(adminsSettings.appsmithHeader).should("be.visible"); + cy.visit(adminSettingsHelper.routes.GOOGLEAUTH, { timeout: 60000 }); + cy.url().should("contain", "/google-auth"); + cy.wait(2000); //page to load properly + cy.get(adminsSettings.appsmithHeader).should("be.visible"); + }); - it("4. should test that settings page is redirected to default tab", () => { - cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); - cy.visit(adminSettingsHelper.routes.SETTINGS, { timeout: 60000 }); - cy.url().should("contain", adminSettingsHelper.routes.GENERAL); - }); + it("3. should test that clicking on logo should redirect to applications page", () => { + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + cy.get(adminsSettings.appsmithHeader).should("be.visible"); + cy.get(adminsSettings.appsmithLogo).should("be.visible"); + cy.get(adminsSettings.appsmithLogo).click(); + cy.url().should("contain", adminSettingsHelper.routes.APPLICATIONS); + }); - it( - "airgap", - "5. should test that settings page tab redirects and google maps doesn't exist - airgap", - () => { - cy.visit(adminSettingsHelper.routes.APPLICATIONS, { timeout: 60000 }); - cy.wait(3000); - cy.get(".admin-settings-menu-option").click(); - cy.get(adminsSettings.generalTab).click(); + it("4. should test that settings page is redirected to default tab", () => { + cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); + cy.visit(adminSettingsHelper.routes.SETTINGS, { timeout: 60000 }); cy.url().should("contain", adminSettingsHelper.routes.GENERAL); - cy.get(adminsSettings.advancedTab).click(); - cy.url().should("contain", adminSettingsHelper.routes.ADVANCED); - cy.get(adminsSettings.authenticationTab).click(); - cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION); - cy.get(adminsSettings.emailTab).click(); - cy.get(adminsSettings.developerSettingsTab).should("not.exist"); - cy.url().should("contain", adminSettingsHelper.routes.EMAIL); - cy.get(adminsSettings.versionTab).click(); - cy.url().should("contain", adminSettingsHelper.routes.VERSION); - }, - ); + }); - it("6. should test save and clear buttons disabled state", () => { - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - const assertVisibilityAndDisabledState = () => { + it( + "airgap", + "5. should test that settings page tab redirects and google maps doesn't exist - airgap", + () => { + cy.visit(adminSettingsHelper.routes.APPLICATIONS, { timeout: 60000 }); + cy.wait(3000); + cy.get(".admin-settings-menu-option").click(); + cy.get(adminsSettings.generalTab).click(); + cy.url().should("contain", adminSettingsHelper.routes.GENERAL); + cy.get(adminsSettings.advancedTab).click(); + cy.url().should("contain", adminSettingsHelper.routes.ADVANCED); + cy.get(adminsSettings.authenticationTab).click(); + cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION); + cy.get(adminsSettings.emailTab).click(); + cy.get(adminsSettings.developerSettingsTab).should("not.exist"); + cy.url().should("contain", adminSettingsHelper.routes.EMAIL); + cy.get(adminsSettings.versionTab).click(); + cy.url().should("contain", adminSettingsHelper.routes.VERSION); + }, + ); + + it("6. should test save and clear buttons disabled state", () => { + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + const assertVisibilityAndDisabledState = () => { + cy.get(adminsSettings.saveButton).should("be.visible"); + cy.get(adminsSettings.saveButton).should("be.disabled"); + cy.get(adminsSettings.resetButton).should("be.visible"); + cy.get(adminsSettings.resetButton).should("be.disabled"); + }; + assertVisibilityAndDisabledState(); + cy.get(adminsSettings.instanceName).should("be.visible"); + cy.get(adminsSettings.instanceName).clear().type("AppsmithInstance"); cy.get(adminsSettings.saveButton).should("be.visible"); - cy.get(adminsSettings.saveButton).should("be.disabled"); + cy.get(adminsSettings.saveButton).should("not.be.disabled"); cy.get(adminsSettings.resetButton).should("be.visible"); - cy.get(adminsSettings.resetButton).should("be.disabled"); - }; - assertVisibilityAndDisabledState(); - cy.get(adminsSettings.instanceName).should("be.visible"); - cy.get(adminsSettings.instanceName).clear().type("AppsmithInstance"); - cy.get(adminsSettings.saveButton).should("be.visible"); - cy.get(adminsSettings.saveButton).should("not.be.disabled"); - cy.get(adminsSettings.resetButton).should("be.visible"); - cy.get(adminsSettings.resetButton).should("not.be.disabled"); - cy.get(adminsSettings.resetButton).click(); - assertVisibilityAndDisabledState(); - }); - - it("7. should test saving a setting value", () => { - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - cy.get(adminsSettings.restartNotice).should("not.exist"); - cy.get(adminsSettings.instanceName).should("be.visible"); - let instanceName; - cy.generateUUID().then((uuid) => { - instanceName = uuid; - cy.get(adminsSettings.instanceName).clear().type(uuid); + cy.get(adminsSettings.resetButton).should("not.be.disabled"); + cy.get(adminsSettings.resetButton).click(); + assertVisibilityAndDisabledState(); }); - cy.get(adminsSettings.saveButton).should("be.visible"); - cy.get(adminsSettings.saveButton).should("not.be.disabled"); - cy.get(adminsSettings.saveButton).click(); - cy.wait("@postTenantConfig").then((interception) => { - expect(interception.request.body.instanceName).to.equal(instanceName); - }); - cy.get(adminsSettings.restartNotice).should("not.exist"); - cy.wait(3000); - }); - it("8. should test saving settings value from different tabs", () => { - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - cy.get(adminsSettings.restartNotice).should("not.exist"); - cy.get(adminsSettings.instanceName).should("be.visible"); - let instanceName; - cy.generateUUID().then((uuid) => { - instanceName = uuid; - cy.get(adminsSettings.instanceName).clear().type(uuid); - }); - cy.get(adminsSettings.saveButton).should("be.visible"); - cy.get(adminsSettings.saveButton).should("not.be.disabled"); - cy.get(adminsSettings.emailTab).click(); - cy.get(adminsSettings.saveButton).should("be.visible"); - cy.get(adminsSettings.saveButton).should("not.be.disabled"); - cy.get(adminsSettings.fromAddress).should("be.visible"); - let fromAddress; - cy.generateUUID().then((uuid) => { - fromAddress = uuid; - cy.get(adminsSettings.fromAddress).clear().type(`${uuid}@appsmith.com`); - }); - cy.intercept("POST", "/api/v1/admin/restart", { - body: { responseMeta: { status: 200, success: true }, data: true }, - }); - cy.get(adminsSettings.saveButton).click(); - cy.wait("@postTenantConfig").then((interception) => { - expect(interception.request.body.instanceName).to.equal(instanceName); + it("7. should test saving a setting value", () => { + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + cy.get(adminsSettings.restartNotice).should("not.exist"); + cy.get(adminsSettings.instanceName).should("be.visible"); + let instanceName; + cy.generateUUID().then((uuid) => { + instanceName = uuid; + cy.get(adminsSettings.instanceName).clear().type(uuid); + }); + cy.get(adminsSettings.saveButton).should("be.visible"); + cy.get(adminsSettings.saveButton).should("not.be.disabled"); + cy.get(adminsSettings.saveButton).click(); + cy.wait("@postTenantConfig").then((interception) => { + expect(interception.request.body.instanceName).to.equal(instanceName); + }); + cy.get(adminsSettings.restartNotice).should("not.exist"); + cy.wait(3000); }); - cy.wait("@postEnvVariables").then((interception) => { - expect(interception.request.body.APPSMITH_MAIL_FROM).to.equal( - `${fromAddress}@appsmith.com`, + + it("8. should test saving settings value from different tabs", () => { + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + cy.get(adminsSettings.restartNotice).should("not.exist"); + cy.get(adminsSettings.instanceName).should("be.visible"); + let instanceName; + cy.generateUUID().then((uuid) => { + instanceName = uuid; + cy.get(adminsSettings.instanceName).clear().type(uuid); + }); + cy.get(adminsSettings.saveButton).should("be.visible"); + cy.get(adminsSettings.saveButton).should("not.be.disabled"); + cy.get(adminsSettings.emailTab).click(); + cy.get(adminsSettings.saveButton).should("be.visible"); + cy.get(adminsSettings.saveButton).should("not.be.disabled"); + cy.get(adminsSettings.fromAddress).should("be.visible"); + let fromAddress; + cy.generateUUID().then((uuid) => { + fromAddress = uuid; + cy.get(adminsSettings.fromAddress).clear().type(`${uuid}@appsmith.com`); + }); + cy.intercept("POST", "/api/v1/admin/restart", { + body: { responseMeta: { status: 200, success: true }, data: true }, + }); + cy.get(adminsSettings.saveButton).click(); + cy.wait("@postTenantConfig").then((interception) => { + expect(interception.request.body.instanceName).to.equal(instanceName); + }); + cy.wait("@postEnvVariables").then((interception) => { + expect(interception.request.body.APPSMITH_MAIL_FROM).to.equal( + `${fromAddress}@appsmith.com`, + ); + }); + cy.waitUntil(() => + cy.contains("General", { timeout: 180000 }).should("be.visible"), ); + cy.get(adminsSettings.restartNotice).should("not.exist"); + cy.wait(3000); }); - cy.waitUntil(() => - cy.contains("General", { timeout: 180000 }).should("be.visible"), - ); - cy.get(adminsSettings.restartNotice).should("not.exist"); - cy.wait(3000); - }); - it("9. should test that instance name and admin emails exist on general tab", () => { - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - cy.get(adminsSettings.instanceName).should("be.visible"); - cy.get(adminsSettings.adminEmails).should("be.visible"); - }); -}); + it("9. should test that instance name and admin emails exist on general tab", () => { + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + cy.get(adminsSettings.instanceName).should("be.visible"); + cy.get(adminsSettings.adminEmails).should("be.visible"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_2_spec.js index cc5790f476a..fdc9e5bbfff 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_2_spec.js @@ -6,52 +6,61 @@ const { GOOGLE_MAPS_SETUP_DOC, } = require("../../../../../src/constants/ThirdPartyConstants"); -describe("Admin settings page", { tags: ["@tag.IDE"] }, function () { - it("1. should test that configure link redirects to google maps setup doc", () => { - cy.visit(adminSettingsHelper.routes.DEVELOPER_SETTINGS, { timeout: 60000 }); - cy.get(adminsSettings.readMoreLink).within(() => { - cy.get("a") - .should("have.attr", "target", "_blank") - .invoke("removeAttr", "target") - .click() - .wait(3000); //for page to load fully; - cy.url().should("contain", GOOGLE_MAPS_SETUP_DOC); +describe( + "Admin settings page", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + it("1. should test that configure link redirects to google maps setup doc", () => { + cy.visit(adminSettingsHelper.routes.DEVELOPER_SETTINGS, { + timeout: 60000, + }); + cy.get(adminsSettings.readMoreLink).within(() => { + cy.get("a") + .should("have.attr", "target", "_blank") + .invoke("removeAttr", "target") + .click() + .wait(3000); //for page to load fully; + cy.url().should("contain", GOOGLE_MAPS_SETUP_DOC); + }); }); - }); - it( - "airgap", - "2. should test that authentication page redirects and google and github auth doesn't exist - airgap", - () => { - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - cy.get(adminsSettings.authenticationTab).click(); - cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION); - cy.get(adminsSettings.googleButton).should("not.exist"); - cy.get(adminsSettings.githubButton).should("not.exist"); - cy.get(adminsSettings.formloginButton).click(); - cy.url().should("contain", adminSettingsHelper.routes.FORMLOGIN); - }, - ); + it( + "airgap", + "2. should test that authentication page redirects and google and github auth doesn't exist - airgap", + () => { + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + cy.get(adminsSettings.authenticationTab).click(); + cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION); + cy.get(adminsSettings.googleButton).should("not.exist"); + cy.get(adminsSettings.githubButton).should("not.exist"); + cy.get(adminsSettings.formloginButton).click(); + cy.url().should("contain", adminSettingsHelper.routes.FORMLOGIN); + }, + ); - it( - "airgap", - "5. should test that read more on version is hidden for airgap", - () => { - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - cy.get(adminsSettings.versionTab).click(); - cy.url().should("contain", adminSettingsHelper.routes.VERSION); - cy.get(adminsSettings.readMoreLink).should("not.exist"); - }, - ); + it( + "airgap", + "5. should test that read more on version is hidden for airgap", + () => { + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + cy.get(adminsSettings.versionTab).click(); + cy.url().should("contain", adminSettingsHelper.routes.VERSION); + cy.get(adminsSettings.readMoreLink).should("not.exist"); + }, + ); - it("6. should test that settings page is not accessible to normal users", () => { - cy.LogOut(false); - cy.wait(2000); - cy.LoginFromAPI(Cypress.env("TESTUSERNAME3"), Cypress.env("TESTPASSWORD3")); - cy.get(".admin-settings-menu-option").should("not.exist"); - cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); - // non super users are redirected to home page - cy.url().should("contain", adminSettingsHelper.routes.APPLICATIONS); - cy.LogOut(false); - }); -}); + it("6. should test that settings page is not accessible to normal users", () => { + cy.LogOut(false); + cy.wait(2000); + cy.LoginFromAPI( + Cypress.env("TESTUSERNAME3"), + Cypress.env("TESTPASSWORD3"), + ); + cy.get(".admin-settings-menu-option").should("not.exist"); + cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); + // non super users are redirected to home page + cy.url().should("contain", adminSettingsHelper.routes.APPLICATIONS); + cy.LogOut(false); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_3_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_3_spec.ts index b0f71965592..54fb5955101 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_3_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Admin_settings_3_spec.ts @@ -10,7 +10,7 @@ const { describe( "Admin settings page", - { tags: ["@tag.IDE", "@tag.excludeForAirgap"] }, + { tags: ["@tag.IDE", "@tag.excludeForAirgap", "@tag.PropertyPane"] }, function () { it("1. should test that authentication page redirects", () => { cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Bindings_Widgets_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Bindings_Widgets_spec.ts index 926bfaeee83..f9111b4486a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Bindings_Widgets_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Bindings_Widgets_spec.ts @@ -11,7 +11,7 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Entity explorer tests related to widgets and validation", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/CopyQuery_RenameDatasource_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/CopyQuery_RenameDatasource_spec.js index e38696d6247..535ec4df3c5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/CopyQuery_RenameDatasource_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/CopyQuery_RenameDatasource_spec.js @@ -16,7 +16,7 @@ let datasourceName; describe( "Entity explorer tests related to copy query", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { beforeEach(() => { dataSources.StartDataSourceRoutes(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/DragAndDropWidget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/DragAndDropWidget_spec.js index f8fc4b44385..a0ee177944e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/DragAndDropWidget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/DragAndDropWidget_spec.js @@ -11,7 +11,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Entity explorer Drag and Drop widgets testcases", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { it("1. Drag and drop form widget and validate", function () { cy.get(commonlocators.entityExplorersearch).should("be.visible"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Drag_Drop_Building_Blocks_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Drag_Drop_Building_Blocks_spec.ts index db34cc51dae..2bdeb3c0fb6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Drag_Drop_Building_Blocks_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Drag_Drop_Building_Blocks_spec.ts @@ -19,6 +19,11 @@ describe( "@tag.Widget", "@tag.Templates", "@tag.excludeForAirgap", + "@tag.PropertyPane", + "@tag.Git", + "@tag.ImportExport", + "@tag.Fork", + "@tag.Binding", ], }, () => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Entity_Naming_conflict_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Entity_Naming_conflict_spec.js index 3c6c68c2306..65705fcab66 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Entity_Naming_conflict_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Entity_Naming_conflict_spec.js @@ -7,25 +7,29 @@ const apiwidget = require("../../../../locators/apiWidgetslocator.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("Tab widget test", { tags: ["@tag.IDE"] }, function () { - const apiName = "Table1"; - const tableName = "Table1"; - before(() => { - _.agHelper.AddDsl("basicTabledsl"); - }); +describe( + "Tab widget test", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + const apiName = "Table1"; + const tableName = "Table1"; + before(() => { + _.agHelper.AddDsl("basicTabledsl"); + }); - it("1. Rename API with table widget name validation test", function () { - cy.log("Login Successful"); - cy.CreateApiAndValidateUniqueEntityName(apiName); - cy.get(apiwidget.apiTxt) - .clear() - .type(tableName, { force: true }) - .should("have.value", tableName); - //Rename Table widget with api name validation test - PageLeftPane.switchSegment(PagePaneSegment.UI); - PageLeftPane.assertPresence("Table1"); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - cy.RenameEntity(apiName); - cy.validateMessage(apiName); - }); -}); + it("1. Rename API with table widget name validation test", function () { + cy.log("Login Successful"); + cy.CreateApiAndValidateUniqueEntityName(apiName); + cy.get(apiwidget.apiTxt) + .clear() + .type(tableName, { force: true }) + .should("have.value", tableName); + //Rename Table widget with api name validation test + PageLeftPane.switchSegment(PagePaneSegment.UI); + PageLeftPane.assertPresence("Table1"); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + cy.RenameEntity(apiName); + cy.validateMessage(apiName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Hide_Page_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Hide_Page_spec.js index 90f5ba7b7ac..985faa158df 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Hide_Page_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Hide_Page_spec.js @@ -9,7 +9,7 @@ import { EntityItems } from "../../../../support/Pages/AssertHelper"; describe( "Hide / Show page test functionality", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { it("1. Hide/Show page test ", function () { PageList.AddNewPage(); // Page2 diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts index c6f892cde2f..c132f969099 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/JSEditorContextMenu_Spec.ts @@ -13,7 +13,7 @@ import { EntityItems } from "../../../../support/Pages/AssertHelper"; describe( "Validate basic operations on Entity explorer JSEditor structure", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, () => { const pageId = "Page1"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Long_Name_Tooltip_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Long_Name_Tooltip_spec.js index 1de4d9a46e4..fa2e9654bea 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Long_Name_Tooltip_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Long_Name_Tooltip_spec.js @@ -12,7 +12,7 @@ const alternateName = "AlternateName"; const tooltTipQuery = `.rc-tooltip.ads-v2-tooltip:not(.rc-tooltip-hidden) > .rc-tooltip-content > .rc-tooltip-inner > .ads-v2-text`; describe( "Entity Explorer showing tooltips on long names", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { it("1. Expect tooltip on long names only", function () { // create an API with a short name diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Page_Load_Spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Page_Load_Spec.js index fb68eabeb0c..66286db4200 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Page_Load_Spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Page_Load_Spec.js @@ -11,7 +11,7 @@ import { import PageList from "../../../../support/Pages/PageList"; import { EntityItems } from "../../../../support/Pages/AssertHelper"; -describe("Page Load tests", { tags: ["@tag.IDE"] }, () => { +describe("Page Load tests", { tags: ["@tag.IDE", "@tag.PropertyPane"] }, () => { afterEach(() => { agHelper.SaveLocalStorageCache(); }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js index cf1d77b9dd1..b0189631403 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Pages_spec.js @@ -4,7 +4,7 @@ import EditorNavigation, { } from "../../../../support/Pages/EditorNavigation"; import PageList from "../../../../support/Pages/PageList"; -describe("Pages", { tags: ["@tag.IDE"] }, function () { +describe("Pages", { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { let veryLongPageName = `abcdefghijklmnopqrstuvwxyz1234`; let apiName = "someApi"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Query_Datasource_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Query_Datasource_spec.js index db02a87e71d..70e051f3101 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Query_Datasource_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Query_Datasource_spec.js @@ -17,7 +17,7 @@ let datasourceName; describe( "Entity explorer tests related to query and datasource", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { before(() => { cy.generateUUID().then((uid) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Renaming_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Renaming_spec.js index 95bb8d42253..8df62d3156c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Renaming_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Renaming_spec.js @@ -19,7 +19,7 @@ const secondApiName = "Second"; describe( "Api Naming conflict on a page test", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { it("1. Expects actions on the same page cannot have identical names", function () { // create an API diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Select_Widget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Select_Widget_spec.js index 193f72ce28c..419b2b2c5ac 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Select_Widget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Select_Widget_spec.js @@ -6,94 +6,111 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Explorer hidden widget Selection", { tags: ["@tag.IDE"] }, () => { - before(() => { - _.agHelper.AddDsl("explorerHiddenWidgets"); - }); - afterEach(() => { - cy.get(commonLocators.canvas).click({ force: true }); - }); - it("1. Opens modal when selecting a modal", () => { - EditorNavigation.SelectEntityByName("SimpleModal", EntityType.Widget); +describe( + "Explorer hidden widget Selection", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + () => { + before(() => { + _.agHelper.AddDsl("explorerHiddenWidgets"); + }); + afterEach(() => { + cy.get(commonLocators.canvas).click({ force: true }); + }); + it("1. Opens modal when selecting a modal", () => { + EditorNavigation.SelectEntityByName("SimpleModal", EntityType.Widget); - cy.get(widgetLocators.modalWidget).should("have.length", 1); - cy.get(commonLocators.propertyPaneTitle).should("contain", "SimpleModal"); - cy.get(widgets.modalCloseButton).click({ force: true }); - }); + cy.get(widgetLocators.modalWidget).should("have.length", 1); + cy.get(commonLocators.propertyPaneTitle).should("contain", "SimpleModal"); + cy.get(widgets.modalCloseButton).click({ force: true }); + }); - it("2. Opens modal when selecting a widget inside a modal", () => { - EditorNavigation.SelectEntityByName("Simple_Modal_Text", EntityType.Widget); + it("2. Opens modal when selecting a widget inside a modal", () => { + EditorNavigation.SelectEntityByName( + "Simple_Modal_Text", + EntityType.Widget, + ); - cy.get(widgetLocators.modalWidget).should("have.length", 1); - cy.get(commonLocators.propertyPaneTitle).should( - "contain", - "Simple_Modal_Text", - ); - cy.get(widgets.modalCloseButton).click({ force: true }); - }); + cy.get(widgetLocators.modalWidget).should("have.length", 1); + cy.get(commonLocators.propertyPaneTitle).should( + "contain", + "Simple_Modal_Text", + ); + cy.get(widgets.modalCloseButton).click({ force: true }); + }); - it("3. Switches tabs when selecting a tab", () => { - EditorNavigation.SelectEntityByName( - "UnselectedTab", - EntityType.Widget, - {}, - ["Tabs1"], - ); + it("3. Switches tabs when selecting a tab", () => { + EditorNavigation.SelectEntityByName( + "UnselectedTab", + EntityType.Widget, + {}, + ["Tabs1"], + ); - // Assert correct tab is open - cy.wait(1000); - cy.get(".t--page-switch-tab.is-active").contains("UnselectedTab"); - }); + // Assert correct tab is open + cy.wait(1000); + cy.get(".t--page-switch-tab.is-active").contains("UnselectedTab"); + }); - it("4. Switches tabs when selecting a widget inside other tab", () => { - EditorNavigation.SelectEntityByName("Button6", EntityType.Widget, {}, [ - "UnselectedTab", - ]); + it("4. Switches tabs when selecting a widget inside other tab", () => { + EditorNavigation.SelectEntityByName("Button6", EntityType.Widget, {}, [ + "UnselectedTab", + ]); - // Assert correct tab is open and button selected - cy.wait(1000); - cy.get(".t--page-switch-tab.is-active").contains("UnselectedTab"); - cy.get(commonLocators.propertyPaneTitle).should("contain", "Button6"); - }); - it("5. Switches tabs with a button inside the tab", () => { - cy.get(".t--page-switch-tab") - .contains("UnselectedTab") - .click({ force: true }); - cy.wait(1000); - cy.get(widgets.buttonWidget).contains("Unselected").click({ force: true }); - // Assert tab is switched - cy.get(".t--page-switch-tab.is-active").should("contain", "InternalTab"); - cy.get(commonLocators.propertyPaneTitle).should("contain", "Button6"); - }); - it("6. Switches tabs when selecting a widget inside hidden tab", () => { - EditorNavigation.SelectEntityByName("Button7", EntityType.Widget, {}, [ - "Tab 3", - ]); + // Assert correct tab is open and button selected + cy.wait(1000); + cy.get(".t--page-switch-tab.is-active").contains("UnselectedTab"); + cy.get(commonLocators.propertyPaneTitle).should("contain", "Button6"); + }); + it("5. Switches tabs with a button inside the tab", () => { + cy.get(".t--page-switch-tab") + .contains("UnselectedTab") + .click({ force: true }); + cy.wait(1000); + cy.get(widgets.buttonWidget) + .contains("Unselected") + .click({ force: true }); + // Assert tab is switched + cy.get(".t--page-switch-tab.is-active").should("contain", "InternalTab"); + cy.get(commonLocators.propertyPaneTitle).should("contain", "Button6"); + }); + it("6. Switches tabs when selecting a widget inside hidden tab", () => { + EditorNavigation.SelectEntityByName("Button7", EntityType.Widget, {}, [ + "Tab 3", + ]); - // Assert button is selected - cy.wait(1000); - cy.get(".t--page-switch-tab.is-active").should("not.exist"); - cy.get(commonLocators.propertyPaneTitle).should("contain", "Button7"); - }); + // Assert button is selected + cy.wait(1000); + cy.get(".t--page-switch-tab.is-active").should("not.exist"); + cy.get(commonLocators.propertyPaneTitle).should("contain", "Button7"); + }); - it("7. Assert the overkill", () => { - EditorNavigation.SelectEntityByName("OverKillText", EntityType.Widget, {}, [ - "Overkill_Modal", - "Tabs2", - "Tab 2", - "Tabs3", - "Canvas9", - "Tabs4", - "Canvas11", - "Tabs5", - "Canvas13", - ]); + it("7. Assert the overkill", () => { + EditorNavigation.SelectEntityByName( + "OverKillText", + EntityType.Widget, + {}, + [ + "Overkill_Modal", + "Tabs2", + "Tab 2", + "Tabs3", + "Canvas9", + "Tabs4", + "Canvas11", + "Tabs5", + "Canvas13", + ], + ); - // Assert that widget is seen - cy.get(commonLocators.propertyPaneTitle).should("contain", "OverKillText"); - cy.get(`div[data-testid='t--selected']`) - .should("have.length", 1) - .should("have.class", "t--draggable-textwidget") - .contains("Overkill Widget"); - }); -}); + // Assert that widget is seen + cy.get(commonLocators.propertyPaneTitle).should( + "contain", + "OverKillText", + ); + cy.get(`div[data-testid='t--selected']`) + .should("have.length", 1) + .should("have.class", "t--draggable-textwidget") + .contains("Overkill Widget"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Tab_rename_Delete_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Tab_rename_Delete_spec.ts index fe76b3118a2..df52ca57622 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Tab_rename_Delete_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Tab_rename_Delete_spec.ts @@ -9,36 +9,39 @@ import EditorNavigation, { PageLeftPane, } from "../../../../support/Pages/EditorNavigation"; -describe("Tab widget test", { tags: ["@tag.IDE"] }, function () { - const tabname = "UpdatedTab"; - before(() => { - agHelper.AddDsl("tabdsl"); - }); +describe( + "Tab widget test", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + const tabname = "UpdatedTab"; + before(() => { + agHelper.AddDsl("tabdsl"); + }); - it("1. Tab Widget Functionality To rename Tabs from entity explorer", function () { - EditorNavigation.SelectEntityByName("Tabs1", EntityType.Widget); - PageLeftPane.expandCollapseItem("Tabs1"); - entityExplorer.RenameEntityFromExplorer("Tab1", tabname, true); - }); + it("1. Tab Widget Functionality To rename Tabs from entity explorer", function () { + EditorNavigation.SelectEntityByName("Tabs1", EntityType.Widget); + PageLeftPane.expandCollapseItem("Tabs1"); + entityExplorer.RenameEntityFromExplorer("Tab1", tabname, true); + }); - it("2. Tab Widget Functionality To delete Tabs from entity explorer", function () { - EditorNavigation.SelectEntityByName("Tabs1", EntityType.Widget); - PageLeftPane.expandCollapseItem("Tabs1"); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Tab2", - action: "Rename", + it("2. Tab Widget Functionality To delete Tabs from entity explorer", function () { + EditorNavigation.SelectEntityByName("Tabs1", EntityType.Widget); + PageLeftPane.expandCollapseItem("Tabs1"); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "Tab2", + action: "Rename", + }); + agHelper.TypeText(locators._entityNameEditing("Tab2"), tabname); + agHelper.Sleep(2000); + entityExplorer.ValidateDuplicateMessageToolTip(tabname); + cy.get(explorer.editEntity) + .last() + .click() + .type("Tab2" + "{enter}", { force: true }); + entityExplorer.DeleteWidgetFromEntityExplorer(tabname + "Tab2"); }); - agHelper.TypeText(locators._entityNameEditing("Tab2"), tabname); - agHelper.Sleep(2000); - entityExplorer.ValidateDuplicateMessageToolTip(tabname); - cy.get(explorer.editEntity) - .last() - .click() - .type("Tab2" + "{enter}", { force: true }); - entityExplorer.DeleteWidgetFromEntityExplorer(tabname + "Tab2"); - }); - /* To be enabled once the bug is fixed + /* To be enabled once the bug is fixed it("Publish app and check for the widget name", function() { deployMode.DeployApp(); cy.get(publish.tabWidget) @@ -61,7 +64,8 @@ deployMode.NavigateBacktoEditor(); .should("not.be.visible"); }); */ -}); + }, +); afterEach(() => { // put your clean up code if any diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js index 9c8d981cda5..ac48486220e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Delete_Undo_spec.js @@ -17,7 +17,7 @@ before(() => { describe( "Test Suite to validate copy/delete/undo functionalites", - { tags: ["@tag.IDE", "@tag.Sanity"] }, + { tags: ["@tag.IDE", "@tag.Sanity", "@tag.PropertyPane"] }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js index dab2b9f5b08..350e4b00856 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Copy_Paste_Delete_Undo_Keyboard_Event_spec.js @@ -16,7 +16,7 @@ before(() => { describe( "Test Suite to validate copy/delete/undo functionalites", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { it("1. Drag and drop form widget and validate copy widget via toast message", function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_spec.js index c08e88e2ca3..552b50ca072 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Entity explorer tests related to widgets and validation", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { before(() => { _.agHelper.AddDsl("displayWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts index 1ff3847aa8d..34d2bd4c166 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkAppWithMultipleDS_Spec.ts @@ -9,7 +9,9 @@ let targetWorkspaceId: string; describe( "Fork application with multiple datasources", - { tags: ["@tag.Fork"] }, + { + tags: ["@tag.Fork", "@tag.Datasource", "@tag.Git", "@tag.Table", "@tag.JS"], + }, function () { it("1. Bug Id: 24708 - fork and test the forked application", function () { // Create a new workspace and fork application diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationInDeployedMode_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationInDeployedMode_spec.ts index 9de8b3ef168..637d705ec7e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationInDeployedMode_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationInDeployedMode_spec.ts @@ -8,7 +8,9 @@ import applicationLocators from "../../../../locators/Applications.json"; describe( "Fork application in deployed mode", - { tags: ["@tag.Fork"] }, + { + tags: ["@tag.Fork", "@tag.Datasource", "@tag.Git", "@tag.Table", "@tag.JS"], + }, function () { it("1. Fork modal should open and close", function () { appSettings.OpenAppSettings(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts index 3495f3942d8..9b3d2056ac4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationReconnectModal_spec.ts @@ -8,7 +8,16 @@ let currentWorkspace: string, currentAppName: string, forkWorkspaceName: string; describe( "Fork application across workspaces", - { tags: ["@tag.Fork", "@tag.Sanity"] }, + { + tags: [ + "@tag.Fork", + "@tag.Sanity", + "@tag.Datasource", + "@tag.Git", + "@tag.Table", + "@tag.JS", + ], + }, function () { it("Bug 24702: Signed user should be able to fork a public forkable app & Check if the forked application has the same dsl as the original", function () { // Create new workspace to create App in diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationWithinAppEditor_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationWithinAppEditor_spec.ts index 0f45c14af7b..bcef1ac1fa4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationWithinAppEditor_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplicationWithinAppEditor_spec.ts @@ -5,7 +5,9 @@ import EditorNavigation, { describe( "Fork application across workspaces", - { tags: ["@tag.Fork"] }, + { + tags: ["@tag.Fork", "@tag.Datasource", "@tag.Git", "@tag.Table", "@tag.JS"], + }, function () { before(() => { _.agHelper.AddDsl("basicDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts index 8a2bfbebb65..a4612d360b9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Fork/ForkApplication_spec.ts @@ -25,7 +25,9 @@ let forkableAppUrl: any; describe( "Fork application across workspaces", - { tags: ["@tag.Fork"] }, + { + tags: ["@tag.Fork", "@tag.Datasource", "@tag.Git", "@tag.Table", "@tag.JS"], + }, function () { it("1. Mark application as forkable", () => { cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts index 0c101ae1460..909105a7603 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/ExistingApps/v1.9.24/DSCrudAndBindings_Spec.ts @@ -13,7 +13,20 @@ import PageList from "../../../../../../support/Pages/PageList"; describe( "Import and validate older app (app created in older versions of Appsmith) from Gitea", - { tags: ["@tag.Git", "@tag.Sanity", "@tag.TedMigration"] }, + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.TedMigration", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { let appRepoName = "TED-migration-test-1", appName = "UpgradeAppToLatestVersion", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts index c55b51711ce..fc6e6ff070b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts @@ -16,6 +16,13 @@ describe( "@tag.GitAutocommit", "@tag.Sanity", "@tag.TedMigration", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", ], }, function () { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js index fd1877ce5c2..2a2a4818b92 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js @@ -19,7 +19,19 @@ import PageList from "../../../../../support/Pages/PageList"; describe( "Git discard changes:", - { tags: ["@tag.Git", "@tag.Sanity"] }, + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { let datasourceName; let repoName; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js index 0c64032af71..118bcb335e3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/GitImport_spec.js @@ -23,7 +23,19 @@ import PageList from "../../../../../support/Pages/PageList"; describe( "Git import flow ", - { tags: ["@tag.Git", "@tag.Sanity"] }, + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { it("1. Import an app from JSON with Postgres, MySQL, Mongo db & then connect it to Git", () => { homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/ImportEmptyRepo_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/ImportEmptyRepo_spec.js index 50ba0fb3a34..04b1d6c6555 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/ImportEmptyRepo_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitImport/ImportEmptyRepo_spec.js @@ -2,39 +2,54 @@ import homePage from "../../../../../locators/HomePage"; import gitSyncLocators from "../../../../../locators/gitSyncLocators"; import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Git import empty repository", { tags: ["@tag.Git"] }, function () { - let repoName; - const assertConnectFailure = true; - const failureMessage = - "git import failed. \nDetails: Cannot import app from an empty repo"; - before(() => { - _.homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); - }); - cy.generateUUID().then((uid) => { - repoName = uid; - _.gitSync.CreateTestGiteaRepo(repoName); +describe( + "Git import empty repository", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + let repoName; + const assertConnectFailure = true; + const failureMessage = + "git import failed. \nDetails: Cannot import app from an empty repo"; + before(() => { + _.homePage.NavigateToHome(); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); + }); + cy.generateUUID().then((uid) => { + repoName = uid; + _.gitSync.CreateTestGiteaRepo(repoName); + }); }); - }); - it("1. Bug #12749 Git Import - Empty Repo NullPointerException", () => { - cy.generateUUID().then((uid) => { - repoName = uid; - _.gitSync.CreateTestGiteaRepo(repoName); - _.gitSync.ImportAppFromGit(undefined, repoName, false); - cy.wait("@importFromGit").then((interception) => { - const status = interception.response.body.responseMeta.status; - const message = interception.response.body.responseMeta.error.message; - expect(status).to.be.gte(400); - expect(message).to.contain(failureMessage); - cy.get(gitSyncLocators.closeGitSyncModal).click(); + it("1. Bug #12749 Git Import - Empty Repo NullPointerException", () => { + cy.generateUUID().then((uid) => { + repoName = uid; + _.gitSync.CreateTestGiteaRepo(repoName); + _.gitSync.ImportAppFromGit(undefined, repoName, false); + cy.wait("@importFromGit").then((interception) => { + const status = interception.response.body.responseMeta.status; + const message = interception.response.body.responseMeta.error.message; + expect(status).to.be.gte(400); + expect(message).to.contain(failureMessage); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + }); }); }); - }); - after(() => { - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js index f1259df417d..69ebc80ffda 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DeleteBranch_spec.js @@ -7,112 +7,128 @@ import { } from "../../../../../support/Pages/EditorNavigation"; let repoName, branchName; -describe("Delete branch flow", { tags: ["@tag.Git", "@tag.Sanity"] }, () => { - it("1. Connect app to git, create new branch and delete it", () => { - // create git repo and connect app to git - gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; +describe( + "Delete branch flow", + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + () => { + it("1. Connect app to git, create new branch and delete it", () => { + // create git repo and connect app to git + gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); + gitSync.CreateGitBranch(); + //cy.createGitBranch(branchName); + cy.wait(1000); + // verify can not delete the checked out branch + DeleteBranchFromUI(1); + cy.get("@gitbranchName").then((branName) => { + branchName = branName; + agHelper.ValidateToastMessage( + `Cannot delete checked out branch. Please check out other branch before deleting ${branchName}.`, + ); + cy.get(gitSyncLocators.closeBranchList).click({ force: true }); + // switch to master and delete new branch created + cy.switchGitBranch("master"); + cy.wait(2000); + + DeleteBranchFromUI(1); + cy.wait("@deleteBranch").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.get(gitSyncLocators.closeBranchList).click({ force: true }); + // verify remote branch is there for the deleted local branch + cy.wait(2000); + cy.switchGitBranch(`origin/${branchName}`); + cy.wait(2000); + }); }); - gitSync.CreateGitBranch(); - //cy.createGitBranch(branchName); - cy.wait(1000); - // verify can not delete the checked out branch - DeleteBranchFromUI(1); - cy.get("@gitbranchName").then((branName) => { - branchName = branName; - agHelper.ValidateToastMessage( - `Cannot delete checked out branch. Please check out other branch before deleting ${branchName}.`, - ); - cy.get(gitSyncLocators.closeBranchList).click({ force: true }); - // switch to master and delete new branch created + + it("2. Create child branch, merge data from child branch, delete child branch verify the data should reflect in master ", () => { + cy.switchGitBranch("master"); + gitSync.CreateGitBranch("", true); + cy.wait(1000); + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.dragAndDropToCanvas("checkboxwidget", { x: 100, y: 200 }); + cy.get(".t--draggable-checkboxwidget").should("exist"); + cy.wait(2000); + cy.commitAndPush(); + cy.merge("master"); + gitSync.CloseGitSyncModal(); cy.switchGitBranch("master"); cy.wait(2000); DeleteBranchFromUI(1); + cy.wait("@deleteBranch").should( "have.nested.property", "response.body.responseMeta.status", 200, ); cy.get(gitSyncLocators.closeBranchList).click({ force: true }); - // verify remote branch is there for the deleted local branch - cy.wait(2000); - cy.switchGitBranch(`origin/${branchName}`); - cy.wait(2000); + cy.get(".t--draggable-checkboxwidget").should("be.visible"); }); - }); - - it("2. Create child branch, merge data from child branch, delete child branch verify the data should reflect in master ", () => { - cy.switchGitBranch("master"); - gitSync.CreateGitBranch("", true); - cy.wait(1000); - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.dragAndDropToCanvas("checkboxwidget", { x: 100, y: 200 }); - cy.get(".t--draggable-checkboxwidget").should("exist"); - cy.wait(2000); - cy.commitAndPush(); - cy.merge("master"); - gitSync.CloseGitSyncModal(); - cy.switchGitBranch("master"); - cy.wait(2000); - - DeleteBranchFromUI(1); - - cy.wait("@deleteBranch").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.get(gitSyncLocators.closeBranchList).click({ force: true }); - cy.get(".t--draggable-checkboxwidget").should("be.visible"); - }); - it("3. Create new branch, commit data in that branch , delete the branch, verify data should not reflect in master ", () => { - gitSync.CreateGitBranch("", true); - cy.wait(1000); - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.dragAndDropToCanvas("chartwidget", { x: 210, y: 300 }); - cy.get(".t--widget-chartwidget").should("exist"); - cy.wait(2000); - cy.commitAndPush(); - cy.wait(1000); - cy.switchGitBranch("master"); - cy.wait(3000); + it("3. Create new branch, commit data in that branch , delete the branch, verify data should not reflect in master ", () => { + gitSync.CreateGitBranch("", true); + cy.wait(1000); + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.dragAndDropToCanvas("chartwidget", { x: 210, y: 300 }); + cy.get(".t--widget-chartwidget").should("exist"); + cy.wait(2000); + cy.commitAndPush(); + cy.wait(1000); + cy.switchGitBranch("master"); + cy.wait(3000); - DeleteBranchFromUI(1); + DeleteBranchFromUI(1); - cy.wait("@deleteBranch").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.get(".--widget-chartwidget").should("not.exist"); - cy.get(gitSyncLocators.closeBranchList).click({ force: true }); - }); + cy.wait("@deleteBranch").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.get(".--widget-chartwidget").should("not.exist"); + cy.get(gitSyncLocators.closeBranchList).click({ force: true }); + }); - it("4. Verify Default branch deletion not allowed ", () => { - agHelper.Sleep(2000); //for toasts to appear then wait for disappear - agHelper.WaitUntilAllToastsDisappear(); - DeleteBranchFromUI(0); - cy.get(gitSyncLocators.closeBranchList).click({ force: true }); - agHelper.ValidateToastMessage("Cannot delete default branch: master"); - }); + it("4. Verify Default branch deletion not allowed ", () => { + agHelper.Sleep(2000); //for toasts to appear then wait for disappear + agHelper.WaitUntilAllToastsDisappear(); + DeleteBranchFromUI(0); + cy.get(gitSyncLocators.closeBranchList).click({ force: true }); + agHelper.ValidateToastMessage("Cannot delete default branch: master"); + }); - function DeleteBranchFromUI(index = 1) { - cy.get(gitSyncLocators.branchButton).click(); - cy.get(gitSyncLocators.branchListItem) - .eq(index) - .trigger("mouseenter") - .wait(1000); - cy.get(gitSyncLocators.gitBranchContextMenu).click({ force: true }); - cy.xpath("//div[@role='menu']//span[text()='Delete']") - .should("be.visible") - .click({ force: true }); - } + function DeleteBranchFromUI(index = 1) { + cy.get(gitSyncLocators.branchButton).click(); + cy.get(gitSyncLocators.branchListItem) + .eq(index) + .trigger("mouseenter") + .wait(1000); + cy.get(gitSyncLocators.gitBranchContextMenu).click({ force: true }); + cy.xpath("//div[@role='menu']//span[text()='Delete']") + .should("be.visible") + .click({ force: true }); + } - after(() => { - //clean up - gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + //clean up + gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js index e2d3411a371..ed78013ecc0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Deploy_spec.js @@ -5,7 +5,19 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; let repoName; describe( "Git sync modal: deploy tab", - { tags: ["@tag.Git", "@tag.Sanity"] }, + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { before(() => { _.homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DisconnectGit_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DisconnectGit_spec.js index 1b69edeef30..77855eef72c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DisconnectGit_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/DisconnectGit_spec.js @@ -3,113 +3,130 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; let repoName; let windowOpenSpy; -describe("Git disconnect modal:", { tags: ["@tag.Git"] }, function () { - before(() => { - _.homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); +describe( + "Git disconnect modal:", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + before(() => { + _.homePage.NavigateToHome(); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); + }); }); - }); - it("1. should be opened with proper components", function () { - cy.generateUUID().then((uid) => { - _.gitSync.CreateNConnectToGit(uid); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + it("1. should be opened with proper components", function () { + cy.generateUUID().then((uid) => { + _.gitSync.CreateNConnectToGit(uid); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); }); - }); - cy.get(_.gitSync._bottomSettingsBtn).click(); - cy.get(_.gitSync._settingsTabGeneral).click(); - // after clicked disconnect on connection modal, - // it should be closed and disconnect modal should be opened - cy.get(_.gitSync._disconnectGitBtn).click(); - cy.get(gitSyncLocators.gitSyncModal).should("not.exist"); - cy.get(gitSyncLocators.disconnectGitModal).should("exist"); + cy.get(_.gitSync._bottomSettingsBtn).click(); + cy.get(_.gitSync._settingsTabGeneral).click(); + // after clicked disconnect on connection modal, + // it should be closed and disconnect modal should be opened + cy.get(_.gitSync._disconnectGitBtn).click(); + cy.get(gitSyncLocators.gitSyncModal).should("not.exist"); + cy.get(gitSyncLocators.disconnectGitModal).should("exist"); - cy.get(gitSyncLocators.disconnectGitModal).contains( - Cypress.env("MESSAGES").NONE_REVERSIBLE_MESSAGE(), - ); + cy.get(gitSyncLocators.disconnectGitModal).contains( + Cypress.env("MESSAGES").NONE_REVERSIBLE_MESSAGE(), + ); - // Stubbing window.open - cy.window().then((window) => { - windowOpenSpy = cy.stub(window, "open").callsFake((url) => { - expect(url.startsWith("https://docs.appsmith.com/")).to.be.true; - windowOpenSpy.restore(); + // Stubbing window.open + cy.window().then((window) => { + windowOpenSpy = cy.stub(window, "open").callsFake((url) => { + expect(url.startsWith("https://docs.appsmith.com/")).to.be.true; + windowOpenSpy.restore(); + }); }); - }); - cy.get(gitSyncLocators.disconnectLearnMoreLink).click(); + cy.get(gitSyncLocators.disconnectLearnMoreLink).click(); - cy.window() - .its("store") - .invoke("getState") - .then((state) => { - const { name } = state.ui.gitSync.disconnectingGitApp; - cy.get(gitSyncLocators.disconnectGitModal).contains( - Cypress.env("MESSAGES").GIT_REVOKE_ACCESS(name), - ); - cy.get(gitSyncLocators.disconnectGitModal).contains( - Cypress.env("MESSAGES").GIT_TYPE_REPO_NAME_FOR_REVOKING_ACCESS(name), - ); - }); + cy.window() + .its("store") + .invoke("getState") + .then((state) => { + const { name } = state.ui.gitSync.disconnectingGitApp; + cy.get(gitSyncLocators.disconnectGitModal).contains( + Cypress.env("MESSAGES").GIT_REVOKE_ACCESS(name), + ); + cy.get(gitSyncLocators.disconnectGitModal).contains( + Cypress.env("MESSAGES").GIT_TYPE_REPO_NAME_FOR_REVOKING_ACCESS( + name, + ), + ); + }); - // disconnect button should be disabled - cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); - cy.get(gitSyncLocators.closeDisconnectModal).click(); - cy.wait(2000); - }); + // disconnect button should be disabled + cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); + cy.get(gitSyncLocators.closeDisconnectModal).click(); + cy.wait(2000); + }); - it("2. should have disconnect repo button", function () { - cy.get(_.gitSync._bottomSettingsBtn).click(); - cy.get(_.gitSync._settingsTabGeneral).click(); + it("2. should have disconnect repo button", function () { + cy.get(_.gitSync._bottomSettingsBtn).click(); + cy.get(_.gitSync._settingsTabGeneral).click(); - // after clicked disconnect on connection modal, - // it should be closed and disconnect modal should be opened - cy.get(_.gitSync._disconnectGitBtn).click(); - cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); + // after clicked disconnect on connection modal, + // it should be closed and disconnect modal should be opened + cy.get(_.gitSync._disconnectGitBtn).click(); + cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); - cy.get(gitSyncLocators.disconnectAppNameInput).type( - `{selectAll}${repoName}`, - ); - cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); + cy.get(gitSyncLocators.disconnectAppNameInput).type( + `{selectAll}${repoName}`, + ); + cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); - cy.window() - .its("store") - .invoke("getState") - .then((state) => { - const { name } = state.ui.gitSync.disconnectingGitApp; - cy.get(gitSyncLocators.disconnectAppNameInput).type( - `{selectAll}${name}`, - ); - cy.get(gitSyncLocators.disconnectButton).should("be.enabled"); - }); + cy.window() + .its("store") + .invoke("getState") + .then((state) => { + const { name } = state.ui.gitSync.disconnectingGitApp; + cy.get(gitSyncLocators.disconnectAppNameInput).type( + `{selectAll}${name}`, + ); + cy.get(gitSyncLocators.disconnectButton).should("be.enabled"); + }); - // disconnecting validation - cy.intercept("POST", "api/v1/git/disconnect/app/*").as("disconnect"); - cy.get(gitSyncLocators.disconnectButton).click(); - cy.wait(3000); - //cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); - cy.wait("@disconnect").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); + // disconnecting validation + cy.intercept("POST", "api/v1/git/disconnect/app/*").as("disconnect"); + cy.get(gitSyncLocators.disconnectButton).click(); + cy.wait(3000); + //cy.get(gitSyncLocators.disconnectButton).should("be.disabled"); + cy.wait("@disconnect").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); - // validation store after disconnected - cy.window() - .its("store") - .invoke("getState") - .then((state) => { - const { id, name } = state.ui.gitSync.disconnectingGitApp; - expect(name).to.eq(""); - expect(id).to.eq(""); - }); + // validation store after disconnected + cy.window() + .its("store") + .invoke("getState") + .then((state) => { + const { id, name } = state.ui.gitSync.disconnectingGitApp; + expect(name).to.eq(""); + expect(id).to.eq(""); + }); - cy.get(gitSyncLocators.disconnectGitModal).should("not.exist"); - }); + cy.get(gitSyncLocators.disconnectGitModal).should("not.exist"); + }); - after(() => { - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitBranchProtect_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitBranchProtect_spec.ts index 6a27f57bb7b..5864a921501 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitBranchProtect_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitBranchProtect_spec.ts @@ -7,55 +7,70 @@ import { let guid: any; let repoName: any; -describe("Git Branch Protection", { tags: ["@tag.Git"] }, function () { - it("Issue 28056 - 2 : Check if protection is enabled when feature flag is enabled", function () { - _.agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - guid = uid; - const wsName = "GitBranchProtect-2" + uid; - const appName = "GitBranchProtect-2" + uid; - _.homePage.CreateNewWorkspace(wsName, true); - _.homePage.CreateAppInWorkspace(wsName, appName); - _.gitSync.CreateNConnectToGit("repoprotect", true, true); - cy.wait(1000); +describe( + "Git Branch Protection", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + it("Issue 28056 - 2 : Check if protection is enabled when feature flag is enabled", function () { + _.agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + guid = uid; + const wsName = "GitBranchProtect-2" + uid; + const appName = "GitBranchProtect-2" + uid; + _.homePage.CreateNewWorkspace(wsName, true); + _.homePage.CreateAppInWorkspace(wsName, appName); + _.gitSync.CreateNConnectToGit("repoprotect", true, true); + cy.wait(1000); - cy.intercept({ - method: "POST", - url: /\/api\/v1\/git\/branch\/app\/.*\/protected/, - }).as("gitProtectApi"); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; - _.gitSync.OpenGitSettingsModal(); - _.agHelper.GetNClick(_.gitSync._settingsTabBranch); - _.agHelper.GetNClick(_.gitSync._protectedBranchesSelect); - _.agHelper.GetNClick( - `${_.gitSync._protectedBranchesSelect} .rc-select-item`, - 0, - ); - _.agHelper.GetNClick(_.gitSync._branchProtectionUpdateBtn); - cy.wait("@gitProtectApi").then((res1) => { - _.agHelper.GetNClick(_.gitSync._closeGitSettingsModal); - expect(res1.response).to.have.property("statusCode", 200); - _.agHelper.AssertElementAbsence(AppSidebar.locators.sidebar); - _.agHelper.AssertElementVisibility( - PageLeftPane.locators.selector, - false, - ); - _.agHelper.AssertElementVisibility( - _.propPane._propertyPaneSidebar, - false, - ); - _.agHelper.AssertElementEnabledDisabled( - _.gitSync._bottomBarCommit, + cy.intercept({ + method: "POST", + url: /\/api\/v1\/git\/branch\/app\/.*\/protected/, + }).as("gitProtectApi"); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + _.gitSync.OpenGitSettingsModal(); + _.agHelper.GetNClick(_.gitSync._settingsTabBranch); + _.agHelper.GetNClick(_.gitSync._protectedBranchesSelect); + _.agHelper.GetNClick( + `${_.gitSync._protectedBranchesSelect} .rc-select-item`, 0, - true, ); + _.agHelper.GetNClick(_.gitSync._branchProtectionUpdateBtn); + cy.wait("@gitProtectApi").then((res1) => { + _.agHelper.GetNClick(_.gitSync._closeGitSettingsModal); + expect(res1.response).to.have.property("statusCode", 200); + _.agHelper.AssertElementAbsence(AppSidebar.locators.sidebar); + _.agHelper.AssertElementVisibility( + PageLeftPane.locators.selector, + false, + ); + _.agHelper.AssertElementVisibility( + _.propPane._propertyPaneSidebar, + false, + ); + _.agHelper.AssertElementEnabledDisabled( + _.gitSync._bottomBarCommit, + 0, + true, + ); + }); }); }); }); - }); - after(() => { - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts index c157464dbe0..64da08fe67d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitConnectV2_spec.ts @@ -9,45 +9,65 @@ let app1Name: string; let repoName: any; let branchName: any; -describe("Git Connect V2", { tags: ["@tag.Git", "@tag.Sanity"] }, function () { - before(() => { - _.agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - ws1Name = "GCV2-1" + uid; - ws2Name = "GCV2-2" + uid; - app1Name = "GCV2" + uid; - _.homePage.CreateNewWorkspace(ws1Name, true); - _.homePage.CreateNewWorkspace(ws2Name, true); - _.homePage.SelectWorkspace(ws1Name); - _.homePage.CreateAppInWorkspace(ws1Name, app1Name); +describe( + "Git Connect V2", + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + before(() => { + _.agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + ws1Name = "GCV2-1" + uid; + ws2Name = "GCV2-2" + uid; + app1Name = "GCV2" + uid; + _.homePage.CreateNewWorkspace(ws1Name, true); + _.homePage.CreateNewWorkspace(ws2Name, true); + _.homePage.SelectWorkspace(ws1Name); + _.homePage.CreateAppInWorkspace(ws1Name, app1Name); + }); }); - }); - it("Testing connect to git flow - V2", function () { - _.gitSync.CreateNConnectToGit(); + it("Testing connect to git flow - V2", function () { + _.gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); }); - }); - it("Testing import via git flow - V2", function () { - _.gitSync.CreateGitBranch("test", true); - cy.get("@gitbranchName").then((bName) => { - branchName = bName; - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 300, 300); - _.propPane.RenameWidget("Text1", "MyText"); - _.propPane.UpdatePropertyFieldValue("Text", "Hello World"); - _.gitSync.CommitAndPush(); + it("Testing import via git flow - V2", function () { + _.gitSync.CreateGitBranch("test", true); + cy.get("@gitbranchName").then((bName) => { + branchName = bName; + _.entityExplorer.DragDropWidgetNVerify( + _.draggableWidgets.TEXT, + 300, + 300, + ); + _.propPane.RenameWidget("Text1", "MyText"); + _.propPane.UpdatePropertyFieldValue("Text", "Hello World"); + _.gitSync.CommitAndPush(); - _.gitSync.ImportAppFromGit(ws2Name, repoName); - _.gitSync.SwitchGitBranch(branchName); - EditorNavigation.SelectEntityByName("MyText", EntityType.Widget); - _.propPane.ValidatePropertyFieldValue("Text", "Hello World"); + _.gitSync.ImportAppFromGit(ws2Name, repoName); + _.gitSync.SwitchGitBranch(branchName); + EditorNavigation.SelectEntityByName("MyText", EntityType.Widget); + _.propPane.ValidatePropertyFieldValue("Text", "Hello World"); + }); }); - }); - after(() => { - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitStatusLite_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitStatusLite_spec.ts index ced7d8b756b..480b0696f6a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitStatusLite_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitStatusLite_spec.ts @@ -4,39 +4,54 @@ let wsName: string; let appName: string; let repoName: any; -describe("Git Connect V2", { tags: ["@tag.Git"] }, function () { - before(() => { - _.agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - wsName = "GitStatusLite" + uid; - appName = "GitStatusLite" + uid; - _.homePage.CreateNewWorkspace(wsName, true); - _.homePage.CreateAppInWorkspace(wsName, appName); - _.gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; +describe( + "Git Connect V2", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + before(() => { + _.agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + wsName = "GitStatusLite" + uid; + appName = "GitStatusLite" + uid; + _.homePage.CreateNewWorkspace(wsName, true); + _.homePage.CreateAppInWorkspace(wsName, appName); + _.gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); }); }); - }); - it("Issue 26038 : No simultaneous git status and remote compare api calls on commit modal", function () { - cy.wait(1000); + it("Issue 26038 : No simultaneous git status and remote compare api calls on commit modal", function () { + cy.wait(1000); - cy.intercept({ - method: "GET", - url: "/api/v1/git/status/app/**", - query: { compareRemote: "true" }, - }).as("gitStatusApi"); + cy.intercept({ + method: "GET", + url: "/api/v1/git/status/app/**", + query: { compareRemote: "true" }, + }).as("gitStatusApi"); - _.agHelper.GetNClick(_.locators._publishButton); + _.agHelper.GetNClick(_.locators._publishButton); - cy.wait("@gitStatusApi").then((res1) => { - expect(res1.response).to.have.property("statusCode", 200); - _.agHelper.GetNClick(_.locators._dialogCloseButton); + cy.wait("@gitStatusApi").then((res1) => { + expect(res1.response).to.have.property("statusCode", 200); + _.agHelper.GetNClick(_.locators._dialogCloseButton); + }); }); - }); - after(() => { - _.gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + _.gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js index e803036ac36..03717e87189 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncGitBugs_spec.js @@ -27,7 +27,19 @@ let repoName; describe( "Git sync Bug #10773", - { tags: ["@tag.Git", "@tag.Sanity"] }, + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js index fbabcd599f0..e3d4b01a7ad 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/GitSyncedApps_spec.js @@ -41,408 +41,427 @@ const mainBranch = "master"; let datasourceName; let repoName; -describe("Git sync apps", { tags: ["@tag.Git"] }, function () { - it("1. Generate postgreSQL crud page , connect to git, clone the page, rename page with special character in it", () => { - homePage.NavigateToHome(); - homePage.CreateNewApplication(); +describe( + "Git sync apps", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + it("1. Generate postgreSQL crud page , connect to git, clone the page, rename page with special character in it", () => { + homePage.NavigateToHome(); + homePage.CreateNewApplication(); + + // create New App and generate Postgres CRUD page + PageList.AddNewPage("Generate page with data"); + //cy.get(generatePage.generateCRUDPageActionCard).click(); + + cy.get(generatePage.selectDatasourceDropdown).click(); + + cy.contains("Connect new datasource").click({ force: true }); + + agHelper.GetNClick(datasource.PostgreSQL); + + cy.fillPostgresDatasourceForm(); + + cy.generateUUID().then((UUID) => { + datasourceName = `${UUID}`; + cy.renameDatasource(datasourceName); + }); - // create New App and generate Postgres CRUD page - PageList.AddNewPage("Generate page with data"); - //cy.get(generatePage.generateCRUDPageActionCard).click(); + cy.get(".t--save-datasource").click(); + cy.wait("@saveDatasource").should( + "have.nested.property", + "response.body.responseMeta.status", + 201, + ); - cy.get(generatePage.selectDatasourceDropdown).click(); + cy.wait("@getDatasourceStructure").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); - cy.contains("Connect new datasource").click({ force: true }); + cy.get(generatePage.selectTableDropdown).click(); - agHelper.GetNClick(datasource.PostgreSQL); + cy.get(generatePage.dropdownOption).contains("public.configs").click(); - cy.fillPostgresDatasourceForm(); + // skip optional search column selection. + cy.get(generatePage.generatePageFormSubmitBtn).click(); - cy.generateUUID().then((UUID) => { - datasourceName = `${UUID}`; - cy.renameDatasource(datasourceName); - }); + cy.wait("@replaceLayoutWithCRUDPage").should( + "have.nested.property", + "response.body.responseMeta.status", + 201, + ); + cy.wait("@getActions"); + cy.wait("@postExecute").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); - cy.get(".t--save-datasource").click(); - cy.wait("@saveDatasource").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); - - cy.wait("@getDatasourceStructure").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - - cy.get(generatePage.selectTableDropdown).click(); - - cy.get(generatePage.dropdownOption).contains("public.configs").click(); - - // skip optional search column selection. - cy.get(generatePage.generatePageFormSubmitBtn).click(); - - cy.wait("@replaceLayoutWithCRUDPage").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); - cy.wait("@getActions"); - cy.wait("@postExecute").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - - cy.get("span:contains('Got it')").click(); - - // connect app to git - gitSync.CreateNConnectToGit(repoName); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; - }); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + cy.get("span:contains('Got it')").click(); + + // connect app to git + gitSync.CreateNConnectToGit(repoName); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + // rename page to crud_page + entityExplorer.RenameEntityFromExplorer( + "Page1", + pageName, + false, + EntityItems.Page, + ); + PageList.ClonePage(pageName); + + PageList.ShowList(); + PageLeftPane.assertPresence(`${pageName} Copy`); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); }); - // rename page to crud_page - entityExplorer.RenameEntityFromExplorer( - "Page1", - pageName, - false, - EntityItems.Page, - ); - PageList.ClonePage(pageName); - - PageList.ShowList(); - PageLeftPane.assertPresence(`${pageName} Copy`); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + + it("2. Create api queries from api pane and cURL import , bind it to widget and clone page from page settings", () => { + cy.fixture("datasources").then((datasourceFormData) => { + cy.Createpage(newPage); + EditorNavigation.SelectEntityByName(newPage, EntityType.Page); + + // create a get api call + apiPage.CreateAndFillApi(datasourceFormData["echoApiUrl"], "get_data"); + apiPage.EnterHeader("info", "This is a test"); + apiPage.RunAPI(); + apiPage.ResponseStatusCheck("200 OK"); + // curl import + apiPage.FillCurlNImport( + `curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST '` + + datasourceFormData["echoApiUrl"], + ); + cy.RunAPI(); + apiPage.ResponseStatusCheck("200 OK"); + cy.get("@curlImport").then((response) => { + cy.expect(response.response.body.responseMeta.success).to.eq(true); + cy.get(apiwidget.ApiName) + .invoke("text") + .then((text) => { + const someText = text; + expect(someText).to.equal(response.response.body.data.name); + }); + }); + EditorNavigation.ShowCanvas(); + // bind input widgets to the api calls responses + cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 300 }); + cy.get(".t--widget-inputwidgetv2").should("exist"); + cy.EnableAllCodeEditors(); + cy.get( + `.t--property-control-defaultvalue ${dynamicInputLocators.input}`, + ) + .last() + .click({ force: true }) + .type("{{Api1.data.body.name}}", { + parseSpecialCharSequences: false, + }); + cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 500 }); + propPane.UpdatePropertyFieldValue( + "Default value", + "{{get_data.data.headers.Info}}", + ); + agHelper.WaitUntilToastDisappear( + "will be executed automatically on page load", + ); + // clone the page from page settings + PageList.ClonePage(newPage); + EditorNavigation.SelectEntityByName(newPage, EntityType.Page); + }); }); - }); - it("2. Create api queries from api pane and cURL import , bind it to widget and clone page from page settings", () => { - cy.fixture("datasources").then((datasourceFormData) => { - cy.Createpage(newPage); + it("3. Commit and push changes, validate data binding on all pages in edit and deploy mode on master", () => { + // verfiy data binding on all pages in edit mode + cy.get(widgetsPage.inputWidget).should("be.visible"); + cy.get(widgetsPage.inputWidget) + .first() + .find(widgetsPage.dataclass) + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + cy.get(widgetsPage.inputWidget) + .last() + .find(widgetsPage.dataclass) + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + + PageList.ShowList(); EditorNavigation.SelectEntityByName(newPage, EntityType.Page); + cy.get(widgetsPage.inputWidget) + .first() + .find(widgetsPage.dataclass) + .should("have.value", "morpheus"); + cy.get(widgetsPage.inputWidget) + .last() + .find(widgetsPage.dataclass) + .should("have.value", "This is a test"); + + PageList.ShowList(); + EditorNavigation.SelectEntityByName(pageName, EntityType.Page); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + + PageList.ShowList(); + EditorNavigation.SelectEntityByName(`${pageName} Copy`, EntityType.Page); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + // commit and push the changes + gitSync.CommitAndPush(true); + // verify data binding on all pages in deploy mode + cy.latestDeployPreview(); + agHelper.GetNClickByContains(locators._deployedPage, pageName); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + agHelper.GetNClickByContains(locators._deployedPage, `${pageName} Copy`); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); + agHelper.RefreshPage("getConsolidatedData"); + cy.get(widgetsPage.dataclass) + .first() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + cy.get(widgetsPage.dataclass) + .last() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + cy.get(".t--page-switch-tab") + .contains(`${newPage} Copy`) + .click({ force: true }); + cy.get(widgetsPage.dataclass) + .first() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + cy.get(widgetsPage.dataclass) + .last() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + agHelper.AssertElementLength( + locators._widgetInDeployed(draggableWidgets.INPUT_V2), + 2, + ); + deployMode.NavigateBacktoEditor(); + }); - // create a get api call - apiPage.CreateAndFillApi(datasourceFormData["echoApiUrl"], "get_data"); - apiPage.EnterHeader("info", "This is a test"); - apiPage.RunAPI(); - apiPage.ResponseStatusCheck("200 OK"); - // curl import - apiPage.FillCurlNImport( - `curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST '` + - datasourceFormData["echoApiUrl"], + it("4. Create a new branch tempBranch, add jsObject and datasource query, move them to new page i.e. Child_Page and bind to widgets", () => { + gitSync.CreateGitBranch(tempBranch, true); + cy.get("@gitbranchName").then((branName) => { + tempBranch = branName; + }); + // create jsObject and rename it + EditorNavigation.SelectEntityByName(`${newPage} Copy`, EntityType.Page); + + jsEditor.CreateJSObject('return "Success";'); + // create postgres select query + dataSources.CreateQueryForDS( + datasourceName, + "SELECT * FROM users ORDER BY id LIMIT 10;", + "get_users", ); - cy.RunAPI(); - apiPage.ResponseStatusCheck("200 OK"); - cy.get("@curlImport").then((response) => { - cy.expect(response.response.body.responseMeta.success).to.eq(true); - cy.get(apiwidget.ApiName) - .invoke("text") - .then((text) => { - const someText = text; - expect(someText).to.equal(response.response.body.data.name); - }); + dataSources.RunQuery(); + // create a new page + cy.Createpage("Child_Page"); + EditorNavigation.SelectEntityByName(`${newPage} Copy`, EntityType.Page); + EditorNavigation.SelectEntityByName("get_users", EntityType.Query); + agHelper.ActionContextMenuWithInPane({ + action: "Move to page", + subAction: "Child_Page", + toastToValidate: "moved to page", + }); + agHelper.WaitUntilAllToastsDisappear(); + dataSources.RunQuery(); + EditorNavigation.SelectEntityByName(`${newPage} Copy`, EntityType.Page); + EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "JSObject1", + action: "Move to page", + subAction: "Child_Page", + toastToValidate: "moved to page", }); - EditorNavigation.ShowCanvas(); - // bind input widgets to the api calls responses + agHelper.WaitUntilAllToastsDisappear(); + // bind input widgets to the jsObject and query response cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 300 }); cy.get(".t--widget-inputwidgetv2").should("exist"); cy.EnableAllCodeEditors(); cy.get(`.t--property-control-defaultvalue ${dynamicInputLocators.input}`) .last() .click({ force: true }) - .type("{{Api1.data.body.name}}", { parseSpecialCharSequences: false }); + .type("{{JSObject1.myFun1()}}", { parseSpecialCharSequences: false }); cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 500 }); + cy.get(".t--widget-inputwidgetv2").should("exist"); propPane.UpdatePropertyFieldValue( "Default value", - "{{get_data.data.headers.Info}}", - ); - agHelper.WaitUntilToastDisappear( - "will be executed automatically on page load", + "{{get_users.data[0].name}}", ); - // clone the page from page settings - PageList.ClonePage(newPage); - EditorNavigation.SelectEntityByName(newPage, EntityType.Page); - }); - }); - - it("3. Commit and push changes, validate data binding on all pages in edit and deploy mode on master", () => { - // verfiy data binding on all pages in edit mode - cy.get(widgetsPage.inputWidget).should("be.visible"); - cy.get(widgetsPage.inputWidget) - .first() - .find(widgetsPage.dataclass) - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(widgetsPage.inputWidget) - .last() - .find(widgetsPage.dataclass) - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - - PageList.ShowList(); - EditorNavigation.SelectEntityByName(newPage, EntityType.Page); - cy.get(widgetsPage.inputWidget) - .first() - .find(widgetsPage.dataclass) - .should("have.value", "morpheus"); - cy.get(widgetsPage.inputWidget) - .last() - .find(widgetsPage.dataclass) - .should("have.value", "This is a test"); - - PageList.ShowList(); - EditorNavigation.SelectEntityByName(pageName, EntityType.Page); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + EditorNavigation.SelectEntityByName("get_users", EntityType.Query); + dataSources.RunQuery(); }); - PageList.ShowList(); - EditorNavigation.SelectEntityByName(`${pageName} Copy`, EntityType.Page); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); - }); - // commit and push the changes - gitSync.CommitAndPush(true); - // verify data binding on all pages in deploy mode - cy.latestDeployPreview(); - agHelper.GetNClickByContains(locators._deployedPage, pageName); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + it("5. Commit and push changes, validate data binding on all pages in edit and deploy mode on tempBranch", () => { + // commit and push changes + cy.get(homePageLocators.publishButton).click(); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + cy.get(gitSyncLocators.commitButton).click(); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + // verfiy data binding on all pages in deploy mode + cy.latestDeployPreview(); + cy.get(widgetsPage.dataclass).should("be.visible"); + cy.get(widgetsPage.dataclass) + .first() + .invoke("val") + .should("be.oneOf", ["Success", "Test user 7"]); + cy.get(widgetsPage.dataclass) + .last() + .invoke("val") + .should("be.oneOf", ["Success", "Test user 7"]); + agHelper.GetNClickByContains(locators._deployedPage, `${pageName}`); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + agHelper.GetNClickByContains(locators._deployedPage, `${pageName} Copy`); + table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); + cy.get(widgetsPage.dataclass) + .first() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + cy.get(widgetsPage.dataclass) + .last() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + + agHelper.GetNClickByContains(locators._deployedPage, `${newPage} Copy`); + cy.get(widgetsPage.dataclass) + .first() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + cy.get(widgetsPage.dataclass) + .last() + .invoke("val") + .should("be.oneOf", ["morpheus", "This is a test"]); + deployMode.NavigateBacktoEditor(); }); - agHelper.GetNClickByContains(locators._deployedPage, `${pageName} Copy`); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + + it("6. Switch to master and verify no uncommitted changes should be shown on master", () => { + cy.switchGitBranch("master"); + // verify commit input box is disabled + cy.get(homePageLocators.publishButton).click(); + cy.get(gitSyncLocators.commitCommentInput) + .should("be.disabled") + .and("have.text", "No changes to commit"); + cy.get(gitSyncLocators.closeGitSyncModal).click(); }); - agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); - agHelper.RefreshPage("getConsolidatedData"); - cy.get(widgetsPage.dataclass) - .first() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(widgetsPage.dataclass) - .last() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(".t--page-switch-tab") - .contains(`${newPage} Copy`) - .click({ force: true }); - cy.get(widgetsPage.dataclass) - .first() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(widgetsPage.dataclass) - .last() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - agHelper.AssertElementLength( - locators._widgetInDeployed(draggableWidgets.INPUT_V2), - 2, - ); - deployMode.NavigateBacktoEditor(); - }); - - it("4. Create a new branch tempBranch, add jsObject and datasource query, move them to new page i.e. Child_Page and bind to widgets", () => { - gitSync.CreateGitBranch(tempBranch, true); - cy.get("@gitbranchName").then((branName) => { - tempBranch = branName; + + it("7. Switch to tempBranch , Clone the Child_Page, change it's visiblity to hidden and deploy, merge to master", () => { + cy.switchGitBranch(tempBranch); + // clone the Child_Page + EditorNavigation.SelectEntityByName("Child_Page", EntityType.Page); + PageList.ClonePage("Child_Page"); + // change cloned page visiblity to hidden + EditorNavigation.SelectEntityByName("Child_Page Copy", EntityType.Page); + PageList.HidePage("Child_Page"); + + EditorNavigation.SelectEntityByName("Child_Page", EntityType.Page); + cy.wait("@getConsolidatedData"); + cy.get(homePageLocators.publishButton).click(); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + cy.get(gitSyncLocators.commitButton).click(); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + + gitSync.MergeToMaster(); + + cy.latestDeployPreview(); + // verify page is hidden on deploy mode + agHelper.AssertContains("Child_Page Copy", "not.exist"); + deployMode.NavigateBacktoEditor(); }); - // create jsObject and rename it - EditorNavigation.SelectEntityByName(`${newPage} Copy`, EntityType.Page); - - jsEditor.CreateJSObject('return "Success";'); - // create postgres select query - dataSources.CreateQueryForDS( - datasourceName, - "SELECT * FROM users ORDER BY id LIMIT 10;", - "get_users", - ); - dataSources.RunQuery(); - // create a new page - cy.Createpage("Child_Page"); - EditorNavigation.SelectEntityByName(`${newPage} Copy`, EntityType.Page); - EditorNavigation.SelectEntityByName("get_users", EntityType.Query); - agHelper.ActionContextMenuWithInPane({ - action: "Move to page", - subAction: "Child_Page", - toastToValidate: "moved to page", + + it("8. Verify Page visiblity on master in edit and deploy mode", () => { + cy.switchGitBranch(mainBranch); + cy.latestDeployPreview(); + agHelper.AssertContains("Child_Page Copy", "not.exist"); + deployMode.NavigateBacktoEditor(); }); - agHelper.WaitUntilAllToastsDisappear(); - dataSources.RunQuery(); - EditorNavigation.SelectEntityByName(`${newPage} Copy`, EntityType.Page); - EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "JSObject1", - action: "Move to page", - subAction: "Child_Page", - toastToValidate: "moved to page", + + it("9. Create new branch, delete a page and merge back to master, verify page is deleted on master", () => { + //cy.createGitBranch(tempBranch1); + gitSync.CreateGitBranch(tempBranch1, true); + // delete page from page settings + EditorNavigation.SelectEntityByName("Child_Page Copy", EntityType.Page); + cy.wait("@getConsolidatedData"); + PageList.DeletePage("Child_Page Copy"); + cy.get(homePageLocators.publishButton).click(); + cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); + cy.get(gitSyncLocators.commitButton).click(); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + gitSync.MergeToMaster(); + cy.latestDeployPreview(); + // verify page is hidden on deploy mode + agHelper.AssertContains("Child_Page Copy", "not.exist"); + deployMode.NavigateBacktoEditor(); }); - agHelper.WaitUntilAllToastsDisappear(); - // bind input widgets to the jsObject and query response - cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 300 }); - cy.get(".t--widget-inputwidgetv2").should("exist"); - cy.EnableAllCodeEditors(); - cy.get(`.t--property-control-defaultvalue ${dynamicInputLocators.input}`) - .last() - .click({ force: true }) - .type("{{JSObject1.myFun1()}}", { parseSpecialCharSequences: false }); - cy.dragAndDropToCanvas("inputwidgetv2", { x: 300, y: 500 }); - cy.get(".t--widget-inputwidgetv2").should("exist"); - propPane.UpdatePropertyFieldValue( - "Default value", - "{{get_users.data[0].name}}", - ); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - EditorNavigation.SelectEntityByName("get_users", EntityType.Query); - dataSources.RunQuery(); - }); - - it("5. Commit and push changes, validate data binding on all pages in edit and deploy mode on tempBranch", () => { - // commit and push changes - cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - cy.get(gitSyncLocators.commitButton).click(); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - // verfiy data binding on all pages in deploy mode - cy.latestDeployPreview(); - cy.get(widgetsPage.dataclass).should("be.visible"); - cy.get(widgetsPage.dataclass) - .first() - .invoke("val") - .should("be.oneOf", ["Success", "Test user 7"]); - cy.get(widgetsPage.dataclass) - .last() - .invoke("val") - .should("be.oneOf", ["Success", "Test user 7"]); - agHelper.GetNClickByContains(locators._deployedPage, `${pageName}`); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + + //Skipping these since these are causing chrome crash in CI, passes in electron. + it.skip("10. After merge back to master, verify page is deleted on master", () => { + // verify Child_Page is not on master + cy.switchGitBranch(mainBranch); + assertHelper.AssertDocumentReady(); + table.WaitUntilTableLoad(); + cy.readTabledataPublish("0", "1").then((cellData) => { + expect(cellData).to.be.equal("New Config"); + }); + agHelper.AssertAutoSave(); + PageList.ShowList(); + PageLeftPane.assertAbsence("Child_Page Copy"); + // create another branch and verify deleted page doesn't exist on it + gitSync.CreateGitBranch(tempBranch0, true); + PageList.ShowList(); + PageLeftPane.assertAbsence("Child_Page Copy"); }); - agHelper.GetNClickByContains(locators._deployedPage, `${pageName} Copy`); - table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + + it.skip("11. Import app from git and verify page order should not change", () => { + cy.get(homePageLocators.homeIcon).click(); + agHelper.GetNClick(homePageLocators.createNew, 0); + cy.get(homePageLocators.workspaceImportAppOption).click({ force: true }); + cy.get(".t--import-json-card").next().click(); + // import application from git + cy.importAppFromGit(repoName); + // verify page order remains same as in orignal app + PageList.ShowList(); + cy.get(".t--entity-item").eq(1).contains("crudpage_1"); + cy.get(".t--entity-item").eq(2).contains("crudpage_1 Copy"); + cy.get(".t--entity-item").eq(3).contains("ApiCalls_1"); + cy.get(".t--entity-item").eq(4).contains("ApiCalls_1 Copy"); + cy.get(".t--entity-item").eq(5).contains("Child_Page"); }); - agHelper.GetNClickByContains(locators._deployedPage, `${newPage}`); - cy.get(widgetsPage.dataclass) - .first() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(widgetsPage.dataclass) - .last() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - - agHelper.GetNClickByContains(locators._deployedPage, `${newPage} Copy`); - cy.get(widgetsPage.dataclass) - .first() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - cy.get(widgetsPage.dataclass) - .last() - .invoke("val") - .should("be.oneOf", ["morpheus", "This is a test"]); - deployMode.NavigateBacktoEditor(); - }); - - it("6. Switch to master and verify no uncommitted changes should be shown on master", () => { - cy.switchGitBranch("master"); - // verify commit input box is disabled - cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput) - .should("be.disabled") - .and("have.text", "No changes to commit"); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - }); - - it("7. Switch to tempBranch , Clone the Child_Page, change it's visiblity to hidden and deploy, merge to master", () => { - cy.switchGitBranch(tempBranch); - // clone the Child_Page - EditorNavigation.SelectEntityByName("Child_Page", EntityType.Page); - PageList.ClonePage("Child_Page"); - // change cloned page visiblity to hidden - EditorNavigation.SelectEntityByName("Child_Page Copy", EntityType.Page); - PageList.HidePage("Child_Page"); - - EditorNavigation.SelectEntityByName("Child_Page", EntityType.Page); - cy.wait("@getConsolidatedData"); - cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - cy.get(gitSyncLocators.commitButton).click(); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - - gitSync.MergeToMaster(); - - cy.latestDeployPreview(); - // verify page is hidden on deploy mode - agHelper.AssertContains("Child_Page Copy", "not.exist"); - deployMode.NavigateBacktoEditor(); - }); - - it("8. Verify Page visiblity on master in edit and deploy mode", () => { - cy.switchGitBranch(mainBranch); - cy.latestDeployPreview(); - agHelper.AssertContains("Child_Page Copy", "not.exist"); - deployMode.NavigateBacktoEditor(); - }); - - it("9. Create new branch, delete a page and merge back to master, verify page is deleted on master", () => { - //cy.createGitBranch(tempBranch1); - gitSync.CreateGitBranch(tempBranch1, true); - // delete page from page settings - EditorNavigation.SelectEntityByName("Child_Page Copy", EntityType.Page); - cy.wait("@getConsolidatedData"); - PageList.DeletePage("Child_Page Copy"); - cy.get(homePageLocators.publishButton).click(); - cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit"); - cy.get(gitSyncLocators.commitButton).click(); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - gitSync.MergeToMaster(); - cy.latestDeployPreview(); - // verify page is hidden on deploy mode - agHelper.AssertContains("Child_Page Copy", "not.exist"); - deployMode.NavigateBacktoEditor(); - }); - - //Skipping these since these are causing chrome crash in CI, passes in electron. - it.skip("10. After merge back to master, verify page is deleted on master", () => { - // verify Child_Page is not on master - cy.switchGitBranch(mainBranch); - assertHelper.AssertDocumentReady(); - table.WaitUntilTableLoad(); - cy.readTabledataPublish("0", "1").then((cellData) => { - expect(cellData).to.be.equal("New Config"); + + after(() => { + //clean up + gitSync.DeleteTestGithubRepo(repoName); }); - agHelper.AssertAutoSave(); - PageList.ShowList(); - PageLeftPane.assertAbsence("Child_Page Copy"); - // create another branch and verify deleted page doesn't exist on it - gitSync.CreateGitBranch(tempBranch0, true); - PageList.ShowList(); - PageLeftPane.assertAbsence("Child_Page Copy"); - }); - - it.skip("11. Import app from git and verify page order should not change", () => { - cy.get(homePageLocators.homeIcon).click(); - agHelper.GetNClick(homePageLocators.createNew, 0); - cy.get(homePageLocators.workspaceImportAppOption).click({ force: true }); - cy.get(".t--import-json-card").next().click(); - // import application from git - cy.importAppFromGit(repoName); - // verify page order remains same as in orignal app - PageList.ShowList(); - cy.get(".t--entity-item").eq(1).contains("crudpage_1"); - cy.get(".t--entity-item").eq(2).contains("crudpage_1 Copy"); - cy.get(".t--entity-item").eq(3).contains("ApiCalls_1"); - cy.get(".t--entity-item").eq(4).contains("ApiCalls_1 Copy"); - cy.get(".t--entity-item").eq(5).contains("Child_Page"); - }); - - after(() => { - //clean up - gitSync.DeleteTestGithubRepo(repoName); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts index 10cf74d2fd0..ec5a302d5a5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/MergeViaRemote_spec.ts @@ -29,7 +29,18 @@ let repoName: any; describe( "Git sync: Merge changes via remote", - { tags: ["@tag.Git"] }, + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { before(() => { _.homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js index 59e70823498..82f17e6d1cb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/Merge_spec.js @@ -7,7 +7,19 @@ let childBranchKey = "ChildBranch"; let mainBranch = "master"; describe( "Git sync modal: merge tab", - { tags: ["@tag.Git", "@tag.Git", "@tag.Sanity"] }, + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { before(() => { _.homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/PreConnect_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/PreConnect_spec.ts index 633de9d4984..139ca0d4da5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/PreConnect_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/PreConnect_spec.ts @@ -2,39 +2,54 @@ import homePage from "../../../../../locators/HomePage"; import * as _ from "../../../../../support/Objects/ObjectsCore"; import gitSyncLocators from "../../../../../locators/gitSyncLocators"; -describe("Pre git connection spec:", { tags: ["@tag.Git"] }, function () { - it("1. Deploy menu at the application dropdown menu", () => { - // create new app - _.homePage.NavigateToHome(); - cy.createWorkspace(); - cy.wait("@createWorkspace").then((interception) => { - const newWorkspaceName = interception.response.body.data.name; - cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); - }); +describe( + "Pre git connection spec:", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + it("1. Deploy menu at the application dropdown menu", () => { + // create new app + _.homePage.NavigateToHome(); + cy.createWorkspace(); + cy.wait("@createWorkspace").then((interception) => { + const newWorkspaceName = interception.response.body.data.name; + cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName); + }); - cy.intercept("POST", "/api/v1/applications/publish/*").as("publishApp"); + cy.intercept("POST", "/api/v1/applications/publish/*").as("publishApp"); - cy.window().then((window) => { - cy.stub(window, "open").callsFake((url) => { - expect(!!url).to.be.true; + cy.window().then((window) => { + cy.stub(window, "open").callsFake((url) => { + expect(!!url).to.be.true; + }); }); - }); - // deploy - _.agHelper.GetNClick(_.locators._publishButton); - cy.wait("@publishApp"); + // deploy + _.agHelper.GetNClick(_.locators._publishButton); + cy.wait("@publishApp"); - // current deployed version - _.agHelper.GetNClick(homePage.deployPopupOptionTrigger); - _.agHelper.AssertElementExist(homePage.currentDeployedPreviewBtn); + // current deployed version + _.agHelper.GetNClick(homePage.deployPopupOptionTrigger); + _.agHelper.AssertElementExist(homePage.currentDeployedPreviewBtn); - // connect to git - _.agHelper.GetNClick(homePage.connectToGitBtn); - _.agHelper.AssertElementVisibility(gitSyncLocators.gitSyncModal); - cy.get(gitSyncLocators.closeGitSyncModal).click(); + // connect to git + _.agHelper.GetNClick(homePage.connectToGitBtn); + _.agHelper.AssertElementVisibility(gitSyncLocators.gitSyncModal); + cy.get(gitSyncLocators.closeGitSyncModal).click(); - cy.get(gitSyncLocators.connectGitBottomBar).click(); - _.agHelper.AssertElementVisibility(gitSyncLocators.gitSyncModal); - cy.get(gitSyncLocators.closeGitSyncModal).click(); - }); -}); + cy.get(gitSyncLocators.connectGitBottomBar).click(); + _.agHelper.AssertElementVisibility(gitSyncLocators.gitSyncModal); + cy.get(gitSyncLocators.closeGitSyncModal).click(); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/RepoLimitExceededErrorModal_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/RepoLimitExceededErrorModal_spec.js index cf275ba1ddf..879543ef43b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/RepoLimitExceededErrorModal_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/RepoLimitExceededErrorModal_spec.js @@ -11,7 +11,18 @@ import { REPO, CURRENT_REPO } from "../../../../../fixtures/REPO"; let repoName1, repoName2, repoName3, repoName4, windowOpenSpy; describe( "Repo Limit Exceeded Error Modal", - { tags: ["@tag.Git"] }, + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { before(() => { const uuid = require("uuid"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js index b411c8b7919..c652285ef44 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js @@ -23,258 +23,276 @@ let parentBranchKey = "ParentBranch", branchQueryKey = "branch"; let repoName; -describe("Git sync:", { tags: ["@tag.Git", "@tag.Sanity"] }, function () { - before(() => { - gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; +describe( + "Git sync:", + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + before(() => { + gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); }); - }); - - it("1. create branch input", function () { - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.get(gitSyncLocators.branchButton).click(); - // validate of the branch name - const hypenBranchName = "hypen-branch-name"; - cy.get(gitSyncLocators.branchSearchInput).type( - `{selectall}${hypenBranchName}`, - ); - agHelper.AssertAttribute( - gitSyncLocators.branchSearchInput, - "value", - "hypen-branch-name", - ); - const specialBranchName = "special&branch-name~@#$%^&*()_+={}[]><,."; - cy.get(gitSyncLocators.branchSearchInput).type( - `{selectall}${specialBranchName}`, - ); - agHelper.AssertAttribute( - gitSyncLocators.branchSearchInput, - "value", - "special_branch-name_____________________", - ); - cy.get(gitSyncLocators.closeBranchList).click(); - }); + it("1. create branch input", function () { + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.get(gitSyncLocators.branchButton).click(); - it("2. creates a new branch and create branch specific resources", function () { - cy.get(commonLocators.canvas).click({ force: true }); - //cy.createGitBranch(parentBranchKey); - gitSync.CreateGitBranch(parentBranchKey, true); - cy.get("@gitbranchName").then((branName) => { - parentBranchKey = branName; + // validate of the branch name + const hypenBranchName = "hypen-branch-name"; + cy.get(gitSyncLocators.branchSearchInput).type( + `{selectall}${hypenBranchName}`, + ); + agHelper.AssertAttribute( + gitSyncLocators.branchSearchInput, + "value", + "hypen-branch-name", + ); + const specialBranchName = "special&branch-name~@#$%^&*()_+={}[]><,."; + cy.get(gitSyncLocators.branchSearchInput).type( + `{selectall}${specialBranchName}`, + ); + agHelper.AssertAttribute( + gitSyncLocators.branchSearchInput, + "value", + "special_branch-name_____________________", + ); + cy.get(gitSyncLocators.closeBranchList).click(); }); - PageList.AddNewPage(); - entityExplorer.RenameEntityFromExplorer( - "Page2", - "ParentPage1", - false, - EntityItems.Page, - ); - dataSources.NavigateToDSCreateNew(); - apiPage.CreateApi("ParentApi1"); - jsEditor.CreateJSObject(); - // Added because api name edit takes some time to - // reflect in api sidebar after the call passes. - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(2000); - gitSync.CreateGitBranch(childBranchKey, true); - cy.get("@gitbranchName").then((branName) => { - childBranchKey = branName; - }); - PageList.AddNewPage(); - entityExplorer.RenameEntityFromExplorer( - "Page2", - "ChildPage1", - false, - EntityItems.Page, - ); - dataSources.NavigateToDSCreateNew(); - apiPage.CreateApi("ChildApi1"); - jsEditor.CreateJSObject(); - // Added because api name edit takes some time to - // reflect in api sidebar after the call passes. - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(2000); + it("2. creates a new branch and create branch specific resources", function () { + cy.get(commonLocators.canvas).click({ force: true }); + //cy.createGitBranch(parentBranchKey); + gitSync.CreateGitBranch(parentBranchKey, true); + cy.get("@gitbranchName").then((branName) => { + parentBranchKey = branName; + }); - // A switch here should not show a 404 page - cy.switchGitBranch(parentBranchKey); - // When entity not found, takes them to the home page - PageList.VerifyIsCurrentPage("Page1"); + PageList.AddNewPage(); + entityExplorer.RenameEntityFromExplorer( + "Page2", + "ParentPage1", + false, + EntityItems.Page, + ); + dataSources.NavigateToDSCreateNew(); + apiPage.CreateApi("ParentApi1"); + jsEditor.CreateJSObject(); + // Added because api name edit takes some time to + // reflect in api sidebar after the call passes. + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(2000); + gitSync.CreateGitBranch(childBranchKey, true); + cy.get("@gitbranchName").then((branName) => { + childBranchKey = branName; + }); + PageList.AddNewPage(); + entityExplorer.RenameEntityFromExplorer( + "Page2", + "ChildPage1", + false, + EntityItems.Page, + ); + dataSources.NavigateToDSCreateNew(); + apiPage.CreateApi("ChildApi1"); + jsEditor.CreateJSObject(); + // Added because api name edit takes some time to + // reflect in api sidebar after the call passes. + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(2000); - EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); - PageList.assertAbsence("ChildPage1"); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - PageLeftPane.assertAbsence("ChildApi1"); - PageLeftPane.switchSegment(PagePaneSegment.JS); - PageLeftPane.assertAbsence("ChildJSAction1"); - }); + // A switch here should not show a 404 page + cy.switchGitBranch(parentBranchKey); + // When entity not found, takes them to the home page + PageList.VerifyIsCurrentPage("Page1"); + + EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); + PageList.assertAbsence("ChildPage1"); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + PageLeftPane.assertAbsence("ChildApi1"); + PageLeftPane.switchSegment(PagePaneSegment.JS); + PageLeftPane.assertAbsence("ChildJSAction1"); + }); - // rename entities - it("3. makes branch specific resource updates", function () { - cy.switchGitBranch(childBranchKey); - EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); - entityExplorer.RenameEntityFromExplorer( - "ParentPage1", - "ParentPageRenamed", - false, - EntityItems.Page, - ); - agHelper.RemoveUIElement( - "Tooltip", - Cypress.env("MESSAGES").ADD_QUERY_JS_TOOLTIP(), - ); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - entityExplorer.RenameEntityFromExplorer("ParentApi1", "ParentApiRenamed"); + // rename entities + it("3. makes branch specific resource updates", function () { + cy.switchGitBranch(childBranchKey); + EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); + entityExplorer.RenameEntityFromExplorer( + "ParentPage1", + "ParentPageRenamed", + false, + EntityItems.Page, + ); + agHelper.RemoveUIElement( + "Tooltip", + Cypress.env("MESSAGES").ADD_QUERY_JS_TOOLTIP(), + ); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + entityExplorer.RenameEntityFromExplorer("ParentApi1", "ParentApiRenamed"); - cy.switchGitBranch(parentBranchKey); + cy.switchGitBranch(parentBranchKey); - PageList.assertAbsence("ParentPageRenamed"); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - PageLeftPane.assertAbsence("ParentApiRenamed"); - }); + PageList.assertAbsence("ParentPageRenamed"); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + PageLeftPane.assertAbsence("ParentApiRenamed"); + }); - it("4. enables switching branch from the URL", () => { - cy.url().then((url) => { - EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); - cy.dragAndDropToCanvas("tablewidgetv2", { x: 200, y: 200 }); - cy.get(".t--widget-tablewidgetv2").should("exist"); - cy.commitAndPush(); + it("4. enables switching branch from the URL", () => { + cy.url().then((url) => { + EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page); + cy.dragAndDropToCanvas("tablewidgetv2", { x: 200, y: 200 }); + cy.get(".t--widget-tablewidgetv2").should("exist"); + cy.commitAndPush(); - const urlObject = new URL(url); - urlObject.searchParams.set(branchQueryKey, childBranchKey); - cy.visit(urlObject.toString(), { timeout: 60000 }); + const urlObject = new URL(url); + urlObject.searchParams.set(branchQueryKey, childBranchKey); + cy.visit(urlObject.toString(), { timeout: 60000 }); - cy.get(".ads-v2-spinner").should("exist"); - cy.get(".ads-v2-spinner").should("not.exist"); + cy.get(".ads-v2-spinner").should("exist"); + cy.get(".ads-v2-spinner").should("not.exist"); - cy.get(".t--widget-tablewidgetv2").should("not.exist"); + cy.get(".t--widget-tablewidgetv2").should("not.exist"); - cy.commitAndPush(); + cy.commitAndPush(); - cy.latestDeployPreview(); + cy.latestDeployPreview(); - cy.get(".t--widget-tablewidgetv2").should("not.exist"); - //cy.get(commonLocators.backToEditor).click(); - cy.wait(2000); - cy.url().then((url) => { - const urlObject = new URL(url); - urlObject.searchParams.set(branchQueryKey, parentBranchKey); - cy.visit(urlObject.toString(), { timeout: 60000 }); + cy.get(".t--widget-tablewidgetv2").should("not.exist"); + //cy.get(commonLocators.backToEditor).click(); + cy.wait(2000); + cy.url().then((url) => { + const urlObject = new URL(url); + urlObject.searchParams.set(branchQueryKey, parentBranchKey); + cy.visit(urlObject.toString(), { timeout: 60000 }); - cy.wait("@getConsolidatedData").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.get(".t--page-switch-tab").contains("ParentPage1").click(); - cy.get(".t--widget-tablewidgetv2").should("exist"); + cy.wait("@getConsolidatedData").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.get(".t--page-switch-tab").contains("ParentPage1").click(); + cy.get(".t--widget-tablewidgetv2").should("exist"); + }); }); }); - }); - //Rename - hence skipping for Gitea - it.skip("5. test sync and prune branches", () => { - // uncomment once prune branch flow is complete - let tempBranch = "featureA"; - const tempBranchRenamed = "newFeatureA"; - deployMode.NavigateBacktoEditor(); - gitSync.CreateGitBranch(tempBranch, true); - cy.get("@gitbranchName").then((branName) => { - tempBranch = branName; + //Rename - hence skipping for Gitea + it.skip("5. test sync and prune branches", () => { + // uncomment once prune branch flow is complete + let tempBranch = "featureA"; + const tempBranchRenamed = "newFeatureA"; + deployMode.NavigateBacktoEditor(); + gitSync.CreateGitBranch(tempBranch, true); + cy.get("@gitbranchName").then((branName) => { + tempBranch = branName; + }); + gitSync.CreateGitBranch(`${tempBranch}-1`, true); + // cy.get("@gitbranchName").then((branName) => { + // tempBranch = branName; + // }); + // rename branch API missing in TED. + // cy.renameBranchViaGithubApi(repoName, tempBranch, tempBranchRenamed); + cy.get(gitSyncLocators.branchButton).click(); + cy.get(gitSyncLocators.branchSearchInput).type( + `{selectall}${tempBranch}`, + ); + const tempBranchRegex = new RegExp(`^${tempBranch}$`); + const tempBranchRenamedRegex = new RegExp(`^${tempBranchRenamed}$`); + const remoteTempBranchRenamedRegex = new RegExp( + `^origin/${tempBranchRenamed}$`, + ); + cy.get(gitSyncLocators.branchListItem).contains(tempBranchRegex); + cy.get(gitSyncLocators.syncBranches).click(); + cy.get(gitSyncLocators.branchListItem) + .contains(tempBranchRegex) + .should("exist"); + cy.get(gitSyncLocators.branchListItem) + .contains(remoteTempBranchRenamedRegex) + .should("exist"); + cy.get(gitSyncLocators.closeBranchList).click(); + cy.switchGitBranch(`origin/${tempBranchRenamed}`); + cy.switchGitBranch(`origin/${tempBranchRenamed}`, true); + cy.wait(4000); // wait for switch branch + // assert error toast + cy.contains(`origin/${tempBranchRenamed} already exists`); + cy.get(gitSyncLocators.closeBranchList).click(); }); - gitSync.CreateGitBranch(`${tempBranch}-1`, true); - // cy.get("@gitbranchName").then((branName) => { - // tempBranch = branName; - // }); - // rename branch API missing in TED. - // cy.renameBranchViaGithubApi(repoName, tempBranch, tempBranchRenamed); - cy.get(gitSyncLocators.branchButton).click(); - cy.get(gitSyncLocators.branchSearchInput).type(`{selectall}${tempBranch}`); - const tempBranchRegex = new RegExp(`^${tempBranch}$`); - const tempBranchRenamedRegex = new RegExp(`^${tempBranchRenamed}$`); - const remoteTempBranchRenamedRegex = new RegExp( - `^origin/${tempBranchRenamed}$`, - ); - cy.get(gitSyncLocators.branchListItem).contains(tempBranchRegex); - cy.get(gitSyncLocators.syncBranches).click(); - cy.get(gitSyncLocators.branchListItem) - .contains(tempBranchRegex) - .should("exist"); - cy.get(gitSyncLocators.branchListItem) - .contains(remoteTempBranchRenamedRegex) - .should("exist"); - cy.get(gitSyncLocators.closeBranchList).click(); - cy.switchGitBranch(`origin/${tempBranchRenamed}`); - cy.switchGitBranch(`origin/${tempBranchRenamed}`, true); - cy.wait(4000); // wait for switch branch - // assert error toast - cy.contains(`origin/${tempBranchRenamed} already exists`); - cy.get(gitSyncLocators.closeBranchList).click(); - }); - // Validate the error faced when user switches between the branches - it("6. no error faced when user switches branch with new page", function () { - deployMode.NavigateBacktoEditor(); //Adding since skipping 6th case - cy.generateUUID().then((uuid) => { - gitSync.CreateGitBranch(childBranchKey, true); - //cy.createGitBranch(childBranchKey); - PageList.AddNewPage(); - cy.get(gitSyncLocators.branchButton).click({ force: true }); - cy.get(gitSyncLocators.branchSearchInput).type("{selectall}master"); - cy.wait(400); - cy.get(gitSyncLocators.branchListItem).contains("master").click(); - cy.wait(4000); - PageLeftPane.switchSegment(PagePaneSegment.UI); - PageList.VerifyIsCurrentPage("Page1"); - cy.get(".t--canvas-artboard").should("be.visible"); + // Validate the error faced when user switches between the branches + it("6. no error faced when user switches branch with new page", function () { + deployMode.NavigateBacktoEditor(); //Adding since skipping 6th case + cy.generateUUID().then((uuid) => { + gitSync.CreateGitBranch(childBranchKey, true); + //cy.createGitBranch(childBranchKey); + PageList.AddNewPage(); + cy.get(gitSyncLocators.branchButton).click({ force: true }); + cy.get(gitSyncLocators.branchSearchInput).type("{selectall}master"); + cy.wait(400); + cy.get(gitSyncLocators.branchListItem).contains("master").click(); + cy.wait(4000); + PageLeftPane.switchSegment(PagePaneSegment.UI); + PageList.VerifyIsCurrentPage("Page1"); + cy.get(".t--canvas-artboard").should("be.visible"); + }); + agHelper.RefreshPage(); }); - agHelper.RefreshPage(); - }); - it("7. branch list search", function () { - cy.get(".ads-v2-spinner").should("not.exist"); - PageLeftPane.switchSegment(PagePaneSegment.UI); - cy.get(commonLocators.canvas).click({ force: true }); - let parentBKey, childBKey; - gitSync.CreateGitBranch("parentBranch", true); - cy.get("@gitbranchName").then((branName) => { - parentBKey = branName; - - gitSync.CreateGitBranch("childBranch", true); + it("7. branch list search", function () { + cy.get(".ads-v2-spinner").should("not.exist"); + PageLeftPane.switchSegment(PagePaneSegment.UI); + cy.get(commonLocators.canvas).click({ force: true }); + let parentBKey, childBKey; + gitSync.CreateGitBranch("parentBranch", true); cy.get("@gitbranchName").then((branName) => { - childBKey = branName; + parentBKey = branName; - cy.get(gitSyncLocators.branchButton).click(); - cy.get(gitSyncLocators.branchSearchInput).type( - `{selectall}${parentBKey.slice(0, 3)}`, - ); - cy.get(gitSyncLocators.branchListItem).contains(parentBKey); + gitSync.CreateGitBranch("childBranch", true); + cy.get("@gitbranchName").then((branName) => { + childBKey = branName; - cy.get(gitSyncLocators.branchSearchInput).type( - `{selectall}${childBKey.slice(0, 3)}`, - ); - cy.get(gitSyncLocators.branchListItem).contains(childBKey); + cy.get(gitSyncLocators.branchButton).click(); + cy.get(gitSyncLocators.branchSearchInput).type( + `{selectall}${parentBKey.slice(0, 3)}`, + ); + cy.get(gitSyncLocators.branchListItem).contains(parentBKey); - cy.get(gitSyncLocators.branchSearchInput).type( - `{selectall}${branchQueryKey}`, - ); - cy.get(gitSyncLocators.branchListItem).contains(childBKey); - cy.get(gitSyncLocators.branchListItem).contains(parentBKey); + cy.get(gitSyncLocators.branchSearchInput).type( + `{selectall}${childBKey.slice(0, 3)}`, + ); + cy.get(gitSyncLocators.branchListItem).contains(childBKey); - cy.get(gitSyncLocators.branchSearchInput).type(`{selectall}abcde`); - cy.get(gitSyncLocators.branchListItem).should("not.exist"); + cy.get(gitSyncLocators.branchSearchInput).type( + `{selectall}${branchQueryKey}`, + ); + cy.get(gitSyncLocators.branchListItem).contains(childBKey); + cy.get(gitSyncLocators.branchListItem).contains(parentBKey); - cy.get(gitSyncLocators.branchSearchInput).clear(); - cy.get(gitSyncLocators.branchListItem).contains(childBKey); - cy.get(gitSyncLocators.branchListItem).contains(parentBKey); + cy.get(gitSyncLocators.branchSearchInput).type(`{selectall}abcde`); + cy.get(gitSyncLocators.branchListItem).should("not.exist"); + + cy.get(gitSyncLocators.branchSearchInput).clear(); + cy.get(gitSyncLocators.branchListItem).contains(childBKey); + cy.get(gitSyncLocators.branchListItem).contains(parentBKey); + }); }); + cy.get(gitSyncLocators.closeBranchList).click(); }); - cy.get(gitSyncLocators.closeBranchList).click(); - }); - after(() => { - gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithAutoLayout/conversion_of_git_connected_apps_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithAutoLayout/conversion_of_git_connected_apps_spec.js index fc25d668396..622095c9c8d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithAutoLayout/conversion_of_git_connected_apps_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithAutoLayout/conversion_of_git_connected_apps_spec.js @@ -16,78 +16,101 @@ let parentBranchKey = "ParentBranch", childBranchKey = "ChildBranch"; let repoName; -describe("Git sync:", { tags: ["@tag.Git"] }, function () { - before(() => { - homePage.NavigateToHome(); - agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - homePage.CreateNewWorkspace("AutoLayoutGit" + uid); - homePage.CreateAppInWorkspace("AutoLayoutGit" + uid); +describe( + "Git sync:", + { + tags: [ + "@tag.Git", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, + function () { + before(() => { + homePage.NavigateToHome(); + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + homePage.CreateNewWorkspace("AutoLayoutGit" + uid); + homePage.CreateAppInWorkspace("AutoLayoutGit" + uid); + }); + + gitSync.CreateNConnectToGit(); + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); + cy.wait(3000); + + gitSync.CreateGitBranch(parentBranchKey, true); + cy.get("@gitbranchName").then((branName) => { + parentBranchKey = branName; + }); + + gitSync.CreateGitBranch(childBranchKey, true); + cy.get("@gitbranchName").then((branName) => { + childBranchKey = branName; + }); }); - gitSync.CreateNConnectToGit(); - cy.get("@gitRepoName").then((repName) => { - repoName = repName; - }); - cy.wait(3000); - - gitSync.CreateGitBranch(parentBranchKey, true); - cy.get("@gitbranchName").then((branName) => { - parentBranchKey = branName; - }); - - gitSync.CreateGitBranch(childBranchKey, true); - cy.get("@gitbranchName").then((branName) => { - childBranchKey = branName; - }); - }); + it("1. when snapshot is restored from a page created before Conversion, it should refresh in the same page", () => { + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.CONTAINER, + 100, + 100, + ); - it("1. when snapshot is restored from a page created before Conversion, it should refresh in the same page", () => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.CONTAINER, 100, 100); + PageList.AddNewPage("New blank page"); - PageList.AddNewPage("New blank page"); + autoLayout.ConvertToAutoLayoutAndVerify(); - autoLayout.ConvertToAutoLayoutAndVerify(); + autoLayout.UseSnapshotFromBanner(); - autoLayout.UseSnapshotFromBanner(); + PageList.VerifyIsCurrentPage("Page2"); - PageList.VerifyIsCurrentPage("Page2"); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + agHelper.Sleep(); - agHelper.Sleep(); - - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "Page2", - entityType: EntityItems.Page, + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "Page2", + entityType: EntityItems.Page, + }); }); - }); - it("2. when snapshot is restored from a page created after Conversion, it should redirected to home page", () => { - autoLayout.ConvertToAutoLayoutAndVerify(); + it("2. when snapshot is restored from a page created after Conversion, it should redirected to home page", () => { + autoLayout.ConvertToAutoLayoutAndVerify(); - PageList.AddNewPage("New blank page"); + PageList.AddNewPage("New blank page"); - autoLayout.UseSnapshotFromBanner(); + autoLayout.UseSnapshotFromBanner(); - PageList.VerifyIsCurrentPage("Page1"); - }); + PageList.VerifyIsCurrentPage("Page1"); + }); - it("3. Switch to parentBranch and when snapshot is restored from a page created after Conversion, it should redirected to home page", () => { - cy.switchGitBranch(parentBranchKey); + it("3. Switch to parentBranch and when snapshot is restored from a page created after Conversion, it should redirected to home page", () => { + cy.switchGitBranch(parentBranchKey); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.CONTAINER, 100, 100); + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.CONTAINER, + 100, + 100, + ); - autoLayout.ConvertToAutoLayoutAndVerify(); + autoLayout.ConvertToAutoLayoutAndVerify(); - PageList.AddNewPage("New blank page"); + PageList.AddNewPage("New blank page"); - autoLayout.UseSnapshotFromBanner(); + autoLayout.UseSnapshotFromBanner(); - PageList.VerifyIsCurrentPage("Page1"); - }); + PageList.VerifyIsCurrentPage("Page1"); + }); - after(() => { - gitSync.DeleteTestGithubRepo(repoName); - }); -}); + after(() => { + gitSync.DeleteTestGithubRepo(repoName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js index 269e4c51558..7f11b385846 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js @@ -17,7 +17,20 @@ let repoName; describe( "Tests JS Library with Git", - { tags: ["@tag.Git", "@tag.excludeForAirgap", "@tag.Sanity"] }, + { + tags: [ + "@tag.Git", + "@tag.excludeForAirgap", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, () => { before(() => { homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js index 874af31e989..ef0f304ce4c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Git/GitWithTheming/GitWithTheming_spec.js @@ -4,7 +4,19 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Git with Theming:", - { tags: ["@tag.Git", "@tag.Sanity"] }, + { + tags: [ + "@tag.Git", + "@tag.Sanity", + "@tag.AccessControl", + "@tag.Workflows", + "@tag.Module", + "@tag.Theme", + "@tag.JS", + "@tag.Container", + "@tag.ImportExport", + ], + }, function () { const backgroudColorMaster = "rgb(22, 163, 74)"; const backgroudColorChildBranch = "rgb(100, 116, 139)"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Homepage/HomepageExperienceV2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Homepage/HomepageExperienceV2_spec.ts index a48460f5b01..d0ce249e894 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Homepage/HomepageExperienceV2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Homepage/HomepageExperienceV2_spec.ts @@ -8,7 +8,7 @@ import HomepageLocators from "../../../../locators/HomePage"; describe( "Validate Homepage Experience V2 changes", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, function () { before(() => {}); diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js index 0940b777580..37250029245 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js @@ -14,62 +14,82 @@ const page1 = "Page1"; const page2 = "Page2"; const api1 = "API1"; -describe("Canvas context Property Pane", { tags: ["@tag.IDE"] }, function () { - before(() => { - _.agHelper.AddDsl("editorContextdsl"); - - PageList.AddNewPage("New blank page"); - cy.dragAndDropToCanvas("textwidget", { x: 300, y: 200 }); - EditorNavigation.SelectEntityByName(page1, EntityType.Page); - _.apiPage.CreateApi(api1); - PageLeftPane.switchSegment(PagePaneSegment.UI); - }); - - beforeEach(() => { - _.agHelper.RefreshPage(); - }); - - let propPaneBack = "[data-testid='t--property-pane-back-btn']"; - - it("1. Code Editor should have focus while switching between widgets, pages and Editor Panes - Label", function () { - propertyControlSelector = ".t--property-control-label"; - verifyPropertyPaneContext( - () => { - cy.focusCodeInput(propertyControlSelector); - }, - () => { - cy.assertSoftFocusOnCodeInput(propertyControlSelector); - }, - "Button1", - ); - }); +describe( + "Canvas context Property Pane", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + before(() => { + _.agHelper.AddDsl("editorContextdsl"); + + PageList.AddNewPage("New blank page"); + cy.dragAndDropToCanvas("textwidget", { x: 300, y: 200 }); + EditorNavigation.SelectEntityByName(page1, EntityType.Page); + _.apiPage.CreateApi(api1); + PageLeftPane.switchSegment(PagePaneSegment.UI); + }); - it("2. Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { - propertyControlSelector = `.t--property-control-animateloading input[type="checkbox"]`; - verifyPropertyPaneContext( - () => { - cy.get(propertyControlSelector).click({ force: true }); - }, - () => { - cy.get(propertyControlSelector).should("be.focused"); + beforeEach(() => { + _.agHelper.RefreshPage(); + }); + + let propPaneBack = "[data-testid='t--property-pane-back-btn']"; + + it("1. Code Editor should have focus while switching between widgets, pages and Editor Panes - Label", function () { + propertyControlSelector = ".t--property-control-label"; + verifyPropertyPaneContext( + () => { + cy.focusCodeInput(propertyControlSelector); + }, + () => { + cy.assertSoftFocusOnCodeInput(propertyControlSelector); + }, + "Button1", + ); + }); + + it("2. Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { + propertyControlSelector = `.t--property-control-animateloading input[type="checkbox"]`; + verifyPropertyPaneContext( + () => { + cy.get(propertyControlSelector).click({ force: true }); + }, + () => { + cy.get(propertyControlSelector).should("be.focused"); + }, + "Button1", + ); + }); + + it( + "3. Code Editor should have focus while switching between widgets, pages and Editor Panes", + { tags: ["@tag.excludeForAirgap"] }, + function () { + // TODO: Since google recaptcha is not possible in airgap mode, skipping this test for now for airgapped version. + //Will modify the dsl to have maybe phone input widget to have a dropdown property control - Sangeeth + //if (!Cypress.env("AIRGAPPED")) { + //DropDown Property controls should have focus while switching between widgets, pages and Editor Panes + _.agHelper.RefreshPage(); + propertyControlClickSelector = `.t--property-control-googlerecaptchaversion .rc-select-selection-search-input`; + propertyControlVerifySelector = + ".t--property-control-googlerecaptchaversion .rc-select-selection-search-input"; + + verifyPropertyPaneContext( + () => { + cy.get(propertyControlClickSelector).eq(0).click({ force: true }); + }, + () => { + cy.get(propertyControlVerifySelector).should("be.focused"); + }, + "Button1", + ); + //} }, - "Button1", ); - }); - - it( - "3. Code Editor should have focus while switching between widgets, pages and Editor Panes", - { tags: ["@tag.excludeForAirgap"] }, - function () { - // TODO: Since google recaptcha is not possible in airgap mode, skipping this test for now for airgapped version. - //Will modify the dsl to have maybe phone input widget to have a dropdown property control - Sangeeth - //if (!Cypress.env("AIRGAPPED")) { - //DropDown Property controls should have focus while switching between widgets, pages and Editor Panes - _.agHelper.RefreshPage(); - propertyControlClickSelector = `.t--property-control-googlerecaptchaversion .rc-select-selection-search-input`; - propertyControlVerifySelector = - ".t--property-control-googlerecaptchaversion .rc-select-selection-search-input"; + it("4. Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { + //Icon Button Property controls should have focus while switching between widgets, pages and Editor Panes + propertyControlClickSelector = `.t--property-control-borderradius .ads-v2-segmented-control__segments-container`; + propertyControlVerifySelector = `.t--property-control-borderradius .ads-v2-segmented-control__segments-container[data-selected="true"]`; verifyPropertyPaneContext( () => { cy.get(propertyControlClickSelector).eq(0).click({ force: true }); @@ -78,120 +98,104 @@ describe("Canvas context Property Pane", { tags: ["@tag.IDE"] }, function () { cy.get(propertyControlVerifySelector).should("be.focused"); }, "Button1", + true, ); - //} - }, - ); - - it("4. Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { - //Icon Button Property controls should have focus while switching between widgets, pages and Editor Panes - propertyControlClickSelector = `.t--property-control-borderradius .ads-v2-segmented-control__segments-container`; - propertyControlVerifySelector = `.t--property-control-borderradius .ads-v2-segmented-control__segments-container[data-selected="true"]`; - verifyPropertyPaneContext( - () => { - cy.get(propertyControlClickSelector).eq(0).click({ force: true }); - }, - () => { - cy.get(propertyControlVerifySelector).should("be.focused"); - }, - "Button1", - true, - ); - }); + }); - it("5. ColorPicker Property controls should have focus while switching between widgets, pages and Editor Panes", function () { - let propertyControlSelector = `.t--property-control-buttoncolor input[type="text"]`; - verifyPropertyPaneContext( - () => { - cy.get(propertyControlSelector).click({ force: true }); - }, - () => { - cy.get(propertyControlSelector).should("be.focused"); - }, - "Button1", - true, - ); - }); + it("5. ColorPicker Property controls should have focus while switching between widgets, pages and Editor Panes", function () { + let propertyControlSelector = `.t--property-control-buttoncolor input[type="text"]`; + verifyPropertyPaneContext( + () => { + cy.get(propertyControlSelector).click({ force: true }); + }, + () => { + cy.get(propertyControlSelector).should("be.focused"); + }, + "Button1", + true, + ); + }); - it("6. ColorPicker Property controls should have focus while switching between widgets, pages and Editor Panes", function () { - propertySectionState = { - basic: false, - general: true, - }; + it("6. ColorPicker Property controls should have focus while switching between widgets, pages and Editor Panes", function () { + propertySectionState = { + basic: false, + general: true, + }; - if (!Cypress.env("AIRGAPPED")) { + if (!Cypress.env("AIRGAPPED")) { + propertySectionState = { + ...propertySectionState, + validation: false, + formsettings: true, + }; + } + + verifyPropertyPaneContext( + () => { + setPropertyPaneSectionState(propertySectionState); + }, + () => { + verifyPropertyPaneSectionState(propertySectionState); + }, + "Button1", + ); + }); + + it("7. ColorPicker Property controls should have focus while switching between widgets, pages and Editor Panes", function () { propertySectionState = { - ...propertySectionState, - validation: false, - formsettings: true, + general: true, + icon: false, + color: true, + borderandshadow: false, }; - } - verifyPropertyPaneContext( - () => { - setPropertyPaneSectionState(propertySectionState); - }, - () => { - verifyPropertyPaneSectionState(propertySectionState); - }, - "Button1", - ); - }); - - it("7. ColorPicker Property controls should have focus while switching between widgets, pages and Editor Panes", function () { - propertySectionState = { - general: true, - icon: false, - color: true, - borderandshadow: false, - }; - - verifyPropertyPaneContext( - () => { - cy.get(`.ads-v2-tabs__list-tab:contains("Style")`).eq(0).click(); - setPropertyPaneSectionState(propertySectionState); - }, - () => { - verifyPropertyPaneSectionState(propertySectionState); - }, - "Button1", - ); - }); - - it("8. Layered PropertyPane - Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { - propertyControlSelector = ".t--property-control-computedvalue"; - verifyPropertyPaneContext( - () => { - cy.editColumn("step"); - cy.focusCodeInput(propertyControlSelector); - }, - () => { - cy.assertSoftFocusOnCodeInput(propertyControlSelector); - }, - "Table1", - ); + verifyPropertyPaneContext( + () => { + cy.get(`.ads-v2-tabs__list-tab:contains("Style")`).eq(0).click(); + setPropertyPaneSectionState(propertySectionState); + }, + () => { + verifyPropertyPaneSectionState(propertySectionState); + }, + "Button1", + ); + }); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); + it("8. Layered PropertyPane - Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { + propertyControlSelector = ".t--property-control-computedvalue"; + verifyPropertyPaneContext( + () => { + cy.editColumn("step"); + cy.focusCodeInput(propertyControlSelector); + }, + () => { + cy.assertSoftFocusOnCodeInput(propertyControlSelector); + }, + "Table1", + ); - it("9. Layered PropertyPane - Toggle Property controls should have focus while switching between widgets, pages and Editor Panes", function () { - let propertyControlSelector = `.t--property-control-cellwrapping input[type="checkbox"]`; - verifyPropertyPaneContext( - () => { - cy.editColumn("step"); - cy.get(propertyControlSelector).click({ force: true }); - }, - () => { - cy.get(propertyControlSelector).should("be.focused"); - }, - "Table1", - ); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); -}); + it("9. Layered PropertyPane - Toggle Property controls should have focus while switching between widgets, pages and Editor Panes", function () { + let propertyControlSelector = `.t--property-control-cellwrapping input[type="checkbox"]`; + verifyPropertyPaneContext( + () => { + cy.editColumn("step"); + cy.get(propertyControlSelector).click({ force: true }); + }, + () => { + cy.get(propertyControlSelector).should("be.focused"); + }, + "Table1", + ); + + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); + }, +); let propertySectionClass = (section) => `.t--property-pane-section-collapse-${section}`; diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js index 1d317d75898..22b1cd7cb16 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js @@ -11,165 +11,169 @@ const page1 = "Page1"; const page2 = "Page2"; const api1 = "API1"; -describe("Canvas context Property Pane", { tags: ["@tag.IDE"] }, function () { - before(() => { - _.agHelper.AddDsl("editorContextdsl"); - PageList.AddNewPage("New blank page"); - cy.dragAndDropToCanvas("textwidget", { x: 300, y: 200 }); - EditorNavigation.SelectEntityByName(page1, EntityType.Page); - _.apiPage.CreateApi(api1); - PageLeftPane.switchSegment(PagePaneSegment.UI); - }); - - beforeEach(() => { - _.agHelper.RefreshPage(); - }); - - let propPaneBack = "[data-testid='t--property-pane-back-btn']"; - - it("1. Layered PropertyPane - Property Sections should retain state while switching between widgets, pages and Editor Panes", () => { - let propertySectionState = { - data: false, - general: true, - }; - - verifyPropertyPaneContext( - () => { - cy.editColumn("step"); - setPropertyPaneSectionState(propertySectionState); - }, - () => { - cy.wait(500); - verifyPropertyPaneSectionState(propertySectionState); - }, - "Table1", - ); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); - - it("2. Layered PropertyPane - Property Tabs and Sections should retain state while switching between widgets, pages and Editor Panes", () => { - propertySectionState = { - textformatting: true, - color: false, - }; - - verifyPropertyPaneContext( - () => { - cy.editColumn("step"); - cy.get(`.ads-v2-tabs__list-tab:contains("Style")`).eq(0).click(); - setPropertyPaneSectionState(propertySectionState); - }, - () => { - verifyPropertyPaneSectionState(propertySectionState); - }, - "Table1", - ); - - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); - - it("3. Multi Layered PropertyPane - Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { - let propertyControlSelector = ".t--property-control-text"; - verifyPropertyPaneContext( - () => { - cy.editColumn("status"); - cy.editColumn("menuIteme63irwbvnd", false); - cy.focusCodeInput(propertyControlSelector); - }, - () => { - cy.assertSoftFocusOnCodeInput(propertyControlSelector); - }, - "Table1", - ); - - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "status"); - - cy.wait(500); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); - - it("4. Multi Layered PropertyPane - Toggle Property controls should have focus while switching between widgets, pages and Editor Panes", () => { - propertyControlSelector = `.t--property-control-visible input[type="checkbox"]`; - verifyPropertyPaneContext( - () => { - cy.editColumn("status"); - cy.editColumn("menuIteme63irwbvnd", false); - cy.get(propertyControlSelector).click({ force: true }); - }, - () => { - cy.get(propertyControlSelector).should("be.focused"); - }, - "Table1", - ); - cy.wait(500); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "status"); - - cy.wait(500); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); - - it("5. Multi Layered PropertyPane - Property Sections should retain state while switching between widgets, pages and Editor Panes", () => { - let propertySectionState = { - basic: false, - general: true, - }; - - verifyPropertyPaneContext( - () => { - cy.editColumn("status"); - cy.editColumn("menuIteme63irwbvnd", false); - setPropertyPaneSectionState(propertySectionState); - }, - () => { - cy.wait(500); - verifyPropertyPaneSectionState(propertySectionState); - }, - "Table1", - ); - - cy.wait(500); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "status"); - - cy.wait(500); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); - - it("6. Multi Layered PropertyPane - Property Tabs and Sections should retain state while switching between widgets, pages and Editor Panes", () => { - propertySectionState = { - icon: true, - color: false, - }; - - verifyPropertyPaneContext( - () => { - cy.editColumn("status"); - cy.editColumn("menuIteme63irwbvnd", false); - cy.get(`.ads-v2-tabs__list-tab:contains("Style")`).eq(0).click(); - setPropertyPaneSectionState(propertySectionState); - }, - () => { - verifyPropertyPaneSectionState(propertySectionState); - }, - "Table1", - ); - - cy.wait(500); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "status"); - - cy.wait(500); - cy.get(propPaneBack).click(); - cy.get(".t--property-pane-title").should("contain", "Table1"); - }); -}); +describe( + "Canvas context Property Pane", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + before(() => { + _.agHelper.AddDsl("editorContextdsl"); + PageList.AddNewPage("New blank page"); + cy.dragAndDropToCanvas("textwidget", { x: 300, y: 200 }); + EditorNavigation.SelectEntityByName(page1, EntityType.Page); + _.apiPage.CreateApi(api1); + PageLeftPane.switchSegment(PagePaneSegment.UI); + }); + + beforeEach(() => { + _.agHelper.RefreshPage(); + }); + + let propPaneBack = "[data-testid='t--property-pane-back-btn']"; + + it("1. Layered PropertyPane - Property Sections should retain state while switching between widgets, pages and Editor Panes", () => { + let propertySectionState = { + data: false, + general: true, + }; + + verifyPropertyPaneContext( + () => { + cy.editColumn("step"); + setPropertyPaneSectionState(propertySectionState); + }, + () => { + cy.wait(500); + verifyPropertyPaneSectionState(propertySectionState); + }, + "Table1", + ); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); + + it("2. Layered PropertyPane - Property Tabs and Sections should retain state while switching between widgets, pages and Editor Panes", () => { + propertySectionState = { + textformatting: true, + color: false, + }; + + verifyPropertyPaneContext( + () => { + cy.editColumn("step"); + cy.get(`.ads-v2-tabs__list-tab:contains("Style")`).eq(0).click(); + setPropertyPaneSectionState(propertySectionState); + }, + () => { + verifyPropertyPaneSectionState(propertySectionState); + }, + "Table1", + ); + + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); + + it("3. Multi Layered PropertyPane - Code Editor should have focus while switching between widgets, pages and Editor Panes", function () { + let propertyControlSelector = ".t--property-control-text"; + verifyPropertyPaneContext( + () => { + cy.editColumn("status"); + cy.editColumn("menuIteme63irwbvnd", false); + cy.focusCodeInput(propertyControlSelector); + }, + () => { + cy.assertSoftFocusOnCodeInput(propertyControlSelector); + }, + "Table1", + ); + + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "status"); + + cy.wait(500); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); + + it("4. Multi Layered PropertyPane - Toggle Property controls should have focus while switching between widgets, pages and Editor Panes", () => { + propertyControlSelector = `.t--property-control-visible input[type="checkbox"]`; + verifyPropertyPaneContext( + () => { + cy.editColumn("status"); + cy.editColumn("menuIteme63irwbvnd", false); + cy.get(propertyControlSelector).click({ force: true }); + }, + () => { + cy.get(propertyControlSelector).should("be.focused"); + }, + "Table1", + ); + cy.wait(500); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "status"); + + cy.wait(500); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); + + it("5. Multi Layered PropertyPane - Property Sections should retain state while switching between widgets, pages and Editor Panes", () => { + let propertySectionState = { + basic: false, + general: true, + }; + + verifyPropertyPaneContext( + () => { + cy.editColumn("status"); + cy.editColumn("menuIteme63irwbvnd", false); + setPropertyPaneSectionState(propertySectionState); + }, + () => { + cy.wait(500); + verifyPropertyPaneSectionState(propertySectionState); + }, + "Table1", + ); + + cy.wait(500); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "status"); + + cy.wait(500); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); + + it("6. Multi Layered PropertyPane - Property Tabs and Sections should retain state while switching between widgets, pages and Editor Panes", () => { + propertySectionState = { + icon: true, + color: false, + }; + + verifyPropertyPaneContext( + () => { + cy.editColumn("status"); + cy.editColumn("menuIteme63irwbvnd", false); + cy.get(`.ads-v2-tabs__list-tab:contains("Style")`).eq(0).click(); + setPropertyPaneSectionState(propertySectionState); + }, + () => { + verifyPropertyPaneSectionState(propertySectionState); + }, + "Table1", + ); + + cy.wait(500); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "status"); + + cy.wait(500); + cy.get(propPaneBack).click(); + cy.get(".t--property-pane-title").should("contain", "Table1"); + }); + }, +); let propertySectionClass = (section) => `.t--property-pane-section-collapse-${section}`; diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Selected_Widgets_spec.js b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Selected_Widgets_spec.js index d2f599c696d..ae55672fb46 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Selected_Widgets_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Selected_Widgets_spec.js @@ -13,7 +13,7 @@ const api1 = "API1"; describe( "Canvas context widget selection", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { before(() => { _.agHelper.AddDsl("editorContextdsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/Command_Click_Navigation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/IDE/Command_Click_Navigation_spec.js index 1ae8d3082b1..114e4230103 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/Command_Click_Navigation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/Command_Click_Navigation_spec.js @@ -29,180 +29,192 @@ const JSInput2TestCode = let repoName; -describe("1. CommandClickNavigation", { tags: ["@tag.IDE"] }, function () { - it("1. Import application & Assert few things", () => { - homePage.NavigateToHome(); - cy.reload(); - homePage.ImportApp("ContextSwitching.json"); - cy.wait("@importNewApplication").then((interception) => { - agHelper.Sleep(); - const { isPartialImport } = interception.response.body.data; - if (isPartialImport) { - // should reconnect modal - cy.get(reconnectDatasourceModal.SkipToAppBtn).click({ - force: true, - }); - agHelper.Sleep(2000); - } else { - homePage.AssertImportToast(); - } - }); - - //Assert link and and style - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget, {}, [ - "Container1", - ]); - - cy.updateCodeInput(".t--property-control-text", "{{ Graphql_Query.data }}"); - - cy.get(`[${NAVIGATION_ATTRIBUTE}="Graphql_Query"]`) - .should("have.length", 1) - .should("have.text", "Graphql_Query") - .realHover() - .should("have.css", "cursor", "text"); - - // TODO how to hover with cmd or ctrl to assert pointer? +describe( + "1. CommandClickNavigation", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + it("1. Import application & Assert few things", () => { + homePage.NavigateToHome(); + cy.reload(); + homePage.ImportApp("ContextSwitching.json"); + cy.wait("@importNewApplication").then((interception) => { + agHelper.Sleep(); + const { isPartialImport } = interception.response.body.data; + if (isPartialImport) { + // should reconnect modal + cy.get(reconnectDatasourceModal.SkipToAppBtn).click({ + force: true, + }); + agHelper.Sleep(2000); + } else { + homePage.AssertImportToast(); + } + }); + + //Assert link and and style + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget, {}, [ + "Container1", + ]); + + cy.updateCodeInput( + ".t--property-control-text", + "{{ Graphql_Query.data }}", + ); + + cy.get(`[${NAVIGATION_ATTRIBUTE}="Graphql_Query"]`) + .should("have.length", 1) + .should("have.text", "Graphql_Query") + .realHover() + .should("have.css", "cursor", "text"); + + // TODO how to hover with cmd or ctrl to assert pointer? + + // Assert navigation only when cmd or ctrl is pressed - // Assert navigation only when cmd or ctrl is pressed + agHelper.Sleep(); + cy.get(`[${NAVIGATION_ATTRIBUTE}="Graphql_Query"]`).click({ + force: true, + }); + cy.url().should("not.contain", "/api/"); + + cy.get(`[${NAVIGATION_ATTRIBUTE}="Graphql_Query"]`).click({ + ctrlKey: true, + force: true, + }); + + cy.url().should("contain", "/api/"); + + //Assert working on url field + cy.updateCodeInput( + ".t--dataSourceField", + "http://host.docker.internal:5001/{{ SQL_Query.data }}", + ); + agHelper.Sleep(); - agHelper.Sleep(); - cy.get(`[${NAVIGATION_ATTRIBUTE}="Graphql_Query"]`).click({ force: true }); - cy.url().should("not.contain", "/api/"); + cy.get(`[${NAVIGATION_ATTRIBUTE}="SQL_Query"]`) + .should("have.length", 1) + .click({ cmdKey: true, force: true }); - cy.get(`[${NAVIGATION_ATTRIBUTE}="Graphql_Query"]`).click({ - ctrlKey: true, - force: true, + cy.url().should("contain", "/queries/"); }); - cy.url().should("contain", "/api/"); - - //Assert working on url field - cy.updateCodeInput( - ".t--dataSourceField", - "http://host.docker.internal:5001/{{ SQL_Query.data }}", - ); - agHelper.Sleep(); - - cy.get(`[${NAVIGATION_ATTRIBUTE}="SQL_Query"]`) - .should("have.length", 1) - .click({ cmdKey: true, force: true }); - - cy.url().should("contain", "/queries/"); - }); - - it("2. Will open & close modals ", () => { - cy.updateCodeInput( - ".t--actionConfiguration\\.body", - "SELECT * from {{ Button3.text }}", - ); - agHelper.Sleep(); - cy.get(`[${NAVIGATION_ATTRIBUTE}="Button3"]`) - .should("have.length", 1) - .click({ cmdKey: true }); - - cy.url().should("not.contain", "/queries/"); - - //CLose modal - cy.updateCodeInput( - `${locators._propertyControl}tooltip`, - "{{ Image1.image }}", - ); - - // TODO: Debug why image1 data-navigate-to wasn't found - // cy.get(`[${NAVIGATION_ATTRIBUTE}="Image1"]`) - // .should("have.length", 1) - // .click({ cmdKey: true }); - }); - - it("3. Will navigate to specific JS Functions", () => { - // It was found that when having git connected, - // cmd clicking to JS function reloaded the app. Will assert that does not happen - cy.generateUUID().then((uid) => { - const repoName = uid; - gitSync.CreateNConnectToGit(repoName); - gitSync.CreateGitBranch(repoName); - }); - - cy.get("@gitRepoName").then((repName) => { - repoName = repName; + it("2. Will open & close modals ", () => { + cy.updateCodeInput( + ".t--actionConfiguration\\.body", + "SELECT * from {{ Button3.text }}", + ); + agHelper.Sleep(); + cy.get(`[${NAVIGATION_ATTRIBUTE}="Button3"]`) + .should("have.length", 1) + .click({ cmdKey: true }); + + cy.url().should("not.contain", "/queries/"); + + //CLose modal + cy.updateCodeInput( + `${locators._propertyControl}tooltip`, + "{{ Image1.image }}", + ); + + // TODO: Debug why image1 data-navigate-to wasn't found + // cy.get(`[${NAVIGATION_ATTRIBUTE}="Image1"]`) + // .should("have.length", 1) + // .click({ cmdKey: true }); }); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget, {}, [ - "Container1", - ]); - cy.updateCodeInput(".t--property-control-text", "{{ JSObject1.myFun1() }}"); + it("3. Will navigate to specific JS Functions", () => { + // It was found that when having git connected, + // cmd clicking to JS function reloaded the app. Will assert that does not happen + cy.generateUUID().then((uid) => { + const repoName = uid; + gitSync.CreateNConnectToGit(repoName); + gitSync.CreateGitBranch(repoName); + }); + + cy.get("@gitRepoName").then((repName) => { + repoName = repName; + }); + + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget, {}, [ + "Container1", + ]); + cy.updateCodeInput( + ".t--property-control-text", + "{{ JSObject1.myFun1() }}", + ); - agHelper.Sleep(); + agHelper.Sleep(); - cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myFun1"]`).click({ - cmdKey: true, - force: true, - }); + cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myFun1"]`).click({ + cmdKey: true, + force: true, + }); - cy.assertCursorOnCodeInput(".js-editor", { ch: 1, line: 3 }); - agHelper.Sleep(); + cy.assertCursorOnCodeInput(".js-editor", { ch: 1, line: 3 }); + agHelper.Sleep(); - // Assert context switching works when going back to canvas - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + // Assert context switching works when going back to canvas + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - cy.get(`div[data-testid='t--selected']`).should("have.length", 1); - cy.get(".t--property-pane-title").should("contain", "Text1"); + cy.get(`div[data-testid='t--selected']`).should("have.length", 1); + cy.get(".t--property-pane-title").should("contain", "Text1"); - // Go back to JS editor - cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myFun1"]`).click({ - ctrlKey: true, + // Go back to JS editor + cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myFun1"]`).click({ + ctrlKey: true, + }); }); - }); - it("4. Will navigate within Js Object properly", () => { - cy.updateCodeInput(".js-editor", JSInputTestCode); - agHelper.Sleep(2000); - cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myVar1"]`).click({ - ctrlKey: true, - }); - cy.getCodeInput(".js-editor").then((input) => { - const codeMirrorInput = input[0].CodeMirror; - codeMirrorInput.focus(); - }); - cy.assertCursorOnCodeInput(".js-editor", { ch: 2, line: 1 }); - agHelper.Sleep(); - cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myFun1"]`).click({ - ctrlKey: true, - }); - cy.getCodeInput(".js-editor").then((input) => { - const codeMirrorInput = input[0].CodeMirror; - codeMirrorInput.focus(); - }); - - cy.assertCursorOnCodeInput(".js-editor", { ch: 2, line: 2 }); - agHelper.Sleep(); - cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject2.myFun1"]`).click({ - ctrlKey: true, + it("4. Will navigate within Js Object properly", () => { + cy.updateCodeInput(".js-editor", JSInputTestCode); + agHelper.Sleep(2000); + cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myVar1"]`).click({ + ctrlKey: true, + }); + cy.getCodeInput(".js-editor").then((input) => { + const codeMirrorInput = input[0].CodeMirror; + codeMirrorInput.focus(); + }); + cy.assertCursorOnCodeInput(".js-editor", { ch: 2, line: 1 }); + agHelper.Sleep(); + cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject1.myFun1"]`).click({ + ctrlKey: true, + }); + cy.getCodeInput(".js-editor").then((input) => { + const codeMirrorInput = input[0].CodeMirror; + codeMirrorInput.focus(); + }); + + cy.assertCursorOnCodeInput(".js-editor", { ch: 2, line: 2 }); + agHelper.Sleep(); + cy.get(`[${NAVIGATION_ATTRIBUTE}="JSObject2.myFun1"]`).click({ + ctrlKey: true, + }); + + cy.getCodeInput(".js-editor").then((input) => { + const codeMirrorInput = input[0].CodeMirror; + expect(codeMirrorInput.getValue()).to.equal(JSInput2TestCode); + }); }); - cy.getCodeInput(".js-editor").then((input) => { - const codeMirrorInput = input[0].CodeMirror; - expect(codeMirrorInput.getValue()).to.equal(JSInput2TestCode); + // Functionality isn't implemented yet + // it("5. Will work with string arguments in framework functions", () => { + // entityExplorer.ExpandCollapseEntity("Widgets"); + // EditorNavigation.SelectEntityByName("Button1", EntityType.Widget, {}, ["Container1"]); + // cy.get(PROPERTY_SELECTOR.onClick).find(".t--js-toggle").click(); + // cy.updateCodeInput( + // PROPERTY_SELECTOR.onClick, + // "{{ resetWidget('Input1') }}", + // ); + // agHelper.Sleep(); + // cy.get(`[${NAVIGATION_ATTRIBUTE}="Input1"]`) + // .should("have.length", 1) + // .click({ cmdKey: true }); + // }); + + after(() => { + //clean up + gitSync.DeleteTestGithubRepo(repoName); }); - }); - - // Functionality isn't implemented yet - // it("5. Will work with string arguments in framework functions", () => { - // entityExplorer.ExpandCollapseEntity("Widgets"); - // EditorNavigation.SelectEntityByName("Button1", EntityType.Widget, {}, ["Container1"]); - // cy.get(PROPERTY_SELECTOR.onClick).find(".t--js-toggle").click(); - // cy.updateCodeInput( - // PROPERTY_SELECTOR.onClick, - // "{{ resetWidget('Input1') }}", - // ); - // agHelper.Sleep(); - // cy.get(`[${NAVIGATION_ATTRIBUTE}="Input1"]`) - // .should("have.length", 1) - // .click({ cmdKey: true }); - // }); - - after(() => { - //clean up - gitSync.DeleteTestGithubRepo(repoName); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/Editor_Segment_Context_Switching_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/IDE/Editor_Segment_Context_Switching_spec.ts index 615ac338891..1c08e1f480c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/Editor_Segment_Context_Switching_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/Editor_Segment_Context_Switching_spec.ts @@ -11,7 +11,7 @@ import reconnectDatasourceModal from "../../../../locators/ReconnectLocators"; describe( "Editor Segment Context Switch", - { tags: ["@tag.IDE", "@tag.ImportExport"] }, + { tags: ["@tag.IDE", "@tag.ImportExport", "@tag.PropertyPane", "@tag.Git"] }, function () { before("Import the test application", () => { homePage.CreateNewWorkspace("IDETest", true); diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/IDE_Add_Pane_Interactions_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/IDE/IDE_Add_Pane_Interactions_spec.ts index e8bd59c4233..afbfca8469b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/IDE_Add_Pane_Interactions_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/IDE_Add_Pane_Interactions_spec.ts @@ -10,81 +10,85 @@ import AddView from "../../../../support/Pages/IDE/AddView"; const agHelper = ObjectsRegistry.AggregateHelper; const commonLocators = ObjectsRegistry.CommonLocators; -describe("IDE add pane interactions", { tags: ["@tag.IDE"] }, () => { - it("1. UI tab add interactions", () => { - // check add pane is open - PageLeftPane.assertInAddView(); - // close add pane to show blank state - PageLeftPane.closeAddView(); - // click on add button and check add state - PageLeftPane.switchToAddNew(); - // check add pane - PageLeftPane.assertInAddView(); - // drag and drop a widget and list view should be opened - cy.dragAndDropToCanvas("textwidget", { x: 300, y: 200 }); - // check listing ui - PageLeftPane.selectedItem().contains("Text1"); - // click add button - PageLeftPane.switchToAddNew(); - // check add pane is open - PageLeftPane.assertInAddView(); - // close add pane - PageLeftPane.closeAddView(); - // click on canvas and check add pane visible or not - agHelper.GetNClick(commonLocators._canvas).click(); - // check add pane - PageLeftPane.assertInAddView(); - }); +describe( + "IDE add pane interactions", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + () => { + it("1. UI tab add interactions", () => { + // check add pane is open + PageLeftPane.assertInAddView(); + // close add pane to show blank state + PageLeftPane.closeAddView(); + // click on add button and check add state + PageLeftPane.switchToAddNew(); + // check add pane + PageLeftPane.assertInAddView(); + // drag and drop a widget and list view should be opened + cy.dragAndDropToCanvas("textwidget", { x: 300, y: 200 }); + // check listing ui + PageLeftPane.selectedItem().contains("Text1"); + // click add button + PageLeftPane.switchToAddNew(); + // check add pane is open + PageLeftPane.assertInAddView(); + // close add pane + PageLeftPane.closeAddView(); + // click on canvas and check add pane visible or not + agHelper.GetNClick(commonLocators._canvas).click(); + // check add pane + PageLeftPane.assertInAddView(); + }); - it("2. JS tab add interactions", () => { - /** Fullscreen */ - // switch to JS tab from UI - PageLeftPane.switchSegment(PagePaneSegment.JS); - // check and click on blank state add button - PageLeftPane.switchToAddNew(); - // check listing UI - PageLeftPane.assertInListView(); - // click on add btn in the listing UI - PageLeftPane.switchToAddNew(); - // check item got added or not - PageLeftPane.assertInListView(); - PageLeftPane.assertItemCount(2); - /** Splitscreen */ - // switch to splitscreen - EditorNavigation.SwitchScreenMode(EditorViewMode.SplitScreen); - // click on add - FileTabs.switchToAddNew(); - // check tabs count to verify js added or not - FileTabs.assertTabCount(3); - }); + it("2. JS tab add interactions", () => { + /** Fullscreen */ + // switch to JS tab from UI + PageLeftPane.switchSegment(PagePaneSegment.JS); + // check and click on blank state add button + PageLeftPane.switchToAddNew(); + // check listing UI + PageLeftPane.assertInListView(); + // click on add btn in the listing UI + PageLeftPane.switchToAddNew(); + // check item got added or not + PageLeftPane.assertInListView(); + PageLeftPane.assertItemCount(2); + /** Splitscreen */ + // switch to splitscreen + EditorNavigation.SwitchScreenMode(EditorViewMode.SplitScreen); + // click on add + FileTabs.switchToAddNew(); + // check tabs count to verify js added or not + FileTabs.assertTabCount(3); + }); - it("3. Queries tab add interactions", () => { - /** Fullscreen */ - EditorNavigation.SwitchScreenMode(EditorViewMode.FullScreen); - // switch to Query tab from JS - PageLeftPane.switchSegment(PagePaneSegment.Queries); - // check and click on blank state add button - PageLeftPane.switchToAddNew(); - // check add pane - PageLeftPane.assertInAddView(); - // close add tab - FileTabs.closeTab("new_query"); - // open add pane to add item - PageLeftPane.switchToAddNew(); - // add item - cy.get(".t--new-blank-api").children("div").first().click(); - // check item added or not - PageLeftPane.assertPresence("Api1"); - /** Splitscreen */ - // switch to splitscreen - EditorNavigation.SwitchScreenMode(EditorViewMode.SplitScreen); - // click on add - FileTabs.switchToAddNew(); - // check add pane - PageLeftPane.assertInAddView(); - // add item - cy.get(".t--new-blank-api").children("div").first().click(); - // check tabs count to verify js added or not - FileTabs.assertTabCount(2); - }); -}); + it("3. Queries tab add interactions", () => { + /** Fullscreen */ + EditorNavigation.SwitchScreenMode(EditorViewMode.FullScreen); + // switch to Query tab from JS + PageLeftPane.switchSegment(PagePaneSegment.Queries); + // check and click on blank state add button + PageLeftPane.switchToAddNew(); + // check add pane + PageLeftPane.assertInAddView(); + // close add tab + FileTabs.closeTab("new_query"); + // open add pane to add item + PageLeftPane.switchToAddNew(); + // add item + cy.get(".t--new-blank-api").children("div").first().click(); + // check item added or not + PageLeftPane.assertPresence("Api1"); + /** Splitscreen */ + // switch to splitscreen + EditorNavigation.SwitchScreenMode(EditorViewMode.SplitScreen); + // click on add + FileTabs.switchToAddNew(); + // check add pane + PageLeftPane.assertInAddView(); + // add item + cy.get(".t--new-blank-api").children("div").first().click(); + // check tabs count to verify js added or not + FileTabs.assertTabCount(2); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/JSLibrary/Library_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/JSLibrary/Library_spec.ts index 49f4bf74387..16d7edefd6a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/JSLibrary/Library_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/JSLibrary/Library_spec.ts @@ -18,7 +18,7 @@ import { describe( "Tests JS Libraries", - { tags: ["@tag.excludeForAirgap", "@tag.JS"] }, + { tags: ["@tag.excludeForAirgap", "@tag.JS", "@tag.Binding"] }, () => { it("1. Validates Library install/uninstall", () => { AppSidebar.navigate(AppSidebarButton.Libraries); diff --git a/app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObjectMutation_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObjectMutation_spec.ts index a41a81b44da..dbcd6c681a5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObjectMutation_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObjectMutation_spec.ts @@ -6,7 +6,7 @@ import EditorNavigation, { } from "../../../../support/Pages/EditorNavigation"; const commonlocators = require("../../../../locators/commonlocators.json"); -describe("JSObject testing", { tags: ["@tag.JS"] }, () => { +describe("JSObject testing", { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { _.homePage.NavigateToHome(); _.homePage.ImportApp("JSObjectMutationTestApp.json"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/JSObject/JS_Editor_Assert_NoFunctionAvailableText_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/JSObject/JS_Editor_Assert_NoFunctionAvailableText_spec.ts index 50d4c734224..c7dff582060 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/JSObject/JS_Editor_Assert_NoFunctionAvailableText_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/JSObject/JS_Editor_Assert_NoFunctionAvailableText_spec.ts @@ -1,9 +1,12 @@ import { jsEditor } from "../../../../support/Objects/ObjectsCore"; -describe("List no functions on empty collection", { tags: ["@tag.JS"] }, () => { - it("1. Bug 9585: should not show functions when whole code is deleted", () => { - jsEditor.CreateJSObject( - `export default { +describe( + "List no functions on empty collection", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + it("1. Bug 9585: should not show functions when whole code is deleted", () => { + jsEditor.CreateJSObject( + `export default { myFun1: () => { function hi(a,b) { console.log(a,b); @@ -14,15 +17,16 @@ describe("List no functions on empty collection", { tags: ["@tag.JS"] }, () => { //use async-await or promises } }`, - { - completeReplace: true, - toRun: false, - prettify: false, - }, - ); + { + completeReplace: true, + toRun: false, + prettify: false, + }, + ); - jsEditor.AssertSelectedFunction("myFun1"); - jsEditor.ClearJSObj(); - jsEditor.AssertSelectedFunction("No function available"); - }); -}); + jsEditor.AssertSelectedFunction("myFun1"); + jsEditor.ClearJSObj(); + jsEditor.AssertSelectedFunction("No function available"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Linting/AsyncFunctionsBoundInSyncFields_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Linting/AsyncFunctionsBoundInSyncFields_Spec.ts index 18789f6bb53..2bea53ce8a8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Linting/AsyncFunctionsBoundInSyncFields_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Linting/AsyncFunctionsBoundInSyncFields_Spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Linting async JSFunctions bound to data fields", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify("buttonwidget", 300, 300); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts index 4331996e14f..46c87340756 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts @@ -57,7 +57,7 @@ const createMySQLDatasourceQuery = () => { dataSources.CreateQueryForDS(dsName, `SELECT * FROM spacecrafts LIMIT 10;`); }; -describe("Linting", { tags: ["@tag.JS"] }, () => { +describe("Linting", { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify("buttonwidget", 300, 300); dataSources.CreateDataSource("MySql"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Linting/EntityPropertiesLint_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Linting/EntityPropertiesLint_spec.ts index eb36be4f952..f0dd1036932 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Linting/EntityPropertiesLint_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Linting/EntityPropertiesLint_spec.ts @@ -15,107 +15,113 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../support/Pages/EditorNavigation"; -describe("Linting of entity properties", { tags: ["@tag.JS"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); - }); +describe( + "Linting of entity properties", + { tags: ["@tag.JS", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300); + }); - it("1. Shows correct lint error when wrong Api property is binded", () => { - const invalidProperty = "unknownProperty"; - // create Api1 - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - ); - // Edit Button onclick property - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{function(){ + it("1. Shows correct lint error when wrong Api property is binded", () => { + const invalidProperty = "unknownProperty"; + // create Api1 + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + ); + // Edit Button onclick property + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{function(){ console.log(Api1.${invalidProperty}) }()}}`, - ); - cy.wait(200); - cy.focused().blur(); - propPane.UpdatePropertyFieldValue("Label", `{{Api1.${invalidProperty}}}`); - agHelper.AssertElementLength(locators._lintErrorElement, 2); - agHelper.HoverElement(locators._lintErrorElement); - agHelper.AssertContains(`"${invalidProperty}" doesn't exist in Api1`); - agHelper.GetNClick(locators._canvas); - }); + ); + cy.wait(200); + cy.focused().blur(); + propPane.UpdatePropertyFieldValue("Label", `{{Api1.${invalidProperty}}}`); + agHelper.AssertElementLength(locators._lintErrorElement, 2); + agHelper.HoverElement(locators._lintErrorElement); + agHelper.AssertContains(`"${invalidProperty}" doesn't exist in Api1`); + agHelper.GetNClick(locators._canvas); + }); - it("2. Shows correct lint error when wrong JSObject property is binded", () => { - // create JSObject - jsEditor.CreateJSObject( - `export default { + it("2. Shows correct lint error when wrong JSObject property is binded", () => { + // create JSObject + jsEditor.CreateJSObject( + `export default { myFun1: () => { console.log("JSOBJECT 1") } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }, - ); - const invalidProperty = "unknownFunction"; - // Edit Button onclick and text property - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{function(){ + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }, + ); + const invalidProperty = "unknownFunction"; + // Edit Button onclick and text property + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{function(){ console.log(JSObject1.${invalidProperty}) }()}}`, - ); - cy.wait(200); - propPane.UpdatePropertyFieldValue( - "Label", - `{{JSObject1.${invalidProperty}}}`, - ); - // Assert lint errors - agHelper.AssertElementLength(locators._lintErrorElement, 2); - agHelper.HoverElement(locators._lintErrorElement); - agHelper.AssertContains(`"${invalidProperty}" doesn't exist in JSObject1`); + ); + cy.wait(200); + propPane.UpdatePropertyFieldValue( + "Label", + `{{JSObject1.${invalidProperty}}}`, + ); + // Assert lint errors + agHelper.AssertElementLength(locators._lintErrorElement, 2); + agHelper.HoverElement(locators._lintErrorElement); + agHelper.AssertContains( + `"${invalidProperty}" doesn't exist in JSObject1`, + ); - // Edit JS Object and add "unknown" function - EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); - jsEditor.EditJSObj(`export default { + // Edit JS Object and add "unknown" function + EditorNavigation.SelectEntityByName("JSObject1", EntityType.JSObject); + jsEditor.EditJSObj(`export default { ${invalidProperty}: () => { console.log("JSOBJECT 1") } }`); - // select button, and assert that no lint is present - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - agHelper.AssertElementAbsence(locators._lintErrorElement); - // delete JSObject - PageLeftPane.switchSegment(PagePaneSegment.JS); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "JSObject1", - action: "Delete", - entityType: entityItems.JSObject, - }); - // select button, and assert that lint error is present - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - agHelper.AssertElementLength(locators._lintErrorElement, 2); - agHelper.HoverElement(locators._lintErrorElement); - agHelper.AssertContains(`'JSObject1' is not defined`); - // create js object - jsEditor.CreateJSObject( - `export default { + // select button, and assert that no lint is present + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + agHelper.AssertElementAbsence(locators._lintErrorElement); + // delete JSObject + PageLeftPane.switchSegment(PagePaneSegment.JS); + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: "JSObject1", + action: "Delete", + entityType: entityItems.JSObject, + }); + // select button, and assert that lint error is present + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + agHelper.AssertElementLength(locators._lintErrorElement, 2); + agHelper.HoverElement(locators._lintErrorElement); + agHelper.AssertContains(`'JSObject1' is not defined`); + // create js object + jsEditor.CreateJSObject( + `export default { ${invalidProperty}: () => { console.log("JSOBJECT 1") } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }, - ); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }, + ); - // select button, and assert that no lint error is present - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - agHelper.AssertElementAbsence(locators._lintErrorElement); - }); -}); + // select button, and assert that no lint error is present + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + agHelper.AssertElementAbsence(locators._lintErrorElement); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Linting/ErrorReporting_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Linting/ErrorReporting_spec.ts index 0ffeaa75873..e25cd04e84c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Linting/ErrorReporting_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Linting/ErrorReporting_spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../support/Pages/EditorNavigation"; -describe("Lint error reporting", { tags: ["@tag.JS"] }, () => { +describe("Lint error reporting", { tags: ["@tag.JS", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 300, 500); table.AddSampleTableData(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Onboarding/StartFromData_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Onboarding/StartFromData_spec.ts index da36efe2b28..5f2158612d3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Onboarding/StartFromData_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Onboarding/StartFromData_spec.ts @@ -10,7 +10,14 @@ import { describe( "Start with data userflow : Create different datasources and save", - { tags: ["@tag.excludeForAirgap", "@tag.Datasource"] }, + { + tags: [ + "@tag.excludeForAirgap", + "@tag.Datasource", + "@tag.Git", + "@tag.AccessControl", + ], + }, function () { beforeEach(() => { homePage.Signout(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/OneClickBindingMysql_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/OneClickBindingMysql_spec.ts index 1ae360fd105..19620479ef5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/OneClickBindingMysql_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OneClickBinding/TableWidget/OneClickBindingMysql_spec.ts @@ -16,7 +16,7 @@ const oneClickBinding = new OneClickBinding(); describe( "Table widget one click binding feature", - { tags: ["@tag.Widget"] }, + { tags: ["@tag.Widget", "@tag.Binding"] }, () => { it("1.should check that queries are created and bound to table widget properly", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 400); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApiError_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApiError_spec.ts index 993674bed8d..622e3eee241 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApiError_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApiError_spec.ts @@ -4,27 +4,31 @@ import EditorNavigation, { EditorViewMode, } from "../../../../support/Pages/EditorNavigation"; -describe("Api Error Debugger", { tags: ["@tag.IDE"] }, () => { - before(() => { - // Create api that causes an error - _.apiPage.CreateAndFillApi("https://fakeapi/user"); - }); - it("it shows error message", () => { - _.apiPage.RunAPI(false); - _.debuggerHelper.AssertOpen(PageType.API); - _.apiPage.ResponseStatusCheck("PE-RST-5000"); - }); - it("it shows debug button and navigates", () => { - _.apiPage.DebugError(); - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_ERRORS(), - ); - _.debuggerHelper.AssertErrorCount(1); - EditorNavigation.SwitchScreenMode(EditorViewMode.SplitScreen); - _.apiPage.DebugError(); - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_ERRORS(), - ); - _.debuggerHelper.AssertErrorCount(1); - }); -}); +describe( + "Api Error Debugger", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + () => { + before(() => { + // Create api that causes an error + _.apiPage.CreateAndFillApi("https://fakeapi/user"); + }); + it("it shows error message", () => { + _.apiPage.RunAPI(false); + _.debuggerHelper.AssertOpen(PageType.API); + _.apiPage.ResponseStatusCheck("PE-RST-5000"); + }); + it("it shows debug button and navigates", () => { + _.apiPage.DebugError(); + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_ERRORS(), + ); + _.debuggerHelper.AssertErrorCount(1); + EditorNavigation.SwitchScreenMode(EditorViewMode.SplitScreen); + _.apiPage.DebugError(); + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_ERRORS(), + ); + _.debuggerHelper.AssertErrorCount(1); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts index 23d9464dffc..806170b30ff 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/EntityBottomBar_spec.ts @@ -2,152 +2,159 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; import { PageType } from "../../../../support/Pages/DebuggerHelper"; import EditorNavigation from "../../../../support/Pages/EditorNavigation"; -describe("Entity bottom bar", { tags: ["@tag.IDE"] }, () => { - it("1. Debugger should be closable", () => { - //Verify if bottom bar is closed. - _.debuggerHelper.AssertClosed(); - //verify if bottom bar is open on clicking debugger icon in canvas. - _.debuggerHelper.OpenDebugger(); - _.debuggerHelper.AssertOpen(PageType.Canvas); - //Verify if selected tab is errors in tab title. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_ERRORS(), - ); - // verify if bottom bar is closed on clicking close icon in canvas. - _.debuggerHelper.CloseBottomBar(); - _.debuggerHelper.AssertClosed(); - }); - - it("2. Jseditor bottom bar should be collapsable", () => { - _.jsEditor.CreateJSObject(` return "hello world";`); - //Verify if bottom bar opens JSEditor. - _.debuggerHelper.AssertOpen(PageType.JsEditor); - // Verify if selected tab is response. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), - ); - //Verify if bottom bar is closed on clicking close icon in JSEditor. - _.debuggerHelper.CloseBottomBar(); - _.debuggerHelper.AssertClosed(); - //Verify if bottom bar is open on executing JSFunction. - _.jsEditor.RunJSObj(); - _.debuggerHelper.AssertOpen(PageType.JsEditor); - //verify if response tab is selected on execution JSFunction. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), - ); - //verify if bottom bar is closed on switching to canvas page. - EditorNavigation.ShowCanvas(); - _.debuggerHelper.AssertClosed(); - }); +describe( + "Entity bottom bar", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + () => { + it("1. Debugger should be closable", () => { + //Verify if bottom bar is closed. + _.debuggerHelper.AssertClosed(); + //verify if bottom bar is open on clicking debugger icon in canvas. + _.debuggerHelper.OpenDebugger(); + _.debuggerHelper.AssertOpen(PageType.Canvas); + //Verify if selected tab is errors in tab title. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_ERRORS(), + ); + // verify if bottom bar is closed on clicking close icon in canvas. + _.debuggerHelper.CloseBottomBar(); + _.debuggerHelper.AssertClosed(); + }); - it("3. Api bottom pane should be collapsable", () => { - _.apiPage.CreateAndFillApi( - _.dataManager.dsValues[_.dataManager.defaultEnviorment].mockApiUrl, - ); - //Verify that the errors tab is still closed. - _.debuggerHelper.AssertClosed(); - //Verify if bottom bar opens on clicking debugger icon in api page. - _.debuggerHelper.OpenDebugger(); - _.debuggerHelper.AssertOpen(PageType.API); - //Verify if selected tab is errors in tab title. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_ERRORS(), - ); - //Verify if bottom bar is open on executing api. - _.apiPage.RunAPI(); - _.agHelper.Sleep(1000); - _.debuggerHelper.AssertOpen(PageType.API); - //verify if response tab is selected on execution api. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), - ); - }); + it("2. Jseditor bottom bar should be collapsable", () => { + _.jsEditor.CreateJSObject(` return "hello world";`); + //Verify if bottom bar opens JSEditor. + _.debuggerHelper.AssertOpen(PageType.JsEditor); + // Verify if selected tab is response. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), + ); + //Verify if bottom bar is closed on clicking close icon in JSEditor. + _.debuggerHelper.CloseBottomBar(); + _.debuggerHelper.AssertClosed(); + //Verify if bottom bar is open on executing JSFunction. + _.jsEditor.RunJSObj(); + _.debuggerHelper.AssertOpen(PageType.JsEditor); + //verify if response tab is selected on execution JSFunction. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), + ); + //verify if bottom bar is closed on switching to canvas page. + EditorNavigation.ShowCanvas(); + _.debuggerHelper.AssertClosed(); + }); - it("4. Bottom bar in Datasource", () => { - //Verify if bottom bar remain open on shifting to create new datasource page. - _.dataSources.NavigateToDSCreateNew(); - //Expecting errors tab to be closed as this is now a datasource - _.debuggerHelper.AssertClosed(); - //Verify if bottom bar opens on clicking debugger icon in datasource page. - _.debuggerHelper.OpenDebugger(); - _.debuggerHelper.AssertOpen(PageType.DataSources); - }); + it("3. Api bottom pane should be collapsable", () => { + _.apiPage.CreateAndFillApi( + _.dataManager.dsValues[_.dataManager.defaultEnviorment].mockApiUrl, + ); + //Verify that the errors tab is still closed. + _.debuggerHelper.AssertClosed(); + //Verify if bottom bar opens on clicking debugger icon in api page. + _.debuggerHelper.OpenDebugger(); + _.debuggerHelper.AssertOpen(PageType.API); + //Verify if selected tab is errors in tab title. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_ERRORS(), + ); + //Verify if bottom bar is open on executing api. + _.apiPage.RunAPI(); + _.agHelper.Sleep(1000); + _.debuggerHelper.AssertOpen(PageType.API); + //verify if response tab is selected on execution api. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), + ); + }); - it( - "5. Query bottom bar should be collapsable", - { tags: ["@tag.excludeForAirgap"] }, - () => { - _.dataSources.CreateMockDB("Users").then((dbName) => { - //Verify if bottom bar remain open on shifting to active datasource page. - _.debuggerHelper.AssertOpen(PageType.DataSources); - //Verify if selected tab is errors and error count is - //Verify if selected tab is errors in tab title. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_ERRORS(), - ); - //Verify if bottom bar is closed on clicking close icon in active datasource page. - _.debuggerHelper.CloseBottomBar(); - _.debuggerHelper.AssertClosed(); - //Verify if bottom bar opens on clicking debugger icon in query page. - _.dataSources.CreateQueryAfterDSSaved(); - _.debuggerHelper.OpenDebugger(); - _.debuggerHelper.AssertOpen(PageType.Query); - //Verify if bottom bar is closed on clicking close icon in query page. - _.debuggerHelper.CloseBottomBar(); - _.debuggerHelper.AssertClosed(); - //Create and run query. + it("4. Bottom bar in Datasource", () => { + //Verify if bottom bar remain open on shifting to create new datasource page. + _.dataSources.NavigateToDSCreateNew(); + //Expecting errors tab to be closed as this is now a datasource + _.debuggerHelper.AssertClosed(); + //Verify if bottom bar opens on clicking debugger icon in datasource page. + _.debuggerHelper.OpenDebugger(); + _.debuggerHelper.AssertOpen(PageType.DataSources); + }); - _.dataSources.EnterQuery( - "SELECT * FROM users ORDER BY id LIMIT 10;", - 1000, - ); - _.dataSources.RunQuery(); - //Verify if bottom bar is open on executing query. - _.debuggerHelper.AssertOpen(PageType.Query); - //Verify if response atb is selected on executing query. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), - ); - // clean up - _.dataSources.DeleteQuery("Query1"); - _.dataSources.DeleteDatasourceFromWithinDS(dbName); - }); - }, - ); + it( + "5. Query bottom bar should be collapsable", + { tags: ["@tag.excludeForAirgap"] }, + () => { + _.dataSources.CreateMockDB("Users").then((dbName) => { + //Verify if bottom bar remain open on shifting to active datasource page. + _.debuggerHelper.AssertOpen(PageType.DataSources); + //Verify if selected tab is errors and error count is + //Verify if selected tab is errors in tab title. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_ERRORS(), + ); + //Verify if bottom bar is closed on clicking close icon in active datasource page. + _.debuggerHelper.CloseBottomBar(); + _.debuggerHelper.AssertClosed(); + //Verify if bottom bar opens on clicking debugger icon in query page. + _.dataSources.CreateQueryAfterDSSaved(); + _.debuggerHelper.OpenDebugger(); + _.debuggerHelper.AssertOpen(PageType.Query); + //Verify if bottom bar is closed on clicking close icon in query page. + _.debuggerHelper.CloseBottomBar(); + _.debuggerHelper.AssertClosed(); + //Create and run query. - it("airgap", "5. Query bottom bar should be collapsable - airgap", () => { - _.dataSources.CreateDataSource("Postgres"); - //Verify if bottom bar remain open on shifting to active datasource page. - _.debuggerHelper.AssertOpen(PageType.DataSources); - //Verify if selected tab is errors and error count is - //Verify if selected tab is errors in tab title. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_ERRORS(), + _.dataSources.EnterQuery( + "SELECT * FROM users ORDER BY id LIMIT 10;", + 1000, + ); + _.dataSources.RunQuery(); + //Verify if bottom bar is open on executing query. + _.debuggerHelper.AssertOpen(PageType.Query); + //Verify if response atb is selected on executing query. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), + ); + // clean up + _.dataSources.DeleteQuery("Query1"); + _.dataSources.DeleteDatasourceFromWithinDS(dbName); + }); + }, ); - //Verify if bottom bar is closed on clicking close icon in active datasource page. - _.debuggerHelper.CloseBottomBar(); - _.debuggerHelper.AssertClosed(); - //Verify if bottom bar opens on clicking debugger icon in query page. - _.dataSources.CreateQueryAfterDSSaved(); - _.debuggerHelper.OpenDebugger(); - _.debuggerHelper.AssertOpen(PageType.Query); - //Verify if bottom bar is closed on clicking close icon in query page. - _.debuggerHelper.CloseBottomBar(); - _.debuggerHelper.AssertClosed(); - //Create and run query. - _.dataSources.EnterQuery("SELECT * FROM users ORDER BY id LIMIT 10;", 1000); - _.dataSources.RunQuery(); - //Verify if bottom bar is open on executing query. - _.debuggerHelper.AssertOpen(PageType.Query); - //Verify if response atb is selected on executing query. - _.debuggerHelper.AssertSelectedTab( - Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), - ); - // clean up - _.dataSources.DeleteQuery("Query1"); - cy.get("@dsName").then(($dsName) => { - _.dataSources.DeleteDatasourceFromWithinDS($dsName as any); + + it("airgap", "5. Query bottom bar should be collapsable - airgap", () => { + _.dataSources.CreateDataSource("Postgres"); + //Verify if bottom bar remain open on shifting to active datasource page. + _.debuggerHelper.AssertOpen(PageType.DataSources); + //Verify if selected tab is errors and error count is + //Verify if selected tab is errors in tab title. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_ERRORS(), + ); + //Verify if bottom bar is closed on clicking close icon in active datasource page. + _.debuggerHelper.CloseBottomBar(); + _.debuggerHelper.AssertClosed(); + //Verify if bottom bar opens on clicking debugger icon in query page. + _.dataSources.CreateQueryAfterDSSaved(); + _.debuggerHelper.OpenDebugger(); + _.debuggerHelper.AssertOpen(PageType.Query); + //Verify if bottom bar is closed on clicking close icon in query page. + _.debuggerHelper.CloseBottomBar(); + _.debuggerHelper.AssertClosed(); + //Create and run query. + _.dataSources.EnterQuery( + "SELECT * FROM users ORDER BY id LIMIT 10;", + 1000, + ); + _.dataSources.RunQuery(); + //Verify if bottom bar is open on executing query. + _.debuggerHelper.AssertOpen(PageType.Query); + //Verify if response atb is selected on executing query. + _.debuggerHelper.AssertSelectedTab( + Cypress.env("MESSAGES").DEBUGGER_RESPONSE(), + ); + // clean up + _.dataSources.DeleteQuery("Query1"); + cy.get("@dsName").then(($dsName) => { + _.dataSources.DeleteDatasourceFromWithinDS($dsName as any); + }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ExportApplication_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ExportApplication_spec.js index 277e1e97a63..09e93573079 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ExportApplication_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ExportApplication_spec.js @@ -8,7 +8,7 @@ import { describe( "Export application as a JSON file", - { tags: ["@tag.ImportExport"] }, + { tags: ["@tag.ImportExport", "@tag.Git"] }, function () { let workspaceId, appid; diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js index 5e5adb4afa4..a6cca25ae4a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Inspect_Element_spec.js @@ -2,7 +2,9 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Inspect Entity", - { tags: ["@tag.Widget", "@tag.PropertyPane"] }, + { + tags: ["@tag.Widget", "@tag.PropertyPane", "@tag.Binding"], + }, function () { before(() => { _.agHelper.AddDsl("debuggerDependencyDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js index a6aa206e83a..9e55cbb57f9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js @@ -19,135 +19,139 @@ const generateTestLogString = () => { return logString; }; -describe("Debugger logs", { tags: ["@tag.Widget", "@tag.IDE"] }, function () { - this.beforeEach(() => { - logString = generateTestLogString(); - }); +describe( + "Debugger logs", + { tags: ["@tag.Widget", "@tag.IDE", "@tag.PropertyPane", "@tag.Binding"] }, + function () { + this.beforeEach(() => { + logString = generateTestLogString(); + }); - it("1. Console log on button click with normal moustache binding", function () { - ee.DragDropWidgetNVerify("buttonwidget", 200, 200); - // Testing with normal log in moustache binding - propPane.EnterJSContext("onClick", `{{console.log("${logString}")}}`); - agHelper.Sleep(2000); - agHelper.ClickButton("Submit"); - debuggerHelper.OpenDebugger(); - agHelper.GetNClick(jsEditor._logsTab); - debuggerHelper.DoesConsoleLogExist(logString); - }); + it("1. Console log on button click with normal moustache binding", function () { + ee.DragDropWidgetNVerify("buttonwidget", 200, 200); + // Testing with normal log in moustache binding + propPane.EnterJSContext("onClick", `{{console.log("${logString}")}}`); + agHelper.Sleep(2000); + agHelper.ClickButton("Submit"); + debuggerHelper.OpenDebugger(); + agHelper.GetNClick(jsEditor._logsTab); + debuggerHelper.DoesConsoleLogExist(logString); + }); - it("2. Console log on button click with arrow function IIFE", function () { - debuggerHelper.ClearLogs(); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - // Testing with normal log in iifee - propPane.EnterJSContext( - "onClick", - `{{(() => { + it("2. Console log on button click with arrow function IIFE", function () { + debuggerHelper.ClearLogs(); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + // Testing with normal log in iifee + propPane.EnterJSContext( + "onClick", + `{{(() => { console.log('${logString}'); }) () }}`, - ); - agHelper.ClickButton("Submit"); - debuggerHelper.DoesConsoleLogExist(logString); - }); + ); + agHelper.ClickButton("Submit"); + debuggerHelper.DoesConsoleLogExist(logString); + }); - it("3. Console log on button click with function keyword IIFE", function () { - debuggerHelper.ClearLogs(); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - // Testing with normal log in iifee - propPane.EnterJSContext( - "onClick", - `{{ function () { + it("3. Console log on button click with function keyword IIFE", function () { + debuggerHelper.ClearLogs(); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + // Testing with normal log in iifee + propPane.EnterJSContext( + "onClick", + `{{ function () { console.log('${logString}'); } () }}`, - ); - agHelper.ClickButton("Submit"); - debuggerHelper.DoesConsoleLogExist(logString); - }); + ); + agHelper.ClickButton("Submit"); + debuggerHelper.DoesConsoleLogExist(logString); + }); - it("4. Console log on button click with async function IIFE", function () { - debuggerHelper.ClearLogs(); - // Testing with normal log in iifee - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{(async() => { + it("4. Console log on button click with async function IIFE", function () { + debuggerHelper.ClearLogs(); + // Testing with normal log in iifee + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{(async() => { console.log('${logString}'); }) () }}`, - ); - agHelper.ClickButton("Submit"); - debuggerHelper.DoesConsoleLogExist(logString); - }); + ); + agHelper.ClickButton("Submit"); + debuggerHelper.DoesConsoleLogExist(logString); + }); - it("5. Console log on button click with mixed function IIFE", function () { - debuggerHelper.ClearLogs(); - // Testing with normal log in iifee - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - const logStringChild = generateTestLogString(); - propPane.EnterJSContext( - "onClick", - `{{ function () { + it("5. Console log on button click with mixed function IIFE", function () { + debuggerHelper.ClearLogs(); + // Testing with normal log in iifee + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + const logStringChild = generateTestLogString(); + propPane.EnterJSContext( + "onClick", + `{{ function () { console.log('${logString}'); (async () => {console.log('${logStringChild}')})(); } () }}`, - ); - agHelper.ClickButton("Submit"); - debuggerHelper.DoesConsoleLogExist(logString); - debuggerHelper.DoesConsoleLogExist(logStringChild); - }); + ); + agHelper.ClickButton("Submit"); + debuggerHelper.DoesConsoleLogExist(logString); + debuggerHelper.DoesConsoleLogExist(logStringChild); + }); - it("6. Console log grouping on button click", function () { - debuggerHelper.ClearLogs(); - // Testing with normal log in iifee - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{ function () { + it("6. Console log grouping on button click", function () { + debuggerHelper.ClearLogs(); + // Testing with normal log in iifee + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{ function () { console.log('${logString}'); console.log('${logString}'); console.log('${logString}'); console.log('${logString}'); console.log('${logString}'); } () }}`, - ); - agHelper.Sleep(); //Wait for CI flakyness - agHelper.ClickButton("Submit"); - debuggerHelper.DoesConsoleLogExist(logString); - debuggerHelper.AssertConsecutiveConsoleLogCount(5); - }); + ); + agHelper.Sleep(); //Wait for CI flakyness + agHelper.ClickButton("Submit"); + debuggerHelper.DoesConsoleLogExist(logString); + debuggerHelper.AssertConsecutiveConsoleLogCount(5); + }); - it("7. Console log grouping on button click with different log in between", function () { - debuggerHelper.ClearLogs(); - // Testing with normal log in iifee - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - `{{ function () { + it("7. Console log grouping on button click with different log in between", function () { + debuggerHelper.ClearLogs(); + // Testing with normal log in iifee + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + `{{ function () { console.log('${logString}'); console.log('${logString}'); console.log('Different ${logString}'); console.log('${logString}'); } () }}`, - ); - agHelper.ClickButton("Submit"); - debuggerHelper.DoesConsoleLogExist(logString); - debuggerHelper.DoesConsoleLogExist(`Different ${logString}`); - debuggerHelper.AssertConsecutiveConsoleLogCount(2); - }); + ); + agHelper.ClickButton("Submit"); + debuggerHelper.DoesConsoleLogExist(logString); + debuggerHelper.DoesConsoleLogExist(`Different ${logString}`); + debuggerHelper.AssertConsecutiveConsoleLogCount(2); + }); - it("8. Console log grouping on button click from different source", function () { - debuggerHelper.ClearLogs(); - // Testing with normal log in iifee - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext("onClick", `{{console.log("${logString}")}}`); - // Add another button - ee.DragDropWidgetNVerify("buttonwidget", 400, 400); - propPane.UpdatePropertyFieldValue("Label", "Submit2"); - propPane.EnterJSContext("onClick", `{{console.log("${logString}")}}`); - agHelper.Sleep(2000); - agHelper.ClickButton("Submit"); - agHelper.ClickButton("Submit2"); - debuggerHelper.DoesConsoleLogExist(logString); - debuggerHelper.AssertConsecutiveConsoleLogCount(0); - propPane.DeleteWidgetFromPropertyPane("Button1"); - propPane.DeleteWidgetFromPropertyPane("Button2"); - }); -}); + it("8. Console log grouping on button click from different source", function () { + debuggerHelper.ClearLogs(); + // Testing with normal log in iifee + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext("onClick", `{{console.log("${logString}")}}`); + // Add another button + ee.DragDropWidgetNVerify("buttonwidget", 400, 400); + propPane.UpdatePropertyFieldValue("Label", "Submit2"); + propPane.EnterJSContext("onClick", `{{console.log("${logString}")}}`); + agHelper.Sleep(2000); + agHelper.ClickButton("Submit"); + agHelper.ClickButton("Submit2"); + debuggerHelper.DoesConsoleLogExist(logString); + debuggerHelper.AssertConsecutiveConsoleLogCount(0); + propPane.DeleteWidgetFromPropertyPane("Button1"); + propPane.DeleteWidgetFromPropertyPane("Button2"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js index fa3358209b5..e3579989ff1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js @@ -14,34 +14,37 @@ const generateTestLogString = () => { return logString; }; -describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { - this.beforeEach(() => { - logString = generateTestLogString(); - }); +describe( + "Debugger logs", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + function () { + this.beforeEach(() => { + logString = generateTestLogString(); + }); - it("1. Console log on text widget with normal moustache binding", function () { - PageLeftPane.switchSegment(PagePaneSegment.UI); - _.entityExplorer.DragDropWidgetNVerify("textwidget", 400, 400); - _.propPane.UpdatePropertyFieldValue( - "Text", - `{{(function(){ + it("1. Console log on text widget with normal moustache binding", function () { + PageLeftPane.switchSegment(PagePaneSegment.UI); + _.entityExplorer.DragDropWidgetNVerify("textwidget", 400, 400); + _.propPane.UpdatePropertyFieldValue( + "Text", + `{{(function(){ const temp = "Hello!" console.log("${logString}"); return temp; })()}}`, - ); - _.agHelper.RefreshPage(); - // Wait for the debugger icon to be visible - _.agHelper.AssertElementVisibility(".t--debugger-count"); - _.debuggerHelper.OpenDebugger(); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist(logString); - }); + ); + _.agHelper.RefreshPage(); + // Wait for the debugger icon to be visible + _.agHelper.AssertElementVisibility(".t--debugger-count"); + _.debuggerHelper.OpenDebugger(); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist(logString); + }); - it("2. Console log in sync function", function () { - _.jsEditor.CreateJSObject( - `export default { + it("2. Console log in sync function", function () { + _.jsEditor.CreateJSObject( + `export default { myFun1: () => { console.log("${logString}"); return "sync"; @@ -50,21 +53,21 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 1; } }`, - { - paste: true, - completeReplace: true, - toRun: true, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist(logString); - }); + { + paste: true, + completeReplace: true, + toRun: true, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist(logString); + }); - it("3. Console log in async function", function () { - _.jsEditor.CreateJSObject( - `export default { + it("3. Console log in async function", function () { + _.jsEditor.CreateJSObject( + `export default { myFun1: async () => { console.log("${logString}"); return "async"; @@ -73,17 +76,17 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 1; } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: false, - prettify: false, - }, - ); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: false, + prettify: false, + }, + ); - // Edit JSObject and verify no logs are visible - _.jsEditor.EditJSObj(`export default { + // Edit JSObject and verify no logs are visible + _.jsEditor.EditJSObj(`export default { myFun1: async () => { console.log("${logString}"); return "async"; @@ -92,21 +95,21 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 2; } }`); - _.debuggerHelper.DoesConsoleLogExist(logString, false); + _.debuggerHelper.DoesConsoleLogExist(logString, false); - // Run function and verify logs are visible - _.agHelper.GetNClick(_.jsEditor._runButton); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist(logString); - }); - - it("4. Console log after API succedes", function () { - cy.fixture("testdata").then(function (dataSet) { - _.apiPage.CreateAndFillApi(dataSet.baseUrl + dataSet.methods, "Api1"); + // Run function and verify logs are visible + _.agHelper.GetNClick(_.jsEditor._runButton); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist(logString); }); - const returnText = "success"; - _.jsEditor.CreateJSObject( - `export default { + + it("4. Console log after API succedes", function () { + cy.fixture("testdata").then(function (dataSet) { + _.apiPage.CreateAndFillApi(dataSet.baseUrl + dataSet.methods, "Api1"); + }); + const returnText = "success"; + _.jsEditor.CreateJSObject( + `export default { myFun1: async () => { return storeValue("test", "test").then(() => { console.log("${logString} Started"); @@ -123,43 +126,43 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 1; } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }, - ); - - cy.get("@jsObjName").then((jsObjName) => { - _.agHelper.Sleep(2000); - _.jsEditor.RunJSObj(); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist(`${logString} Started`); - _.debuggerHelper.DoesConsoleLogExist(`${logString} Success`); - _.entityExplorer.DragDropWidgetNVerify("textwidget", 200, 600); - _.propPane.UpdatePropertyFieldValue( - "Text", - `{{${jsObjName}.myFun1.data}}`, - ); - _.agHelper.GetNAssertElementText( - commonlocators.textWidgetContainer, - returnText, - "have.text", - 1, + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }, ); - }); - }); - it("5. Console log after API execution fails", function () { - cy.fixture("testdata").then(function (dataSet) { - _.apiPage.CreateAndFillApi( - dataSet.baseUrl + dataSet.methods + "xyz", - "Api2", - ); + cy.get("@jsObjName").then((jsObjName) => { + _.agHelper.Sleep(2000); + _.jsEditor.RunJSObj(); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist(`${logString} Started`); + _.debuggerHelper.DoesConsoleLogExist(`${logString} Success`); + _.entityExplorer.DragDropWidgetNVerify("textwidget", 200, 600); + _.propPane.UpdatePropertyFieldValue( + "Text", + `{{${jsObjName}.myFun1.data}}`, + ); + _.agHelper.GetNAssertElementText( + commonlocators.textWidgetContainer, + returnText, + "have.text", + 1, + ); + }); }); - _.jsEditor.CreateJSObject( - `export default { + + it("5. Console log after API execution fails", function () { + cy.fixture("testdata").then(function (dataSet) { + _.apiPage.CreateAndFillApi( + dataSet.baseUrl + dataSet.methods + "xyz", + "Api2", + ); + }); + _.jsEditor.CreateJSObject( + `export default { myFun1: async () => { console.log("${logString} Started"); return Api2.run().then(()=>{ @@ -174,22 +177,22 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 1; } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }, - ); - _.jsEditor.RunJSObj(); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist(`${logString} Started`); - _.debuggerHelper.DoesConsoleLogExist(`${logString} Failed`); - }); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }, + ); + _.jsEditor.RunJSObj(); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist(`${logString} Started`); + _.debuggerHelper.DoesConsoleLogExist(`${logString} Failed`); + }); - it("6. Console log source inside nested function", function () { - _.jsEditor.CreateJSObject( - `export default { + it("6. Console log source inside nested function", function () { + _.jsEditor.CreateJSObject( + `export default { myFun1: async () => { console.log("Parent ${logString}"); return Api1.run(()=>{console.log("Child ${logString}");}); @@ -198,22 +201,22 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 1; } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: false, - }, - ); - _.jsEditor.RunJSObj(); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist(`Parent ${logString}`); - _.debuggerHelper.DoesConsoleLogExist(`Child ${logString}`); - }); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: false, + }, + ); + _.jsEditor.RunJSObj(); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist(`Parent ${logString}`); + _.debuggerHelper.DoesConsoleLogExist(`Child ${logString}`); + }); - it("7. Console log grouping", function () { - _.jsEditor.CreateJSObject( - `export default { + it("7. Console log grouping", function () { + _.jsEditor.CreateJSObject( + `export default { myFun1: async () => { console.log("${logString}"); console.log("${logString}"); @@ -225,22 +228,22 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 1; } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }, - ); - _.jsEditor.RunJSObj(); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist(`${logString}`); - _.debuggerHelper.AssertConsecutiveConsoleLogCount(5); - }); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }, + ); + _.jsEditor.RunJSObj(); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist(`${logString}`); + _.debuggerHelper.AssertConsecutiveConsoleLogCount(5); + }); - it("8. Console log should not mutate the passed object", function () { - _.jsEditor.CreateJSObject( - `export default { + it("8. Console log should not mutate the passed object", function () { + _.jsEditor.CreateJSObject( + `export default { myFun1: () => { let data = []; console.log("start:", data); @@ -253,21 +256,21 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { return 1; } }`, - { - paste: true, - completeReplace: true, - toRun: true, - shouldCreateNewJSObj: true, - prettify: false, - }, - ); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.DoesConsoleLogExist("start: []"); - _.debuggerHelper.DoesConsoleLogExist("end: [0,1,2,3,4]"); - }); + { + paste: true, + completeReplace: true, + toRun: true, + shouldCreateNewJSObj: true, + prettify: false, + }, + ); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.DoesConsoleLogExist("start: []"); + _.debuggerHelper.DoesConsoleLogExist("end: [0,1,2,3,4]"); + }); - it("9. Bug #19115 - Objects that start with an underscore `_JSObject1` fail to be navigated from the debugger", function () { - const JSOBJECT_WITH_UNNECCESARY_SEMICOLON = `export default { + it("9. Bug #19115 - Objects that start with an underscore `_JSObject1` fail to be navigated from the debugger", function () { + const JSOBJECT_WITH_UNNECCESARY_SEMICOLON = `export default { myFun1: () => { //write code here if (1) { @@ -277,29 +280,29 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { } `; - _.jsEditor.CreateJSObject(JSOBJECT_WITH_UNNECCESARY_SEMICOLON, { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - }); + _.jsEditor.CreateJSObject(JSOBJECT_WITH_UNNECCESARY_SEMICOLON, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - _.agHelper.AssertElementVisibility(".t--debugger-count"); - _.debuggerHelper.OpenDebugger(); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + _.agHelper.AssertElementVisibility(".t--debugger-count"); + _.debuggerHelper.OpenDebugger(); - _.debuggerHelper.ClicklogEntityLink(); + _.debuggerHelper.ClicklogEntityLink(); - cy.get(".t--js-action-name-edit-field").should("exist"); - }); + cy.get(".t--js-action-name-edit-field").should("exist"); + }); - it("10. Bug #24039 - Logs errors from setInterval callback into debugger", () => { - _.entityExplorer.DragDropWidgetNVerify("buttonwidget", 400, 600); - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - _.propPane.SelectPlatformFunction("onClick", "Set interval"); - _.agHelper.EnterActionValue( - "Callback function", - `{{() => { + it("10. Bug #24039 - Logs errors from setInterval callback into debugger", () => { + _.entityExplorer.DragDropWidgetNVerify("buttonwidget", 400, 600); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + _.propPane.SelectPlatformFunction("onClick", "Set interval"); + _.agHelper.EnterActionValue( + "Callback function", + `{{() => { try { Test.run(); } catch (e) { @@ -308,14 +311,15 @@ describe("Debugger logs", { tags: ["@tag.IDE"] }, function () { } } }}`, - ); - _.agHelper.EnterActionValue("Id", "myInterval"); - _.agHelper.Sleep(); - _.agHelper.GetNClick(_.jsEditor._logsTab); - _.debuggerHelper.ClearLogs(); - _.agHelper.ClickButton("Submit"); - _.debuggerHelper.DoesConsoleLogExist( - "Uncaught ReferenceError: Test is not defined", - ); - }); -}); + ); + _.agHelper.EnterActionValue("Id", "myInterval"); + _.agHelper.Sleep(); + _.agHelper.GetNClick(_.jsEditor._logsTab); + _.debuggerHelper.ClearLogs(); + _.agHelper.ClickButton("Submit"); + _.debuggerHelper.DoesConsoleLogExist( + "Uncaught ReferenceError: Test is not defined", + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts index 7a0ddf08e3e..e189897cc75 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PageOnLoad_spec.ts @@ -10,7 +10,7 @@ const testdata = require("../../../../fixtures/testdata.json"); describe( "Check debugger logs state when there are onPageLoad actions", - { tags: ["@tag.IDE", "@tag.Datasource"] }, + { tags: ["@tag.IDE", "@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { before(() => { agHelper.AddDsl("debuggerTableDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js index 6370ecf2866..b6083515f65 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/PreviewMode_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Preview mode functionality", - { tags: ["@tag.IDE", "@tag.Sanity"] }, + { tags: ["@tag.IDE", "@tag.Sanity", "@tag.PropertyPane"] }, function () { before(() => { _.agHelper.AddDsl("previewMode"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js index dd5b11c69ed..51b7f35df77 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_Editor_spec.js @@ -11,7 +11,15 @@ import { describe( "Undo/Redo functionality", - { tags: ["@tag.JS", "@tag.Datasource"] }, + { + tags: [ + "@tag.JS", + "@tag.Datasource", + "@tag.Git", + "@tag.AccessControl", + "@tag.Binding", + ], + }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; let postgresDatasourceName; diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js index f4c9e6fec7e..98a7fdbf9eb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Replay_spec.js @@ -14,7 +14,7 @@ import EditorNavigation, { describe( "Undo/Redo functionality", - { tags: ["@tag.Widget", "@tag.PropertyPane"] }, + { tags: ["@tag.Widget", "@tag.PropertyPane", "@tag.Binding"] }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js index 0f56a228f4f..ce93dfe0612 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Resize_spec.js @@ -3,7 +3,7 @@ import { agHelper, propPane } from "../../../../support/Objects/ObjectsCore"; describe( "Canvas Resize", - { tags: ["@tag.Widget", "@tag.AutoHeight"] }, + { tags: ["@tag.Widget", "@tag.AutoHeight", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("CanvasResizeDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js index 581acca07d8..52bfa47dda3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Unique_key_spec.js @@ -4,49 +4,53 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; // Since we cannot test the root cause as it does not show up on the DOM, we are testing the sideEffects // the root cause is when widget has same keys, which are not visible in DOM but confuses React when the list is modified. // please refer to issue, https://github.com/appsmithorg/appsmith/issues/7415 for more details. -describe("Unique react keys", { tags: ["@tag.Widget"] }, function () { - afterEach(() => { - _.agHelper.SaveLocalStorageCache(); - }); - - beforeEach(() => { - _.agHelper.RestoreLocalStorageCache(); - _.agHelper.AddDsl("basicDsl"); - }); - - it("1. Should not create duplicate versions of widget on drop from explorer", function () { - cy.dragAndDropToCanvas("chartwidget", { x: 200, y: 200 }); - cy.dragAndDropToCanvas("selectwidget", { x: 200, y: 600 }); - cy.dragAndDropToCanvas("selectwidget", { x: 200, y: 700 }); - - cy.openPropertyPane("chartwidget"); - cy.deleteWidget(widgetsPage.chartWidget); - - cy.get(widgetsPage.selectwidget).should("have.length", 2); - }); - - it("2. Should not create duplicate versions of widget on widget copy", function () { - const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; - cy.dragAndDropToCanvas("chartwidget", { x: 200, y: 200 }); - cy.dragAndDropToCanvas("selectwidget", { x: 200, y: 600 }); - //copy and paste - cy.openPropertyPane("selectwidget"); - cy.get("body").type(`{${modifierKey}}c`); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(500); - cy.get("body").click(); - cy.get("body").type(`{${modifierKey}}v`, { force: true }); - cy.wait("@updateLayout").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - - cy.get(widgetsPage.selectwidget).should("have.length", 2); - - cy.openPropertyPane("chartwidget"); - cy.deleteWidget(widgetsPage.chartWidget); - - cy.get(widgetsPage.selectwidget).should("have.length", 2); - }); -}); +describe( + "Unique react keys", + { tags: ["@tag.Widget", "@tag.Binding"] }, + function () { + afterEach(() => { + _.agHelper.SaveLocalStorageCache(); + }); + + beforeEach(() => { + _.agHelper.RestoreLocalStorageCache(); + _.agHelper.AddDsl("basicDsl"); + }); + + it("1. Should not create duplicate versions of widget on drop from explorer", function () { + cy.dragAndDropToCanvas("chartwidget", { x: 200, y: 200 }); + cy.dragAndDropToCanvas("selectwidget", { x: 200, y: 600 }); + cy.dragAndDropToCanvas("selectwidget", { x: 200, y: 700 }); + + cy.openPropertyPane("chartwidget"); + cy.deleteWidget(widgetsPage.chartWidget); + + cy.get(widgetsPage.selectwidget).should("have.length", 2); + }); + + it("2. Should not create duplicate versions of widget on widget copy", function () { + const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; + cy.dragAndDropToCanvas("chartwidget", { x: 200, y: 200 }); + cy.dragAndDropToCanvas("selectwidget", { x: 200, y: 600 }); + //copy and paste + cy.openPropertyPane("selectwidget"); + cy.get("body").type(`{${modifierKey}}c`); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(500); + cy.get("body").click(); + cy.get("body").type(`{${modifierKey}}v`, { force: true }); + cy.wait("@updateLayout").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + + cy.get(widgetsPage.selectwidget).should("have.length", 2); + + cy.openPropertyPane("chartwidget"); + cy.deleteWidget(widgetsPage.chartWidget); + + cy.get(widgetsPage.selectwidget).should("have.length", 2); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js index 1b3c7b6c0d1..6b1c90b4ebe 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ViewMode_spec.js @@ -14,55 +14,59 @@ Cypress.Commands.add("getSharedUrl", () => { return Cypress.sharedStore.url; }); -describe("Preview mode functionality", { tags: ["@tag.IDE"] }, () => { - before(() => { - agHelper.AddDsl("previewMode"); - deployMode.DeployApp(); - cy.url().then((url) => cy.setSharedUrl(url)); - }); +describe( + "Preview mode functionality", + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, + () => { + before(() => { + agHelper.AddDsl("previewMode"); + deployMode.DeployApp(); + cy.url().then((url) => cy.setSharedUrl(url)); + }); - beforeEach(() => { - cy.getSharedUrl().then((url) => { - agHelper.VisitNAssert(url, "getConsolidatedData"), - agHelper.AssertElementVisibility( - locators._widgetInDeployed(draggableWidgets.BUTTON), - ); + beforeEach(() => { + cy.getSharedUrl().then((url) => { + agHelper.VisitNAssert(url, "getConsolidatedData"), + agHelper.AssertElementVisibility( + locators._widgetInDeployed(draggableWidgets.BUTTON), + ); + }); }); - }); - it("1. on click of apps on header, it should take to application home page", function () { - cy.get(appNavigationLocators.userProfileDropdownButton).should("exist"); - cy.get( - `${appNavigationLocators.header} ${appNavigationLocators.backToAppsButton}`, - ).click(); - agHelper.AssertURL(Cypress.config().baseUrl + "applications"); - }); + it("1. on click of apps on header, it should take to application home page", function () { + cy.get(appNavigationLocators.userProfileDropdownButton).should("exist"); + cy.get( + `${appNavigationLocators.header} ${appNavigationLocators.backToAppsButton}`, + ).click(); + agHelper.AssertURL(Cypress.config().baseUrl + "applications"); + }); - it("2. In the published app with embed=true, there should be no header", function () { - cy.url().then((url) => { - url = new URL(url); - url.searchParams.append("embed", "true"); - agHelper.VisitNAssert(url.toString(), "getConsolidatedData"); - agHelper.AssertElementVisibility( - locators._widgetInDeployed(draggableWidgets.BUTTON), - ); + it("2. In the published app with embed=true, there should be no header", function () { + cy.url().then((url) => { + url = new URL(url); + url.searchParams.append("embed", "true"); + agHelper.VisitNAssert(url.toString(), "getConsolidatedData"); + agHelper.AssertElementVisibility( + locators._widgetInDeployed(draggableWidgets.BUTTON), + ); + }); + agHelper.AssertElementAbsence(appNavigationLocators.header); }); - agHelper.AssertElementAbsence(appNavigationLocators.header); - }); - it("3. In the published app with embed=true&navbar=true, navigator should be visible without user settings", function () { - cy.url().then((url) => { - url = new URL(url); - url.searchParams.append("embed", "true"); - url.searchParams.append("navbar", "true"); - agHelper.VisitNAssert(url.toString(), "getConsolidatedData"); - agHelper.AssertElementVisibility( - locators._widgetInDeployed(draggableWidgets.BUTTON), + it("3. In the published app with embed=true&navbar=true, navigator should be visible without user settings", function () { + cy.url().then((url) => { + url = new URL(url); + url.searchParams.append("embed", "true"); + url.searchParams.append("navbar", "true"); + agHelper.VisitNAssert(url.toString(), "getConsolidatedData"); + agHelper.AssertElementVisibility( + locators._widgetInDeployed(draggableWidgets.BUTTON), + ); + }); + agHelper.AssertElementVisibility(appNavigationLocators.header); + agHelper.AssertElementAbsence( + appNavigationLocators.userProfileDropdownButton, ); }); - agHelper.AssertElementVisibility(appNavigationLocators.header); - agHelper.AssertElementAbsence( - appNavigationLocators.userProfileDropdownButton, - ); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js index 1a67eb90f1c..bfe9d67b984 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/Widget_Error_spec.js @@ -6,80 +6,89 @@ const widgetLocators = require("../../../../locators/Widgets.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; import { WIDGET } from "../../../../locators/WidgetLocators"; -describe("Widget error state", { tags: ["@tag.Widget"] }, function () { - const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; +describe( + "Widget error state", + { tags: ["@tag.Widget", "@tag.Binding"] }, + function () { + const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; + + before(() => { + _.agHelper.AddDsl("buttondsl"); + }); + + it("1. Check widget error state", function () { + cy.openPropertyPane("buttonwidget"); + + cy.get(".t--property-control-visible").find(".t--js-toggle").click(); + cy.EnableAllCodeEditors(); + + cy.testJsontext("visible", "Test"); + + //Check if the current value is shown in the debugger + + _.debuggerHelper.OpenDebugger(); + cy.get("[data-testid=t--tab-ERROR_TAB]").click(); + //This feature is disabled in updated error log - epic 17720 + // _.debuggerHelper.LogStateContains("Test"); + }); + + it("2. Switch to error tab when clicked on the debug button", function () { + cy.get("[data-testid=t--tab-LOGS_TAB]").click(); + cy.get(".t--property-control-onclick").find(".t--js-toggle").click(); + cy.EnableAllCodeEditors(); + cy.testJsontext("onclick", "{{testApi.run()}}"); + cy.get(widgetLocators.buttonWidget).click(); + + cy.get(".t--toast-debug-button").click(); + cy.get("[data-testid='t--tab-ERROR_TAB']").should( + "have.attr", + "aria-selected", + "true", + ); + + // All errors should be expanded by default + //Updated count to 2 as the decision to show the widget trigger lint errors to show in the debugger + _.debuggerHelper.AssertVisibleErrorMessagesCount(2); + + // Recent errors are shown at the top of the list + cy.testJsontext("label", "{{[]}}"); + //This feature is disabled in updated error log - epic 17720 + // _.debuggerHelper.LogStateContains("text", 0); + }); - before(() => { - _.agHelper.AddDsl("buttondsl"); - }); - - it("1. Check widget error state", function () { - cy.openPropertyPane("buttonwidget"); - - cy.get(".t--property-control-visible").find(".t--js-toggle").click(); - cy.EnableAllCodeEditors(); - - cy.testJsontext("visible", "Test"); - - //Check if the current value is shown in the debugger - - _.debuggerHelper.OpenDebugger(); - cy.get("[data-testid=t--tab-ERROR_TAB]").click(); - //This feature is disabled in updated error log - epic 17720 - // _.debuggerHelper.LogStateContains("Test"); - }); - - it("2. Switch to error tab when clicked on the debug button", function () { - cy.get("[data-testid=t--tab-LOGS_TAB]").click(); - cy.get(".t--property-control-onclick").find(".t--js-toggle").click(); - cy.EnableAllCodeEditors(); - cy.testJsontext("onclick", "{{testApi.run()}}"); - cy.get(widgetLocators.buttonWidget).click(); - - cy.get(".t--toast-debug-button").click(); - cy.get("[data-testid='t--tab-ERROR_TAB']").should( - "have.attr", - "aria-selected", - "true", - ); - - // All errors should be expanded by default - //Updated count to 2 as the decision to show the widget trigger lint errors to show in the debugger - _.debuggerHelper.AssertVisibleErrorMessagesCount(2); - - // Recent errors are shown at the top of the list - cy.testJsontext("label", "{{[]}}"); //This feature is disabled in updated error log - epic 17720 - // _.debuggerHelper.LogStateContains("text", 0); - }); - - //This feature is disabled in updated error log - epic 17720 - // it("6. Clicking on a message should open the search menu", function() { - // _.debuggerHelper.ClickErrorMessage(0); - // _.debuggerHelper.AssertContextMenuItemVisible(); - // }); + // it("6. Clicking on a message should open the search menu", function() { + // _.debuggerHelper.ClickErrorMessage(0); + // _.debuggerHelper.AssertContextMenuItemVisible(); + // }); - it("3. Undoing widget deletion should show errors if present + Bug 2760", function () { - cy.deleteWidget(); - _.debuggerHelper.AssertVisibleErrorMessagesCount(0); - cy.get("body").type(`{${modifierKey}}z`); - _.debuggerHelper.AssertVisibleErrorMessagesCount(3); + it("3. Undoing widget deletion should show errors if present + Bug 2760", function () { + cy.deleteWidget(); + _.debuggerHelper.AssertVisibleErrorMessagesCount(0); + cy.get("body").type(`{${modifierKey}}z`); + _.debuggerHelper.AssertVisibleErrorMessagesCount(3); - //Bug-2760: Error log on a widget property not clearing out when the widget property is deleted - _.entityExplorer.DragDropWidgetNVerify(WIDGET.TABLE, 150, 300); + //Bug-2760: Error log on a widget property not clearing out when the widget property is deleted + _.entityExplorer.DragDropWidgetNVerify(WIDGET.TABLE, 150, 300); - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - _.table.AddSampleTableData(); + _.table.AddSampleTableData(); - _.table.AddColumn("customColumn1"); - _.propPane.OpenTableColumnSettings("customColumn1"); - _.propPane.UpdatePropertyFieldValue("Computed value", "{{test}}"); + _.table.AddColumn("customColumn1"); + _.propPane.OpenTableColumnSettings("customColumn1"); + _.propPane.UpdatePropertyFieldValue("Computed value", "{{test}}"); - _.debuggerHelper.AssertDebugError("test is not defined", "", false, false); + _.debuggerHelper.AssertDebugError( + "test is not defined", + "", + false, + false, + ); - _.table.DeleteColumn("customColumn1"); + _.table.DeleteColumn("customColumn1"); - _.debuggerHelper.DebuggerListDoesnotContain("test is not defined"); - }); -}); + _.debuggerHelper.DebuggerListDoesnotContain("test is not defined"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts index e2926e346de..fac384da89e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts @@ -10,7 +10,7 @@ const fixtureName = "PartialImportExportSampleApp.json"; describe( "Partial export functionality", - { tags: ["@tag.ImportExport"] }, + { tags: ["@tag.ImportExport", "@tag.Git"] }, () => { before(() => { homePage.ImportApp(`PartialImportExport/${fixtureName}`); diff --git a/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts index 0abc10bb295..1a44872d249 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts @@ -9,7 +9,7 @@ const fixtureName = "PartialImportExportSampleApp.json"; describe( "Partial export functionality", - { tags: ["@tag.ImportExport"] }, + { tags: ["@tag.ImportExport", "@tag.Git"] }, () => { before(() => { agHelper.GenerateUUID(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImport_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImport_spec.ts index df763dc68b4..8bab0d96a52 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImport_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/PartialImportExport/PartialImport_spec.ts @@ -2,7 +2,7 @@ import { partialImportExport } from "../../../../support/Objects/ObjectsCore"; describe( "Partial import functionality", - { tags: ["@tag.ImportExport"] }, + { tags: ["@tag.ImportExport", "@tag.Git"] }, () => { beforeEach(() => { partialImportExport.OpenImportModal(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/PeekOverlay/PeekOverlay_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/PeekOverlay/PeekOverlay_Spec.ts index 32b7f224dcd..8208f09385a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/PeekOverlay/PeekOverlay_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/PeekOverlay/PeekOverlay_Spec.ts @@ -9,7 +9,7 @@ import { dataManager, } from "../../../../support/Objects/ObjectsCore"; -describe("Peek overlay", { tags: ["@tag.JS"] }, () => { +describe("Peek overlay", { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Main test", () => { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 500, 100); table.AddSampleTableData(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js b/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js index 2b1f045cc5b..27bcc72e937 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Performance/LinkRelPreload_Spec.js @@ -30,7 +30,7 @@ import { AppSidebar } from "../../../../support/Pages/EditorNavigation"; describe( "html should include preload metadata for all code-split javascript", - { tags: ["@tag.IDE"] }, + { tags: ["@tag.IDE", "@tag.PropertyPane"] }, function () { before(() => { cy.addDsl(emptyDSL); diff --git a/app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts index 512cb0bb329..67c1ff0d9d7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts @@ -11,7 +11,7 @@ const PAGE_LOAD_MSG = `The action "Incorrect_users" has failed.`; describe( "Published mode toggle toast with debug flag in the url", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("publishedModeToastToggleDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Refactoring/Refactoring_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Refactoring/Refactoring_spec.ts index 29381ced584..993d7649a4f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Refactoring/Refactoring_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Refactoring/Refactoring_spec.ts @@ -19,7 +19,7 @@ import EditorNavigation, { describe( "Validate JS Object Refactoring does not affect the comments & variables", - { tags: ["@tag.PropertyPane"] }, + { tags: ["@tag.PropertyPane", "@tag.Binding"] }, () => { let dsName: any; diff --git a/app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts index ea42c397109..e2760744b5e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts @@ -17,7 +17,7 @@ import EditorNavigation, { describe( "Widget Property Setters - Part III - Tc #2409 - Validates SetOptions", - { tags: ["@tag.Widget", "@tag.JS"] }, + { tags: ["@tag.Widget", "@tag.JS", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 300); diff --git a/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters1_spec.ts index cacf76c350a..a8c40048624 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters1_spec.ts @@ -156,7 +156,7 @@ Object.values(setterMethodsToTest).forEach( describe( "Linting warning for setter methods", - { tags: ["@tag.Widget"] }, + { tags: ["@tag.Widget", "@tag.Binding"] }, function () { it("Lint error when setter is used in a data field", function () { entityExplorer.DragDropWidgetNVerify(WIDGET.BUTTON, 200, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts index 69fb9d670ce..a89504d1794 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts @@ -17,7 +17,7 @@ import EditorNavigation, { describe( "Widget Property Setters - Part II - Tc #2409", - { tags: ["@tag.Widget", "@tag.JS"] }, + { tags: ["@tag.Widget", "@tag.JS", "@tag.Binding"] }, () => { it("1. Bug 25287 - CurrencyInput does not update value when set using CurrencyInput.text", () => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.CURRENCY_INPUT); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts index 291512d7c45..77ddb00725b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/CreateNewAppFromTemplates_spec.ts @@ -14,6 +14,10 @@ describe( "@tag.Workspace", "@tag.Templates", "@tag.Sanity", + "@tag.Git", + "@tag.ImportExport", + "@tag.Fork", + "@tag.AccessControl", ], }, function () { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/Filtering/TemplatesModal_filtering_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Templates/Filtering/TemplatesModal_filtering_spec.ts index 1276999a927..af863476501 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/Filtering/TemplatesModal_filtering_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/Filtering/TemplatesModal_filtering_spec.ts @@ -8,7 +8,15 @@ import reconnectDatasourceLocators from "../../../../../locators/ReconnectLocato describe( "Bug 17276 - Templates modal filtering", - { tags: ["@tag.excludeForAirgap", "@tag.Templates"] }, + { + tags: [ + "@tag.excludeForAirgap", + "@tag.Templates", + "@tag.Git", + "@tag.ImportExport", + "@tag.Fork", + ], + }, () => { const NAME_FILTER = "order"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js index 7cc1d638ed5..1bc69d6f919 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_Existing_app_spec.js @@ -23,7 +23,16 @@ beforeEach(() => { describe( "Fork a template to the current app from new page popover", - { tags: ["@tag.Templates", "@tag.excludeForAirgap", "@tag.Sanity"] }, + { + tags: [ + "@tag.Templates", + "@tag.excludeForAirgap", + "@tag.Sanity", + "@tag.Git", + "@tag.ImportExport", + "@tag.Fork", + ], + }, () => { it("1. Fork template from page section", () => { //Fork template button to be visible always diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_To_App_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_To_App_spec.ts index 46bd1a99a33..d023f346c1a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_To_App_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/Fork_Template_To_App_spec.ts @@ -10,7 +10,15 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Fork a template to the current app", - { tags: ["@tag.Templates", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Templates", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.ImportExport", + "@tag.Fork", + ], + }, () => { it("1. Fork a template to the current app + Bug 17477", () => { PageList.AddNewPage("Add page from template"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts index 63fff9dfdc8..1bd8e9054d2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Templates/TemplatesPage_spec.ts @@ -3,7 +3,16 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Templates page", - { tags: ["@tag.Templates", "@tag.excludeForAirgap", "@tag.Sanity"] }, + { + tags: [ + "@tag.Templates", + "@tag.excludeForAirgap", + "@tag.Sanity", + "@tag.Git", + "@tag.ImportExport", + "@tag.Fork", + ], + }, () => { it("1. Templates Modal should have show only 'allowPageImport:true' templates", () => { cy.fixture("Templates/AllowPageImportTemplates.json").then((data) => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/ThemeReset_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/ThemeReset_spec.js index a72457484ac..4182b5ca123 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/ThemeReset_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/ThemeReset_spec.js @@ -4,42 +4,49 @@ import { ObjectsRegistry } from "../../../../support/Objects/Registry"; const appSettings = ObjectsRegistry.AppSettings; -describe("Theme validation usecases", { tags: ["@tag.Theme"] }, function () { - it("1. Drag and drop button widget, change value and check reset flow", function () { - // drop button widget - cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 300 }); - cy.get(".t--widget-buttonwidget").should("exist"); +describe( + "Theme validation usecases", + { tags: ["@tag.Theme", "@tag.Git"] }, + function () { + it("1. Drag and drop button widget, change value and check reset flow", function () { + // drop button widget + cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 300 }); + cy.get(".t--widget-buttonwidget").should("exist"); - // open property pane - cy.openPropertyPane("buttonwidget"); - cy.moveToStyleTab(); - // change color to red - cy.get(widgetsPage.buttonColor).click({ force: true }).clear().type("red"); + // open property pane + cy.openPropertyPane("buttonwidget"); + cy.moveToStyleTab(); + // change color to red + cy.get(widgetsPage.buttonColor) + .click({ force: true }) + .clear() + .type("red"); - // click on canvas to see the theming pane - cy.get("#canvas-selection-0").click({ force: true }); + // click on canvas to see the theming pane + cy.get("#canvas-selection-0").click({ force: true }); - appSettings.OpenAppSettings(); - appSettings.GoToThemeSettings(); - // reset theme - cy.contains("Theme properties") - .closest("div") - .siblings() - .first() - .find("button") - .click({ force: true }); - cy.contains("Reset widget styles").click({ force: true }); + appSettings.OpenAppSettings(); + appSettings.GoToThemeSettings(); + // reset theme + cy.contains("Theme properties") + .closest("div") + .siblings() + .first() + .find("button") + .click({ force: true }); + cy.contains("Reset widget styles").click({ force: true }); - cy.get(`${commonlocators.themeCard} > main > main`) - .first() - .invoke("css", "background-color") - .then((backgroudColor) => { - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "background-color", - backgroudColor, - ); - }); - appSettings.ClosePane(); - }); -}); + cy.get(`${commonlocators.themeCard} > main > main`) + .first() + .invoke("css", "background-color") + .then((backgroudColor) => { + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "background-color", + backgroudColor, + ); + }); + appSettings.ClosePane(); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_Basic_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_Basic_spec.js index 0b23706fdc2..06b3bdf11d4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_Basic_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_Basic_spec.js @@ -15,766 +15,776 @@ import { const containerShadowElement = `${widgetsPage.containerWidget}`; -describe("App Theming funtionality", { tags: ["@tag.Theme"] }, function () { - let themesSection = (sectionName, themeName) => - "//*[text()='" + - sectionName + - "']/following-sibling::div//*[text()='" + - themeName + - "']"; - let applyTheme = (sectionName, themeName) => - themesSection(sectionName, themeName) + - "/parent::div/following-sibling::div[contains(@class, 't--theme-card')]//div[text()='Apply theme']"; - let themesDeletebtn = (sectionName, themeName) => - themesSection(sectionName, themeName) + "/following-sibling::button"; - - it("1. Checks if theme can be changed to one of the existing themes", function () { - appSettings.OpenAppSettings(); - appSettings.GoToThemeSettings(); - cy.get(commonlocators.changeThemeBtn).click({ force: true }); - agHelper.AssertAutoSave(); - // select a theme - cy.get(commonlocators.themeCard).last().click({ force: true }); - agHelper.AssertAutoSave(); - // check for alert - cy.get(`${commonlocators.themeCard}`) - .last() - .siblings("div") - .first() - .invoke("text") - .then((text) => { - cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); - }); - - // check if color of canvas is same as theme bg color - cy.get(`${commonlocators.themeCard} > main`) - .last() - .invoke("css", "background-color") - .then((backgroudColor) => { - cy.get(commonlocators.canvas).should( - "have.css", - "background-color", - backgroudColor, - ); - }); - }); - - it("2. Checks if theme can be edited", function () { - cy.get(commonlocators.selectThemeBackBtn).click({ force: true }); - appSettings.ClosePane(); - - // drop a button & container widget and click on body - cy.dragAndDropToCanvas("buttonwidget", { x: 100, y: 100 }); - cy.dragAndDropToCanvas("containerwidget", { x: 200, y: 200 }); - cy.get("canvas").first(0).trigger("click", { force: true }); - - appSettings.OpenAppSettings(); - appSettings.GoToThemeSettings(); - - //Click the back button //Commenting below since expanded by default - //cy.get(commonlocators.selectThemeBackBtn).click({ force: true }); - - //Click the border radius toggle - // cy.contains("Border") - // .click({ force: true }) - // .wait(500); - - // change app border radius - cy.get(commonlocators.themeAppBorderRadiusBtn).eq(1).click({ force: true }); - agHelper.AssertAutoSave(); - // check if border radius is changed on button - cy.get(commonlocators.themeAppBorderRadiusBtn) - .eq(1) - .invoke("css", "border-top-left-radius") - .then((borderRadius) => { - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "border-radius", - borderRadius, - ); - - // publish the app - // deployMode.DeployApp(); - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "border-radius", - borderRadius, - ); - }); +describe( + "App Theming funtionality", + { tags: ["@tag.Theme", "@tag.Git"] }, + function () { + let themesSection = (sectionName, themeName) => + "//*[text()='" + + sectionName + + "']/following-sibling::div//*[text()='" + + themeName + + "']"; + let applyTheme = (sectionName, themeName) => + themesSection(sectionName, themeName) + + "/parent::div/following-sibling::div[contains(@class, 't--theme-card')]//div[text()='Apply theme']"; + let themesDeletebtn = (sectionName, themeName) => + themesSection(sectionName, themeName) + "/following-sibling::button"; + + it("1. Checks if theme can be changed to one of the existing themes", function () { + appSettings.OpenAppSettings(); + appSettings.GoToThemeSettings(); + cy.get(commonlocators.changeThemeBtn).click({ force: true }); + agHelper.AssertAutoSave(); + // select a theme + cy.get(commonlocators.themeCard).last().click({ force: true }); + agHelper.AssertAutoSave(); + // check for alert + cy.get(`${commonlocators.themeCard}`) + .last() + .siblings("div") + .first() + .invoke("text") + .then((text) => { + cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); + }); - //Change the color://Commenting below since expanded by default - //cy.contains("Color").click({ force: true }); - - //Change the primary color: - cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); - cy.get(widgetsPage.colorPickerV2Color) - .eq(-3) - .then(($elem) => { - cy.get($elem).click({ force: true }); - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "background-color", - $elem.css("background-color"), - ); - }); + // check if color of canvas is same as theme bg color + cy.get(`${commonlocators.themeCard} > main`) + .last() + .invoke("css", "background-color") + .then((backgroudColor) => { + cy.get(commonlocators.canvas).should( + "have.css", + "background-color", + backgroudColor, + ); + }); + }); - //Change the background color: - //cy.get("[data-testid='theme-backgroundColor']").click({ force: true }); - agHelper.GetNClick("[data-testid='theme-backgroundColor']"); - agHelper.AssertAutoSave(); - - cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); - cy.get(widgetsPage.colorPickerV2Color) - .first() - .then(($elem) => { - cy.get($elem).click({ force: true }); - cy.get(commonlocators.canvas).should( - "have.css", - "background-color", - $elem.css("background-color"), - ); - }); + it("2. Checks if theme can be edited", function () { + cy.get(commonlocators.selectThemeBackBtn).click({ force: true }); + appSettings.ClosePane(); + + // drop a button & container widget and click on body + cy.dragAndDropToCanvas("buttonwidget", { x: 100, y: 100 }); + cy.dragAndDropToCanvas("containerwidget", { x: 200, y: 200 }); + cy.get("canvas").first(0).trigger("click", { force: true }); + + appSettings.OpenAppSettings(); + appSettings.GoToThemeSettings(); + + //Click the back button //Commenting below since expanded by default + //cy.get(commonlocators.selectThemeBackBtn).click({ force: true }); + + //Click the border radius toggle + // cy.contains("Border") + // .click({ force: true }) + // .wait(500); + + // change app border radius + cy.get(commonlocators.themeAppBorderRadiusBtn) + .eq(1) + .click({ force: true }); + agHelper.AssertAutoSave(); + // check if border radius is changed on button + cy.get(commonlocators.themeAppBorderRadiusBtn) + .eq(1) + .invoke("css", "border-top-left-radius") + .then((borderRadius) => { + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "border-radius", + borderRadius, + ); - // Change the shadow - cy.get("[data-value='M']").eq(1).click({ force: true }); - cy.get("[data-value='M']") - .eq(1) - .invoke("css", "box-shadow") - .then((boxShadow) => { - cy.get(containerShadowElement).should( - "have.css", - "box-shadow", - boxShadow, - ); - }); + // publish the app + // deployMode.DeployApp(); + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "border-radius", + borderRadius, + ); + }); - //Change the font //Commenting below since expanded by default - //cy.contains("Font").click({ force: true }); + //Change the color://Commenting below since expanded by default + //cy.contains("Color").click({ force: true }); - agHelper.GetNClick(".rc-select-selection-search-input").then(($elem) => { - agHelper.GetNClick($elem); - cy.get(".rc-virtual-list-holder div") - .children() - .eq(2) - .then(($childElem) => { - cy.get($childElem).click({ force: true }); + //Change the primary color: + cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); + cy.get(widgetsPage.colorPickerV2Color) + .eq(-3) + .then(($elem) => { + cy.get($elem).click({ force: true }); cy.get(widgetsPage.widgetBtn).should( "have.css", - "font-family", - `${$childElem.children().last().text()}"Nunito Sans", sans-serif`, + "background-color", + $elem.css("background-color"), ); }); - }); - }); - - it("4. Verify user able to change between saved theme & already existing Featured themes", () => { - cy.get(commonlocators.changeThemeBtn).click({ force: true }); - - //#region Pampas - cy.xpath(applyTheme("Featured themes", "Pampas")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(5, 150, 105)"); - }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(236, 253, 245)"); - }); + //Change the background color: + //cy.get("[data-testid='theme-backgroundColor']").click({ force: true }); + agHelper.GetNClick("[data-testid='theme-backgroundColor']"); + agHelper.AssertAutoSave(); + + cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); + cy.get(widgetsPage.colorPickerV2Color) + .first() + .then(($elem) => { + cy.get($elem).click({ force: true }); + cy.get(commonlocators.canvas).should( + "have.css", + "background-color", + $elem.css("background-color"), + ); + }); - //#endregion - - //#region Classic - cy.xpath(applyTheme("Featured themes", "Classic")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(22, 163, 74)"); - }); + // Change the shadow + cy.get("[data-value='M']").eq(1).click({ force: true }); + cy.get("[data-value='M']") + .eq(1) + .invoke("css", "box-shadow") + .then((boxShadow) => { + cy.get(containerShadowElement).should( + "have.css", + "box-shadow", + boxShadow, + ); + }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(246, 246, 246)"); + //Change the font //Commenting below since expanded by default + //cy.contains("Font").click({ force: true }); + + agHelper.GetNClick(".rc-select-selection-search-input").then(($elem) => { + agHelper.GetNClick($elem); + cy.get(".rc-virtual-list-holder div") + .children() + .eq(2) + .then(($childElem) => { + cy.get($childElem).click({ force: true }); + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "font-family", + `${$childElem.children().last().text()}"Nunito Sans", sans-serif`, + ); + }); }); + }); - //#endregion - - //#region Modern - cy.xpath(applyTheme("Featured themes", "Modern")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(85, 61, 233)"); - }); + it("4. Verify user able to change between saved theme & already existing Featured themes", () => { + cy.get(commonlocators.changeThemeBtn).click({ force: true }); + + //#region Pampas + cy.xpath(applyTheme("Featured themes", "Pampas")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(5, 150, 105)"); + }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(248, 250, 252)"); - }); + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(236, 253, 245)"); + }); - //#endregion - - //#region Sunrise - cy.xpath(applyTheme("Featured themes", "Sunrise")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(239, 68, 68)"); - }); + //#endregion + + //#region Classic + cy.xpath(applyTheme("Featured themes", "Classic")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(22, 163, 74)"); + }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(255, 241, 242)"); - }); - //#endregion - - //#region Water Lily - cy.xpath(applyTheme("Featured themes", "Water Lily")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(219, 39, 119)"); - }); + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(246, 246, 246)"); + }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(253, 242, 248)"); - }); - //#endregion - - //#region Pacific - cy.xpath(applyTheme("Featured themes", "Pacific")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(8, 145, 178)"); - }); + //#endregion + + //#region Modern + cy.xpath(applyTheme("Featured themes", "Modern")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(85, 61, 233)"); + }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(236, 254, 255)"); - }); - //#endregion - - //#region Earth - cy.xpath(applyTheme("Featured themes", "Earth")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(59, 130, 246)"); - }); + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(248, 250, 252)"); + }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(239, 246, 255)"); - }); - //#endregion - - //#region Moon - cy.xpath(applyTheme("Featured themes", "Moon")) - .click({ force: true }) - .wait(1000); //Changing to one of Featured themes - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(0) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(100, 116, 139)"); - }); + //#endregion + + //#region Sunrise + cy.xpath(applyTheme("Featured themes", "Sunrise")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(239, 68, 68)"); + }); - cy.contains("Applied theme") - // .click() - .parent() - .siblings() - .find(".t--theme-card > main > section > div > main") - .eq(1) - .invoke("css", "background-color") - .then((backgroudColor) => { - expect(backgroudColor).to.eq("rgb(248, 250, 252)"); - }); - //#endregion - }); - - it("5. Verify widgets conform to the selected theme in Publish mode", () => { - deployMode.DeployApp(); - - //cy.wait(4000); //for theme to settle - - cy.get("body").should( - "have.css", - "font-family", - `"Nunito Sans", sans-serif`, - ); //Font - - cy.xpath("//div[@id='root']//section/parent::div").should( - "have.css", - "background-color", - "rgb(248, 250, 252)", - ); //Background Color - cy.get(widgetsPage.widgetBtn).should( - "have.css", - "background-color", - "rgb(100, 116, 139)", - ); //Widget Color - - cy.get(widgetsPage.widgetBtn).should("have.css", "border-radius", "0px"); //Border Radius - - cy.get(widgetsPage.widgetBtn).should("have.css", "box-shadow", "none"); //Shadow - - deployMode.NavigateBacktoEditor(); - }); - - it("6. Verify Adding new Individual widgets & it can change Color, Border radius, Shadow & can revert [Color/Border Radius] to already selected theme", () => { - cy.dragAndDropToCanvas("buttonwidget", { x: 200, y: 400 }); //another button widget - cy.moveToStyleTab(); - //Change Color & verify - cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); - cy.get(widgetsPage.colorPickerV2TailwindColor) - .eq(33) - .then(($elem) => { - cy.get($elem).click({ force: true }); - cy.get(".t--widget-button2 button").should( - "have.css", - "background-color", - $elem.css("background-color"), //rgb(134, 239, 172) - ); //new widget with its own color - - cy.get(".t--widget-button1 button").should( - "have.css", - "background-color", - "rgb(100, 116, 139)", - ); //old widgets still conforming to theme color - }); + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(255, 241, 242)"); + }); + //#endregion + + //#region Water Lily + cy.xpath(applyTheme("Featured themes", "Water Lily")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(219, 39, 119)"); + }); - //Change Border & verify - - cy.get(".border-t-2").eq(0).click(); - cy.get(".border-t-2") - .eq(0) - .invoke("css", "border-top-left-radius") - .then((borderRadius) => { - cy.get(".t--widget-button2 button").should( - "have.css", - "border-radius", - borderRadius, //0px - ); - cy.get(".t--widget-button1 button").should( - "have.css", - "border-radius", - "0px", - ); - }); + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(253, 242, 248)"); + }); + //#endregion + + //#region Pacific + cy.xpath(applyTheme("Featured themes", "Pacific")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(8, 145, 178)"); + }); - //Change Shadow & verify - cy.contains(".ads-v2-segmented-control-value-0", "Large").click(); - - cy.get(".t--widget-button1 button").should( - "have.css", - "box-shadow", - "none", - ); - - agHelper.AssertAutoSave(); - deployMode.DeployApp(); - - //Verify Background color - cy.get(".t--widget-button2 button").should( - "have.css", - "background-color", - "rgb(190, 24, 93)", - ); //new widget with its own color - - ////old widgets still conforming to theme color - cy.get(".t--widget-button1 button").should( - "have.css", - "background-color", - "rgb(100, 116, 139)", - ); - - //Verify Border radius - cy.get(".t--widget-button2 button").should( - "have.css", - "border-radius", - "0px", - ); - cy.get(".t--widget-button1 button").should( - "have.css", - "border-radius", - "0px", - ); - - //Verify Box shadow - cy.get(".t--widget-button2 button").should( - "have.css", - "box-shadow", - "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", - ); - cy.get(".t--widget-button1 button").should( - "have.css", - "box-shadow", - "none", - ); - - deployMode.NavigateBacktoEditor(); - //Resetting back to theme - EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); - cy.moveToStyleTab(); - cy.get(".t--property-control-buttoncolor .reset-button").then(($elem) => { - $elem[0].removeAttribute("display: none"); - $elem[0].click(); - }); + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(236, 254, 255)"); + }); + //#endregion + + //#region Earth + cy.xpath(applyTheme("Featured themes", "Earth")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(59, 130, 246)"); + }); - cy.get(".t--widget-button2 button").should( - "have.css", - "background-color", - "rgb(100, 116, 139)", - ); //verify widget reverted to theme color - cy.get(".t--property-control-borderradius .reset-button").then(($elem) => { - $elem[0].removeAttribute("display: none"); - $elem[0].click(); + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(239, 246, 255)"); + }); + //#endregion + + //#region Moon + cy.xpath(applyTheme("Featured themes", "Moon")) + .click({ force: true }) + .wait(1000); //Changing to one of Featured themes + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(0) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(100, 116, 139)"); + }); + + cy.contains("Applied theme") + // .click() + .parent() + .siblings() + .find(".t--theme-card > main > section > div > main") + .eq(1) + .invoke("css", "background-color") + .then((backgroudColor) => { + expect(backgroudColor).to.eq("rgb(248, 250, 252)"); + }); + //#endregion }); - cy.get(".t--widget-button2 button").should( - "have.css", - "border-radius", - "0px", - ); - - //the new widget with reverted styles also conforming to theme - deployMode.DeployApp(); - - cy.wait(4000); //for theme to settle - cy.get("body").should( - "have.css", - "font-family", - `"Nunito Sans", sans-serif`, - ); //Font - - cy.xpath("//div[@id='root']//section/parent::div").should( - "have.css", - "background-color", - "rgb(248, 250, 252)", - ); //Background Color - cy.get(".t--widget-button1 button").should( - "have.css", - "background-color", - "rgb(100, 116, 139)", - ); //Widget Color - cy.get("body").then(($ele) => { - if ($ele.find(widgetsPage.widgetBtn).length <= 1) { - cy.reload(); - cy.wait(4000); - } + + it("5. Verify widgets conform to the selected theme in Publish mode", () => { + deployMode.DeployApp(); + + //cy.wait(4000); //for theme to settle + + cy.get("body").should( + "have.css", + "font-family", + `"Nunito Sans", sans-serif`, + ); //Font + + cy.xpath("//div[@id='root']//section/parent::div").should( + "have.css", + "background-color", + "rgb(248, 250, 252)", + ); //Background Color + cy.get(widgetsPage.widgetBtn).should( + "have.css", + "background-color", + "rgb(100, 116, 139)", + ); //Widget Color + + cy.get(widgetsPage.widgetBtn).should("have.css", "border-radius", "0px"); //Border Radius + + cy.get(widgetsPage.widgetBtn).should("have.css", "box-shadow", "none"); //Shadow + + deployMode.NavigateBacktoEditor(); }); - cy.get(".t--widget-button2 button").should( - "have.css", - "background-color", - "rgb(100, 116, 139)", - ); //Widget Color - - cy.get(".t--widget-button1 button").should( - "have.css", - "border-radius", - "0px", - ); //Border Radius - cy.get(".t--widget-button2 button").should( - "have.css", - "border-radius", - "0px", - ); //Border Radius - - cy.get(".t--widget-button1 button").should( - "have.css", - "box-shadow", - "none", - ); //Shadow - cy.get(".t--widget-button2 button").should( - "have.css", - "box-shadow", - "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", - ); //Since Shadow revert option does not exixts - deployMode.NavigateBacktoEditor(); - }); - - it("7. Verify Chainging theme should not affect Individual widgets with changed Color, Border radius, Shadow & can revert to newly selected theme", () => { - cy.get("canvas").first(0).trigger("click", { force: true }); - - appSettings.OpenAppSettings(); - appSettings.GoToThemeSettings(); - - cy.get(commonlocators.changeThemeBtn).click({ force: true }); - - //Changing to one of Featured themes & then changing individual widget properties - cy.xpath(applyTheme("Featured themes", "Sunrise")) - .click({ force: true }) - .wait(2000); - - //Change individual widget properties for Button1 - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - cy.moveToStyleTab(); - - //Change Color & verify - cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); - cy.get(widgetsPage.colorPickerV2TailwindColor) - .eq(13) - .then(($elem) => { - cy.get($elem).click({ force: true }); - cy.get(".t--widget-button1 button").should( - "have.css", - "background-color", - $elem.css("background-color"), - ); //new widget with its own color - - cy.get(".t--widget-button2 button").should( - "have.css", - "background-color", - "rgb(239, 68, 68)", - ); //old widgets still conforming to theme color - }); - //Change Border & verify - - cy.get(".border-t-2").eq(1).click().wait(500); - cy.get(".border-t-2") - .eq(1) - .invoke("css", "border-top-left-radius") - .then((borderRadius) => { - cy.get(".t--widget-button1 button").should( - "have.css", - "border-radius", - borderRadius, //6px - ); - - cy.get(".t--widget-button2 button").should( - "have.css", - "border-radius", - "24px", - ); + it("6. Verify Adding new Individual widgets & it can change Color, Border radius, Shadow & can revert [Color/Border Radius] to already selected theme", () => { + cy.dragAndDropToCanvas("buttonwidget", { x: 200, y: 400 }); //another button widget + cy.moveToStyleTab(); + //Change Color & verify + cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); + cy.get(widgetsPage.colorPickerV2TailwindColor) + .eq(33) + .then(($elem) => { + cy.get($elem).click({ force: true }); + cy.get(".t--widget-button2 button").should( + "have.css", + "background-color", + $elem.css("background-color"), //rgb(134, 239, 172) + ); //new widget with its own color + + cy.get(".t--widget-button1 button").should( + "have.css", + "background-color", + "rgb(100, 116, 139)", + ); //old widgets still conforming to theme color + }); + + //Change Border & verify + + cy.get(".border-t-2").eq(0).click(); + cy.get(".border-t-2") + .eq(0) + .invoke("css", "border-top-left-radius") + .then((borderRadius) => { + cy.get(".t--widget-button2 button").should( + "have.css", + "border-radius", + borderRadius, //0px + ); + cy.get(".t--widget-button1 button").should( + "have.css", + "border-radius", + "0px", + ); + }); + + //Change Shadow & verify + cy.contains(".ads-v2-segmented-control-value-0", "Large").click(); + + cy.get(".t--widget-button1 button").should( + "have.css", + "box-shadow", + "none", + ); + + agHelper.AssertAutoSave(); + deployMode.DeployApp(); + + //Verify Background color + cy.get(".t--widget-button2 button").should( + "have.css", + "background-color", + "rgb(190, 24, 93)", + ); //new widget with its own color + + ////old widgets still conforming to theme color + cy.get(".t--widget-button1 button").should( + "have.css", + "background-color", + "rgb(100, 116, 139)", + ); + + //Verify Border radius + cy.get(".t--widget-button2 button").should( + "have.css", + "border-radius", + "0px", + ); + cy.get(".t--widget-button1 button").should( + "have.css", + "border-radius", + "0px", + ); + + //Verify Box shadow + cy.get(".t--widget-button2 button").should( + "have.css", + "box-shadow", + "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", + ); + cy.get(".t--widget-button1 button").should( + "have.css", + "box-shadow", + "none", + ); + + deployMode.NavigateBacktoEditor(); + //Resetting back to theme + EditorNavigation.SelectEntityByName("Button2", EntityType.Widget); + cy.moveToStyleTab(); + cy.get(".t--property-control-buttoncolor .reset-button").then(($elem) => { + $elem[0].removeAttribute("display: none"); + $elem[0].click(); }); - //Change Shadow & verify - cy.contains(".ads-v2-segmented-control-value-0", "Small").click(); - cy.get(".t--widget-button2 button").should( - "have.css", - "box-shadow", - //same value as previous box shadow selection - //since revertion is not possible for box shadow - hence this widget maintains the same value - "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", - ); - - agHelper.AssertAutoSave(); - - //Add deploy mode verification here also! - deployMode.DeployApp(); - - //Verify Background color - cy.get(".t--widget-button1 button").should( - "have.css", - "background-color", - "rgb(161, 98, 7)", - ); //new widget with its own color - - ////old widgets still conforming to theme color - cy.get(".t--widget-button2 button").should( - "have.css", - "background-color", - "rgb(239, 68, 68)", - ); - - //Verify Border radius - cy.get(".t--widget-button1 button").should( - "have.css", - "border-radius", - "6px", - ); - cy.get(".t--widget-button2 button").should( - "have.css", - "border-radius", - "24px", - ); - - //Verify Box shadow - cy.get(".t--widget-button1 button").should( - "have.css", - "box-shadow", - "rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px", - ); - cy.get(".t--widget-button2 button").should( - "have.css", - "box-shadow", - "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", - ); - - deployMode.NavigateBacktoEditor(); - //Resetting back to theme - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - cy.moveToStyleTab(); - cy.get(".t--property-control-buttoncolor .reset-button").then(($elem) => { - $elem[0].removeAttribute("display: none"); - $elem[0].click(); + cy.get(".t--widget-button2 button").should( + "have.css", + "background-color", + "rgb(100, 116, 139)", + ); //verify widget reverted to theme color + cy.get(".t--property-control-borderradius .reset-button").then( + ($elem) => { + $elem[0].removeAttribute("display: none"); + $elem[0].click(); + }, + ); + cy.get(".t--widget-button2 button").should( + "have.css", + "border-radius", + "0px", + ); + + //the new widget with reverted styles also conforming to theme + deployMode.DeployApp(); + + cy.wait(4000); //for theme to settle + cy.get("body").should( + "have.css", + "font-family", + `"Nunito Sans", sans-serif`, + ); //Font + + cy.xpath("//div[@id='root']//section/parent::div").should( + "have.css", + "background-color", + "rgb(248, 250, 252)", + ); //Background Color + cy.get(".t--widget-button1 button").should( + "have.css", + "background-color", + "rgb(100, 116, 139)", + ); //Widget Color + cy.get("body").then(($ele) => { + if ($ele.find(widgetsPage.widgetBtn).length <= 1) { + cy.reload(); + cy.wait(4000); + } + }); + cy.get(".t--widget-button2 button").should( + "have.css", + "background-color", + "rgb(100, 116, 139)", + ); //Widget Color + + cy.get(".t--widget-button1 button").should( + "have.css", + "border-radius", + "0px", + ); //Border Radius + cy.get(".t--widget-button2 button").should( + "have.css", + "border-radius", + "0px", + ); //Border Radius + + cy.get(".t--widget-button1 button").should( + "have.css", + "box-shadow", + "none", + ); //Shadow + cy.get(".t--widget-button2 button").should( + "have.css", + "box-shadow", + "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", + ); //Since Shadow revert option does not exixts + deployMode.NavigateBacktoEditor(); }); - cy.get(".t--widget-button1 button").should( - "have.css", - "background-color", - "rgb(239, 68, 68)", - ); //verify widget reverted to theme color + it("7. Verify Chainging theme should not affect Individual widgets with changed Color, Border radius, Shadow & can revert to newly selected theme", () => { + cy.get("canvas").first(0).trigger("click", { force: true }); - cy.get(".t--property-control-borderradius .reset-button").then(($elem) => { - $elem[0].removeAttribute("display: none"); - $elem[0].click(); - }); - cy.get(".t--widget-button1 button").should( - "have.css", - "border-radius", - "24px", - ); - - //the new widget with reverted styles also conforming to theme - deployMode.DeployApp(); - - cy.wait(4000); //for theme to settle - cy.get("body").should("have.css", "font-family", "Rubik, sans-serif"); //Font for Rounded theme - - cy.xpath("//div[@id='root']//section/parent::div").should( - "have.css", - "background-color", - "rgb(255, 241, 242)", - ); //Background Color of canvas - - cy.get(".t--widget-button1 button").should( - "have.css", - "background-color", - "rgb(239, 68, 68)", - ); //Widget Color - cy.get("body").then(($ele) => { - if ($ele.find(widgetsPage.widgetBtn).length <= 1) { - cy.reload(); - cy.wait(4000); - } + appSettings.OpenAppSettings(); + appSettings.GoToThemeSettings(); + + cy.get(commonlocators.changeThemeBtn).click({ force: true }); + + //Changing to one of Featured themes & then changing individual widget properties + cy.xpath(applyTheme("Featured themes", "Sunrise")) + .click({ force: true }) + .wait(2000); + + //Change individual widget properties for Button1 + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + cy.moveToStyleTab(); + + //Change Color & verify + cy.get(widgetsPage.colorPickerV2Popover).click({ force: true }).click(); + cy.get(widgetsPage.colorPickerV2TailwindColor) + .eq(13) + .then(($elem) => { + cy.get($elem).click({ force: true }); + cy.get(".t--widget-button1 button").should( + "have.css", + "background-color", + $elem.css("background-color"), + ); //new widget with its own color + + cy.get(".t--widget-button2 button").should( + "have.css", + "background-color", + "rgb(239, 68, 68)", + ); //old widgets still conforming to theme color + }); + + //Change Border & verify + + cy.get(".border-t-2").eq(1).click().wait(500); + cy.get(".border-t-2") + .eq(1) + .invoke("css", "border-top-left-radius") + .then((borderRadius) => { + cy.get(".t--widget-button1 button").should( + "have.css", + "border-radius", + borderRadius, //6px + ); + + cy.get(".t--widget-button2 button").should( + "have.css", + "border-radius", + "24px", + ); + }); + + //Change Shadow & verify + cy.contains(".ads-v2-segmented-control-value-0", "Small").click(); + cy.get(".t--widget-button2 button").should( + "have.css", + "box-shadow", + //same value as previous box shadow selection + //since revertion is not possible for box shadow - hence this widget maintains the same value + "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", + ); + + agHelper.AssertAutoSave(); + + //Add deploy mode verification here also! + deployMode.DeployApp(); + + //Verify Background color + cy.get(".t--widget-button1 button").should( + "have.css", + "background-color", + "rgb(161, 98, 7)", + ); //new widget with its own color + + ////old widgets still conforming to theme color + cy.get(".t--widget-button2 button").should( + "have.css", + "background-color", + "rgb(239, 68, 68)", + ); + + //Verify Border radius + cy.get(".t--widget-button1 button").should( + "have.css", + "border-radius", + "6px", + ); + cy.get(".t--widget-button2 button").should( + "have.css", + "border-radius", + "24px", + ); + + //Verify Box shadow + cy.get(".t--widget-button1 button").should( + "have.css", + "box-shadow", + "rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px", + ); + cy.get(".t--widget-button2 button").should( + "have.css", + "box-shadow", + "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", + ); + + deployMode.NavigateBacktoEditor(); + //Resetting back to theme + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + cy.moveToStyleTab(); + cy.get(".t--property-control-buttoncolor .reset-button").then(($elem) => { + $elem[0].removeAttribute("display: none"); + $elem[0].click(); + }); + + cy.get(".t--widget-button1 button").should( + "have.css", + "background-color", + "rgb(239, 68, 68)", + ); //verify widget reverted to theme color + + cy.get(".t--property-control-borderradius .reset-button").then( + ($elem) => { + $elem[0].removeAttribute("display: none"); + $elem[0].click(); + }, + ); + cy.get(".t--widget-button1 button").should( + "have.css", + "border-radius", + "24px", + ); + + //the new widget with reverted styles also conforming to theme + deployMode.DeployApp(); + + cy.wait(4000); //for theme to settle + cy.get("body").should("have.css", "font-family", "Rubik, sans-serif"); //Font for Rounded theme + + cy.xpath("//div[@id='root']//section/parent::div").should( + "have.css", + "background-color", + "rgb(255, 241, 242)", + ); //Background Color of canvas + + cy.get(".t--widget-button1 button").should( + "have.css", + "background-color", + "rgb(239, 68, 68)", + ); //Widget Color + cy.get("body").then(($ele) => { + if ($ele.find(widgetsPage.widgetBtn).length <= 1) { + cy.reload(); + cy.wait(4000); + } + }); + cy.get(".t--widget-button2 button").should( + "have.css", + "background-color", + "rgb(239, 68, 68)", + ); //Widget Color + + cy.get(".t--widget-button1 button").should( + "have.css", + "border-radius", + "24px", + ); //Border Radius + cy.get(".t--widget-button2 button").should( + "have.css", + "border-radius", + "24px", + ); //Border Radius + + cy.get(".t--widget-button1 button").should( + "have.css", + "box-shadow", + "rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px", + ); //Shadow + cy.get(".t--widget-button2 button").should( + "have.css", + "box-shadow", + "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", + ); //Since Shadow revert option does not exixts + + deployMode.NavigateBacktoEditor(); }); - cy.get(".t--widget-button2 button").should( - "have.css", - "background-color", - "rgb(239, 68, 68)", - ); //Widget Color - - cy.get(".t--widget-button1 button").should( - "have.css", - "border-radius", - "24px", - ); //Border Radius - cy.get(".t--widget-button2 button").should( - "have.css", - "border-radius", - "24px", - ); //Border Radius - - cy.get(".t--widget-button1 button").should( - "have.css", - "box-shadow", - "rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px", - ); //Shadow - cy.get(".t--widget-button2 button").should( - "have.css", - "box-shadow", - "rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", - ); //Since Shadow revert option does not exixts - - deployMode.NavigateBacktoEditor(); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_FormWidget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_FormWidget_spec.js index 8761ba5c3c5..1ca6afa882f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_FormWidget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_FormWidget_spec.js @@ -20,225 +20,237 @@ const themelocator = require("../../../../locators/ThemeLocators.json"); let themeBackgroudColor; let themeFont; -describe("Theme validation usecases", { tags: ["@tag.Theme"] }, function () { - it("1. Drag and drop form widget and validate Default font and list of font validation", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.FORM); - agHelper.GetNClick(locators._canvas); - appSettings.OpenAppSettings(); - appSettings.GoToThemeSettings(); - //Border validation - //cy.contains("Border").click({ force: true }); - cy.get(themelocator.border).should("have.length", "3"); - cy.borderMouseover(0, "none"); - cy.borderMouseover(1, "M"); - cy.borderMouseover(2, "L"); - cy.get(themelocator.border).eq(2).click({ force: true }); - cy.wait("@updateTheme").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.wait(2000); - cy.contains("Border").click({ force: true }); - - //Shadow validation - //cy.contains("Shadow").click({ force: true }); - cy.xpath(theme.locators._boxShadow("L")).click({ force: true }); - cy.wait("@updateTheme").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.wait(2000); - cy.contains("Shadow").click({ force: true }); - - //Font - cy.xpath( - "//p[text()='App font']/following-sibling::section//div//input", - ).then(($elem) => { - cy.get($elem).click({ force: true }); - cy.wait(250); - cy.fixture("fontData").then(function (testdata) { - this.testdata = testdata; +describe( + "Theme validation usecases", + { tags: ["@tag.Theme", "@tag.Git"] }, + function () { + it("1. Drag and drop form widget and validate Default font and list of font validation", function () { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.FORM); + agHelper.GetNClick(locators._canvas); + appSettings.OpenAppSettings(); + appSettings.GoToThemeSettings(); + //Border validation + //cy.contains("Border").click({ force: true }); + cy.get(themelocator.border).should("have.length", "3"); + cy.borderMouseover(0, "none"); + cy.borderMouseover(1, "M"); + cy.borderMouseover(2, "L"); + cy.get(themelocator.border).eq(2).click({ force: true }); + cy.wait("@updateTheme").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.wait(2000); + cy.contains("Border").click({ force: true }); + + //Shadow validation + //cy.contains("Shadow").click({ force: true }); + cy.xpath(theme.locators._boxShadow("L")).click({ force: true }); + cy.wait("@updateTheme").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.wait(2000); + cy.contains("Shadow").click({ force: true }); + + //Font + cy.xpath( + "//p[text()='App font']/following-sibling::section//div//input", + ).then(($elem) => { + cy.get($elem).click({ force: true }); + cy.wait(250); + cy.fixture("fontData").then(function (testdata) { + this.testdata = testdata; + }); + + cy.get(themelocator.fontsSelected) + //.eq(10) + .should("contain.text", "Nunito Sans"); + + cy.get(".rc-virtual-list .rc-select-item-option") + .find(".leading-normal") + .eq(2) + .then(($childElem) => { + cy.get($childElem).click({ force: true }); + cy.get(".t--draggable-buttonwidget button :contains('Sub')").should( + "have.css", + "font-family", + `Poppins, sans-serif`, + ); + //themeFont = `${$childElem.children().last().text()}, sans-serif`; + themeFont = `Poppins, sans-serif`; + + cy.contains("Font").click({ force: true }); + + //Color + //cy.contains("Color").click({ force: true }); + cy.wait(2000); + cy.colorMouseover(0, "Primary color"); + cy.validateColor("Primary", "#553DE9"); + cy.colorMouseover(1, "Background color"); + cy.validateColor("Background", "#F8FAFC"); + + cy.get(themelocator.inputColor).click({ force: true }); + cy.chooseColor(0, themelocator.greenColor); + + cy.get(themelocator.inputColor).should("have.value", "#15803d"); + cy.get(themelocator.inputColor).clear({ force: true }); + cy.wait(2000); + theme.ChangeThemeColor(16, "Background"); + cy.get(themelocator.inputColor).should("have.value", "#86efac"); //Red + cy.wait(2000); + + cy.get(themelocator.inputColor).eq(0).click({ force: true }); + cy.get(themelocator.inputColor).click({ force: true }); + cy.get('[data-testid="color-picker"]') + .first() + .click({ force: true }); + cy.get("[style='background-color: rgb(21, 128, 61);']") + .last() + .click(); + cy.wait(2000); + cy.get(themelocator.inputColor).should("have.value", "#15803d"); + cy.get(themelocator.inputColor).clear({ force: true }); + cy.wait(2000); + theme.ChangeThemeColor(9, "Primary"); + cy.get(themelocator.inputColor).should("have.value", "#7f1d1d"); //Black + cy.wait(2000); + cy.contains("Color").click({ force: true }); + appSettings.ClosePane(); + + //Publish the App and validate Font across the app + deployMode.DeployApp(); + cy.get(".bp3-button:contains('Sub')").should( + "have.css", + "font-family", + themeFont, + ); + cy.get(".bp3-button:contains('Reset')").should( + "have.css", + "font-family", + themeFont, + ); + }); }); + deployMode.NavigateBacktoEditor(); + }); - cy.get(themelocator.fontsSelected) - //.eq(10) - .should("contain.text", "Nunito Sans"); + it("2. Validate Default Theme change across application", function () { + propPane.RenameWidget("Form1", "FormTest"); + propPane.MoveToTab("Style"); + cy.get(widgetsPage.backgroundcolorPickerNew) + .first() + .click({ force: true }); + cy.get("[style='background-color: rgb(21, 128, 61);']").last().click(); + cy.wait(2000); + cy.get(formWidgetsPage.formD) + .should("have.css", "background-color") + .and("eq", "rgb(21, 128, 61)"); + cy.get("#canvas-selection-0").click({ force: true }); - cy.get(".rc-virtual-list .rc-select-item-option") - .find(".leading-normal") - .eq(2) - .then(($childElem) => { - cy.get($childElem).click({ force: true }); - cy.get(".t--draggable-buttonwidget button :contains('Sub')").should( - "have.css", - "font-family", - `Poppins, sans-serif`, - ); - //themeFont = `${$childElem.children().last().text()}, sans-serif`; - themeFont = `Poppins, sans-serif`; - - cy.contains("Font").click({ force: true }); - - //Color - //cy.contains("Color").click({ force: true }); - cy.wait(2000); - cy.colorMouseover(0, "Primary color"); - cy.validateColor("Primary", "#553DE9"); - cy.colorMouseover(1, "Background color"); - cy.validateColor("Background", "#F8FAFC"); - - cy.get(themelocator.inputColor).click({ force: true }); - cy.chooseColor(0, themelocator.greenColor); - - cy.get(themelocator.inputColor).should("have.value", "#15803d"); - cy.get(themelocator.inputColor).clear({ force: true }); - cy.wait(2000); - theme.ChangeThemeColor(16, "Background"); - cy.get(themelocator.inputColor).should("have.value", "#86efac"); //Red - cy.wait(2000); - - cy.get(themelocator.inputColor).eq(0).click({ force: true }); - cy.get(themelocator.inputColor).click({ force: true }); - cy.get('[data-testid="color-picker"]').first().click({ force: true }); - cy.get("[style='background-color: rgb(21, 128, 61);']") + appSettings.OpenAppSettings(); + appSettings.GoToThemeSettings(); + //Change the Theme + cy.get(commonlocators.changeThemeBtn).click({ force: true }); + cy.get(themelocator.currentTheme).click({ force: true }); + cy.get(".t--theme-card main > main") + .first() + .invoke("css", "background-color") + .then((CurrentBackgroudColor) => { + cy.get(".bp3-button:contains('Sub')") .last() - .click(); - cy.wait(2000); - cy.get(themelocator.inputColor).should("have.value", "#15803d"); - cy.get(themelocator.inputColor).clear({ force: true }); - cy.wait(2000); - theme.ChangeThemeColor(9, "Primary"); - cy.get(themelocator.inputColor).should("have.value", "#7f1d1d"); //Black - cy.wait(2000); - cy.contains("Color").click({ force: true }); - appSettings.ClosePane(); - - //Publish the App and validate Font across the app - deployMode.DeployApp(); - cy.get(".bp3-button:contains('Sub')").should( + .invoke("css", "background-color") + .then((selectedBackgroudColor) => { + expect(CurrentBackgroudColor).to.equal(selectedBackgroudColor); + themeBackgroudColor = CurrentBackgroudColor; + appSettings.ClosePane(); + }); + }); + }); + + it("3. Validate Theme change across application", function () { + EditorNavigation.SelectEntityByName("FormTest", EntityType.Widget); + propPane.MoveToTab("Style"); + cy.get(widgetsPage.backgroundcolorPickerNew) + .first() + .click({ force: true }); + cy.get("[style='background-color: rgb(21, 128, 61);']").last().click(); + cy.wait(2000); + cy.get(formWidgetsPage.formD) + .should("have.css", "background-color") + .and("eq", "rgb(21, 128, 61)"); + + cy.get("#canvas-selection-0").click({ force: true }); + + appSettings.OpenAppSettings(); + appSettings.GoToThemeSettings(); + //Change the Theme + cy.get(commonlocators.changeThemeBtn).click({ force: true }); + // select a theme + cy.get(commonlocators.themeCard).last().click({ force: true }); + + // check for alert + cy.get(`${commonlocators.themeCard}`) + .last() + .siblings("div") + .first() + .invoke("text") + .then((text) => { + cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); + }); + cy.get(`${commonlocators.themeCard} > main`) + .last() + .invoke("css", "background-color") + .then((backgroudColor) => { + cy.get(commonlocators.canvas).should( "have.css", - "font-family", - themeFont, + "background-color", + backgroudColor, ); - cy.get(".bp3-button:contains('Reset')").should( + }); + cy.get(themelocator.currentTheme).click({ force: true }); + cy.get(".t--theme-card > main") + .first() + .invoke("css", "background-color") + .then((backgroudColor) => { + cy.get(commonlocators.canvas).should( "have.css", - "font-family", - themeFont, + "background-color", + backgroudColor, ); }); + cy.get(".t--theme-card main > main") + .first() + .invoke("css", "background-color") + .then((CurrentBackgroudColor) => { + cy.get(".t--theme-card main > main") + .last() + .invoke("css", "background-color") + .then((selectedBackgroudColor) => { + expect(CurrentBackgroudColor).to.equal(selectedBackgroudColor); + themeBackgroudColor = CurrentBackgroudColor; + appSettings.ClosePane(); + }); + }); + EditorNavigation.SelectEntityByName("FormTest", EntityType.Widget); + propPane.MoveToTab("Style"); + cy.get(widgetsPage.backgroundcolorPickerNew) + .first() + .click({ force: true }); + cy.get("[style='background-color: rgb(126, 34, 206);']").first().click(); + cy.wait(2000); + cy.get(formWidgetsPage.formD) + .should("have.css", "background-color") + .and("eq", "rgb(126, 34, 206)"); + + //Publish the App and validate Theme across the app + deployMode.DeployApp(); + //Bug Form backgroud colour reset in Publish mode + cy.get(formWidgetsPage.formD) + .should("have.css", "background-color") + .and("eq", "rgb(126, 34, 206)"); }); - deployMode.NavigateBacktoEditor(); - }); - - it("2. Validate Default Theme change across application", function () { - propPane.RenameWidget("Form1", "FormTest"); - propPane.MoveToTab("Style"); - cy.get(widgetsPage.backgroundcolorPickerNew).first().click({ force: true }); - cy.get("[style='background-color: rgb(21, 128, 61);']").last().click(); - cy.wait(2000); - cy.get(formWidgetsPage.formD) - .should("have.css", "background-color") - .and("eq", "rgb(21, 128, 61)"); - cy.get("#canvas-selection-0").click({ force: true }); - - appSettings.OpenAppSettings(); - appSettings.GoToThemeSettings(); - //Change the Theme - cy.get(commonlocators.changeThemeBtn).click({ force: true }); - cy.get(themelocator.currentTheme).click({ force: true }); - cy.get(".t--theme-card main > main") - .first() - .invoke("css", "background-color") - .then((CurrentBackgroudColor) => { - cy.get(".bp3-button:contains('Sub')") - .last() - .invoke("css", "background-color") - .then((selectedBackgroudColor) => { - expect(CurrentBackgroudColor).to.equal(selectedBackgroudColor); - themeBackgroudColor = CurrentBackgroudColor; - appSettings.ClosePane(); - }); - }); - }); - - it("3. Validate Theme change across application", function () { - EditorNavigation.SelectEntityByName("FormTest", EntityType.Widget); - propPane.MoveToTab("Style"); - cy.get(widgetsPage.backgroundcolorPickerNew).first().click({ force: true }); - cy.get("[style='background-color: rgb(21, 128, 61);']").last().click(); - cy.wait(2000); - cy.get(formWidgetsPage.formD) - .should("have.css", "background-color") - .and("eq", "rgb(21, 128, 61)"); - - cy.get("#canvas-selection-0").click({ force: true }); - - appSettings.OpenAppSettings(); - appSettings.GoToThemeSettings(); - //Change the Theme - cy.get(commonlocators.changeThemeBtn).click({ force: true }); - // select a theme - cy.get(commonlocators.themeCard).last().click({ force: true }); - - // check for alert - cy.get(`${commonlocators.themeCard}`) - .last() - .siblings("div") - .first() - .invoke("text") - .then((text) => { - cy.get(commonlocators.toastmsg).contains(`Theme ${text} applied`); - }); - cy.get(`${commonlocators.themeCard} > main`) - .last() - .invoke("css", "background-color") - .then((backgroudColor) => { - cy.get(commonlocators.canvas).should( - "have.css", - "background-color", - backgroudColor, - ); - }); - cy.get(themelocator.currentTheme).click({ force: true }); - cy.get(".t--theme-card > main") - .first() - .invoke("css", "background-color") - .then((backgroudColor) => { - cy.get(commonlocators.canvas).should( - "have.css", - "background-color", - backgroudColor, - ); - }); - cy.get(".t--theme-card main > main") - .first() - .invoke("css", "background-color") - .then((CurrentBackgroudColor) => { - cy.get(".t--theme-card main > main") - .last() - .invoke("css", "background-color") - .then((selectedBackgroudColor) => { - expect(CurrentBackgroudColor).to.equal(selectedBackgroudColor); - themeBackgroudColor = CurrentBackgroudColor; - appSettings.ClosePane(); - }); - }); - EditorNavigation.SelectEntityByName("FormTest", EntityType.Widget); - propPane.MoveToTab("Style"); - cy.get(widgetsPage.backgroundcolorPickerNew).first().click({ force: true }); - cy.get("[style='background-color: rgb(126, 34, 206);']").first().click(); - cy.wait(2000); - cy.get(formWidgetsPage.formD) - .should("have.css", "background-color") - .and("eq", "rgb(126, 34, 206)"); - - //Publish the App and validate Theme across the app - deployMode.DeployApp(); - //Bug Form backgroud colour reset in Publish mode - cy.get(formWidgetsPage.formD) - .should("have.css", "background-color") - .and("eq", "rgb(126, 34, 206)"); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_MultiSelectWidget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_MultiSelectWidget_spec.js index 0f149cf2179..4e6f553f23f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_MultiSelectWidget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/ThemingTests/Theme_MultiSelectWidget_spec.js @@ -16,7 +16,7 @@ let themeFont; describe( "Theme validation usecase for multi-select widget", - { tags: ["@tag.Theme"] }, + { tags: ["@tag.Theme", "@tag.Git"] }, function () { it("1. Drag and drop multi-select widget and validate Default font and list of font validation + Bug 15007", function () { entityExplorer.DragDropWidgetNVerify( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder1_spec.ts index a883cdd8c5a..1906771330e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder1_spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "Audio Recorder functionality tests", - { tags: ["@tag.Widget", "@tag.Audio"] }, + { tags: ["@tag.Widget", "@tag.Audio", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder_spec.js index df109cf90c4..9f0ec20ec71 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/AudioRecorder_spec.js @@ -2,7 +2,7 @@ const widgetName = "audiorecorderwidget"; describe( "AudioRecorder Widget", - { tags: ["@tag.Widget", "@tag.Audio"] }, + { tags: ["@tag.Widget", "@tag.Audio", "@tag.Binding"] }, () => { it("Drag & drop AudioRecorder and Text widgets", () => { cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/audio_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/audio_spec.js index 216b9ae6902..92b0cb1fa31 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/audio_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Audio/audio_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Audio Widget Functionality", - { tags: ["@tag.Widget", "@tag.Audio"] }, + { tags: ["@tag.Widget", "@tag.Audio", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("audioWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button2_spec.ts index 4cfc7b8c890..f3dc601cbcf 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button2_spec.ts @@ -19,7 +19,7 @@ import EditorNavigation, { describe( "Button widget testcases", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Binding"] }, () => { before(() => { apiPage.CreateAndFillApi( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts index 11ad2754198..df1c74b3436 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup2_spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Button Group Widget Test", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Binding"] }, function () { before("Login to the app and navigate to the workspace", function () { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON_GROUP); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_MenuButton_Width_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_MenuButton_Width_spec.js index a6ad1506f52..d73126ed990 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_MenuButton_Width_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_MenuButton_Width_spec.js @@ -3,7 +3,7 @@ import { agHelper } from "../../../../../support/Objects/ObjectsCore"; describe( "In a button group widget, menu button width", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("ButtonGroup_MenuButton_Width_dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_spec.js index 6d1b1fb35f1..1e64e83a5c5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_spec.js @@ -18,7 +18,7 @@ const menuButton = describe( "Button Group Widget Functionality", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON_GROUP); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js index 93bcb3dbd81..435651a97ba 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonLintErrorValidation_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Linting warning validation with button widget", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("buttonLintErrorDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js index 703cfc151a1..a387f885c20 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_onClickAction_spec.js @@ -16,7 +16,7 @@ import { describe( "Button Widget Functionality", - { tags: ["@tag.Widget", "@tag.Button", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Sanity", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_spec.js index 0c0824d6798..54292962792 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_spec.js @@ -12,7 +12,7 @@ const iconAlignmentProperty = ".t--property-control-position"; describe( "Button Widget Functionality", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_tooltip_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_tooltip_spec.js index ea098127276..2bfd4ced8ae 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_tooltip_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/Button_tooltip_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Button Widget Functionality - Validate tooltip visibility", - { tags: ["@tag.Widget", "@tag.Button"] }, + { tags: ["@tag.Widget", "@tag.Button", "@tag.Binding"] }, function () { before(() => { _.entityExplorer.DragDropWidgetNVerify( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraImage_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraImage_Spec.ts index e0438a393e2..8572db562db 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraImage_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraImage_Spec.ts @@ -15,7 +15,7 @@ import PageList from "../../../../../support/Pages/PageList"; describe( "Camera widget - Image test", - { tags: ["@tag.Widget", "@tag.Camera", "@tag.Visual"] }, + { tags: ["@tag.Widget", "@tag.Camera", "@tag.Visual", "@tag.Binding"] }, () => { before(() => { //Reset video source to default incase it got changed in other specs diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraVideo_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraVideo_Spec.ts index 9c010aa16c6..b949463c9ab 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraVideo_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Camera/CameraVideo_Spec.ts @@ -14,7 +14,7 @@ import EditorNavigation, { describe( "Camera widget - Video test", - { tags: ["@tag.Widget", "@tag.Camera", "@tag.Visual"] }, + { tags: ["@tag.Widget", "@tag.Camera", "@tag.Visual", "@tag.Binding"] }, () => { before(() => { //Reset video source to default incase it got changed in other specs diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts index 3f12e9eb6f7..05ae81bb802 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartDataPoint_Spec.ts @@ -16,7 +16,7 @@ let dataSet: any, dsl: any; describe( "Input widget test with default value from chart datapoint", - { tags: ["@tag.Widget", "@tag.Chart", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Chart", "@tag.Sanity", "@tag.Binding"] }, () => { //beforeEach - to enable re-attempt passing! beforeEach(() => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartWidgetErrors_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartWidgetErrors_spec.ts index fdded5f5f7f..ea59fb84bc8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartWidgetErrors_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/ChartWidgetErrors_spec.ts @@ -7,7 +7,7 @@ import { describe( "Chart renders widget errors", - { tags: ["@tag.Widget", "@tag.Chart"] }, + { tags: ["@tag.Widget", "@tag.Chart", "@tag.Binding"] }, () => { it("1. If there are syntax errors, the errors are displayed inside the chart widget", function () { entityExplorer.DragDropWidgetNVerify(draggableWidgets.CHART); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Chart_Widget_Loading_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Chart_Widget_Loading_spec.js index d4a956c29f0..57747db1c83 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Chart_Widget_Loading_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Chart_Widget_Loading_spec.js @@ -9,7 +9,7 @@ import EditorNavigation, { let dsname; describe( "Chart Widget Skeleton Loading Functionality", - { tags: ["@tag.Widget", "@tag.Chart"] }, + { tags: ["@tag.Widget", "@tag.Chart", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("ChartLoadingDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom3DChartSpec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom3DChartSpec.ts index 696303aad3c..3e2f532a06e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom3DChartSpec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom3DChartSpec.ts @@ -7,7 +7,7 @@ const publicWidgetsPage = require("../../../../../locators/publishWidgetspage.js describe.skip( "3D Custom EChart feature", - { tags: ["@tag.Widget", "@tag.Chart", "@tag.Visual"] }, + { tags: ["@tag.Widget", "@tag.Chart", "@tag.Visual", "@tag.Binding"] }, function () { it("1. 3D EChart Custom Chart Widget Functionality", function () { _.agHelper.RefreshPage(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_Data_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_Data_spec.js index d416f39a899..dd84c19b891 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_Data_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_Data_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Chart Widget Functionality around custom chart data", - { tags: ["@tag.Widget", "@tag.Chart"] }, + { tags: ["@tag.Widget", "@tag.Chart", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("chartCustomDataDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_spec.js index 6e204e3cacc..1e0a8370e27 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Chart/Custom_Chart_spec.js @@ -8,7 +8,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Chart Widget Functionality around custom chart feature", - { tags: ["@tag.Widget", "@tag.Chart"] }, + { tags: ["@tag.Widget", "@tag.Chart", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("chartUpdatedDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxLintErrorMultipleRowValidation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxLintErrorMultipleRowValidation_spec.js index e2a827abac0..358fe39e3e5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxLintErrorMultipleRowValidation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxLintErrorMultipleRowValidation_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Linting warning validation with Checkbox widget", - { tags: ["@tag.Widget", "@tag.Checkbox"] }, + { tags: ["@tag.Widget", "@tag.Checkbox", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("snippetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxMultipleLintError_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxMultipleLintError_spec.js index 704cccbc829..6f54c58e01d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxMultipleLintError_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBoxMultipleLintError_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Linting warning validation with Checkbox widget", - { tags: ["@tag.Widget", "@tag.Checkbox"] }, + { tags: ["@tag.Widget", "@tag.Checkbox", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("snippetErrordsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBox_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBox_spec.js index e6d56424297..7ac312e3057 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBox_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckBox_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Checkbox Widget Functionality", - { tags: ["@tag.Widget", "@tag.Checkbox"] }, + { tags: ["@tag.Widget", "@tag.Checkbox", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup1_spec.js index af446969241..ec713566d2e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup1_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "checkboxgroupwidget Widget Functionality", - { tags: ["@tag.Widget", "@tag.Checkbox"] }, + { tags: ["@tag.Widget", "@tag.Checkbox", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup2_spec.js index 10c00970efb..81ba7c6278a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup2_spec.js @@ -8,7 +8,7 @@ import { describe( "Checkbox Group Widget Functionality", - { tags: ["@tag.Widget", "@tag.Checkbox"] }, + { tags: ["@tag.Widget", "@tag.Checkbox", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("checkboxgroupDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup_withQuery_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup_withQuery_spec.js index f1117e54f00..958b4f596e3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup_withQuery_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Checkbox/CheckboxGroup_withQuery_spec.js @@ -8,7 +8,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Checkbox Group Widget Functionality", - { tags: ["@tag.Widget", "@tag.Checkbox"] }, + { tags: ["@tag.Widget", "@tag.Checkbox", "@tag.Binding"] }, function () { let dsName; before(() => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner1_spec.ts index 25d66aff682..e0bc3666bad 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner1_spec.ts @@ -8,7 +8,7 @@ const codeScannerDisabledSVGIconOnPublishPage = `${publish.codescannerwidget} ${ describe( "Code Scanner widget's functionality", - { tags: ["@tag.Widget", "@tag.Scanner"] }, + { tags: ["@tag.Widget", "@tag.Scanner", "@tag.Binding"] }, () => { it("1 => Check if code scanner widget can be dropped on the canvas", () => { // Drop the widget diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner2_spec.ts index 32604807f28..27be8c47b5a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CodeScanner/CodeScanner2_spec.ts @@ -14,7 +14,7 @@ import EditorNavigation, { describe( "Code scanner widget tests", - { tags: ["@tag.Widget", "@tag.Scanner"] }, + { tags: ["@tag.Widget", "@tag.Scanner", "@tag.Binding"] }, () => { before(() => { //Reset video source to default diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ContainerTest2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ContainerTest2_spec.ts index 9045781906b..6c3a3a61a60 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ContainerTest2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ContainerTest2_spec.ts @@ -12,7 +12,9 @@ import EditorNavigation, { describe( "Rich Text Editor widget Tests", - { tags: ["@tag.Widget", "@tag.Container"] }, + { + tags: ["@tag.Widget", "@tag.Container", "@tag.AutoHeight", "@tag.Binding"], + }, function () { before(() => { agHelper.AddDsl("ContainerWithOtherWidgetsDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Container_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Container_spec.js index 4f9ba8fe210..cfff72ba14c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Container_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Container_spec.js @@ -11,7 +11,9 @@ const boxShadowOptions = { describe( "Container Widget Functionality", - { tags: ["@tag.Widget", "@tag.Container"] }, + { + tags: ["@tag.Widget", "@tag.Container", "@tag.AutoHeight", "@tag.Binding"], + }, function () { before(() => { _.agHelper.AddDsl("containerdsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInputDynamicCurrencyCode_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInputDynamicCurrencyCode_spec.js index 5186338e775..89be8b321e7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInputDynamicCurrencyCode_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInputDynamicCurrencyCode_spec.js @@ -4,7 +4,7 @@ const widgetName = "currencyinputwidget"; describe( "Currency input widget - ", - { tags: ["@tag.Widget", "@tag.CurrencyInput"] }, + { tags: ["@tag.Widget", "@tag.CurrencyInput", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("CurrencyInputDynamic"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_ShowStepArrows_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_ShowStepArrows_spec.js index ffb298164e7..a4febaa8886 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_ShowStepArrows_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_ShowStepArrows_spec.js @@ -5,7 +5,7 @@ const widgetName = "currencyinputwidget"; describe( "Currency Widget showStepArrows Functionality - ", - { tags: ["@tag.Widget", "@tag.CurrencyInput"] }, + { tags: ["@tag.Widget", "@tag.CurrencyInput", "@tag.Binding"] }, function () { it("1. Validate that For new currency input widgets being dragged, the value for showStepArrows should be set to false", () => { cy.dragAndDropToCanvas(widgetName, { x: 300, y: 400 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_spec.js index 3292ad922fd..b4fdfe4d25c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/CurrencyInput/CurrencyInput_spec.js @@ -6,7 +6,7 @@ const widgetInput = `.t--widget-${widgetName} input`; describe( "Currency widget - ", - { tags: ["@tag.Widget", "@tag.CurrencyInput"] }, + { tags: ["@tag.Widget", "@tag.CurrencyInput", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetDefaultComponent_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetDefaultComponent_spec.ts index 94b74026459..7716e7dbfa0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetDefaultComponent_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetDefaultComponent_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Custom widget Tests", - { tags: ["@tag.Widget", "@tag.excludeForAirgap"] }, + { tags: ["@tag.Widget", "@tag.excludeForAirgap", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify("customwidget", 550, 100); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetEditorPropertyPane_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetEditorPropertyPane_spec.ts index 6805ad32881..166dd8006e7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetEditorPropertyPane_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetEditorPropertyPane_spec.ts @@ -7,7 +7,7 @@ import { describe( "Custom widget Tests", - { tags: ["@tag.Widget", "@tag.excludeForAirgap"] }, + { tags: ["@tag.Widget", "@tag.excludeForAirgap", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("customWidget"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker1_spec.js index 4759b6b77fd..67573cfc47e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker1_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "DatePicker Widget Property pane tests with js bindings", - { tags: ["@tag.Widget", "@tag.Datepicker"] }, + { tags: ["@tag.Widget", "@tag.Datepicker", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("datePicker2dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js index e9eaf610b9c..9f40aaefde3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker2_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "DatePicker Widget Functionality", - { tags: ["@tag.Widget", "@tag.Datepicker"] }, + { tags: ["@tag.Widget", "@tag.Datepicker", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts index 71e8bf1e95c..a2f5acc71df 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker3_spec.ts @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Date picker widget testcases", - { tags: ["@tag.Widget", "@tag.Datepicker"] }, + { tags: ["@tag.Widget", "@tag.Datepicker", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.DATEPICKER); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2Updated_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2Updated_spec.js index 10f3ff529b1..1b634205dfe 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2Updated_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2Updated_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "DatePicker Widget Property pane tests with js bindings", - { tags: ["@tag.Widget", "@tag.Datepicker"] }, + { tags: ["@tag.Widget", "@tag.Datepicker", "@tag.Binding"] }, function () { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2_spec.js index 953307c20c6..7bc4efc0936 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePickerV2_spec.js @@ -9,7 +9,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "DatePicker Widget Property pane tests with js bindings", - { tags: ["@tag.Widget", "@tag.Datepicker"] }, + { tags: ["@tag.Widget", "@tag.Datepicker", "@tag.Binding"] }, function () { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_Toggle_js_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_Toggle_js_spec.js index 3ff25dc51f5..6b706e4798c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_Toggle_js_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_Toggle_js_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "DatePicker", - { tags: ["@tag.Widget", "@tag.Datepicker"] }, + { tags: ["@tag.Widget", "@tag.Datepicker", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_With_Switch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_With_Switch_spec.js index a120e800f97..d48e5ce34c9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_With_Switch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Datepicker/DatePicker_With_Switch_spec.js @@ -9,7 +9,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Switch Widget within Form widget Functionality", - { tags: ["@tag.Widget", "@tag.Datepicker"] }, + { tags: ["@tag.Widget", "@tag.Datepicker", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("datepicker_switchDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Disabled_Widgets_drag_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Disabled_Widgets_drag_validation_spec.js index 525223a5711..3e28c329db5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Disabled_Widgets_drag_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Disabled_Widgets_drag_validation_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Disabled Widgets drag Functionality", - { tags: ["@tag.Widget"] }, + { tags: ["@tag.Widget", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("disabledWidgetsDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Divider/Widget_Divider_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Divider/Widget_Divider_spec.ts index 7975e17717c..51c3fd4afcf 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Divider/Widget_Divider_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Divider/Widget_Divider_spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "Divider Widget functionality tests", - { tags: ["@tag.Widget", "@tag.Divider"] }, + { tags: ["@tag.Widget", "@tag.Divider", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.DIVIDER, 200, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts index 510db43eef9..38d9da17a91 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/DocumentViewer/DocumentViewer_spec.ts @@ -23,7 +23,7 @@ const pdf = "http://host.docker.internal:4200/sample-pdf-file.pdf"; describe( "DocumentViewer Widget Functionality", - { tags: ["@tag.Widget", "@tag.DocumentViewer"] }, + { tags: ["@tag.Widget", "@tag.DocumentViewer", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify("filepickerwidgetv2", 400, 900); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/DropDownWidget_value_reset_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/DropDownWidget_value_reset_spec.js index fa229a8df15..19961a302d3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/DropDownWidget_value_reset_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/DropDownWidget_value_reset_spec.js @@ -9,7 +9,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Dropdown Widget Check value does not reset on navigation", - { tags: ["@tag.Widget", "@tag.Dropdown"] }, + { tags: ["@tag.Widget", "@tag.Dropdown", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("dropDownWidget_reset_check_dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js index e78f872fca7..f6c2128c334 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_onOptionChange_spec.js @@ -17,7 +17,7 @@ import { describe( "Dropdown Widget", - { tags: ["@tag.Widget", "@tag.Dropdown"] }, + { tags: ["@tag.Widget", "@tag.Dropdown", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_spec.js index 29003b4017c..aea162b8819 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Dropdown/Dropdown_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Dropdown Widget Functionality", - { tags: ["@tag.Widget", "@tag.Dropdown"] }, + { tags: ["@tag.Widget", "@tag.Dropdown", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker2_spec.js index c70ecb7c4f1..fa2f96fe9a8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker2_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "FilePicker Widget Functionality", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, function () { afterEach(() => { _.agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker3_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker3_spec.ts index d2e1fc25f39..aa02ef5e284 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker3_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker3_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Verify file picker widget", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("filepickerDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_CSV_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_CSV_spec.js index f27a969cf0c..975f23e23fb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_CSV_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_CSV_spec.js @@ -12,7 +12,7 @@ const ARRAY_CSV_HELPER_TEXT = `All non CSV, XLS(X), JSON or TSV filetypes will h describe( "File picker widget v2", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("filePickerTableDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_Reskinning_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_Reskinning_spec.js index d44345f8cee..bd22bae6124 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_Reskinning_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_Reskinning_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Checkbox Widget Functionality", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("filePickerV2WidgetReskinDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_reset_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_reset_spec.js index 53e65242410..abb8c22096f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_reset_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_Widget_reset_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "File Picker Widget V2 Functionality", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("filePickerV2_reset_check_dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_spec.js index 47253f3d615..b6d36173849 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePickerV2_spec.js @@ -12,7 +12,7 @@ const widgetName = "filepickerwidgetv2"; describe( "File picker widget v2", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, () => { it("1. Drag & drop FilePicker/Text widgets", () => { cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker_with_fileTypes_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker_with_fileTypes_spec.js index e8343a336b4..bbb10da1457 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker_with_fileTypes_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/FilePicker_with_fileTypes_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "FilePicker Widget Functionality with different file types", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("filepickerDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/Filepicker1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/Filepicker1_spec.js index 50226155ed4..b951a50a447 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/Filepicker1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Filepicker/Filepicker1_spec.js @@ -10,7 +10,7 @@ import EditorNavigation, { describe( "FilePicker Widget Functionality", - { tags: ["@tag.Widget", "@tag.Filepicker"] }, + { tags: ["@tag.Widget", "@tag.Filepicker", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.FILEPICKER); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormData_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormData_spec.js index 51f1939d259..cce668c46f5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormData_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormData_spec.js @@ -1,24 +1,28 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Form data", { tags: ["@tag.Widget", "@tag.Form"] }, function () { - before(() => { - _.agHelper.AddDsl("formDataDsl"); - }); +describe( + "Form data", + { tags: ["@tag.Widget", "@tag.Form", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("formDataDsl"); + }); - it("CheckboxGroupWidget, MultiSelectTreeWidget, MultiSelectWidgetV2, SelectWidget, SingleSelectTreeWidget, SwitchGroupWidget, PhoneInputWidget, InputWidgetV2 and CurrencyInputWidget should have value props of which values are not null or undefined to be included as a form data", function () { - // Check form data - cy.get("[data-testid='container-wrapper-vannrar7rd'] span") - .should("exist") - .and(($formData) => { - expect($formData).to.contain("FormCheckboxGroupWidget"); - expect($formData).to.contain("FormMultiSelectTreeWidget"); - expect($formData).to.contain("FormMultiSelectWidgetV2"); - expect($formData).to.contain("FormSingleSelectTreeWidget"); - expect($formData).to.contain("FormSwitchGroupWidget"); - expect($formData).to.contain("FormSelectWidget"); - expect($formData).to.contain("FormPhoneInputWidget"); - expect($formData).to.contain("FormInputWidgetV2"); - expect($formData).to.contain("FormCurrencyInputWidget"); - }); - }); -}); + it("CheckboxGroupWidget, MultiSelectTreeWidget, MultiSelectWidgetV2, SelectWidget, SingleSelectTreeWidget, SwitchGroupWidget, PhoneInputWidget, InputWidgetV2 and CurrencyInputWidget should have value props of which values are not null or undefined to be included as a form data", function () { + // Check form data + cy.get("[data-testid='container-wrapper-vannrar7rd'] span") + .should("exist") + .and(($formData) => { + expect($formData).to.contain("FormCheckboxGroupWidget"); + expect($formData).to.contain("FormMultiSelectTreeWidget"); + expect($formData).to.contain("FormMultiSelectWidgetV2"); + expect($formData).to.contain("FormSingleSelectTreeWidget"); + expect($formData).to.contain("FormSwitchGroupWidget"); + expect($formData).to.contain("FormSelectWidget"); + expect($formData).to.contain("FormPhoneInputWidget"); + expect($formData).to.contain("FormInputWidgetV2"); + expect($formData).to.contain("FormCurrencyInputWidget"); + }); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormReset_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormReset_spec.js index 06bf2a8ca9e..a01f0728e1a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormReset_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormReset_spec.js @@ -3,7 +3,7 @@ import widgets from "../../../../../locators/Widgets.json"; describe( "Form reset functionality", - { tags: ["@tag.Widget", "@tag.Form"] }, + { tags: ["@tag.Widget", "@tag.Form", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formResetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Nested_HasChanges_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Nested_HasChanges_spec.js index afd94896bde..146d2380080 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Nested_HasChanges_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Nested_HasChanges_spec.js @@ -1,17 +1,21 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Form Widget", { tags: ["@tag.Widget", "@tag.Form"] }, () => { - before(() => { - _.agHelper.AddDsl("formHasChangesDsl"); - }); +describe( + "Form Widget", + { tags: ["@tag.Widget", "@tag.Form", "@tag.Binding"] }, + () => { + before(() => { + _.agHelper.AddDsl("formHasChangesDsl"); + }); - it("Check hasChanges meta property", () => { - // Check if isDirty is false for the first time - cy.contains(".t--widget-textwidget", "false").should("exist"); - // Interact with UI - cy.get(`.t--widget-checkboxwidget label`).first().click(); - // Check if isDirty is set to true - cy.contains(".t--widget-textwidget", "false").should("not.exist"); - cy.contains(".t--widget-textwidget", "true").should("exist"); - }); -}); + it("Check hasChanges meta property", () => { + // Check if isDirty is false for the first time + cy.contains(".t--widget-textwidget", "false").should("exist"); + // Interact with UI + cy.get(`.t--widget-checkboxwidget label`).first().click(); + // Check if isDirty is set to true + cy.contains(".t--widget-textwidget", "false").should("not.exist"); + cy.contains(".t--widget-textwidget", "true").should("exist"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Select_TreeSelect_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Select_TreeSelect_spec.js index a5914c3f5d4..48540b1e7f8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Select_TreeSelect_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_Select_TreeSelect_spec.js @@ -4,7 +4,7 @@ import { agHelper } from "../../../../../support/Objects/ObjectsCore"; describe( "Form Widget Functionality", - { tags: ["@tag.Widget", "@tag.Form"] }, + { tags: ["@tag.Widget", "@tag.Form", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("formSelectTreeselectDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_With_RichTextEditor_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_With_RichTextEditor_spec.js index ae07e8828be..08dadf6b8ed 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_With_RichTextEditor_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_With_RichTextEditor_spec.js @@ -4,7 +4,7 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); describe( "RichTextEditor Widget Functionality in Form", - { tags: ["@tag.Widget", "@tag.Form", "@tag.TextEditor"] }, + { tags: ["@tag.Widget", "@tag.Form", "@tag.TextEditor", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formWithRTEDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_spec.js index bacf2927b2e..1e0e8b65336 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWidget_spec.js @@ -11,7 +11,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Form Widget Functionality", - { tags: ["@tag.Widget", "@tag.Form"] }, + { tags: ["@tag.Widget", "@tag.Form", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formdsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWithSwitch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWithSwitch_spec.js index 17d8f6b74a0..99052f9d079 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWithSwitch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/FormWithSwitch_spec.js @@ -8,7 +8,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Switch Widget within Form widget Functionality", - { tags: ["@tag.Widget", "@tag.Form"] }, + { tags: ["@tag.Widget", "@tag.Form", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formSwitchDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/Form_With_CheckBox_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/Form_With_CheckBox_spec.js index d5ffd22fa12..855123bb997 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/Form_With_CheckBox_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Form/Form_With_CheckBox_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Checkbox Widget Functionality", - { tags: ["@tag.Widget", "@tag.Form"] }, + { tags: ["@tag.Widget", "@tag.Form", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formWidgetdsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/IframeTest_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/IframeTest_spec.ts index 51b452e6c3c..3d67faf4003 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/IframeTest_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/IframeTest_spec.ts @@ -10,7 +10,7 @@ import testdata from "../../../../../fixtures/testdata.json"; describe( "Iframe widget Tests", - { tags: ["@tag.Widget", "@tag.Iframe"] }, + { tags: ["@tag.Widget", "@tag.Iframe", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify("iframewidget", 550, 100); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_onSrcDocChange_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_onSrcDocChange_spec.js index 79a84b9f6af..4f08e92318f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_onSrcDocChange_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_onSrcDocChange_spec.js @@ -10,7 +10,7 @@ const page1 = "Page1"; describe( "Iframe Widget functionality", - { tags: ["@tag.Widget", "@tag.Iframe"] }, + { tags: ["@tag.Widget", "@tag.Iframe", "@tag.Binding"] }, function () { it("1.Import application json", function () { cy.visit("/applications", { timeout: 60000 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_spec.js index 49d29ff6dcc..62890ddc741 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Iframe Widget functionality", - { tags: ["@tag.Widget", "@tag.Iframe"] }, + { tags: ["@tag.Widget", "@tag.Iframe", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("IframeDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image2_Spec.ts index bf7d32d3852..e991a66c274 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image2_Spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "Image widget tests", - { tags: ["@tag.Widget", "@tag.Image"] }, + { tags: ["@tag.Widget", "@tag.Image", "@tag.Binding"] }, function () { const image = (src: string) => 'img[src="' + src + '"]'; const jpgImg = diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image3_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image3_Spec.ts index 1b0fb86b0fc..e0cbcad39cc 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image3_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image3_Spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "Image widget - Rotation & Download", - { tags: ["@tag.Widget", "@tag.Image"] }, + { tags: ["@tag.Widget", "@tag.Image", "@tag.Binding"] }, function () { const jpgImg = "https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg?itok=yG4bpfFs"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_base64_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_base64_spec.js index 804e8531ef9..b10747276f8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_base64_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_base64_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Image Widget Functionality with base64", - { tags: ["@tag.Widget", "@tag.Image"] }, + { tags: ["@tag.Widget", "@tag.Image", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("base64imagedsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_spec.js index 7059d211196..01e0a4a3278 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_spec.js @@ -10,7 +10,7 @@ import { describe( "Image Widget Functionality", - { tags: ["@tag.Widget", "@tag.Image"] }, + { tags: ["@tag.Widget", "@tag.Image", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("displayWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_validation_spec.js index 682c2031eb0..fac0f3e7dd8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Image/Image_validation_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Image Widget Validation Image Urls", - { tags: ["@tag.Widget", "@tag.Image"] }, + { tags: ["@tag.Widget", "@tag.Image", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("displayWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input2_Spec.ts index cc81c42a399..9000508eafc 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input2_Spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "InputV2 widget tests", - { tags: ["@tag.Widget", "@tag.Input"] }, + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, function () { let testcases, multilineData = `[ diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts index fb0886bd52a..18d754517aa 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input3_Spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "InputV2 widget tests - continuation", - { tags: ["@tag.Widget", "@tag.Input"] }, + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_MaxChar_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_MaxChar_spec.js index 444b07a3905..140adc42e50 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_MaxChar_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_MaxChar_spec.js @@ -4,7 +4,7 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); describe( "Input Widget Max Char Functionality", - { tags: ["@tag.Widget", "@tag.Input"] }, + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, function () { afterEach(() => { _.agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_Multiline_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_Multiline_spec.js index 48e4c3fd1ff..1b5f1d4cc77 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_Multiline_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_Multiline_spec.js @@ -8,7 +8,7 @@ import homePage from "../../../../../locators/HomePage"; describe( "Input Widget Multiline feature", - { tags: ["@tag.Widget", "@tag.Input"] }, + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; it("1. Single-line text with different heights i.e. Auto height and Fixed", () => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_OnFocus_OnBlur_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_OnFocus_OnBlur_spec.js index 4d3c2f4b3fc..0eb799fdeef 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_OnFocus_OnBlur_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_OnFocus_OnBlur_spec.js @@ -14,7 +14,7 @@ const agHelper = ObjectsRegistry.AggregateHelper; describe( "Input Widget Property tests onFocus and onBlur", - { tags: ["@tag.Widget", "@tag.Input"] }, + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, function () { it("1. onBlur and onFocus should be triggered from the input widget", () => { cy.dragAndDropToCanvas(inputWidgetName, { x: 300, y: 200 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_spec.js index 2491002404c..b94fa422bd6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Input_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Input Widget Functionality", - { tags: ["@tag.Widget", "@tag.Input"] }, + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_ShowStepArrows_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_ShowStepArrows_spec.js index b29bd02cf41..ebc4162c2d1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_ShowStepArrows_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_ShowStepArrows_spec.js @@ -5,7 +5,7 @@ const widgetName = "inputwidgetv2"; describe( "Input Widget V2 showStepArrows Functionality - ", - { tags: ["@tag.Widget", "@tag.Input"] }, + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, function () { it("1. Validate that dataType - NUMBER, For new widgets being dragged, the value for showStepArrows should be set to false", () => { cy.dragAndDropToCanvas(widgetName, { x: 300, y: 400 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_inside_List_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_inside_List_spec.js index 63c7a790bd0..291ece7961e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_inside_List_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_inside_List_spec.js @@ -3,176 +3,184 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; const widgetName = "inputwidgetv2"; const widgetInput = `.t--widget-${widgetName} input`; -describe("Input widget V2 - ", { tags: ["@tag.Widget", "@tag.Input"] }, () => { - before(() => { - _.agHelper.AddDsl("InputWidgetV2InsideListDSL"); - }); +describe( + "Input widget V2 - ", + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, + () => { + before(() => { + _.agHelper.AddDsl("InputWidgetV2InsideListDSL"); + }); - it("1. Validate input widget resets OnSubmit", () => { - cy.openPropertyPane(widgetName); - cy.getAlert("onSubmit", "Submitted!!"); - cy.get(widgetInput).clear({ force: true }); - cy.wait(300); - cy.get(widgetInput).type("test{enter}"); //Clicking enter submits the form here - cy.wait(300); - cy.get(widgetInput).should("contain.value", ""); - }); + it("1. Validate input widget resets OnSubmit", () => { + cy.openPropertyPane(widgetName); + cy.getAlert("onSubmit", "Submitted!!"); + cy.get(widgetInput).clear({ force: true }); + cy.wait(300); + cy.get(widgetInput).type("test{enter}"); //Clicking enter submits the form here + cy.wait(300); + cy.get(widgetInput).should("contain.value", ""); + }); - it("2. Validate DataType - TEXT can be entered into Input widget", () => { - [ - { - input: "test", - expected: "test:true:false", - }, - { - input: "test123", - expected: "test123:true:false", - }, - { - input: "123", - expected: "123:true:false", - }, - { - input: "", - expected: ":true:false", - }, - { - input: "$100.22", - expected: "$100.22:true:false", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:true:false", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - }); + it("2. Validate DataType - TEXT can be entered into Input widget", () => { + [ + { + input: "test", + expected: "test:true:false", + }, + { + input: "test123", + expected: "test123:true:false", + }, + { + input: "123", + expected: "123:true:false", + }, + { + input: "", + expected: ":true:false", + }, + { + input: "$100.22", + expected: "$100.22:true:false", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:true:false", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + }); - it("3. Validate DataType - NUMBER can be entered into Input widget", () => { - cy.openPropertyPane(widgetName); - cy.selectDropdownValue(".t--property-control-datatype input", "Number"); + it("3. Validate DataType - NUMBER can be entered into Input widget", () => { + cy.openPropertyPane(widgetName); + cy.selectDropdownValue(".t--property-control-datatype input", "Number"); - cy.get(".t--property-control-required label").last().click({ force: true }); + cy.get(".t--property-control-required label") + .last() + .click({ force: true }); - cy.selectDropdownValue(".t--property-control-datatype input", "Number"); - [ - { - input: "invalid", - expected: "null:true:false", - }, - { - input: "invalid123", - expected: "123:true:false", - }, - { - input: "123", - expected: "123:true:false", - }, - { - input: "-", - expected: "null:true:false", - }, - { - input: "", - expected: "null:true:false", - }, - { - input: "$100.22", - expected: "100.22:true:false", - }, - { - input: "invalid@appsmith.com", - expected: "null:true:false", - }, - { - input: "1.001", - expected: "1.001:true:false", - }, - { - input: "1.1.", - expected: "null:true:false", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - }); + cy.selectDropdownValue(".t--property-control-datatype input", "Number"); + [ + { + input: "invalid", + expected: "null:true:false", + }, + { + input: "invalid123", + expected: "123:true:false", + }, + { + input: "123", + expected: "123:true:false", + }, + { + input: "-", + expected: "null:true:false", + }, + { + input: "", + expected: "null:true:false", + }, + { + input: "$100.22", + expected: "100.22:true:false", + }, + { + input: "invalid@appsmith.com", + expected: "null:true:false", + }, + { + input: "1.001", + expected: "1.001:true:false", + }, + { + input: "1.1.", + expected: "null:true:false", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + }); - it("4. Validate DataType - PASSWORD can be entered into Input widget", () => { - cy.openPropertyPane(widgetName); - cy.selectDropdownValue(".t--property-control-datatype input", "Password"); - [ - { - input: "test", - expected: "test:true:false", - }, - { - input: "test123", - expected: "test123:true:false", - }, - { - input: "123", - expected: "123:true:false", - }, - { - input: "-", - expected: "-:true:false", - }, - { - input: "", - expected: ":true:false", - }, - { - input: "$100.22", - expected: "$100.22:true:false", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:true:false", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - }); + it("4. Validate DataType - PASSWORD can be entered into Input widget", () => { + cy.openPropertyPane(widgetName); + cy.selectDropdownValue(".t--property-control-datatype input", "Password"); + [ + { + input: "test", + expected: "test:true:false", + }, + { + input: "test123", + expected: "test123:true:false", + }, + { + input: "123", + expected: "123:true:false", + }, + { + input: "-", + expected: "-:true:false", + }, + { + input: "", + expected: ":true:false", + }, + { + input: "$100.22", + expected: "$100.22:true:false", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:true:false", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + }); - it("5. Validate DataType - EMAIL can be entered into Input widget", () => { - cy.openPropertyPane(widgetName); - cy.selectDropdownValue(".t--property-control-datatype input", "Email"); + it("5. Validate DataType - EMAIL can be entered into Input widget", () => { + cy.openPropertyPane(widgetName); + cy.selectDropdownValue(".t--property-control-datatype input", "Email"); - cy.get(".t--property-control-required label").last().click({ force: true }); + cy.get(".t--property-control-required label") + .last() + .click({ force: true }); - [ - { - input: "test", - expected: "test:true:false", - }, - { - input: "test123", - expected: "test123:true:false", - }, - { - input: "123", - expected: "123:true:false", - }, - { - input: "-", - expected: "-:true:false", - }, - { - input: "", - expected: ":true:false", - }, - { - input: "$100.22", - expected: "$100.22:true:false", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:true:false", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - }); + [ + { + input: "test", + expected: "test:true:false", + }, + { + input: "test123", + expected: "test123:true:false", + }, + { + input: "123", + expected: "123:true:false", + }, + { + input: "-", + expected: "-:true:false", + }, + { + input: "", + expected: ":true:false", + }, + { + input: "$100.22", + expected: "$100.22:true:false", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:true:false", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + }); - function enterAndTest(text, expected) { - cy.get(`.t--widget-${widgetName} input`).clear({ force: true }); - cy.wait(300); - if (text) { - cy.get(`.t--widget-${widgetName} input`).click().type(text); + function enterAndTest(text, expected) { + cy.get(`.t--widget-${widgetName} input`).clear({ force: true }); + cy.wait(300); + if (text) { + cy.get(`.t--widget-${widgetName} input`).click().type(text); + } + cy.get(".t--widget-textwidget").should("contain", expected); } - cy.get(".t--widget-textwidget").should("contain", expected); - } -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_spec.js index b3fce85a21c..3c9f53e826d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Input/Inputv2_spec.js @@ -3,479 +3,498 @@ import { agHelper } from "../../../../../support/Objects/ObjectsCore"; const widgetName = "inputwidgetv2"; const widgetInput = `.t--widget-${widgetName} input`; -describe("Input widget V2 - ", { tags: ["@tag.Widget", "@tag.Input"] }, () => { - it("1. DragDrop Input & Label/Text widgets", () => { - cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 }); - cy.get(`.t--widget-${widgetName}`).should("exist"); - cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 }); - cy.openPropertyPane("textwidget"); - cy.updateCodeInput( - ".t--property-control-text", - `{{Input1.text}}:{{Input1.value}}:{{Input1.isValid}}`, - ); - }); - - it("2. Validate input widget resets OnSubmit", () => { - cy.openPropertyPane(widgetName); - cy.getAlert("onSubmit", "Submitted!!"); - cy.get(widgetInput).clear(); - cy.wait(300); - cy.get(widgetInput).type("test{enter}"); //Clicking enter submits the form here - cy.wait(300); - cy.get(widgetInput).should("contain.value", ""); - - cy.selectDropdownValue(".t--property-control-datatype input", "Number"); - - cy.get(widgetInput).clear(); - cy.get(widgetInput).type("1.0010{enter}"); //Clicking enter submits the form here - cy.wait(300); - cy.get(widgetInput).should("contain.value", ""); - }); - - it("3. Validate DataType - TEXT can be entered into Input widget", () => { - cy.selectDropdownValue( - ".t--property-control-datatype input", - "Single-line text", - ); - [ - { - input: "test", - expected: "test:test:true", - }, - { - input: "test123", - expected: "test123:test123:true", - }, - { - input: "123", - expected: "123:123:true", - }, - { - input: "", - expected: "::true", - }, - { - input: "$100.22", - expected: "$100.22:$100.22:true", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:test@appsmith.com:true", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - - cy.openPropertyPane(widgetName); - - //required: on - cy.get(".t--property-control-required label").last().click({ force: true }); - - [ - { - input: "test", - expected: "test:test:true", - }, - { - input: "test123", - expected: "test123:test123:true", - }, - { - input: "123", - expected: "123:123:true", - }, - { - input: "-", - expected: "-:-:true", - }, - { - input: "", - expected: "::false", - }, - { - input: "$100.22", - expected: "$100.22:$100.22:true", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:test@appsmith.com:true", - }, - { - input: "", - expected: "::false", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - }); - - it("4. Validate DataType - NUMBER can be entered into Input widget", () => { - cy.openPropertyPane(widgetName); - cy.selectDropdownValue(".t--property-control-datatype input", "Number"); - [ - { - input: "invalid", - expected: "null:null:false", - }, - { - input: "invalid123", - expected: "123:123:true", - }, - { - input: "123", - expected: "123:123:true", - }, - { - input: "-", - expected: "null:null:false", - }, - { - input: "", - expected: "null:null:false", - }, - { - input: "$100.22", - expected: "100.22:100.22:true", - }, - { - input: "invalid@appsmith.com", - expected: "null:null:false", - }, - { - input: "1.001", - expected: "1.001:1.001:true", - }, - { - input: "1.1.", - expected: "null:null:false", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - - //required: off - cy.get(".t--property-control-required label").last().click({ force: true }); - - cy.selectDropdownValue(".t--property-control-datatype input", "Number"); - [ - { - input: "invalid", - expected: "null:null:true", - }, - { - input: "invalid123", - expected: "123:123:true", - }, - { - input: "123", - expected: "123:123:true", - }, - { - input: "-", - expected: "null:null:false", - }, - { - input: "", - expected: "null:null:true", - }, - { - input: "$100.22", - expected: "100.22:100.22:true", - }, - { - input: "invalid@appsmith.com", - expected: "null:null:false", - }, - { - input: "1.001", - expected: "1.001:1.001:true", - }, - { - input: "1.1.", - expected: "null:null:false", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - }); - - it("5. Validate DataType - PASSWORD can be entered into Input widget", () => { - cy.openPropertyPane(widgetName); - cy.selectDropdownValue(".t--property-control-datatype input", "Password"); - [ - { - input: "test", - expected: "test:test:true", - }, - { - input: "test123", - expected: "test123:test123:true", - }, - { - input: "123", - expected: "123:123:true", - }, - { - input: "-", - expected: "-:-:true", - }, - { - input: "", - expected: "::true", - }, - { - input: "$100.22", - expected: "$100.22:$100.22:true", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:test@appsmith.com:true", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - - //required: on - cy.get(".t--property-control-required label").last().click({ force: true }); - - [ - { - input: "test", - expected: "test:test:true", - }, - { - input: "test123", - expected: "test123:test123:true", - }, - { - input: "123", - expected: "123:123:true", - }, - { - input: "-", - expected: "-:-:true", - }, - { - input: "", - expected: "::false", - }, - { - input: "$100.22", - expected: "$100.22:$100.22:true", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:test@appsmith.com:true", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - - validateAutocompleteAttribute(); - }); - - it("6. Validate DataType - EMAIL can be entered into Input widget", () => { - cy.openPropertyPane(widgetName); - cy.selectDropdownValue(".t--property-control-datatype input", "Email"); - [ - { - input: "test", - expected: "test:test:false", - }, - { - input: "test123", - expected: "test123:test123:false", - }, - { - input: "123", - expected: "123:123:false", - }, - { - input: "-", - expected: "-:-:false", - }, - { - input: "", - expected: "::false", - }, - { - input: "$100.22", - expected: "$100.22:$100.22:false", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:test@appsmith.com:true", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - - //required: off - cy.get(".t--property-control-required label").last().click({ force: true }); - - [ - { - input: "test", - expected: "test:test:false", - }, - { - input: "test123", - expected: "test123:test123:false", - }, - { - input: "123", - expected: "123:123:false", - }, - { - input: "-", - expected: "-:-:false", - }, - { - input: "", - expected: "::true", - }, - { - input: "$100.22", - expected: "$100.22:$100.22:false", - }, - { - input: "test@appsmith.com", - expected: "test@appsmith.com:test@appsmith.com:true", - }, - ].forEach(({ expected, input }) => enterAndTest(input, expected)); - - validateAutocompleteAttribute(); - }); - - it("7. Validating other properties - Input validity with #valid", () => { - cy.openPropertyPane(widgetName); - [ - ["{{1 === 2}}", "false", true], - ["", "true", false], - ["{{1 === 1}}", "true", true], - ["", "true", false], - ].forEach(([input, expected, isValueDynamic]) => { - cy.updateCodeInput(".t--property-control-valid", input); - cy.wait(500); - isValueDynamic && cy.validateEvaluatedValue(expected); +describe( + "Input widget V2 - ", + { tags: ["@tag.Widget", "@tag.Input", "@tag.Binding"] }, + () => { + it("1. DragDrop Input & Label/Text widgets", () => { + cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 }); + cy.get(`.t--widget-${widgetName}`).should("exist"); + cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 }); + cy.openPropertyPane("textwidget"); + cy.updateCodeInput( + ".t--property-control-text", + `{{Input1.text}}:{{Input1.value}}:{{Input1.isValid}}`, + ); }); - }); - - it("8. onSubmit should be triggered with the whole input value", () => { - cy.openPropertyPane(widgetName); - cy.selectDropdownValue( - ".t--property-control-datatype input", - "Single-line text", - ); - cy.get(".t--property-control-required label").last().click({ force: true }); - // Set onSubmit action, storing value - cy.get(".t--property-control-onsubmit").find(".t--js-toggle").click(); - cy.updateCodeInput( - ".t--property-control-onsubmit", - "{{storeValue('textPayloadOnSubmit',Input1.text)}}", - ); - // Bind to stored value above - cy.openPropertyPane("textwidget"); - cy.updateCodeInput( - ".t--property-control-text", - "{{appsmith.store.textPayloadOnSubmit}}", - ); - agHelper.AssertAutoSave(); - - cy.closePropertyPane(); - cy.get(widgetInput).clear(); - cy.wait(300); - // Input text and hit enter key - cy.get(widgetInput).type("test{enter}"); - // Assert if the Text widget contains the whole value, test - cy.get(".t--widget-textwidget").should("have.text", "test"); - }); - - it("9. changing default text should change text", () => { - cy.openPropertyPane("textwidget"); - cy.updateCodeInput( - ".t--property-control-text", - `{{Input1.text}}:{{Input1.value}}:{{Input1.isValid}}`, - ); - cy.openPropertyPane(widgetName); - cy.updateCodeInput(".t--property-control-defaultvalue", `test`); - // wait for evaluations - cy.wait(300); - cy.get(`.t--widget-${widgetName} input`).should("contain.value", "test"); - cy.get(".t--widget-textwidget").should("contain", "test:test:true"); - - cy.updateCodeInput(".t--property-control-defaultvalue", `anotherText`); - // wait for evaluations - cy.wait(300); - cy.get(`.t--widget-${widgetName} input`).should( - "contain.value", - "anotherText", - ); - cy.get(".t--widget-textwidget").should( - "contain", - "anotherText:anotherText:true", - ); - - cy.selectDropdownValue(".t--property-control-datatype input", "Number"); - - cy.updateCodeInput(".t--property-control-defaultvalue", `{{1}}`); - // wait for evaluations - cy.wait(300); - cy.get(`.t--widget-${widgetName} input`).should("contain.value", "1"); - cy.get(".t--widget-textwidget").should("contain", "1:1:true"); - - cy.updateCodeInput(".t--property-control-defaultvalue", `{{1.00010000}}`); - // wait for evaluations - cy.wait(300); - cy.get(`.t--widget-${widgetName} input`).should("contain.value", "1.0001"); - cy.get(".t--widget-textwidget").should("contain", "1.0001:1.0001:true"); - }); - - it("10. Check isDirty meta property", function () { - cy.openPropertyPane("textwidget"); - cy.updateCodeInput(".t--property-control-text", `{{Input1.isDirty}}`); - // Init isDirty - cy.openPropertyPane(widgetName); - cy.selectDropdownValue( - ".t--property-control-datatype input", - "Single-line text", - ); - cy.updateCodeInput(".t--property-control-defaultvalue", "a"); - // Check if initial value of isDirty is false - cy.get(".t--widget-textwidget").should("contain", "false"); - // Interact with UI - cy.get(widgetInput).clear(); - cy.wait(300); - cy.get(widgetInput).type("b"); - cy.wait(300); - // Check if isDirty is set to true - cy.get(".t--widget-textwidget").should("contain", "true"); - // Change defaultText - cy.openPropertyPane(widgetName); - cy.updateCodeInput(".t--property-control-defaultvalue", "c"); - // Check if isDirty is reset to false - cy.get(".t--widget-textwidget").should("contain", "false"); - }); - - function enterAndTest(text, expected) { - cy.get(`.t--widget-${widgetName} input`).clear(); - cy.wait(300); - if (text) { - cy.get(`.t--widget-${widgetName} input`) - .click({ force: true }) - .type(text); + + it("2. Validate input widget resets OnSubmit", () => { + cy.openPropertyPane(widgetName); + cy.getAlert("onSubmit", "Submitted!!"); + cy.get(widgetInput).clear(); + cy.wait(300); + cy.get(widgetInput).type("test{enter}"); //Clicking enter submits the form here + cy.wait(300); + cy.get(widgetInput).should("contain.value", ""); + + cy.selectDropdownValue(".t--property-control-datatype input", "Number"); + + cy.get(widgetInput).clear(); + cy.get(widgetInput).type("1.0010{enter}"); //Clicking enter submits the form here + cy.wait(300); + cy.get(widgetInput).should("contain.value", ""); + }); + + it("3. Validate DataType - TEXT can be entered into Input widget", () => { + cy.selectDropdownValue( + ".t--property-control-datatype input", + "Single-line text", + ); + [ + { + input: "test", + expected: "test:test:true", + }, + { + input: "test123", + expected: "test123:test123:true", + }, + { + input: "123", + expected: "123:123:true", + }, + { + input: "", + expected: "::true", + }, + { + input: "$100.22", + expected: "$100.22:$100.22:true", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:test@appsmith.com:true", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + + cy.openPropertyPane(widgetName); + + //required: on + cy.get(".t--property-control-required label") + .last() + .click({ force: true }); + + [ + { + input: "test", + expected: "test:test:true", + }, + { + input: "test123", + expected: "test123:test123:true", + }, + { + input: "123", + expected: "123:123:true", + }, + { + input: "-", + expected: "-:-:true", + }, + { + input: "", + expected: "::false", + }, + { + input: "$100.22", + expected: "$100.22:$100.22:true", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:test@appsmith.com:true", + }, + { + input: "", + expected: "::false", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + }); + + it("4. Validate DataType - NUMBER can be entered into Input widget", () => { + cy.openPropertyPane(widgetName); + cy.selectDropdownValue(".t--property-control-datatype input", "Number"); + [ + { + input: "invalid", + expected: "null:null:false", + }, + { + input: "invalid123", + expected: "123:123:true", + }, + { + input: "123", + expected: "123:123:true", + }, + { + input: "-", + expected: "null:null:false", + }, + { + input: "", + expected: "null:null:false", + }, + { + input: "$100.22", + expected: "100.22:100.22:true", + }, + { + input: "invalid@appsmith.com", + expected: "null:null:false", + }, + { + input: "1.001", + expected: "1.001:1.001:true", + }, + { + input: "1.1.", + expected: "null:null:false", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + + //required: off + cy.get(".t--property-control-required label") + .last() + .click({ force: true }); + + cy.selectDropdownValue(".t--property-control-datatype input", "Number"); + [ + { + input: "invalid", + expected: "null:null:true", + }, + { + input: "invalid123", + expected: "123:123:true", + }, + { + input: "123", + expected: "123:123:true", + }, + { + input: "-", + expected: "null:null:false", + }, + { + input: "", + expected: "null:null:true", + }, + { + input: "$100.22", + expected: "100.22:100.22:true", + }, + { + input: "invalid@appsmith.com", + expected: "null:null:false", + }, + { + input: "1.001", + expected: "1.001:1.001:true", + }, + { + input: "1.1.", + expected: "null:null:false", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + }); + + it("5. Validate DataType - PASSWORD can be entered into Input widget", () => { + cy.openPropertyPane(widgetName); + cy.selectDropdownValue(".t--property-control-datatype input", "Password"); + [ + { + input: "test", + expected: "test:test:true", + }, + { + input: "test123", + expected: "test123:test123:true", + }, + { + input: "123", + expected: "123:123:true", + }, + { + input: "-", + expected: "-:-:true", + }, + { + input: "", + expected: "::true", + }, + { + input: "$100.22", + expected: "$100.22:$100.22:true", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:test@appsmith.com:true", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + + //required: on + cy.get(".t--property-control-required label") + .last() + .click({ force: true }); + + [ + { + input: "test", + expected: "test:test:true", + }, + { + input: "test123", + expected: "test123:test123:true", + }, + { + input: "123", + expected: "123:123:true", + }, + { + input: "-", + expected: "-:-:true", + }, + { + input: "", + expected: "::false", + }, + { + input: "$100.22", + expected: "$100.22:$100.22:true", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:test@appsmith.com:true", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + + validateAutocompleteAttribute(); + }); + + it("6. Validate DataType - EMAIL can be entered into Input widget", () => { + cy.openPropertyPane(widgetName); + cy.selectDropdownValue(".t--property-control-datatype input", "Email"); + [ + { + input: "test", + expected: "test:test:false", + }, + { + input: "test123", + expected: "test123:test123:false", + }, + { + input: "123", + expected: "123:123:false", + }, + { + input: "-", + expected: "-:-:false", + }, + { + input: "", + expected: "::false", + }, + { + input: "$100.22", + expected: "$100.22:$100.22:false", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:test@appsmith.com:true", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + + //required: off + cy.get(".t--property-control-required label") + .last() + .click({ force: true }); + + [ + { + input: "test", + expected: "test:test:false", + }, + { + input: "test123", + expected: "test123:test123:false", + }, + { + input: "123", + expected: "123:123:false", + }, + { + input: "-", + expected: "-:-:false", + }, + { + input: "", + expected: "::true", + }, + { + input: "$100.22", + expected: "$100.22:$100.22:false", + }, + { + input: "test@appsmith.com", + expected: "test@appsmith.com:test@appsmith.com:true", + }, + ].forEach(({ expected, input }) => enterAndTest(input, expected)); + + validateAutocompleteAttribute(); + }); + + it("7. Validating other properties - Input validity with #valid", () => { + cy.openPropertyPane(widgetName); + [ + ["{{1 === 2}}", "false", true], + ["", "true", false], + ["{{1 === 1}}", "true", true], + ["", "true", false], + ].forEach(([input, expected, isValueDynamic]) => { + cy.updateCodeInput(".t--property-control-valid", input); + cy.wait(500); + isValueDynamic && cy.validateEvaluatedValue(expected); + }); + }); + + it("8. onSubmit should be triggered with the whole input value", () => { + cy.openPropertyPane(widgetName); + cy.selectDropdownValue( + ".t--property-control-datatype input", + "Single-line text", + ); + cy.get(".t--property-control-required label") + .last() + .click({ force: true }); + // Set onSubmit action, storing value + cy.get(".t--property-control-onsubmit").find(".t--js-toggle").click(); + cy.updateCodeInput( + ".t--property-control-onsubmit", + "{{storeValue('textPayloadOnSubmit',Input1.text)}}", + ); + // Bind to stored value above + cy.openPropertyPane("textwidget"); + cy.updateCodeInput( + ".t--property-control-text", + "{{appsmith.store.textPayloadOnSubmit}}", + ); + agHelper.AssertAutoSave(); + + cy.closePropertyPane(); + cy.get(widgetInput).clear(); + cy.wait(300); + // Input text and hit enter key + cy.get(widgetInput).type("test{enter}"); + // Assert if the Text widget contains the whole value, test + cy.get(".t--widget-textwidget").should("have.text", "test"); + }); + + it("9. changing default text should change text", () => { + cy.openPropertyPane("textwidget"); + cy.updateCodeInput( + ".t--property-control-text", + `{{Input1.text}}:{{Input1.value}}:{{Input1.isValid}}`, + ); + cy.openPropertyPane(widgetName); + cy.updateCodeInput(".t--property-control-defaultvalue", `test`); + // wait for evaluations + cy.wait(300); + cy.get(`.t--widget-${widgetName} input`).should("contain.value", "test"); + cy.get(".t--widget-textwidget").should("contain", "test:test:true"); + + cy.updateCodeInput(".t--property-control-defaultvalue", `anotherText`); + // wait for evaluations + cy.wait(300); + cy.get(`.t--widget-${widgetName} input`).should( + "contain.value", + "anotherText", + ); + cy.get(".t--widget-textwidget").should( + "contain", + "anotherText:anotherText:true", + ); + + cy.selectDropdownValue(".t--property-control-datatype input", "Number"); + + cy.updateCodeInput(".t--property-control-defaultvalue", `{{1}}`); + // wait for evaluations + cy.wait(300); + cy.get(`.t--widget-${widgetName} input`).should("contain.value", "1"); + cy.get(".t--widget-textwidget").should("contain", "1:1:true"); + + cy.updateCodeInput(".t--property-control-defaultvalue", `{{1.00010000}}`); + // wait for evaluations + cy.wait(300); + cy.get(`.t--widget-${widgetName} input`).should( + "contain.value", + "1.0001", + ); + cy.get(".t--widget-textwidget").should("contain", "1.0001:1.0001:true"); + }); + + it("10. Check isDirty meta property", function () { + cy.openPropertyPane("textwidget"); + cy.updateCodeInput(".t--property-control-text", `{{Input1.isDirty}}`); + // Init isDirty + cy.openPropertyPane(widgetName); + cy.selectDropdownValue( + ".t--property-control-datatype input", + "Single-line text", + ); + cy.updateCodeInput(".t--property-control-defaultvalue", "a"); + // Check if initial value of isDirty is false + cy.get(".t--widget-textwidget").should("contain", "false"); + // Interact with UI + cy.get(widgetInput).clear(); + cy.wait(300); + cy.get(widgetInput).type("b"); + cy.wait(300); + // Check if isDirty is set to true + cy.get(".t--widget-textwidget").should("contain", "true"); + // Change defaultText + cy.openPropertyPane(widgetName); + cy.updateCodeInput(".t--property-control-defaultvalue", "c"); + // Check if isDirty is reset to false + cy.get(".t--widget-textwidget").should("contain", "false"); + }); + + function enterAndTest(text, expected) { + cy.get(`.t--widget-${widgetName} input`).clear(); + cy.wait(300); + if (text) { + cy.get(`.t--widget-${widgetName} input`) + .click({ force: true }) + .type(text); + } + cy.get(".t--widget-textwidget").should("contain", expected); + } + + function validateAutocompleteAttribute() { + //validate autocomplete behaviour for email and password + + cy.openPropertyPane("textwidget"); + cy.openPropertyPane(widgetName); + //check if autofill toggle option is present and is checked by default + cy.get(".t--property-control-allowautofill input").should("be.checked"); + //check if autocomplete attribute is not present in the text widget when autofill is enabled + cy.get(widgetInput).should("not.have.attr", "autocomplete"); + + //toggle off autofill + cy.get(".t--property-control-allowautofill input").click({ force: true }); + cy.get(".t--property-control-allowautofill input").should( + "not.be.checked", + ); + + //autocomplete should now be present in the text widget + cy.get(widgetInput).should("have.attr", "autocomplete", "off"); + + //select a non email or password option + cy.selectDropdownValue(".t--property-control-datatype input", "text"); + //autofill toggle should not be present as this restores autofill to be enabled + cy.get(".t--property-control-allowautofill input").should("not.exist"); + //autocomplete attribute should not be present in the text widget + cy.get(widgetInput).should("not.have.attr", "autocomplete"); } - cy.get(".t--widget-textwidget").should("contain", expected); - } - - function validateAutocompleteAttribute() { - //validate autocomplete behaviour for email and password - - cy.openPropertyPane("textwidget"); - cy.openPropertyPane(widgetName); - //check if autofill toggle option is present and is checked by default - cy.get(".t--property-control-allowautofill input").should("be.checked"); - //check if autocomplete attribute is not present in the text widget when autofill is enabled - cy.get(widgetInput).should("not.have.attr", "autocomplete"); - - //toggle off autofill - cy.get(".t--property-control-allowautofill input").click({ force: true }); - cy.get(".t--property-control-allowautofill input").should("not.be.checked"); - - //autocomplete should now be present in the text widget - cy.get(widgetInput).should("have.attr", "autocomplete", "off"); - - //select a non email or password option - cy.selectDropdownValue(".t--property-control-datatype input", "text"); - //autofill toggle should not be present as this restores autofill to be enabled - cy.get(".t--property-control-allowautofill input").should("not.exist"); - //autocomplete attribute should not be present in the text widget - cy.get(widgetInput).should("not.have.attr", "autocomplete"); - } -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_ArrayField_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_ArrayField_spec.js index 249fb2cf611..fa62fb57105 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_ArrayField_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_ArrayField_spec.js @@ -18,7 +18,7 @@ import { describe( "JSON Form Widget Array Field", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js index 23894738bcb..d1c22d3395f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormDisabled_spec.js @@ -13,7 +13,7 @@ import { describe( "JSON Form Widget AutoGenerate Disabled", - { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("jsonFormDslWithSchemaAndWithoutSourceData"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js index 11a286f7a22..cb956747023 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_AutoGenerateFormEnabled_spec.js @@ -16,7 +16,7 @@ let locators = ObjectsRegistry.CommonLocators; describe( "JSON Form Widget AutoGenerate Enabled", - { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js index c2f299b7b88..43e96747d50 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Basic_spec.js @@ -11,7 +11,7 @@ const { describe( "JsonForm widget basis c usecases", - { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Sanity", "@tag.Binding"] }, function () { before(() => { cy.dragAndDropToCanvas("jsonformwidget", { x: 200, y: 200 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CurrencyField_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CurrencyField_spec.ts index 3ffce22e58e..2284c8b7e86 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CurrencyField_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CurrencyField_spec.ts @@ -10,7 +10,7 @@ import { describe( "Modal Widget background color spec", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { const schema = { name: "John", diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CustomField_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CustomField_spec.js index 594790b9c9a..282c6019f97 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CustomField_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CustomField_spec.js @@ -16,7 +16,7 @@ const fieldPrefix = ".t--jsonformfield"; describe( "JSON Form Widget Custom Field", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { it("uses the custom field when the accessor matches", () => { const formDsl = JSON.parse( diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldChange_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldChange_spec.js index 1db07042fae..2b0b27cffeb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldChange_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldChange_spec.js @@ -17,7 +17,7 @@ const fieldPrefix = ".t--jsonformfield"; describe( "JSON Form Widget Field Change", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { before(() => { cy.addDsl(dslWithSchema); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_1_spec.js index 42b42ebb662..9cc6aec506a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_1_spec.js @@ -20,7 +20,7 @@ const toggleJSButton = (name) => `.t--property-control-${name} .t--js-toggle`; describe( "Radio Group Field", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_2_spec.js index 37545555a21..7635d6eea56 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldEvents_2_spec.js @@ -19,7 +19,7 @@ const toggleJSButton = (name) => `.t--property-control-${name} .t--js-toggle`; describe( "Radio Group Field", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_1_spec.js index 42db1f388a0..ca9d0fcae3d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_1_spec.js @@ -17,7 +17,7 @@ const fieldPrefix = ".t--jsonformfield"; describe( "Text Field Property Control", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_2_spec.js index 6fc4a81e50d..f9ebebd9647 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FieldProperties_2_spec.js @@ -17,7 +17,7 @@ const fieldPrefix = ".t--jsonformfield"; describe( "Text Field Property Control", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FilterText_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FilterText_spec.js index bd4e1e80662..155c4dd218a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FilterText_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FilterText_spec.js @@ -17,7 +17,7 @@ let locators = ObjectsRegistry.CommonLocators; describe( "JSONForm Select field - filterText update action trigger ", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Footer_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Footer_spec.js index 42dcad420de..d4bb8369083 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Footer_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Footer_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "JSONForm Footer spec", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormBindings_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormBindings_spec.js index 20aa79224af..9f7a36d61c4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormBindings_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormBindings_spec.js @@ -11,7 +11,7 @@ const locators = ObjectsRegistry.CommonLocators; describe( "JSON Form Widget Form Bindings", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormProperties_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormProperties_spec.js index a01cff55777..9787c93addc 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormProperties_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_FormProperties_spec.js @@ -22,7 +22,7 @@ import { describe( "JSON Form Widget Form Bindings", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_1_spec.js index 1bf397baeb0..d75b0f4fc4b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_1_spec.js @@ -89,7 +89,7 @@ function removeCustomField() { describe( "JSON Form Hidden fields", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("jsonFormDslWithSchema"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_2_spec.js index 2121d0d38b9..dba231477df 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_HiddenFields_2_spec.js @@ -92,7 +92,7 @@ function removeCustomField() { describe( "JSON Form Hidden fields", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("jsonFormDslWithSchema"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_MultipleSourceData_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_MultipleSourceData_spec.js index 8914b8920b9..d2be55c5931 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_MultipleSourceData_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_MultipleSourceData_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Verify syntax to create Datpicker field type", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_RadioGroupField_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_RadioGroupField_spec.js index f1f67a73948..aa641517d91 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_RadioGroupField_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_RadioGroupField_spec.js @@ -35,7 +35,7 @@ function clearOptionsProperty() { describe( "JSONForm RadioGroup Field", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Reset_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Reset_spec.js index e6a86ecbebc..1b2572c5121 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Reset_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_Reset_spec.js @@ -3,144 +3,151 @@ import { ObjectsRegistry } from "../../../../../support/Objects/Registry"; const locators = ObjectsRegistry.CommonLocators; const fieldPrefix = ".t--jsonformfield"; -describe("JSON Form reset", { tags: ["@tag.Widget", "@tag.JSONForm"] }, () => { - before(() => { - cy.addDsl(dslWithSchema); - cy.openPropertyPane("jsonformwidget"); - cy.get(locators._jsToggle("sourcedata")).click({ force: true }); - }); +describe( + "JSON Form reset", + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, + () => { + before(() => { + cy.addDsl(dslWithSchema); + cy.openPropertyPane("jsonformwidget"); + cy.get(locators._jsToggle("sourcedata")).click({ force: true }); + }); - it("updates formData when field value changes", () => { - const initialFormData = { - age: 30, - dob: "10/12/1992", - migrant: false, - address: { street: "Koramangala", city: "Bangalore" }, - hobbies: ["travelling", "swimming"], - education: [{ college: "MIT", year: "20/10/2014" }], - name: "John", - }; - const updatedFormData = { - age: 40, - dob: "10/12/1992", - migrant: false, - address: { street: "Indranagar", city: "Bangalore" }, - hobbies: ["travelling"], - education: [{ college: "IIT", year: "20/10/2014" }], - name: "Test", - }; + it("updates formData when field value changes", () => { + const initialFormData = { + age: 30, + dob: "10/12/1992", + migrant: false, + address: { street: "Koramangala", city: "Bangalore" }, + hobbies: ["travelling", "swimming"], + education: [{ college: "MIT", year: "20/10/2014" }], + name: "John", + }; + const updatedFormData = { + age: 40, + dob: "10/12/1992", + migrant: false, + address: { street: "Indranagar", city: "Bangalore" }, + hobbies: ["travelling"], + education: [{ college: "IIT", year: "20/10/2014" }], + name: "Test", + }; - // Verify current field values - cy.get(`${fieldPrefix}-name input`).should( - "have.value", - initialFormData.name, - ); - cy.get(`${fieldPrefix}-age input`).should( - "have.value", - initialFormData.age, - ); - cy.get(`${fieldPrefix}-dob input`).should( - "have.value", - initialFormData.dob, - ); - cy.get(`${fieldPrefix}-address-street input`).should( - "have.value", - initialFormData.address.street, - ); - cy.get(`${fieldPrefix}-address-city input`).should( - "have.value", - initialFormData.address.city, - ); - cy.get(`${fieldPrefix}-education-0--college input`).should( - "have.value", - initialFormData.education[0].college, - ); - cy.get(`${fieldPrefix}-education-0--year input`).should( - "have.value", - initialFormData.education[0].year, - ); + // Verify current field values + cy.get(`${fieldPrefix}-name input`).should( + "have.value", + initialFormData.name, + ); + cy.get(`${fieldPrefix}-age input`).should( + "have.value", + initialFormData.age, + ); + cy.get(`${fieldPrefix}-dob input`).should( + "have.value", + initialFormData.dob, + ); + cy.get(`${fieldPrefix}-address-street input`).should( + "have.value", + initialFormData.address.street, + ); + cy.get(`${fieldPrefix}-address-city input`).should( + "have.value", + initialFormData.address.city, + ); + cy.get(`${fieldPrefix}-education-0--college input`).should( + "have.value", + initialFormData.education[0].college, + ); + cy.get(`${fieldPrefix}-education-0--year input`).should( + "have.value", + initialFormData.education[0].year, + ); - // Modify field values - cy.get(`${fieldPrefix}-name input`) - .clear({ force: true }) - .type(updatedFormData.name); - cy.get(`${fieldPrefix}-age input`) - .clear({ force: true }) - .clear({ force: true }) - .type(updatedFormData.age); - cy.get(`${fieldPrefix}-address-street input`) - .clear({ force: true }) - .type(updatedFormData.address.street); - cy.get(`${fieldPrefix}-hobbies .rc-select-selection-item`) - .contains("swimming") - .siblings(".rc-select-selection-item-remove") - .click({ force: true }); - cy.get(`${fieldPrefix}-education-0--college input`) - .clear({ force: true }) - .type(updatedFormData.education[0].college) - .wait(200); + // Modify field values + cy.get(`${fieldPrefix}-name input`) + .clear({ force: true }) + .type(updatedFormData.name); + cy.get(`${fieldPrefix}-age input`) + .clear({ force: true }) + .clear({ force: true }) + .type(updatedFormData.age); + cy.get(`${fieldPrefix}-address-street input`) + .clear({ force: true }) + .type(updatedFormData.address.street); + cy.get(`${fieldPrefix}-hobbies .rc-select-selection-item`) + .contains("swimming") + .siblings(".rc-select-selection-item-remove") + .click({ force: true }); + cy.get(`${fieldPrefix}-education-0--college input`) + .clear({ force: true }) + .type(updatedFormData.education[0].college) + .wait(200); - // Verify new field values - cy.get(`${fieldPrefix}-name input`).should( - "have.value", - updatedFormData.name, - ); - cy.get(`${fieldPrefix}-age input`).should( - "have.value", - updatedFormData.age, - ); - cy.get(`${fieldPrefix}-dob input`).should( - "have.value", - updatedFormData.dob, - ); - cy.get(`${fieldPrefix}-address-street input`).should( - "have.value", - updatedFormData.address.street, - ); - cy.get(`${fieldPrefix}-address-city input`).should( - "have.value", - updatedFormData.address.city, - ); - cy.get(`${fieldPrefix}-education-0--college input`).should( - "have.value", - updatedFormData.education[0].college, - ); - cy.get(`${fieldPrefix}-education-0--year input`).should( - "have.value", - updatedFormData.education[0].year, - ); + // Verify new field values + cy.get(`${fieldPrefix}-name input`).should( + "have.value", + updatedFormData.name, + ); + cy.get(`${fieldPrefix}-age input`).should( + "have.value", + updatedFormData.age, + ); + cy.get(`${fieldPrefix}-dob input`).should( + "have.value", + updatedFormData.dob, + ); + cy.get(`${fieldPrefix}-address-street input`).should( + "have.value", + updatedFormData.address.street, + ); + cy.get(`${fieldPrefix}-address-city input`).should( + "have.value", + updatedFormData.address.city, + ); + cy.get(`${fieldPrefix}-education-0--college input`).should( + "have.value", + updatedFormData.education[0].college, + ); + cy.get(`${fieldPrefix}-education-0--year input`).should( + "have.value", + updatedFormData.education[0].year, + ); - // Reset form - cy.get("button").contains("Reset").parent("button").click({ force: true }); + // Reset form + cy.get("button") + .contains("Reset") + .parent("button") + .click({ force: true }); - // Verify initial field values - cy.get(`${fieldPrefix}-name input`).should( - "have.value", - initialFormData.name, - ); - cy.get(`${fieldPrefix}-age input`).should( - "have.value", - initialFormData.age, - ); - cy.get(`${fieldPrefix}-dob input`).should( - "have.value", - initialFormData.dob, - ); - cy.get(`${fieldPrefix}-address-street input`).should( - "have.value", - initialFormData.address.street, - ); - cy.get(`${fieldPrefix}-address-city input`).should( - "have.value", - initialFormData.address.city, - ); - cy.get(`${fieldPrefix}-education-0--college input`).should( - "have.value", - initialFormData.education[0].college, - ); - cy.get(`${fieldPrefix}-education-0--year input`).should( - "have.value", - initialFormData.education[0].year, - ); - }); -}); + // Verify initial field values + cy.get(`${fieldPrefix}-name input`).should( + "have.value", + initialFormData.name, + ); + cy.get(`${fieldPrefix}-age input`).should( + "have.value", + initialFormData.age, + ); + cy.get(`${fieldPrefix}-dob input`).should( + "have.value", + initialFormData.dob, + ); + cy.get(`${fieldPrefix}-address-street input`).should( + "have.value", + initialFormData.address.street, + ); + cy.get(`${fieldPrefix}-address-city input`).should( + "have.value", + initialFormData.address.city, + ); + cy.get(`${fieldPrefix}-education-0--college input`).should( + "have.value", + initialFormData.education[0].college, + ); + cy.get(`${fieldPrefix}-education-0--year input`).should( + "have.value", + initialFormData.education[0].year, + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_UnicodeKeys_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_UnicodeKeys_spec.js index e78e607008a..b7c4bbb021d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_UnicodeKeys_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_UnicodeKeys_spec.js @@ -11,7 +11,7 @@ const backBtn = "[data-testid='t--property-pane-back-btn']"; describe( "JSON Form Widget Unicode keys", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONFrom_Modal_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONFrom_Modal_spec.js index 4580188bf7d..3bc9292ec2d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONFrom_Modal_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONFrom_Modal_spec.js @@ -34,7 +34,7 @@ const checkFormModalValues = (value) => { describe( "JSONForm in Modal", - { tags: ["@tag.Widget", "@tag.JSONForm"] }, + { tags: ["@tag.Widget", "@tag.JSONForm", "@tag.Binding"] }, () => { it("should show the JSONForm with default values from Table widget", () => { const tableData = [ diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List1_spec.js index 273c4052387..29e4660a37d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List1_spec.js @@ -3,7 +3,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Binding the list widget with text widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { //const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; it("1. Validate delete widget action from side bar", function () { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List3_spec.js index 7dbb9c75636..59098d66d59 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List3_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Binding the list widget with text widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("listRegression3Dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_1_spec.ts index c57873a5791..93acb177e8c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_1_spec.ts @@ -16,7 +16,7 @@ const dsl = require("../../../../../fixtures/listdsl.json"); describe( "List Widget Functionality", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { const items = JSON.parse(dsl.dsl.children[0].listData); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_2_spec.js index 145ca961b12..0f2a29e663a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List4_2_spec.js @@ -11,7 +11,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Container Widget Functionality", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { const items = JSON.parse(dsl.dsl.children[0].listData); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List5_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List5_spec.js index 3de11873fe2..555bda23fe8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List5_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List5_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Binding - List widget to text widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("listRegression2Dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List6_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List6_spec.js index 72a468e14dc..3f866e831ae 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List6_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List6_spec.js @@ -6,7 +6,7 @@ import EditorNavigation, { describe( "Binding the list widget with text widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { //const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List7_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List7_spec.js index 88b9c7b6eff..ecb6e79f8ae 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List7_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/List/List7_spec.js @@ -3,7 +3,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Binding the list widget with text widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("ListVulnerabilityDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_FilePicker_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_FilePicker_spec.js index 61ccaff0f72..ca4ba730078 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_FilePicker_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_FilePicker_spec.js @@ -14,7 +14,7 @@ const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; describe( " File Picker Widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("Listv2/simpleLargeListv2"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Inputs_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Inputs_spec.js index f8eef27adcc..f19c2ba93b7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Inputs_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Inputs_spec.js @@ -14,198 +14,208 @@ import EditorNavigation, { // TODO: Test for Reset functionality const items = JSON.parse(dsl.dsl.children[0].listData); -describe("Input Widgets", { tags: ["@tag.Widget", "@tag.List"] }, function () { - before(() => { - agHelper.AddDsl("Listv2/simpleLargeListv2"); - }); - - beforeEach(() => { - agHelper.RestoreLocalStorageCache(); - }); - - afterEach(() => { - agHelper.SaveLocalStorageCache(); - }); - - it("1. Input Widgets default value", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 100); //for test #2 - entityExplorer.DragDropWidgetNVerify( - draggableWidgets.CURRENCY_INPUT, - 200, - 100, - ); - propPane.UpdatePropertyFieldValue("Default value", "{{currentItem.id}}"); - propPane.TogglePropertyState("Required", "On"); - - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 200); //for test #2 - entityExplorer.DragDropWidgetNVerify( - draggableWidgets.PHONE_INPUT, - 200, - 200, - ); - propPane.UpdatePropertyFieldValue( - "Default value", - "{{currentItem.phoneNumber}}", - ); - propPane.TogglePropertyState("Required", "On"); - propPane.TogglePropertyState("Enable formatting", "Off"); - - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 300); //for test #2 - entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 200, 300); - propPane.UpdatePropertyFieldValue("Default value", "{{currentItem.email}}"); - propPane.TogglePropertyState("Required", "On"); - - agHelper.AssertText( - locators._widgetInCanvas(draggableWidgets.INPUT_V2) + - " " + - locators._inputField, - "val", - items[0].email, - ); - - agHelper.AssertText( - locators._widgetInCanvas(draggableWidgets.CURRENCY_INPUT) + - " " + - locators._inputField, - "val", - items[0].id.toString(), - ); - agHelper.AssertText( - locators._widgetInCanvas(draggableWidgets.PHONE_INPUT) + - " " + - locators._inputField, - "val", - items[0].phoneNumber.toString(), - ); - }); - - it("2. Input Widgets isValid", function () { - // Test for isValid === True - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.RenameWidget("Text1", "Currency_Widget"); - agHelper.Sleep(); - propPane.UpdatePropertyFieldValue( - "Text", - "{{currentView.CurrencyInput1.isValid}}", - ); - agHelper.AssertText( - propPane._widgetToVerifyText("Currency_Widget"), - "text", - "true", - ); - - EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); - propPane.RenameWidget("Text2", "PhoneInput_Widget"); - agHelper.Sleep(); - propPane.UpdatePropertyFieldValue( - "Text", - "{{currentView.PhoneInput1.isValid}}", - ); - agHelper.AssertText( - propPane._widgetToVerifyText("PhoneInput_Widget"), - "text", - "true", - ); - - EditorNavigation.SelectEntityByName("Text3", EntityType.Widget); - propPane.RenameWidget("Text3", "Input_Widget"); - agHelper.Sleep(); - propPane.UpdatePropertyFieldValue("Text", "{{currentView.Input1.isValid}}"); - agHelper.AssertText( - propPane._widgetToVerifyText("Input_Widget"), - "text", - "true", - ); - - // Test for isValid === false - deployMode.DeployApp(); - // cy.get(`${widgetSelectorByType("inputwidgetv2")} input`).clear({ - // force: true, - // }); - agHelper.ClearTextField( - locators._widgetInDeployed(draggableWidgets.INPUT_V2) + - " " + - locators._inputField, - true, - ); - agHelper.AssertText( - locators._widgetInDeployed(draggableWidgets.TEXT), - "text", - "false", - 2, - ); - - agHelper.ClearTextField( - locators._widgetInDeployed(draggableWidgets.PHONE_INPUT) + - " " + - locators._inputField, - true, - ); - agHelper.AssertText( - locators._widgetInDeployed(draggableWidgets.TEXT), - "text", - "false", - 1, - ); - - agHelper.ClearTextField( - locators._widgetInDeployed(draggableWidgets.CURRENCY_INPUT) + - " " + - locators._inputField, - true, - ); - agHelper.AssertText( - locators._widgetInDeployed(draggableWidgets.TEXT), - "text", - "false", - ); - deployMode.NavigateBacktoEditor(); - }); - - it("3. Currency widget default value is retained over page change", () => { - const value = "123456789"; - const formattedText = "123,456,789"; - - cy.addDsl(dslWithCurrencyWidget); - cy.openPropertyPane("currencyinputwidget"); - cy.updateCodeInput(".t--property-control-defaultvalue", value); - - // Observe the value of 2nd item currency widget - formatted text - cy.get(".t--widget-currencyinputwidget") - .eq(1) - .find("input") - .should("have.value", formattedText); - - // Find the 2nd item currency and click to focus - cy.get(".t--widget-currencyinputwidget") - .eq(1) - .find("input") - .click({ force: true }); - - // Observe the value of 2nd item currency widget - un-formatted text - cy.get(".t--widget-currencyinputwidget") - .eq(1) - .find("input") - .should("have.value", value); - - // Change to page 2 - cy.get(".rc-pagination-item") - .find("a") - .contains("2") - .click({ force: true }) - .wait(500); - - // Back to page 1 - cy.get(".rc-pagination-item") - .find("a") - .contains("1") - .click({ force: true }) - .wait(500); - - // Observe the value of 2nd item currency widget - formatted text - cy.get(".t--widget-currencyinputwidget") - .eq(1) - .find("input") - .should("have.value", formattedText); - }); -}); +describe( + "Input Widgets", + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, + function () { + before(() => { + agHelper.AddDsl("Listv2/simpleLargeListv2"); + }); + + beforeEach(() => { + agHelper.RestoreLocalStorageCache(); + }); + + afterEach(() => { + agHelper.SaveLocalStorageCache(); + }); + + it("1. Input Widgets default value", function () { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 100); //for test #2 + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.CURRENCY_INPUT, + 200, + 100, + ); + propPane.UpdatePropertyFieldValue("Default value", "{{currentItem.id}}"); + propPane.TogglePropertyState("Required", "On"); + + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 200); //for test #2 + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.PHONE_INPUT, + 200, + 200, + ); + propPane.UpdatePropertyFieldValue( + "Default value", + "{{currentItem.phoneNumber}}", + ); + propPane.TogglePropertyState("Required", "On"); + propPane.TogglePropertyState("Enable formatting", "Off"); + + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 300); //for test #2 + entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 200, 300); + propPane.UpdatePropertyFieldValue( + "Default value", + "{{currentItem.email}}", + ); + propPane.TogglePropertyState("Required", "On"); + + agHelper.AssertText( + locators._widgetInCanvas(draggableWidgets.INPUT_V2) + + " " + + locators._inputField, + "val", + items[0].email, + ); + + agHelper.AssertText( + locators._widgetInCanvas(draggableWidgets.CURRENCY_INPUT) + + " " + + locators._inputField, + "val", + items[0].id.toString(), + ); + agHelper.AssertText( + locators._widgetInCanvas(draggableWidgets.PHONE_INPUT) + + " " + + locators._inputField, + "val", + items[0].phoneNumber.toString(), + ); + }); + + it("2. Input Widgets isValid", function () { + // Test for isValid === True + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.RenameWidget("Text1", "Currency_Widget"); + agHelper.Sleep(); + propPane.UpdatePropertyFieldValue( + "Text", + "{{currentView.CurrencyInput1.isValid}}", + ); + agHelper.AssertText( + propPane._widgetToVerifyText("Currency_Widget"), + "text", + "true", + ); + + EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); + propPane.RenameWidget("Text2", "PhoneInput_Widget"); + agHelper.Sleep(); + propPane.UpdatePropertyFieldValue( + "Text", + "{{currentView.PhoneInput1.isValid}}", + ); + agHelper.AssertText( + propPane._widgetToVerifyText("PhoneInput_Widget"), + "text", + "true", + ); + + EditorNavigation.SelectEntityByName("Text3", EntityType.Widget); + propPane.RenameWidget("Text3", "Input_Widget"); + agHelper.Sleep(); + propPane.UpdatePropertyFieldValue( + "Text", + "{{currentView.Input1.isValid}}", + ); + agHelper.AssertText( + propPane._widgetToVerifyText("Input_Widget"), + "text", + "true", + ); + + // Test for isValid === false + deployMode.DeployApp(); + // cy.get(`${widgetSelectorByType("inputwidgetv2")} input`).clear({ + // force: true, + // }); + agHelper.ClearTextField( + locators._widgetInDeployed(draggableWidgets.INPUT_V2) + + " " + + locators._inputField, + true, + ); + agHelper.AssertText( + locators._widgetInDeployed(draggableWidgets.TEXT), + "text", + "false", + 2, + ); + + agHelper.ClearTextField( + locators._widgetInDeployed(draggableWidgets.PHONE_INPUT) + + " " + + locators._inputField, + true, + ); + agHelper.AssertText( + locators._widgetInDeployed(draggableWidgets.TEXT), + "text", + "false", + 1, + ); + + agHelper.ClearTextField( + locators._widgetInDeployed(draggableWidgets.CURRENCY_INPUT) + + " " + + locators._inputField, + true, + ); + agHelper.AssertText( + locators._widgetInDeployed(draggableWidgets.TEXT), + "text", + "false", + ); + deployMode.NavigateBacktoEditor(); + }); + + it("3. Currency widget default value is retained over page change", () => { + const value = "123456789"; + const formattedText = "123,456,789"; + + cy.addDsl(dslWithCurrencyWidget); + cy.openPropertyPane("currencyinputwidget"); + cy.updateCodeInput(".t--property-control-defaultvalue", value); + + // Observe the value of 2nd item currency widget - formatted text + cy.get(".t--widget-currencyinputwidget") + .eq(1) + .find("input") + .should("have.value", formattedText); + + // Find the 2nd item currency and click to focus + cy.get(".t--widget-currencyinputwidget") + .eq(1) + .find("input") + .click({ force: true }); + + // Observe the value of 2nd item currency widget - un-formatted text + cy.get(".t--widget-currencyinputwidget") + .eq(1) + .find("input") + .should("have.value", value); + + // Change to page 2 + cy.get(".rc-pagination-item") + .find("a") + .contains("2") + .click({ force: true }) + .wait(500); + + // Back to page 1 + cy.get(".rc-pagination-item") + .find("a") + .contains("1") + .click({ force: true }) + .wait(500); + + // Observe the value of 2nd item currency widget - formatted text + cy.get(".t--widget-currencyinputwidget") + .eq(1) + .find("input") + .should("have.value", formattedText); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Modal_Stats_Check_Radio_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Modal_Stats_Check_Radio_spec.js index 2e769772f50..5f5d27332c4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Modal_Stats_Check_Radio_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Modal_Stats_Check_Radio_spec.js @@ -5,7 +5,7 @@ const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; describe( "Modal, Radio, Checkbox widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("Listv2/ListWithModalStatCheckboxAndRadio"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Select_Widgets_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Select_Widgets_spec.js index d734b16281c..9591f03a397 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Select_Widgets_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Select_Widgets_spec.js @@ -13,170 +13,180 @@ const items = JSON.parse(dsl.dsl.children[0].listData); const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; const widgetSelectorByType = (name) => `.t--widget-${name}`; -describe("Select Widgets", { tags: ["@tag.Widget", "@tag.List"] }, function () { - before(() => { - _.agHelper.AddDsl("Listv2/simpleLargeListv2"); - }); - - it("1. Select Widgets default value", function () { - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 500, 100); //for test #2 - _.entityExplorer.DragDropWidgetNVerify( - _.draggableWidgets.MULTISELECT, - 200, - 150, - ); - - _.propPane.ToggleJSMode("sourcedata"); - - _.propPane.UpdatePropertyFieldValue( - "Source Data", - `{{[{ +describe( + "Select Widgets", + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("Listv2/simpleLargeListv2"); + }); + + it("1. Select Widgets default value", function () { + _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 500, 100); //for test #2 + _.entityExplorer.DragDropWidgetNVerify( + _.draggableWidgets.MULTISELECT, + 200, + 150, + ); + + _.propPane.ToggleJSMode("sourcedata"); + + _.propPane.UpdatePropertyFieldValue( + "Source Data", + `{{[{ label: currentItem.name, value: currentItem.id }]}}`, - ); - - _.propPane.ToggleJSMode("label key"); - cy.updateCodeInput( - ".t--property-control-wrapper.t--property-control-labelkey", - `label`, - ); - - _.propPane.ToggleJSMode("value key"); - cy.updateCodeInput(".t--property-control-valuekey", `value`); - - _.propPane.UpdatePropertyFieldValue( - "Default selected values", - "{{currentItem.id}}", - ); - _.propPane.TogglePropertyState("Required", "On"); - _.propPane.EnterJSContext( - "onOptionChange", - "{{showAlert('Row ' + currentIndex + ' Option Changed')}}", - ); - - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 500, 300); //for test #2 - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.SELECT, 200, 350); - - _.propPane.ToggleJSMode("sourcedata"); - - _.propPane.UpdatePropertyFieldValue( - "Source Data", - `{{[{ + ); + + _.propPane.ToggleJSMode("label key"); + cy.updateCodeInput( + ".t--property-control-wrapper.t--property-control-labelkey", + `label`, + ); + + _.propPane.ToggleJSMode("value key"); + cy.updateCodeInput(".t--property-control-valuekey", `value`); + + _.propPane.UpdatePropertyFieldValue( + "Default selected values", + "{{currentItem.id}}", + ); + _.propPane.TogglePropertyState("Required", "On"); + _.propPane.EnterJSContext( + "onOptionChange", + "{{showAlert('Row ' + currentIndex + ' Option Changed')}}", + ); + + _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 500, 300); //for test #2 + _.entityExplorer.DragDropWidgetNVerify( + _.draggableWidgets.SELECT, + 200, + 350, + ); + + _.propPane.ToggleJSMode("sourcedata"); + + _.propPane.UpdatePropertyFieldValue( + "Source Data", + `{{[{ label: currentItem.name, value: currentItem.id }]}}`, - ); - - _.propPane.ToggleJSMode("label key"); - cy.updateCodeInput( - ".t--property-control-wrapper.t--property-control-labelkey", - `label`, - ); - - _.propPane.ToggleJSMode("value key"); - cy.updateCodeInput(".t--property-control-valuekey", `value`); - - _.propPane.UpdatePropertyFieldValue( - "Default selected value", - "{{currentItem.id}}", - ); - _.propPane.TogglePropertyState("Required", "On"); - _.propPane.EnterJSContext( - "onOptionChange", - "{{showAlert('Row ' + currentIndex + ' Option Changed')}}", - ); - - // Page 1 - _.agHelper.ReadSelectedDropDownValue().then(($selectedValue) => { - expect($selectedValue).to.eq(items[0].name); + ); + + _.propPane.ToggleJSMode("label key"); + cy.updateCodeInput( + ".t--property-control-wrapper.t--property-control-labelkey", + `label`, + ); + + _.propPane.ToggleJSMode("value key"); + cy.updateCodeInput(".t--property-control-valuekey", `value`); + + _.propPane.UpdatePropertyFieldValue( + "Default selected value", + "{{currentItem.id}}", + ); + _.propPane.TogglePropertyState("Required", "On"); + _.propPane.EnterJSContext( + "onOptionChange", + "{{showAlert('Row ' + currentIndex + ' Option Changed')}}", + ); + + // Page 1 + _.agHelper.ReadSelectedDropDownValue().then(($selectedValue) => { + expect($selectedValue).to.eq(items[0].name); + }); + cy.get(formWidgetsPage.multiselectwidgetv2) + .find(".rc-select-selection-item-content") + .first() + .should("have.text", items[0].name); + + cy.get(commonlocators.listPaginateNextButton).click({ + force: true, + }); + _.agHelper.Sleep(); + + // Page 2 + _.agHelper.ReadSelectedDropDownValue().then(($selectedValue) => { + expect($selectedValue).to.eq(items[1].name); + }); + + cy.get(`.rc-select-selection-item[title="${items[1].name}"]`).should( + "have.text", + items[1].name, + ); + + cy.get(commonlocators.listPaginatePrevButton).click({ + force: true, + }); }); - cy.get(formWidgetsPage.multiselectwidgetv2) - .find(".rc-select-selection-item-content") - .first() - .should("have.text", items[0].name); - cy.get(commonlocators.listPaginateNextButton).click({ - force: true, + it("2. Select Widgets isValid", function () { + // Test for isValid === True + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + _.propPane.RenameWidget("Text1", "MultiSelect_Widget"); + _.propPane.UpdatePropertyFieldValue( + "Text", + "{{`${currentView.MultiSelect1.selectedOptionLabels[0]}_${currentView.MultiSelect1.selectedOptionValues[0]}_${currentView.MultiSelect1.isDirty}_${currentView.MultiSelect1.isValid}`}}", + ); + cy.get( + `${widgetSelector("MultiSelect_Widget")} ${commonlocators.bodyTextStyle}`, + ) + .first() + .should("have.text", `${items[0].name}_${items[0].id}_false_true`); + + EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); + _.propPane.RenameWidget("Text2", "Select_Widget"); + _.propPane.UpdatePropertyFieldValue( + "Text", + "{{`${currentView.Select1.selectedOptionLabel}_${currentView.Select1.selectedOptionValue}_${currentView.Select1.isDirty}_${currentView.Select1.isValid}`}}", + ); + cy.get( + `${widgetSelector("Select_Widget")} ${commonlocators.bodyTextStyle}`, + ) + .first() + .should("have.text", `${items[0].name}_${items[0].id}_false_true`); + + // Test for isValid === false + EditorNavigation.SelectEntityByName("MultiSelect1", EntityType.Widget); + _.agHelper.SelectFromMultiSelect([`${items[0].name}`], 0, false); + cy.get( + `${widgetSelector("MultiSelect_Widget")} ${commonlocators.bodyTextStyle}`, + ) + .first() + .should("have.text", `undefined_undefined_true_false`); + + cy.get(_.locators._selectClearButton_dataTestId).should("not.exist"); }); - _.agHelper.Sleep(); - - // Page 2 - _.agHelper.ReadSelectedDropDownValue().then(($selectedValue) => { - expect($selectedValue).to.eq(items[1].name); - }); - - cy.get(`.rc-select-selection-item[title="${items[1].name}"]`).should( - "have.text", - items[1].name, - ); - cy.get(commonlocators.listPaginatePrevButton).click({ - force: true, + it("3. Select Widgets onOptionChange", function () { + cy.get(formWidgetsPage.selectWidget) + .find(widgetLocators.dropdownSingleSelect) + .click({ force: true }); + cy.get(commonlocators.singleSelectWidgetMenuItem) + .contains(items[0].name) + .click({ force: true }); + cy.wait(200); + + cy.get(formWidgetsPage.selectWidget).contains(items[0].name); + cy.validateToastMessage("Row 0 Option Changed"); + + cy.get(formWidgetsPage.multiselectwidgetv2) + .find(".rc-select-selection-search-input") + .first() + .focus({ force: true }) + .type("{uparrow}", { force: true }); + + cy.get(".multi-select-dropdown") + .contains(items[0].name) + .click({ force: true }); + cy.get(`.rc-select-selection-item[title="${items[0].name}"]`).should( + "have.text", + items[0].name, + ); + cy.validateToastMessage("Row 0 Option Changed"); }); - }); - - it("2. Select Widgets isValid", function () { - // Test for isValid === True - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - _.propPane.RenameWidget("Text1", "MultiSelect_Widget"); - _.propPane.UpdatePropertyFieldValue( - "Text", - "{{`${currentView.MultiSelect1.selectedOptionLabels[0]}_${currentView.MultiSelect1.selectedOptionValues[0]}_${currentView.MultiSelect1.isDirty}_${currentView.MultiSelect1.isValid}`}}", - ); - cy.get( - `${widgetSelector("MultiSelect_Widget")} ${commonlocators.bodyTextStyle}`, - ) - .first() - .should("have.text", `${items[0].name}_${items[0].id}_false_true`); - - EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); - _.propPane.RenameWidget("Text2", "Select_Widget"); - _.propPane.UpdatePropertyFieldValue( - "Text", - "{{`${currentView.Select1.selectedOptionLabel}_${currentView.Select1.selectedOptionValue}_${currentView.Select1.isDirty}_${currentView.Select1.isValid}`}}", - ); - cy.get(`${widgetSelector("Select_Widget")} ${commonlocators.bodyTextStyle}`) - .first() - .should("have.text", `${items[0].name}_${items[0].id}_false_true`); - - // Test for isValid === false - EditorNavigation.SelectEntityByName("MultiSelect1", EntityType.Widget); - _.agHelper.SelectFromMultiSelect([`${items[0].name}`], 0, false); - cy.get( - `${widgetSelector("MultiSelect_Widget")} ${commonlocators.bodyTextStyle}`, - ) - .first() - .should("have.text", `undefined_undefined_true_false`); - - cy.get(_.locators._selectClearButton_dataTestId).should("not.exist"); - }); - - it("3. Select Widgets onOptionChange", function () { - cy.get(formWidgetsPage.selectWidget) - .find(widgetLocators.dropdownSingleSelect) - .click({ force: true }); - cy.get(commonlocators.singleSelectWidgetMenuItem) - .contains(items[0].name) - .click({ force: true }); - cy.wait(200); - - cy.get(formWidgetsPage.selectWidget).contains(items[0].name); - cy.validateToastMessage("Row 0 Option Changed"); - - cy.get(formWidgetsPage.multiselectwidgetv2) - .find(".rc-select-selection-search-input") - .first() - .focus({ force: true }) - .type("{uparrow}", { force: true }); - - cy.get(".multi-select-dropdown") - .contains(items[0].name) - .click({ force: true }); - cy.get(`.rc-select-selection-item[title="${items[0].name}"]`).should( - "have.text", - items[0].name, - ); - cy.validateToastMessage("Row 0 Option Changed"); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Table_Widgets_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Table_Widgets_spec.js index 82a46638727..365b3e2d048 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Table_Widgets_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Table_Widgets_spec.js @@ -3,67 +3,71 @@ const containerWidgetSelector = `[type="CONTAINER_WIDGET"]`; const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; -describe("Select Widgets", { tags: ["@tag.Widget", "@tag.List"] }, function () { - before(() => { - _.agHelper.AddDsl("Listv2/Listv2WithTablewidget"); - }); - it("a. Validate the Values in Table widget", function () { - cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) - .eq(0) - .within(() => { - cy.readTableV2dataPublish("0", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("Blue"); - cy.log("the value is" + tabValue); - }); +describe( + "Select Widgets", + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("Listv2/Listv2WithTablewidget"); + }); + it("a. Validate the Values in Table widget", function () { + cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) + .eq(0) + .within(() => { + cy.readTableV2dataPublish("0", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("Blue"); + cy.log("the value is" + tabValue); + }); - cy.readTableV2dataPublish("3", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("White"); - cy.log("the value is" + tabValue); + cy.readTableV2dataPublish("3", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("White"); + cy.log("the value is" + tabValue); + }); }); - }); - cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) - .eq(1) - .within(() => { - cy.readTableV2dataPublish("0", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("Orange"); - }); + cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) + .eq(1) + .within(() => { + cy.readTableV2dataPublish("0", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("Orange"); + }); - cy.readTableV2dataPublish("3", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("Mustard"); + cy.readTableV2dataPublish("3", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("Mustard"); + }); }); - }); - cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) - .eq(2) - .within(() => { - cy.readTableV2dataPublish("0", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("Teal"); - }); + cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) + .eq(2) + .within(() => { + cy.readTableV2dataPublish("0", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("Teal"); + }); - cy.readTableV2dataPublish("3", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("Marine"); + cy.readTableV2dataPublish("3", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("Marine"); + }); }); - }); - cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) - .eq(3) - .within(() => { - cy.readTableV2dataPublish("0", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("Blue"); - }); + cy.get(`${widgetSelector("List1")} ${containerWidgetSelector}`) + .eq(3) + .within(() => { + cy.readTableV2dataPublish("0", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("Blue"); + }); - cy.readTableV2dataPublish("3", "1").then((tabData) => { - const tabValue = tabData; - expect(tabValue).to.be.equal("Lavender"); + cy.readTableV2dataPublish("3", "1").then((tabData) => { + const tabValue = tabData; + expect(tabValue).to.be.equal("Lavender"); + }); }); - }); - }); -}); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Button_Widget_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Button_Widget_spec.ts index 0455f933c89..0857ed1bf1a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Button_Widget_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Button_Widget_spec.ts @@ -3,29 +3,33 @@ import EditorNavigation, { EntityType, } from "../../../../../../support/Pages/EditorNavigation"; -describe("List v2- Tabs Widget", { tags: ["@tag.Widget", "@tag.List"] }, () => { - before(() => { - _.agHelper.AddDsl("Listv2/simpleListWithInputAndButton"); - }); +describe( + "List v2- Tabs Widget", + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, + () => { + before(() => { + _.agHelper.AddDsl("Listv2/simpleListWithInputAndButton"); + }); - it("1. should not throw error when on click event is changed No Action", () => { - EditorNavigation.SelectEntityByName("Button1", EntityType.Widget, {}, [ - "List1", - "Container1", - ]); - _.propPane.EnterJSContext("onClick", "{{showAlert('Hello')}}"); - _.agHelper.Sleep(); - _.agHelper.ClickButton("Submit"); - _.agHelper.ValidateToastMessage("Hello"); + it("1. should not throw error when on click event is changed No Action", () => { + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget, {}, [ + "List1", + "Container1", + ]); + _.propPane.EnterJSContext("onClick", "{{showAlert('Hello')}}"); + _.agHelper.Sleep(); + _.agHelper.ClickButton("Submit"); + _.agHelper.ValidateToastMessage("Hello"); - // Wait for toastmsg to close - _.agHelper.WaitUntilAllToastsDisappear(); + // Wait for toastmsg to close + _.agHelper.WaitUntilAllToastsDisappear(); - // Clear the event - _.propPane.UpdatePropertyFieldValue("onClick", ""); - _.agHelper.Sleep(); - _.agHelper.ClickButton("Submit"); + // Clear the event + _.propPane.UpdatePropertyFieldValue("onClick", ""); + _.agHelper.Sleep(); + _.agHelper.ClickButton("Submit"); - _.agHelper.AssertElementAbsence(_.locators._specificToast("Hello")); - }); -}); + _.agHelper.AssertElementAbsence(_.locators._specificToast("Hello")); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Tabs_Widget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Tabs_Widget_spec.js index 353528e41be..48c06295e08 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Tabs_Widget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/Listv2_Tabs_Widget_spec.js @@ -1,29 +1,33 @@ import * as _ from "../../../../../../support/Objects/ObjectsCore"; const commonlocators = require("../../../../../../locators/commonlocators.json"); -describe("List v2- Tabs Widget", { tags: ["@tag.Widget", "@tag.List"] }, () => { - before(() => { - _.agHelper.AddDsl("Listv2/simpleListWithTabsWidget"); - }); +describe( + "List v2- Tabs Widget", + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, + () => { + before(() => { + _.agHelper.AddDsl("Listv2/simpleListWithTabsWidget"); + }); - it("1. change in the properties of the tabs widget should retain the default selected tab", () => { - cy.openPropertyPaneByWidgetName("Tabs1", "tabswidget"); + it("1. change in the properties of the tabs widget should retain the default selected tab", () => { + cy.openPropertyPaneByWidgetName("Tabs1", "tabswidget"); - // Check if Tab1 selected - cy.get(".t--page-switch-tab.is-active").contains("Tab 1"); + // Check if Tab1 selected + cy.get(".t--page-switch-tab.is-active").contains("Tab 1"); - // Disable Scroll Content - _.agHelper.CheckUncheck(commonlocators.scrollView, false); - // Check if disabled - cy.get(commonlocators.scrollView).parent().should("not.be.checked"); - // Check if Tab 1 still selected - cy.get(".t--page-switch-tab.is-active").contains("Tab 1"); + // Disable Scroll Content + _.agHelper.CheckUncheck(commonlocators.scrollView, false); + // Check if disabled + cy.get(commonlocators.scrollView).parent().should("not.be.checked"); + // Check if Tab 1 still selected + cy.get(".t--page-switch-tab.is-active").contains("Tab 1"); - // Enable Scroll Content - _.agHelper.CheckUncheck(commonlocators.scrollView); - // Check if enabled - cy.get(commonlocators.scrollView).should("be.checked"); - // Check if Tab 1 still selected - cy.get(".t--page-switch-tab.is-active").contains("Tab 1"); - }); -}); + // Enable Scroll Content + _.agHelper.CheckUncheck(commonlocators.scrollView); + // Check if enabled + cy.get(commonlocators.scrollView).should("be.checked"); + // Check if Tab 1 still selected + cy.get(".t--page-switch-tab.is-active").contains("Tab 1"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifierProperty_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifierProperty_spec.ts index 661a206c0af..05b0bf8d9a1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifierProperty_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifierProperty_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "List v2 - Data Identifier property", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts index 0b1f970d36c..8faae3ee37d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DataIdentifier_spec.ts @@ -34,7 +34,7 @@ const data = [ describe( "List v2 - Data Identifier property", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("Listv2/ListV2WithNullPrimaryKey"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DefaultSelectItem_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DefaultSelectItem_spec.ts index 6ab02041d74..33f94769240 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DefaultSelectItem_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/DefaultSelectItem_spec.ts @@ -54,7 +54,7 @@ function setUpDataSource() { describe( "List widget v2 defaultSelectedItem", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("Listv2/ListV2_Reset_dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Event_Bindings_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Event_Bindings_spec.ts index 0d7b56550a2..f463e306a83 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Event_Bindings_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Event_Bindings_spec.ts @@ -10,7 +10,7 @@ import EditorNavigation, { describe( "Listv2 - Event bindings spec", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { it("1. nested list - inner widget should have access to currentItem, currentIndex, currentView and level_1", () => { agHelper.AddDsl("Listv2/nestedList"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts index 594f05b4474..9516f37bc73 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_NestedList_spec.ts @@ -13,7 +13,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Nested List widget V2 ", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("listV2NestedDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js index 00e3059cd5a..2d5cc6eb0d9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_PageNo_PageSize_spec.js @@ -88,7 +88,7 @@ const listData = [ describe( "List widget V2 page number and page size", - { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("listv2PaginationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js index 061e83a4c9e..dbb9727591c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js @@ -15,7 +15,7 @@ const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; describe( "List widget V2 Serverside Pagination", - { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("Listv2/Listv2JSObjects"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_WithOtherWidget_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_WithOtherWidget_spec.ts index 9670243a014..ca90e9d4afe 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_WithOtherWidget_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_WithOtherWidget_spec.ts @@ -10,7 +10,7 @@ import EditorNavigation, { describe( "List widget V2 functionality with audio and video widgets", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("listV2AudioVideoDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js index 0aafd27f8e5..2ca9fe4720f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_nested_List_widget_spec.js @@ -27,7 +27,7 @@ function checkAutosuggestion(label, type) { } describe( " Nested List Widgets ", - { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity", "@tag.Binding"] }, function () { const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; beforeEach(() => { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js index 1bdbef59b94..97814dc5b46 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicChildWidgetInteraction_spec.js @@ -51,7 +51,7 @@ function checkSelectedRadioValue(selector, value) { describe( "List widget v2 - Basic Child Widget Interaction", - { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("Listv2/emptyList"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js index c762a36fc84..0728fa37cc7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicClientSideData_spec.js @@ -26,7 +26,7 @@ const simpleListData1 = [ describe( "List widget v2 - Basic client side data tests", - { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity", "@tag.Binding"] }, () => { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicServerSideData_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicServerSideData_spec.js index 03475cbff38..fde5879d85c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicServerSideData_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_BasicServerSideData_spec.js @@ -10,7 +10,7 @@ const toggleJSButton = (name) => `.t--property-control-${name} .t--js-toggle`; describe( "List widget v2 - Basic server side data tests", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("Listv2/listWithServerSideData"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Copy_Paste_Delete_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Copy_Paste_Delete_spec.js index 1a242fc7de2..6923bbcd0e3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Copy_Paste_Delete_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Copy_Paste_Delete_spec.js @@ -4,7 +4,7 @@ const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; describe( "List widget v2 Copy and Paste", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { it("1. Validate Copy paste action", () => { cy.dragAndDropToCanvas("listwidgetv2", { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_EvaluatedPopup_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_EvaluatedPopup_spec.js index 25f27987ab7..3f5b3d5d993 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_EvaluatedPopup_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_EvaluatedPopup_spec.js @@ -1,6 +1,6 @@ describe( "List widget v2 Evaluated Popup", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { it("1. List widget V2 with currentItem", () => { cy.dragAndDropToCanvas("listwidgetv2", { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ClientSide_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ClientSide_spec.js index 51f901f0d9d..589d2ef0e35 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ClientSide_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ClientSide_spec.js @@ -60,7 +60,7 @@ function verifyValueOfWidget(widgetType, value, index) { describe( "List widget v2 - meta hydration tests", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("Listv2/MetaHydrationDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ServerSide_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ServerSide_spec.js index 7ed4c574446..4d6d5178355 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ServerSide_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Meta_Hydration_ServerSide_spec.js @@ -75,7 +75,7 @@ function testJsontextClear(endp) { describe( "List widget v2 - meta hydration tests", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("Listv2/MetaHydrationDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js index 344b4116035..1518bd7c3ff 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_Nested_EventBindings_spec.js @@ -6,7 +6,7 @@ const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; describe( "Listv2 - Event bindings spec", - { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity", "@tag.Binding"] }, () => { it("1. nested list - inner widget should have access to currentItem, currentIndex, currentView and level_1", () => { cy.addDsl(nestedListDSL); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_WithButtonGroupIconWidget_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_WithButtonGroupIconWidget_spec.ts index fbe7a15d34b..b545b0f4a68 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_WithButtonGroupIconWidget_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_WithButtonGroupIconWidget_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "List widget V2 functionality with button, button group and icon button widgets", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("listV2ButtonsDsl", locators._buttonByText("Submit")); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_autocomplete_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_autocomplete_spec.js index 60ed01e6f9f..c7d9d1997ce 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_autocomplete_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_autocomplete_spec.js @@ -12,7 +12,7 @@ function checkAutosuggestion(label, type) { describe( "List v2 - Property autocomplete", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { cy.addDsl(level3NestedList); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_container_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_container_spec.js index a1739330308..704d88d8ef4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_container_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_container_spec.js @@ -3,7 +3,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Listv2 - Container widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { before(() => { cy.addDsl(simpleListDSL); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js index 7d3e5f1d4e9..62c4d75957a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_onItemClick_spec.js @@ -30,7 +30,7 @@ function deleteAllWidgetsInContainer() { describe( "List widget v2 onItemClick", - { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Sanity", "@tag.Binding"] }, () => { it("1. List widget V2 with onItemClick", () => { cy.dragAndDropToCanvas("listwidgetv2", { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_regression_fix_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_regression_fix_spec.js index f9173928d47..91a35c8be8f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_regression_fix_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_regression_fix_spec.js @@ -4,7 +4,7 @@ const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; describe( "List widget v2 Regression", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { it("1. List widget V2 with invisible widgets", () => { cy.dragAndDropToCanvas("listwidgetv2", { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_spec.js index 81c6e5ad3c8..4fd89cd231c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_spec.js @@ -12,7 +12,7 @@ import { describe( "List Widget V2 Functionality", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("Listv2/simpleLargeListv2"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_vulnerability_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_vulnerability_spec.js index 77af980174e..6e4325de8bb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_vulnerability_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/Listv2_vulnerability_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Binding the list widget with text widget", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("Listv2/simpleListVulnerability"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/PropertyPane_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/PropertyPane_spec.ts index 504f60b9921..6433daf8351 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/PropertyPane_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/ListV2/PropertyPane_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "List widget V2 PropertyPane", - { tags: ["@tag.Widget", "@tag.List"] }, + { tags: ["@tag.Widget", "@tag.List", "@tag.Binding"] }, () => { it("1. Validate isVisible", () => { entityExplorer.DragDropWidgetNVerify("listwidgetv2", 300, 300); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Migration_Spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Migration_Spec.js index f9958c77a29..ff32b90e833 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Migration_Spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Migration_Spec.js @@ -12,304 +12,308 @@ import { table, } from "../../../../support/Objects/ObjectsCore"; -describe("Migration Validate", { tags: ["@tag.ImportExport"] }, function () { - it("1. Import application and Validate Migration on pageload", function () { - // import application - homePageHelpers.NavigateToHome(); - agHelper.GetNClick(homePage.createNew, 0); - cy.get(homePage.workspaceImportAppOption).click({ force: true }); - cy.get(homePage.workspaceImportAppModal).should("be.visible"); - cy.xpath(homePage.uploadLogo) - .selectFile("cypress/fixtures/TableMigrationAppExported.json", { - force: true, - }) - .wait(500); - cy.get(homePage.workspaceImportAppModal).should("not.exist"); - - cy.wait("@importNewApplication").then(() => { - cy.get(homePage.toastMessage).should( - "contain", - Cypress.env("MESSAGES").IMPORT_APP_SUCCESSFUL(), - ); - - //Renaming imported app! - const uuid = () => Cypress._.random(0, 1e4); - const name = uuid(); - homePageHelpers.RenameApplication(`app${name}`); - cy.wrap(`app${name}`).as("appname"); - - // Validating data binding for the imported application - Page1 - - //Validating order of header row! - cy.xpath( - "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]", - ) - .invoke("text") - .then((x) => { - expect(x).to.eq( - "Card NumberidNameاسمaddress住所PhoneemailCompanyjobimagessnPin CodeCreditLimitOutstandingStateAvailable LimitCard TypeChange Credit limitimageURLlatitudelongitude", - ); - cy.log("header set is:" + x); - }); - - //Validating Latitude & Longitude are hidden columns: - cy.xpath( - "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='latitude']/parent::div/parent::div/parent::div", - ) - .invoke("attr", "class") - .then((classes) => { - cy.log("classes are:" + classes); - expect(classes).includes("hidden-header"); - }); - - cy.xpath( - "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='longitude']/parent::div/parent::div/parent::div", - ) - .invoke("attr", "class") - .then((classes) => { - cy.log("classes are:" + classes); - expect(classes).includes("hidden-header"); - }); - - //Validating Id column sorting happens as Datatype is Number in app! - cy.xpath( - "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='id']", - ) - .click() - .wait(2000); - - cy.readTabledataPublish("0", "1").then((cellData) => { - expect(cellData).to.be.equal("100"); - }); - - cy.readTabledataPublish("1", "1").then((cellData) => { - expect(cellData).to.be.equal("99"); - }); - - cy.readTabledataPublish("2", "1").then((cellData) => { - expect(cellData).to.be.equal("98"); - }); +describe( + "Migration Validate", + { tags: ["@tag.ImportExport", "@tag.Git"] }, + function () { + it("1. Import application and Validate Migration on pageload", function () { + // import application + homePageHelpers.NavigateToHome(); + agHelper.GetNClick(homePage.createNew, 0); + cy.get(homePage.workspaceImportAppOption).click({ force: true }); + cy.get(homePage.workspaceImportAppModal).should("be.visible"); + cy.xpath(homePage.uploadLogo) + .selectFile("cypress/fixtures/TableMigrationAppExported.json", { + force: true, + }) + .wait(500); + cy.get(homePage.workspaceImportAppModal).should("not.exist"); - //Revert the Id column sorting! - cy.xpath( - "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='id']", - ) - .click() - .wait(2000); + cy.wait("@importNewApplication").then(() => { + cy.get(homePage.toastMessage).should( + "contain", + Cypress.env("MESSAGES").IMPORT_APP_SUCCESSFUL(), + ); - cy.readTabledataPublish("0", "1").then((cellData) => { - expect(cellData).to.be.equal("1"); - }); + //Renaming imported app! + const uuid = () => Cypress._.random(0, 1e4); + const name = uuid(); + homePageHelpers.RenameApplication(`app${name}`); + cy.wrap(`app${name}`).as("appname"); - cy.readTabledataPublish("1", "1").then((cellData) => { - expect(cellData).to.be.equal("2"); - }); + // Validating data binding for the imported application - Page1 - cy.readTabledataPublish("2", "1").then((cellData) => { - expect(cellData).to.be.equal("3"); - }); + //Validating order of header row! + cy.xpath( + "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]", + ) + .invoke("text") + .then((x) => { + expect(x).to.eq( + "Card NumberidNameاسمaddress住所PhoneemailCompanyjobimagessnPin CodeCreditLimitOutstandingStateAvailable LimitCard TypeChange Credit limitimageURLlatitudelongitude", + ); + cy.log("header set is:" + x); + }); - //Validating image column is present: - cy.getTableDataSelector("0", "10").then((selector) => { - cy.get(selector + " div") + //Validating Latitude & Longitude are hidden columns: + cy.xpath( + "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='latitude']/parent::div/parent::div/parent::div", + ) .invoke("attr", "class") .then((classes) => { cy.log("classes are:" + classes); - expect(classes).to.eq("image-cell"); - }); - }); - - //Card Number mapping to text widget! - table.SelectTableRow(2); - cy.wait(2500); //time for table row select to reflect! - cy.readTabledataPublish("2", "0").then((cardNumber) => { - cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]") - .eq(1) - .invoke("text") - .then((cardNo) => { - var format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/; - expect(cardNumber).match(format); - expect(cardNumber).to.be.equal(cardNo); + expect(classes).includes("hidden-header"); }); - }); - - //Address mapping to text widget! - cy.readTabledataPublish("2", "4").then((address) => { - cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]") - .eq(1) - .invoke("text") - .then((addr) => { - expect(address.replace(/\r?\n|\r/, "")).to.eq(addr); - }); - }); - //Validating Available limit column computation maintained! - cy.readTabledataPublish("2", "16").then((availLimit) => { - cy.readTabledataPublish("2", "13").then((creditLimit) => { - cy.readTabledataPublish("2", "14").then((outstanding) => { - expect(Number(availLimit)).to.eq(creditLimit - outstanding); + cy.xpath( + "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='longitude']/parent::div/parent::div/parent::div", + ) + .invoke("attr", "class") + .then((classes) => { + cy.log("classes are:" + classes); + expect(classes).includes("hidden-header"); }); - }); - }); - //Validating State button click & binding & text widget mapping! - cy.getTableDataSelector("2", "15").then((selector) => { - cy.get(selector + " button.bp3-button") + //Validating Id column sorting happens as Datatype is Number in app! + cy.xpath( + "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='id']", + ) .click() - .wait(3000); - - cy.waitUntil( - () => - cy - .xpath("//div[contains(@class, ' t--widget-textwidget')][1]") - .eq(0) - .contains("State:", { timeout: 30000 }) - .should("exist"), - { - errorMsg: "Execute call did not complete evn after 10 secs", - timeout: 20000, - interval: 1000, - }, - ).then(() => cy.wait(500)); - - cy.get(selector + " button span") - .invoke("text") - .then((statetxt) => { - cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]") - .eq(0) - .invoke("text") - .then((txtWidtxt) => { - cy.log("statetxt is:" + statetxt); - let text = - statetxt == "Activate" ? "State:Inactive" : "State:Active"; - expect(text).to.eq(txtWidtxt); - }); - }); - }); + .wait(2000); - //Validating Image URL click & navigation! - cy.getTableDataSelector("2", "19").then((selector) => { - cy.window().then((win) => { - // Stub `window.open` to prevent new tabs - cy.stub(win, "open").as("windowOpenStub"); - cy.get(selector + " span").then(($link) => { - cy.wrap($link).click(); - cy.get("@windowOpenStub").should("have.been.called"); - }); + cy.readTabledataPublish("0", "1").then((cellData) => { + expect(cellData).to.be.equal("100"); }); - }); - - cy.wait("@getWorkspace"); - cy.waitUntil(() => cy.get("div.tableWrap").should("be.visible"), { - errorMsg: "Page is not loaded evn after 10 secs", - timeout: 30000, - interval: 2000, - }).then(() => cy.wait(1000)); //wait for page load! + cy.readTabledataPublish("1", "1").then((cellData) => { + expect(cellData).to.be.equal("99"); + }); - table.SelectTableRow(2); - cy.getTableDataSelector("2", "18").then((selector) => { - cy.get(selector + " button") - .click() - .wait(1000); + cy.readTabledataPublish("2", "1").then((cellData) => { + expect(cellData).to.be.equal("98"); + }); + //Revert the Id column sorting! cy.xpath( - "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='AddcreditLimit']/parent::a", + "//div[@class='tableWrap']//div[@class='thead']//div[@class='tr'][1]//div[@role='columnheader']//span[text()='id']", ) .click() .wait(2000); - cy.waitUntil( - () => - cy - .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { - timeout: 50000, - }) - .eq(0) - .contains("CreditLimit:", { timeout: 30000 }) - .should("exist"), - { - errorMsg: "Execute call did not complete evn after 10 secs", - timeout: 20000, - interval: 1000, - }, - ).then(() => cy.wait(500)); //allow time for n/w to finish - - cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { - timeout: 30000, - }) - .eq(0) - .invoke("text") - .then((addreduce) => { - expect(addreduce).to.eq("CreditLimit:Add"); + cy.readTabledataPublish("0", "1").then((cellData) => { + expect(cellData).to.be.equal("1"); + }); + + cy.readTabledataPublish("1", "1").then((cellData) => { + expect(cellData).to.be.equal("2"); + }); + + cy.readTabledataPublish("2", "1").then((cellData) => { + expect(cellData).to.be.equal("3"); + }); + + //Validating image column is present: + cy.getTableDataSelector("0", "10").then((selector) => { + cy.get(selector + " div") + .invoke("attr", "class") + .then((classes) => { + cy.log("classes are:" + classes); + expect(classes).to.eq("image-cell"); + }); + }); + + //Card Number mapping to text widget! + table.SelectTableRow(2); + cy.wait(2500); //time for table row select to reflect! + cy.readTabledataPublish("2", "0").then((cardNumber) => { + cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]") + .eq(1) + .invoke("text") + .then((cardNo) => { + var format = /^\d{4}-\d{4}-\d{4}(-\d{4})?$/; + expect(cardNumber).match(format); + expect(cardNumber).to.be.equal(cardNo); + }); + }); + + //Address mapping to text widget! + cy.readTabledataPublish("2", "4").then((address) => { + cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]") + .eq(1) + .invoke("text") + .then((addr) => { + expect(address.replace(/\r?\n|\r/, "")).to.eq(addr); + }); + }); + + //Validating Available limit column computation maintained! + cy.readTabledataPublish("2", "16").then((availLimit) => { + cy.readTabledataPublish("2", "13").then((creditLimit) => { + cy.readTabledataPublish("2", "14").then((outstanding) => { + expect(Number(availLimit)).to.eq(creditLimit - outstanding); + }); }); - }); + }); - //Manu Btn validation: - 2nd menu item - cy.getTableDataSelector("2", "18").then((selector) => { - cy.get(selector + " button") - .click() - .wait(1000); + //Validating State button click & binding & text widget mapping! + cy.getTableDataSelector("2", "15").then((selector) => { + cy.get(selector + " button.bp3-button") + .click() + .wait(3000); + + cy.waitUntil( + () => + cy + .xpath("//div[contains(@class, ' t--widget-textwidget')][1]") + .eq(0) + .contains("State:", { timeout: 30000 }) + .should("exist"), + { + errorMsg: "Execute call did not complete evn after 10 secs", + timeout: 20000, + interval: 1000, + }, + ).then(() => cy.wait(500)); + + cy.get(selector + " button span") + .invoke("text") + .then((statetxt) => { + cy.xpath("//div[contains(@class, ' t--widget-textwidget')][1]") + .eq(0) + .invoke("text") + .then((txtWidtxt) => { + cy.log("statetxt is:" + statetxt); + let text = + statetxt == "Activate" ? "State:Inactive" : "State:Active"; + expect(text).to.eq(txtWidtxt); + }); + }); + }); - cy.xpath( - "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='Reducecreditlimit']/parent::a", - ) - .click() - .wait(2000); + //Validating Image URL click & navigation! + cy.getTableDataSelector("2", "19").then((selector) => { + cy.window().then((win) => { + // Stub `window.open` to prevent new tabs + cy.stub(win, "open").as("windowOpenStub"); + cy.get(selector + " span").then(($link) => { + cy.wrap($link).click(); + cy.get("@windowOpenStub").should("have.been.called"); + }); + }); + }); - cy.waitUntil( - () => - cy - .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { - timeout: 50000, - }) - .eq(0) - .contains("CreditLimit:", { timeout: 30000 }) - .should("exist"), - { - errorMsg: "Execute call did not complete evn after 10 secs", - timeout: 20000, - interval: 1000, - }, - ).then(() => cy.wait(500)); //allow time for n/w to finish - - cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { + cy.wait("@getWorkspace"); + + cy.waitUntil(() => cy.get("div.tableWrap").should("be.visible"), { + errorMsg: "Page is not loaded evn after 10 secs", timeout: 30000, - }) - .eq(0) - .invoke("text") - .then((addreduce) => { - expect(addreduce).to.eq("CreditLimit:Reduce"); - }); + interval: 2000, + }).then(() => cy.wait(1000)); //wait for page load! + + table.SelectTableRow(2); + cy.getTableDataSelector("2", "18").then((selector) => { + cy.get(selector + " button") + .click() + .wait(1000); + + cy.xpath( + "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='AddcreditLimit']/parent::a", + ) + .click() + .wait(2000); + + cy.waitUntil( + () => + cy + .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { + timeout: 50000, + }) + .eq(0) + .contains("CreditLimit:", { timeout: 30000 }) + .should("exist"), + { + errorMsg: "Execute call did not complete evn after 10 secs", + timeout: 20000, + interval: 1000, + }, + ).then(() => cy.wait(500)); //allow time for n/w to finish + + cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { + timeout: 30000, + }) + .eq(0) + .invoke("text") + .then((addreduce) => { + expect(addreduce).to.eq("CreditLimit:Add"); + }); + }); + + //Manu Btn validation: - 2nd menu item + cy.getTableDataSelector("2", "18").then((selector) => { + cy.get(selector + " button") + .click() + .wait(1000); + + cy.xpath( + "//div//a[contains(@class, 'bp3-menu-item')]/div[text()='Reducecreditlimit']/parent::a", + ) + .click() + .wait(2000); + + cy.waitUntil( + () => + cy + .xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { + timeout: 50000, + }) + .eq(0) + .contains("CreditLimit:", { timeout: 30000 }) + .should("exist"), + { + errorMsg: "Execute call did not complete evn after 10 secs", + timeout: 20000, + interval: 1000, + }, + ).then(() => cy.wait(500)); //allow time for n/w to finish + + cy.xpath("//div[contains(@class, ' t--widget-textwidget')][2]", { + timeout: 30000, + }) + .eq(0) + .invoke("text") + .then((addreduce) => { + expect(addreduce).to.eq("CreditLimit:Reduce"); + }); + }); }); - }); - //Page 2 Validations: - EditorNavigation.SelectEntityByName( - "Change color and font", - EntityType.Page, - ); - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - - cy.get(widgetsPage.bold) - .invoke("attr", "data-selected") - .then((sel) => expect(Boolean(sel)).to.be.true); - cy.xpath(widgetsPage.textCenterAlign) - .eq(0) - .invoke("attr", "data-selected") - .then((sel) => expect(Boolean(sel)).to.be.true); //Text align - cy.xpath(widgetsPage.textCenterAlign) - .eq(1) - .invoke("attr", "data-selected") - .then((sel) => expect(Boolean(sel)).to.be.true); //Vertical align - cy.get(widgetsPage.textColor) - .first() - .invoke("attr", "value") - .should("contain", "#2E3D49"); - cy.get(`${widgetsPage.cellBackground_tablev1} input`) - .first() - .invoke("attr", "value") - .should("contain", "#FFC13D"); - cy.validateCodeEditorContent(".t--property-control-textsize", "1.5rem"); - }); -}); + //Page 2 Validations: + EditorNavigation.SelectEntityByName( + "Change color and font", + EntityType.Page, + ); + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + + cy.get(widgetsPage.bold) + .invoke("attr", "data-selected") + .then((sel) => expect(Boolean(sel)).to.be.true); + cy.xpath(widgetsPage.textCenterAlign) + .eq(0) + .invoke("attr", "data-selected") + .then((sel) => expect(Boolean(sel)).to.be.true); //Text align + cy.xpath(widgetsPage.textCenterAlign) + .eq(1) + .invoke("attr", "data-selected") + .then((sel) => expect(Boolean(sel)).to.be.true); //Vertical align + cy.get(widgetsPage.textColor) + .first() + .invoke("attr", "value") + .should("contain", "#2E3D49"); + cy.get(`${widgetsPage.cellBackground_tablev1} input`) + .first() + .invoke("attr", "value") + .should("contain", "#FFC13D"); + cy.validateCodeEditorContent(".t--property-control-textsize", "1.5rem"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_On_Table_Filter_Pane_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_On_Table_Filter_Pane_spec.ts index bc08dc34d61..02a3804f1d9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_On_Table_Filter_Pane_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_On_Table_Filter_Pane_spec.ts @@ -3,7 +3,7 @@ const widgets = require("../../../../../locators/Widgets.json"); describe( "Modal Widget Functionality", - { tags: ["@tag.Widget", "@tag.Modal"] }, + { tags: ["@tag.Widget", "@tag.Modal", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("modalOnTableFilterPaneDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_Widget_With_Button_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_Widget_With_Button_spec.ts index 58ca9bb19eb..8eda0ff4a5b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_Widget_With_Button_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_Widget_With_Button_spec.ts @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Modal Widget with auto-layout usecases", - { tags: ["@tag.Widget", "@tag.Modal"] }, + { tags: ["@tag.Widget", "@tag.Modal", "@tag.Binding"] }, function () { it("1. Add new Modal widget with other widgets and validate with auto-layout", () => { _.autoLayout.ConvertToAutoLayoutAndVerify(false); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_background_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_background_spec.ts index 1e748bfcf12..5c8933c7161 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_background_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_background_spec.ts @@ -6,7 +6,7 @@ import { describe( "Modal Widget background color spec", - { tags: ["@tag.Widget", "@tag.Modal"] }, + { tags: ["@tag.Widget", "@tag.Modal", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("modalWidgetBGcolorDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_focus_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_focus_spec.js index 8d774a60f02..594a0458170 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_focus_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_focus_spec.js @@ -6,86 +6,90 @@ import EditorNavigation, { const widgets = require("../../../../../locators/Widgets.json"); import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Modal focus", { tags: ["@tag.Widget", "@tag.Modal"] }, function () { - const someInputText = "some text"; +describe( + "Modal focus", + { tags: ["@tag.Widget", "@tag.Modal", "@tag.Binding"] }, + function () { + const someInputText = "some text"; - function setupModalWithInputWidget() { - //drag a button to open modal - cy.dragAndDropToCanvas("buttonwidget", { x: 400, y: 550 }); - cy.openPropertyPane("buttonwidget"); - cy.get(widgets.toggleOnClick).click(); + function setupModalWithInputWidget() { + //drag a button to open modal + cy.dragAndDropToCanvas("buttonwidget", { x: 400, y: 550 }); + cy.openPropertyPane("buttonwidget"); + cy.get(widgets.toggleOnClick).click(); - cy.updateCodeInput( - ".t--property-control-onclick", - `{{showModal(Modal1.name)}}`, - ); - //add modal - EditorNavigation.SelectEntityByName("Modal1", EntityType.Widget); - cy.get(widgets.modalWidget).should("exist"); + cy.updateCodeInput( + ".t--property-control-onclick", + `{{showModal(Modal1.name)}}`, + ); + //add modal + EditorNavigation.SelectEntityByName("Modal1", EntityType.Widget); + cy.get(widgets.modalWidget).should("exist"); - PageLeftPane.switchToAddNew(); + PageLeftPane.switchToAddNew(); - cy.wait(500); - //drag input field into modal - cy.get(".t--widget-card-draggable-inputwidgetv2") - .first() - .trigger("dragstart", { - force: true, - }); + cy.wait(500); + //drag input field into modal + cy.get(".t--widget-card-draggable-inputwidgetv2") + .first() + .trigger("dragstart", { + force: true, + }); - cy.get(widgets.modalWidget) - .scrollIntoView() - .trigger("mousemove", 50, 100, { eventConstructor: "MouseEvent" }) - .trigger("mousemove", 50, 100, { eventConstructor: "MouseEvent" }) - .trigger("mouseup", 50, 100, { eventConstructor: "MouseEvent" }); - } + cy.get(widgets.modalWidget) + .scrollIntoView() + .trigger("mousemove", 50, 100, { eventConstructor: "MouseEvent" }) + .trigger("mousemove", 50, 100, { eventConstructor: "MouseEvent" }) + .trigger("mouseup", 50, 100, { eventConstructor: "MouseEvent" }); + } - after(() => { - _.agHelper.SaveLocalStorageCache(); - }); + after(() => { + _.agHelper.SaveLocalStorageCache(); + }); - before(() => { - _.agHelper.RestoreLocalStorageCache(); - _.agHelper.AddDsl("ModalDsl"); - }); + before(() => { + _.agHelper.RestoreLocalStorageCache(); + _.agHelper.AddDsl("ModalDsl"); + }); - it("1. Should focus on the input field when autofocus for the input field is enabled", () => { - setupModalWithInputWidget(); - cy.openPropertyPaneFromModal("inputwidgetv2"); + it("1. Should focus on the input field when autofocus for the input field is enabled", () => { + setupModalWithInputWidget(); + cy.openPropertyPaneFromModal("inputwidgetv2"); - // autofocus for input field is enabled - cy.get(".t--property-control-autofocus") - .find(".ads-v2-switch") - .click({ force: true }); - //enter some text to the input field - cy.get(`${widgets.modalWidget} .t--widget-inputwidgetv2 input`) - .click() - .type(someInputText); + // autofocus for input field is enabled + cy.get(".t--property-control-autofocus") + .find(".ads-v2-switch") + .click({ force: true }); + //enter some text to the input field + cy.get(`${widgets.modalWidget} .t--widget-inputwidgetv2 input`) + .click() + .type(someInputText); - //close Modal - cy.get(widgets.modalCloseButton).click({ force: true }); - cy.get(widgets.modalCloseButton).should("not.be.visible"); + //close Modal + cy.get(widgets.modalCloseButton).click({ force: true }); + cy.get(widgets.modalCloseButton).should("not.be.visible"); - cy.wait(1500); - //open the modal - cy.get(widgets.widgetBtn).contains("Submit").click({ force: true }); - //check if the focus is on the input field - cy.focused().should("have.value", someInputText); - }); - it("2. Should not focus on the input field if autofocus is disabled", () => { - cy.openPropertyPaneFromModal("inputwidgetv2"); - // autofocus for input field is disabled - cy.get(".t--property-control-autofocus") - .find(".ads-v2-switch") - .click({ force: true }); - //close Modal - cy.get(widgets.modalCloseButton).click({ force: true }); - cy.get(widgets.modalCloseButton).should("not.be.visible"); + cy.wait(1500); + //open the modal + cy.get(widgets.widgetBtn).contains("Submit").click({ force: true }); + //check if the focus is on the input field + cy.focused().should("have.value", someInputText); + }); + it("2. Should not focus on the input field if autofocus is disabled", () => { + cy.openPropertyPaneFromModal("inputwidgetv2"); + // autofocus for input field is disabled + cy.get(".t--property-control-autofocus") + .find(".ads-v2-switch") + .click({ force: true }); + //close Modal + cy.get(widgets.modalCloseButton).click({ force: true }); + cy.get(widgets.modalCloseButton).should("not.be.visible"); - //open the modal - cy.get(widgets.modalWidget).should("not.exist"); - cy.get(widgets.widgetBtn).contains("Submit").click({ force: true }); - //check if the focus is not on the input field - cy.focused().should("not.have.value", someInputText); - }); -}); + //open the modal + cy.get(widgets.modalWidget).should("not.exist"); + cy.get(widgets.widgetBtn).contains("Submit").click({ force: true }); + //check if the focus is not on the input field + cy.focused().should("not.have.value", someInputText); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_functionaliy_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_functionaliy_spec.js index eb63818e2ac..55c3bc8adbe 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_functionaliy_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_functionaliy_spec.js @@ -10,7 +10,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Modal Widget Functionality", - { tags: ["@tag.Widget", "@tag.Modal"] }, + { tags: ["@tag.Widget", "@tag.Modal", "@tag.Binding"] }, function () { afterEach(() => { _.agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts index e15a1a5095f..de830dd4136 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Modal Widget test cases", - { tags: ["@tag.Widget", "@tag.Modal"] }, + { tags: ["@tag.Widget", "@tag.Modal", "@tag.Binding"] }, function () { const image = (src: string) => 'img[src="' + src + '"]'; const jpgImg = diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js index 90dce2f693b..ac125df7390 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect1_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "MultiSelect Widget Functionality", - { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Sanity", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect2_spec.js index ed1a0968ba9..56c70821725 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect2_spec.js @@ -14,7 +14,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "MultiSelect Widget Functionality", - { tags: ["@tag.Widget", "@tag.Multiselect"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("multiSelectDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect4_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect4_spec.js index f27136699c9..57e3884b2a6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect4_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect4_spec.js @@ -20,7 +20,7 @@ const defaultValue = `[ describe( "MultiSelect Widget Functionality", - { tags: ["@tag.Widget", "@tag.Multiselect"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect5_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect5_spec.ts index d5d1f62a1aa..acad6e559f0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect5_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiSelect5_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Multi Select widget Tests", - { tags: ["@tag.Widget", "@tag.Multiselect"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify("multiselectwidgetv2", 550, 100); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_2_spec.ts index 0d0437231cf..19759c3c7dd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_2_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Multi Select widget Tests", - { tags: ["@tag.Widget", "@tag.Multiselect"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("multiTreeSelectDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_spec.js index f8be47ba867..b510970f2b9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/MultiTreeSelect_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Multi Tree Select Widget", - { tags: ["@tag.Widget", "@tag.Multiselect"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/Multi_Select_Tree_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/Multi_Select_Tree_spec.js index 8b051bbab9c..b614134f52e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/Multi_Select_Tree_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Multiselect/Multi_Select_Tree_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "MultiSelectTree Widget Functionality", - { tags: ["@tag.Widget", "@tag.Multiselect"] }, + { tags: ["@tag.Widget", "@tag.Multiselect", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("TreeSelectDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Camera_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Camera_spec.js index 051b21b774a..3b8f4e7cf7d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Camera_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Camera_spec.js @@ -1,47 +1,51 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Camera Widget", { tags: ["@tag.Widget", "@tag.Image"] }, () => { - before(() => { - _.agHelper.AddDsl("CameraDsl"); - }); - - beforeEach(() => { - cy.openPropertyPane("camerawidget"); - }); - - it("1. Check isDirty, onImageSave, imageBlobURL, imageDataURL", () => { - const mainControlSelector = - "//div[contains(@class, 't--widget-camerawidget')]//button"; - - cy.get(".t--property-control-onimagecapture .t--js-toggle").click(); - - cy.testJsontext("onimagecapture", "{{showAlert('captured','success')}}"); - - cy.openPropertyPane("textwidget"); - cy.updateCodeInput( - ".t--property-control-text", - `{{Camera1.isDirty}}:{{Camera1.imageDataURL}}:{{Camera1.imageBlobURL}}`, - ); - // Initial value of isDirty should be false - cy.get(".t--widget-textwidget").should( - "contain", - "false:undefined:undefined", - ); - // Take photo - cy.xpath(mainControlSelector).eq(2).click(); //taking photo - cy.wait(2000); - // Save photo - cy.xpath(mainControlSelector).eq(2).click(); //saving it - - // Assert: should trigger onImageSave action - cy.validateToastMessage("captured"); - - // Check if isDirty is set to true - cy.get(".t--widget-textwidget") - .invoke("text") - .should( - "match", - /true:blob:[a-z0-9-]*\?type=Base64:blob:https?:\/\/[^/]*\/[a-z0-9-]*/, +describe( + "Camera Widget", + { tags: ["@tag.Widget", "@tag.Image", "@tag.Binding"] }, + () => { + before(() => { + _.agHelper.AddDsl("CameraDsl"); + }); + + beforeEach(() => { + cy.openPropertyPane("camerawidget"); + }); + + it("1. Check isDirty, onImageSave, imageBlobURL, imageDataURL", () => { + const mainControlSelector = + "//div[contains(@class, 't--widget-camerawidget')]//button"; + + cy.get(".t--property-control-onimagecapture .t--js-toggle").click(); + + cy.testJsontext("onimagecapture", "{{showAlert('captured','success')}}"); + + cy.openPropertyPane("textwidget"); + cy.updateCodeInput( + ".t--property-control-text", + `{{Camera1.isDirty}}:{{Camera1.imageDataURL}}:{{Camera1.imageBlobURL}}`, ); - }); -}); + // Initial value of isDirty should be false + cy.get(".t--widget-textwidget").should( + "contain", + "false:undefined:undefined", + ); + // Take photo + cy.xpath(mainControlSelector).eq(2).click(); //taking photo + cy.wait(2000); + // Save photo + cy.xpath(mainControlSelector).eq(2).click(); //saving it + + // Assert: should trigger onImageSave action + cy.validateToastMessage("captured"); + + // Check if isDirty is set to true + cy.get(".t--widget-textwidget") + .invoke("text") + .should( + "match", + /true:blob:[a-z0-9-]*\?type=Base64:blob:https?:\/\/[^/]*\/[a-z0-9-]*/, + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Canvas_scrolling_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Canvas_scrolling_spec.js index 0c91fd6ff79..2ce858f511d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Canvas_scrolling_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Canvas_scrolling_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Modal Widget Functionality", - { tags: ["@tag.Widget", "@tag.Modal"] }, + { tags: ["@tag.Widget", "@tag.Modal", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("modalScroll"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Divider_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Divider_spec.js index 991af1ffedf..29d28219653 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Divider_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Divider_spec.js @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Divider Widget Functionality", - { tags: ["@tag.Widget", "@tag.Divider"] }, + { tags: ["@tag.Widget", "@tag.Divider", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("DividerDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_2_spec.ts index 3df7914335f..24d9b4b8d11 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_2_spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "Icon Button widget Tests", - { tags: ["@tag.Widget", "@tag.IconButton"] }, + { tags: ["@tag.Widget", "@tag.IconButton", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.ICONBUTTON); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_spec.js index 454444d6dcc..ff0a6d1b7cb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/IconButton_spec.js @@ -9,7 +9,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Icon button Widget Functionality", - { tags: ["@tag.Widget", "@tag.IconButton"] }, + { tags: ["@tag.Widget", "@tag.IconButton", "@tag.Binding"] }, function () { before(() => { _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.ICONBUTTON); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapChart_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapChart_Spec.ts index d08455c47be..e7d14151cec 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapChart_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapChart_Spec.ts @@ -18,7 +18,7 @@ const _mapChartPlot = (text: string) => describe( "Map Chart Widget Functionality", - { tags: ["@tag.Widget", "@tag.Maps", "@tag.Visual"] }, + { tags: ["@tag.Widget", "@tag.Maps", "@tag.Visual", "@tag.Binding"] }, function () { it("1. Drag and drop a Map Chart widget and verify", function () { entityExplorer.DragDropWidgetNVerify(draggableWidgets.MAPCHART, 200, 200); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_Spec.ts index 96a6cb701f9..68bbeafc5a6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_Spec.ts @@ -31,7 +31,7 @@ const location = [ describe( "Map Widget", - { tags: ["@tag.Widget", "@tag.Maps", "@tag.Visual"] }, + { tags: ["@tag.Widget", "@tag.Maps", "@tag.Visual", "@tag.Binding"] }, function () { it("1.Drag Map Widget and Verify the Map Widget with Initial Location", () => { //Add map and verify diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_loading_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_loading_Spec.ts index e3e56ddefc8..7d905e38eed 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_loading_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MapWidget_loading_Spec.ts @@ -7,7 +7,7 @@ import { describe( "Map chart Widget", - { tags: ["@tag.Widget", "@tag.Maps"] }, + { tags: ["@tag.Widget", "@tag.Maps", "@tag.Binding"] }, function () { it("1.Drag two Map Widget and Verify the Map Widget is loading", () => { //Add map and verify diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MenuButton_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MenuButton_spec.js index 7e4b34e8383..f94c0bc06f2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MenuButton_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/MenuButton_spec.js @@ -5,7 +5,7 @@ const { modifierKey } = require("../../../../../support/Constants"); describe( "Menu button Widget Functionality", - { tags: ["@tag.Widget", "@tag.MenuButton"] }, + { tags: ["@tag.Widget", "@tag.MenuButton", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("menuButtonDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/OthersAutocomplete_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/OthersAutocomplete_spec.js index 090bd656d0c..d40ec14ca1d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/OthersAutocomplete_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/OthersAutocomplete_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Autocomplete using slash command and mustache tests", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("slashcommandDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Progress_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Progress_spec.js index 5451ff9bbf4..085bfc38999 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Progress_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/Progress_spec.js @@ -11,7 +11,7 @@ import { progressWidgetProgress } from "../../../../../locators/WidgetLocators"; describe( "Progress Widget", - { tags: ["@tag.Widget", "@tag.Progress"] }, + { tags: ["@tag.Widget", "@tag.Progress", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.PROGRESS); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatBox_DragAndDrop_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatBox_DragAndDrop_spec.js index 11b7e493714..181e0f491f6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatBox_DragAndDrop_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatBox_DragAndDrop_spec.js @@ -10,7 +10,7 @@ import { describe( "Statbox Widget Functionality", - { tags: ["@tag.Widget", "@tag.Statbox"] }, + { tags: ["@tag.Widget", "@tag.Statbox", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("dynamicHeightStatboxdsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatboxDsl_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatboxDsl_spec.js index 36ff5136ab3..f48f179d6e6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatboxDsl_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Others/StatboxDsl_spec.js @@ -12,7 +12,7 @@ import { describe( "Statbox Widget", - { tags: ["@tag.Widget", "@tag.Statbox"] }, + { tags: ["@tag.Widget", "@tag.Statbox", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("StatboxDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInputDynamicValue_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInputDynamicValue_spec.js index 78631547f35..b5e60b77840 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInputDynamicValue_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInputDynamicValue_spec.js @@ -12,7 +12,7 @@ const widgetName = "phoneinputwidget"; describe( "Phone input widget - ", - { tags: ["@tag.Widget", "@tag.PhoneInput"] }, + { tags: ["@tag.Widget", "@tag.PhoneInput", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("PhoneInputDynamic"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInput_Part2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInput_Part2_spec.ts index 9eede0aa2b7..6c8cd50ae65 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInput_Part2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/PhoneInput_Part2_spec.ts @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Phone Input widget Tests", - { tags: ["@tag.Widget", "@tag.PhoneInput"] }, + { tags: ["@tag.Widget", "@tag.PhoneInput", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify("phoneinputwidget", 550, 100); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/Phone_input_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/Phone_input_spec.js index d3806f52ec0..a539adac574 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/Phone_input_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/PhoneInput/Phone_input_spec.js @@ -15,7 +15,7 @@ const searchAndSelectOption = (optionValue) => { }; describe( "Phone input widget - ", - { tags: ["@tag.Widget", "@tag.PhoneInput"] }, + { tags: ["@tag.Widget", "@tag.PhoneInput", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor3_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor3_spec.ts index c88557a2c55..7fa1bc92ebb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor3_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor3_spec.ts @@ -10,7 +10,7 @@ import EditorNavigation, { describe( "Rich Text Editor widget Tests", - { tags: ["@tag.Widget", "@tag.TextEditor"] }, + { tags: ["@tag.Widget", "@tag.TextEditor", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("richTextEditorDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_1_spec.js index 65829529af7..de2b53e0032 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_1_spec.js @@ -8,7 +8,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "RichTextEditor Widget Functionality", - { tags: ["@tag.Widget", "@tag.TextEditor"] }, + { tags: ["@tag.Widget", "@tag.TextEditor", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formdsl1"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_2_spec.js index b6291d69cc0..1ca9207fd7f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_2_spec.js @@ -36,7 +36,7 @@ const testCursorPoistion = (textValueLen, tinyMceId) => { describe( "RichTextEditor Widget Functionality", - { tags: ["@tag.Widget", "@tag.TextEditor"] }, + { tags: ["@tag.Widget", "@tag.TextEditor", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formdsl1"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_Validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_Validation_spec.js index 850e1709fe6..547164629ae 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_Validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/RTE/RichTextEditor_Validation_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "RichTextEditor Widget Validation", - { tags: ["@tag.Widget", "@tag.TextEditor"] }, + { tags: ["@tag.Widget", "@tag.TextEditor", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formdsl1"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts index f8fb3832b05..b01f39c2ac9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio2_spec.ts @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Radio Widget test cases", - { tags: ["@tag.Widget", "@tag.Radio"] }, + { tags: ["@tag.Widget", "@tag.Radio", "@tag.Binding"] }, function () { it("1. Validate radio widget bindings", () => { //JS Object diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup1_spec.js index 76754f740d0..088ca5013d4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup1_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Radiogroup Widget Functionality", - { tags: ["@tag.Widget", "@tag.Radio"] }, + { tags: ["@tag.Widget", "@tag.Radio", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup2_spec.js index dd47f2387eb..751138e75ad 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup2_spec.js @@ -1,25 +1,32 @@ const widgetName = "radiogroupwidget"; -describe("Radio Group Widget", { tags: ["@tag.Widget", "@tag.Radio"] }, () => { - it("Drag & drop Radio group & Text widgets", () => { - cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 }); - cy.get(`.t--widget-${widgetName}`).should("exist"); - cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 }); - cy.openPropertyPane("textwidget"); - cy.updateCodeInput(".t--property-control-text", `{{RadioGroup1.isDirty}}`); - }); +describe( + "Radio Group Widget", + { tags: ["@tag.Widget", "@tag.Radio", "@tag.Binding"] }, + () => { + it("Drag & drop Radio group & Text widgets", () => { + cy.dragAndDropToCanvas(widgetName, { x: 300, y: 300 }); + cy.get(`.t--widget-${widgetName}`).should("exist"); + cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 }); + cy.openPropertyPane("textwidget"); + cy.updateCodeInput( + ".t--property-control-text", + `{{RadioGroup1.isDirty}}`, + ); + }); - it("Check isDirty meta property", function () { - // Check if initial value of isDirty is false - cy.get(".t--widget-textwidget").should("contain", "false"); - // Interact with UI - cy.get(".t--widget-radiogroupwidget .bp3-radio").last().click(); - // Check if isDirty is set to true - cy.get(".t--widget-textwidget").should("contain", "true"); - // Change defaultOptionValue - cy.openPropertyPane(widgetName); - cy.updateCodeInput(".t--property-control-defaultselectedvalue", "N"); - // Check if isDirty is reset to false - cy.get(".t--widget-textwidget").should("contain", "false"); - }); -}); + it("Check isDirty meta property", function () { + // Check if initial value of isDirty is false + cy.get(".t--widget-textwidget").should("contain", "false"); + // Interact with UI + cy.get(".t--widget-radiogroupwidget .bp3-radio").last().click(); + // Check if isDirty is set to true + cy.get(".t--widget-textwidget").should("contain", "true"); + // Change defaultOptionValue + cy.openPropertyPane(widgetName); + cy.updateCodeInput(".t--property-control-defaultselectedvalue", "N"); + // Check if isDirty is reset to false + cy.get(".t--widget-textwidget").should("contain", "false"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup_Int_Value_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup_Int_Value_spec.js index f3cd3befa00..2b067d93d6b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup_Int_Value_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/RadioGroup_Int_Value_spec.js @@ -12,7 +12,7 @@ function checkSelectedRadioValue(selector, value) { describe( "RadioGroup widget testing", - { tags: ["@tag.Widget", "@tag.Radio"] }, + { tags: ["@tag.Widget", "@tag.Radio", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("radioGroup_int_value_dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio_spec.js index 1b1810efa3c..52bcf63014a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Radio/Radio_spec.js @@ -15,7 +15,7 @@ import { describe( "Radio Widget Functionality", - { tags: ["@tag.Widget", "@tag.Radio"] }, + { tags: ["@tag.Widget", "@tag.Radio", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Rating/Rating_Widget_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Rating/Rating_Widget_spec.ts index f06811d548b..d0278d6b630 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Rating/Rating_Widget_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Rating/Rating_Widget_spec.ts @@ -12,7 +12,7 @@ import { describe( "Rating widet testcases", - { tags: ["@tag.Widget", "@tag.Rating"] }, + { tags: ["@tag.Widget", "@tag.Rating", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.RATING); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select2_Spec.ts index 30f1a3f108d..4f91c5c0c9f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select2_Spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Select widget tests", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select3_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select3_Spec.ts index 7394090d06c..e7af98c4184 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select3_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select3_Spec.ts @@ -14,7 +14,7 @@ import EditorNavigation, { describe( "Select widget tests", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_TreeSelect_MultiSelect_OnFocus_OnBlur_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_TreeSelect_MultiSelect_OnFocus_OnBlur_spec.js index 75b0802bcdf..714fd662dd4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_TreeSelect_MultiSelect_OnFocus_OnBlur_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_TreeSelect_MultiSelect_OnFocus_OnBlur_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Select, MultiSelect, Tree Select and Multi Tree Select Widget Property tests onFocus and onBlur", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("selectMultiSelectTreeSelectWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js index 7924ea4e9ec..51a05b00944 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_Validation_spec.js @@ -8,7 +8,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Select Widget Functionality", - { tags: ["@tag.Widget", "@tag.Select", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Sanity", "@tag.Binding"] }, function () { before(() => { _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.SELECT); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_spec.js index 059d27c6ca2..2583741fc9b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_spec.js @@ -19,122 +19,128 @@ const { OneClickBinding } = require("../../OneClickBinding/spec_utility"); const oneClickBinding = new OneClickBinding(); -describe("Select widget", { tags: ["@tag.Widget", "@tag.Select"] }, () => { - it("1. Drag and drop Select/Text widgets", () => { - cy.dragAndDropToCanvas("selectwidget", { x: 300, y: 300 }); - cy.get(formWidgetsPage.selectWidget).should("exist"); - }); - - it("2. Check isDirty meta property", () => { - cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 }); - cy.updateCodeInput(".t--property-control-text", `{{Select1.isDirty}}`); - // Check if initial value of isDirty is false - cy.get(".t--widget-textwidget").should("contain", "false"); - // Interact with UI - cy.get(formWidgetsPage.selectWidget) - .find(widgetLocators.dropdownSingleSelect) - .click({ force: true }); - cy.get(commonlocators.singleSelectWidgetMenuItem) - .contains("Blue") - .click({ force: true }); - // Check if isDirty is set to true - cy.get(".t--widget-textwidget").should("contain", "true"); - // Change defaultOptionValue property - cy.updateCodeInput(".t--property-control-defaultselectedvalue", "RED"); - // Check if isDirty is reset to false - cy.get(".t--widget-textwidget").should("contain", "false"); - }); - - it("3. Clears the search field when widget is closed and serverSideFiltering is off", () => { - // open the select widget - cy.get(formWidgetsPage.selectWidget) - .find(widgetLocators.dropdownSingleSelect) - .click({ force: true }); - // search for option Red in the search input - cy.get(commonlocators.selectInputSearch).type("Red"); - // Select the Red option from dropdown list - cy.get(commonlocators.singleSelectWidgetMenuItem) - .contains("Red") - .click({ force: true }); - cy.wait(200); - // Assert if the select widget has Red as the selected value - cy.get(formWidgetsPage.selectWidget).contains("Red"); - // Open the select widget again - cy.get(formWidgetsPage.selectWidget) - .find(widgetLocators.dropdownSingleSelect) - .click({ force: true }); - // Assert if the search input is empty now - cy.get(commonlocators.selectInputSearch).invoke("val").should("be.empty"); - }); - - it("4. Does not clear the search field when widget is closed and serverSideFiltering is on", () => { - // toggle the serversidefiltering option on - agHelper.CheckUncheck(widgetLocators.serversideFilteringInput); - // search for option Red in the search input - cy.get(commonlocators.selectInputSearch).type("Red"); - // Select the Red option from dropdown list - cy.get(commonlocators.singleSelectWidgetMenuItem) - .contains("Red") - .click({ force: true }); - cy.wait(200); - // Open the select widget again - cy.get(formWidgetsPage.selectWidget) - .find(widgetLocators.dropdownSingleSelect) - .click({ force: true }); - // Assert if the search input is not empty - cy.get(commonlocators.selectInputSearch) - .invoke("val") - .should("not.be.empty"); - }); - - it("5. Select widget selection is not cleared when the widget is server side filtered", () => { - dataSources.CreateDataSource("Postgres"); - - cy.get("@dsName").then((dsName) => { - EditorNavigation.SelectEntityByName("Select1", EntityType.Widget); - propPane.ToggleJSMode("sourcedata", false); - - oneClickBinding.ChooseAndAssertForm( - `${dsName}`, - dsName, - "public.employees", - { - label: "first_name", - value: "last_name", - }, - ); +describe( + "Select widget", + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, + () => { + it("1. Drag and drop Select/Text widgets", () => { + cy.dragAndDropToCanvas("selectwidget", { x: 300, y: 300 }); + cy.get(formWidgetsPage.selectWidget).should("exist"); + }); + + it("2. Check isDirty meta property", () => { + cy.dragAndDropToCanvas("textwidget", { x: 300, y: 500 }); + cy.updateCodeInput(".t--property-control-text", `{{Select1.isDirty}}`); + // Check if initial value of isDirty is false + cy.get(".t--widget-textwidget").should("contain", "false"); + // Interact with UI + cy.get(formWidgetsPage.selectWidget) + .find(widgetLocators.dropdownSingleSelect) + .click({ force: true }); + cy.get(commonlocators.singleSelectWidgetMenuItem) + .contains("Blue") + .click({ force: true }); + // Check if isDirty is set to true + cy.get(".t--widget-textwidget").should("contain", "true"); + // Change defaultOptionValue property + cy.updateCodeInput(".t--property-control-defaultselectedvalue", "RED"); + // Check if isDirty is reset to false + cy.get(".t--widget-textwidget").should("contain", "false"); + }); + + it("3. Clears the search field when widget is closed and serverSideFiltering is off", () => { + // open the select widget + cy.get(formWidgetsPage.selectWidget) + .find(widgetLocators.dropdownSingleSelect) + .click({ force: true }); + // search for option Red in the search input + cy.get(commonlocators.selectInputSearch).type("Red"); + // Select the Red option from dropdown list + cy.get(commonlocators.singleSelectWidgetMenuItem) + .contains("Red") + .click({ force: true }); + cy.wait(200); + // Assert if the select widget has Red as the selected value + cy.get(formWidgetsPage.selectWidget).contains("Red"); + // Open the select widget again + cy.get(formWidgetsPage.selectWidget) + .find(widgetLocators.dropdownSingleSelect) + .click({ force: true }); + // Assert if the search input is empty now + cy.get(commonlocators.selectInputSearch).invoke("val").should("be.empty"); + }); + + it("4. Does not clear the search field when widget is closed and serverSideFiltering is on", () => { + // toggle the serversidefiltering option on + agHelper.CheckUncheck(widgetLocators.serversideFilteringInput); + // search for option Red in the search input + cy.get(commonlocators.selectInputSearch).type("Red"); + // Select the Red option from dropdown list + cy.get(commonlocators.singleSelectWidgetMenuItem) + .contains("Red") + .click({ force: true }); + cy.wait(200); + // Open the select widget again + cy.get(formWidgetsPage.selectWidget) + .find(widgetLocators.dropdownSingleSelect) + .click({ force: true }); + // Assert if the search input is not empty + cy.get(commonlocators.selectInputSearch) + .invoke("val") + .should("not.be.empty"); }); - agHelper.GetNClick(OneClickBindingLocator.connectData); + it("5. Select widget selection is not cleared when the widget is server side filtered", () => { + dataSources.CreateDataSource("Postgres"); - assertHelper.AssertNetworkStatus("@postExecute"); + cy.get("@dsName").then((dsName) => { + EditorNavigation.SelectEntityByName("Select1", EntityType.Widget); + propPane.ToggleJSMode("sourcedata", false); - cy.get(formWidgetsPage.selectWidget) - .find(widgetLocators.dropdownSingleSelect) - .click({ force: true }); + oneClickBinding.ChooseAndAssertForm( + `${dsName}`, + dsName, + "public.employees", + { + label: "first_name", + value: "last_name", + }, + ); + }); - cy.get(commonlocators.selectInputSearch).clear().type("Janet"); + agHelper.GetNClick(OneClickBindingLocator.connectData); - cy.get(commonlocators.singleSelectWidgetMenuItem) - .contains("Janet") - .click({ force: true }); + assertHelper.AssertNetworkStatus("@postExecute"); - cy.get(formWidgetsPage.selectWidget) - .find(widgetLocators.dropdownSingleSelect) - .click({ force: true }); + cy.get(formWidgetsPage.selectWidget) + .find(widgetLocators.dropdownSingleSelect) + .click({ force: true }); - cy.get(commonlocators.selectInputSearch).clear().type("Steven"); + cy.get(commonlocators.selectInputSearch).clear().type("Janet"); - assertHelper.AssertNetworkStatus("@postExecute"); + cy.get(commonlocators.singleSelectWidgetMenuItem) + .contains("Janet") + .click({ force: true }); - cy.get(".select-button").should("contain", "Janet"); - }); + cy.get(formWidgetsPage.selectWidget) + .find(widgetLocators.dropdownSingleSelect) + .click({ force: true }); - it("6. Select tooltip renders if tooltip prop is not empty", () => { - cy.openPropertyPane("selectwidget"); - // enter tooltip in property pan - cy.get(widgetsPage.inputTooltipControl).type("Helpful text for tooltip !"); - // tooltip help icon shows - cy.get(".select-tooltip").scrollIntoView().should("be.visible"); - }); -}); + cy.get(commonlocators.selectInputSearch).clear().type("Steven"); + + assertHelper.AssertNetworkStatus("@postExecute"); + + cy.get(".select-button").should("contain", "Janet"); + }); + + it("6. Select tooltip renders if tooltip prop is not empty", () => { + cy.openPropertyPane("selectwidget"); + // enter tooltip in property pan + cy.get(widgetsPage.inputTooltipControl).type( + "Helpful text for tooltip !", + ); + // tooltip help icon shows + cy.get(".select-tooltip").scrollIntoView().should("be.visible"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js index 4dc40ede6cf..73fd969d194 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/Select_widget1_spec.js @@ -9,7 +9,7 @@ const defaultValue = ` describe( "Select Widget Functionality", - { tags: ["@tag.Widget", "@tag.Select", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Sanity", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/select_Widget_Bug_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/select_Widget_Bug_spec.js index 1f674e6d2e1..dd931962d4b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/select_Widget_Bug_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Select/select_Widget_Bug_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Select Widget Functionality", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("formSelectDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/CategorySlider_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/CategorySlider_spec.ts index 41bd965b2ee..9b7ab131267 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/CategorySlider_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/CategorySlider_spec.ts @@ -17,7 +17,7 @@ import EditorNavigation, { describe( "Category Slider spec", - { tags: ["@tag.Widget", "@tag.Slider"] }, + { tags: ["@tag.Widget", "@tag.Slider", "@tag.Binding"] }, () => { const options = `[ { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/NumberSlider_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/NumberSlider_spec.ts index 51643b41556..df056b74fc3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/NumberSlider_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/NumberSlider_spec.ts @@ -13,519 +13,537 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../../support/Pages/EditorNavigation"; -describe("Number Slider spec", { tags: ["@tag.Widget", "@tag.Slider"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify("numbersliderwidget", 550, 100); - entityExplorer.DragDropWidgetNVerify("textwidget", 300, 300); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Text", "{{NumberSlider1.value}}"); - }); - - it("1. Verify property visibility and default values", () => { - const dataSectionProperties = [ - "min\\.value", - "max\\.value", - "stepsize", - "defaultvalue", - ]; - const generalProperties = [ - "showmarks", - "marks", - "visible", - "disabled", - "animateloading", - "showvaluealways", - ]; - const eventsProperties = ["onchange"]; - - EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); - // Data Section properties - dataSectionProperties.forEach((dataSectionProperty) => { - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("data", `${dataSectionProperty}`), - ); +describe( + "Number Slider spec", + { tags: ["@tag.Widget", "@tag.Slider", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify("numbersliderwidget", 550, 100); + entityExplorer.DragDropWidgetNVerify("textwidget", 300, 300); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Text", "{{NumberSlider1.value}}"); }); - // General Section Properties - generalProperties.forEach((generalProperty) => { + + it("1. Verify property visibility and default values", () => { + const dataSectionProperties = [ + "min\\.value", + "max\\.value", + "stepsize", + "defaultvalue", + ]; + const generalProperties = [ + "showmarks", + "marks", + "visible", + "disabled", + "animateloading", + "showvaluealways", + ]; + const eventsProperties = ["onchange"]; + + EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); + // Data Section properties + dataSectionProperties.forEach((dataSectionProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl( + "data", + `${dataSectionProperty}`, + ), + ); + }); + // General Section Properties + generalProperties.forEach((generalProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl( + "general", + `${generalProperty}`, + ), + ); + }); + // Events Section properties + eventsProperties.forEach((eventsProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl("events", `${eventsProperty}`), + ); + }); + //Style Section properties + propPane.MoveToTab("Style"); + agHelper.AssertElementVisibility(propPane._propertyControl("size")); agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("general", `${generalProperty}`), + propPane._propertyPanePropertyControl("color", "fillcolor"), ); + + propPane.MoveToTab("Content"); + // Verify default value + propPane + .EvaluateExistingPropertyFieldValue("Min. value") + .then((val: any) => { + expect(val).to.eq("0"); + }); + propPane + .EvaluateExistingPropertyFieldValue("Max. value") + .then((val: any) => { + expect(val).to.eq("100"); + }); + propPane + .EvaluateExistingPropertyFieldValue("Step size") + .then((val: any) => { + expect(val).to.eq("1"); + }); + propPane + .EvaluateExistingPropertyFieldValue("Default value") + .then((val: any) => { + expect(val).to.eq("10"); + }); }); - // Events Section properties - eventsProperties.forEach((eventsProperty) => { - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("events", `${eventsProperty}`), + + it("2. Validates accepted and unaccepted 'Min. value' values", () => { + propPane.UpdatePropertyFieldValue("Min. value", "110"); + + agHelper.VerifyEvaluatedErrorMessage( + "This value must be less than max value", ); - }); - //Style Section properties - propPane.MoveToTab("Style"); - agHelper.AssertElementVisibility(propPane._propertyControl("size")); - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("color", "fillcolor"), - ); - - propPane.MoveToTab("Content"); - // Verify default value - propPane - .EvaluateExistingPropertyFieldValue("Min. value") - .then((val: any) => { - expect(val).to.eq("0"); - }); - propPane - .EvaluateExistingPropertyFieldValue("Max. value") - .then((val: any) => { - expect(val).to.eq("100"); - }); - propPane - .EvaluateExistingPropertyFieldValue("Step size") - .then((val: any) => { - expect(val).to.eq("1"); - }); - propPane - .EvaluateExistingPropertyFieldValue("Default value") - .then((val: any) => { - expect(val).to.eq("10"); - }); - }); - it("2. Validates accepted and unaccepted 'Min. value' values", () => { - propPane.UpdatePropertyFieldValue("Min. value", "110"); + propPane.UpdatePropertyFieldValue("Min. value", ""); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be less than max value", - ); + agHelper.VerifyEvaluatedErrorMessage("This value is required"); - propPane.UpdatePropertyFieldValue("Min. value", ""); + propPane.UpdatePropertyFieldValue("Min. value", "zero"); - agHelper.VerifyEvaluatedErrorMessage("This value is required"); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - propPane.UpdatePropertyFieldValue("Min. value", "zero"); + // Allows negative value and validate + propPane.UpdatePropertyFieldValue("Min. value", "-10"); + propPane.UpdatePropertyFieldValue("Step size", "10"); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + // Verify in Preview mode negative value + agHelper.GetNClick(locators._enterPreviewMode); + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{leftArrow}") + .type("{leftArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") + .then(($label) => { + expect($label).to.eq("-10"); + }); + agHelper.GetNClick(locators._exitPreviewMode); - // Allows negative value and validate - propPane.UpdatePropertyFieldValue("Min. value", "-10"); - propPane.UpdatePropertyFieldValue("Step size", "10"); + // Verify in Deploy mode negative value + deployMode.DeployApp(); + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{leftArrow}{leftArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") + .then(($label) => { + expect($label).to.eq("-10"); + }); + deployMode.NavigateBacktoEditor(); - // Verify in Preview mode negative value - agHelper.GetNClick(locators._enterPreviewMode); - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{leftArrow}") - .type("{leftArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") - .then(($label) => { - expect($label).to.eq("-10"); - }); - agHelper.GetNClick(locators._exitPreviewMode); - - // Verify in Deploy mode negative value - deployMode.DeployApp(); - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{leftArrow}{leftArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") - .then(($label) => { - expect($label).to.eq("-10"); - }); - deployMode.NavigateBacktoEditor(); - - // Allows decimal value - EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Min. value", "10.5"); - - // Verify Decimal value - agHelper.GetElement(locators._sliderThumb).focus().type("{leftArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") - .then(($label) => { - expect($label).to.eq("10.5"); - }); - }); + // Allows decimal value + EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Min. value", "10.5"); - it("3. Validate accepted and unaccepted 'Max. value' values", () => { - propPane.UpdatePropertyFieldValue("Max. value", "0"); + // Verify Decimal value + agHelper.GetElement(locators._sliderThumb).focus().type("{leftArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") + .then(($label) => { + expect($label).to.eq("10.5"); + }); + }); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be greater than min value", - ); + it("3. Validate accepted and unaccepted 'Max. value' values", () => { + propPane.UpdatePropertyFieldValue("Max. value", "0"); - propPane.UpdatePropertyFieldValue("Max. value", ""); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than min value", + ); - agHelper.VerifyEvaluatedErrorMessage("This value is required"); + propPane.UpdatePropertyFieldValue("Max. value", ""); - propPane.UpdatePropertyFieldValue("Max. value", "asd"); + agHelper.VerifyEvaluatedErrorMessage("This value is required"); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + propPane.UpdatePropertyFieldValue("Max. value", "asd"); - // Allows decimal value - propPane.UpdatePropertyFieldValue("Max. value", "100.5"); - propPane.UpdatePropertyFieldValue("Step size", "90"); - // Verify decimal value - agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") - .then(($label) => { - expect($label).to.eq("100.5"); - }); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - // Accepts negative value - propPane.UpdatePropertyFieldValue("Min. value", "-50"); - propPane.UpdatePropertyFieldValue("Max. value", "-30"); + // Allows decimal value + propPane.UpdatePropertyFieldValue("Max. value", "100.5"); + propPane.UpdatePropertyFieldValue("Step size", "90"); + // Verify decimal value + agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") + .then(($label) => { + expect($label).to.eq("100.5"); + }); - agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") - .then(($label) => { - expect($label).to.eq("-30"); - }); + // Accepts negative value + propPane.UpdatePropertyFieldValue("Min. value", "-50"); + propPane.UpdatePropertyFieldValue("Max. value", "-30"); - // Verify in Preview mode negative value - agHelper.GetNClick(locators._enterPreviewMode); - agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") - .then(($label) => { - expect($label).to.eq("-30"); - }); - agHelper.GetNClick(locators._exitPreviewMode); - - // Verify in Deploy mode negative value - deployMode.DeployApp(); - agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) - .then(($label) => { - expect($label).to.eq("-30"); - }); - deployMode.NavigateBacktoEditor(); - }); + agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") + .then(($label) => { + expect($label).to.eq("-30"); + }); - it("4. Validate accepted and unaccepted 'Step Value' values", () => { - EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); + // Verify in Preview mode negative value + agHelper.GetNClick(locators._enterPreviewMode); + agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text") + .then(($label) => { + expect($label).to.eq("-30"); + }); + agHelper.GetNClick(locators._exitPreviewMode); - propPane.UpdatePropertyFieldValue("Step size", "-10"); + // Verify in Deploy mode negative value + deployMode.DeployApp(); + agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) + .then(($label) => { + expect($label).to.eq("-30"); + }); + deployMode.NavigateBacktoEditor(); + }); - agHelper.VerifyEvaluatedErrorMessage("This value must be greater than 0.1"); + it("4. Validate accepted and unaccepted 'Step Value' values", () => { + EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Step size", "110"); + propPane.UpdatePropertyFieldValue("Step size", "-10"); - agHelper.VerifyEvaluatedErrorMessage("This value must be less than 20"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than 0.1", + ); - propPane.UpdatePropertyFieldValue("Step size", "asd"); + propPane.UpdatePropertyFieldValue("Step size", "110"); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + agHelper.VerifyEvaluatedErrorMessage("This value must be less than 20"); - propPane.UpdatePropertyFieldValue("Step size", "10"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - }); + propPane.UpdatePropertyFieldValue("Step size", "asd"); - it("5. Validates accepted and unaccepted 'Default Value' values", () => { - propPane.UpdatePropertyFieldValue("Max. value", "100"); - propPane.UpdatePropertyFieldValue("Min. value", "10"); - propPane.UpdatePropertyFieldValue("Default value", "-10"); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be greater than or equal to the min value", - ); + propPane.UpdatePropertyFieldValue("Step size", "10"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + }); - propPane.UpdatePropertyFieldValue("Default value", "110"); + it("5. Validates accepted and unaccepted 'Default Value' values", () => { + propPane.UpdatePropertyFieldValue("Max. value", "100"); + propPane.UpdatePropertyFieldValue("Min. value", "10"); + propPane.UpdatePropertyFieldValue("Default value", "-10"); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be less than or equal to the max value", - ); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than or equal to the min value", + ); - propPane.UpdatePropertyFieldValue("Default value", "asd"); + propPane.UpdatePropertyFieldValue("Default value", "110"); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be less than or equal to the max value", + ); - propPane.UpdatePropertyFieldValue("Default value", "10"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - }); + propPane.UpdatePropertyFieldValue("Default value", "asd"); - it("6. Change Step size and check if value changes", () => { - // Assert Text widget has value 10 - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("10"); - }); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - // Change the slider value - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{rightArrow}") - .wait(500); + propPane.UpdatePropertyFieldValue("Default value", "10"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + }); - agHelper.Sleep(2000); //for the changes to reflect in text widget + it("6. Change Step size and check if value changes", () => { + // Assert Text widget has value 10 + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("10"); + }); - // Assert the Text widget has value 20 - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("20"); - }); + // Change the slider value + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{rightArrow}") + .wait(500); - // Change the slider value - agHelper.GetElement(locators._sliderThumb).focus().type("{leftArrow}"); + agHelper.Sleep(2000); //for the changes to reflect in text widget - agHelper.Sleep(2000); //for the changes to reflect in text widget - // Assert the Text widget has value 0 - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("10"); - }); - }); - - it("7. Verify Range slider visibility in explorer", () => { - PageLeftPane.switchSegment(PagePaneSegment.UI); - PageLeftPane.switchToAddNew(); - agHelper.ClearTextField(locators._entityExplorersearch); - agHelper.TypeText(locators._entityExplorersearch, "Number"); - agHelper.AssertElementExist(locators._widgetPageIcon("numbersliderwidget")); - agHelper.ClearTextField(locators._entityExplorersearch); - agHelper.TypeText(locators._entityExplorersearch, "slider"); - agHelper.AssertElementExist(locators._widgetPageIcon("numbersliderwidget")); - }); - - it("8. Validate 'show marks', 'visible' and 'disable' toggle", () => { - EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); - - // Verify Show marks toggle - agHelper.AssertContains("50%", "be.visible", "p"); - propPane.TogglePropertyState("showmarks", "Off"); - agHelper.AssertContains("50%", "not.exist", "p"); - // Verify Disabled toggle - propPane.TogglePropertyState("disabled", "On"); - agHelper.AssertAttribute(locators._sliderThumb, "disabled", "disabled"); - propPane.TogglePropertyState("disabled", "Off"); - // Verify Visible toggle - propPane.TogglePropertyState("visible", "Off"); - agHelper.AssertExistingToggleState("visible", "false"); - propPane.TogglePropertyState("visible", "On"); - agHelper.AssertExistingToggleState("visible", "true"); - }); - - it("9. Validate Events section onChange tests", () => { - // Verify Events onChange - propPane.SelectPlatformFunction("onChange", "Show alert"); - agHelper.TypeText( - propPane._actionSelectorFieldByLabel("Message"), - "Value Changed", - ); - agHelper.GetNClick(propPane._actionSelectorPopupClose); - // Change the slider value - agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); - agHelper.ValidateToastMessage("Value Changed"); - - // Verify in Preview mode - agHelper.GetNClick(locators._enterPreviewMode); - agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); - agHelper.ValidateToastMessage("Value Changed"); - agHelper.GetNClick(locators._exitPreviewMode); - - // Verifying onChange in Deploy mode - deployMode.DeployApp(); - agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); - agHelper.ValidateToastMessage("Value Changed"); - deployMode.NavigateBacktoEditor(); - }); - - it("10. Verify size change and color change", () => { - EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); - propPane.MoveToTab("Style"); - // Verify Size - agHelper.GetWidgetCSSHeight(locators._sliderThumb).then((initialHeight) => { - agHelper.GetNClick(propPane._styleSize("s")); + // Assert the Text widget has value 20 + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("20"); + }); + + // Change the slider value + agHelper.GetElement(locators._sliderThumb).focus().type("{leftArrow}"); + + agHelper.Sleep(2000); //for the changes to reflect in text widget + // Assert the Text widget has value 0 + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("10"); + }); + }); + + it("7. Verify Range slider visibility in explorer", () => { + PageLeftPane.switchSegment(PagePaneSegment.UI); + PageLeftPane.switchToAddNew(); + agHelper.ClearTextField(locators._entityExplorersearch); + agHelper.TypeText(locators._entityExplorersearch, "Number"); + agHelper.AssertElementExist( + locators._widgetPageIcon("numbersliderwidget"), + ); + agHelper.ClearTextField(locators._entityExplorersearch); + agHelper.TypeText(locators._entityExplorersearch, "slider"); + agHelper.AssertElementExist( + locators._widgetPageIcon("numbersliderwidget"), + ); + }); + + it("8. Validate 'show marks', 'visible' and 'disable' toggle", () => { + EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); + + // Verify Show marks toggle + agHelper.AssertContains("50%", "be.visible", "p"); + propPane.TogglePropertyState("showmarks", "Off"); + agHelper.AssertContains("50%", "not.exist", "p"); + // Verify Disabled toggle + propPane.TogglePropertyState("disabled", "On"); + agHelper.AssertAttribute(locators._sliderThumb, "disabled", "disabled"); + propPane.TogglePropertyState("disabled", "Off"); + // Verify Visible toggle + propPane.TogglePropertyState("visible", "Off"); + agHelper.AssertExistingToggleState("visible", "false"); + propPane.TogglePropertyState("visible", "On"); + agHelper.AssertExistingToggleState("visible", "true"); + }); + + it("9. Validate Events section onChange tests", () => { + // Verify Events onChange + propPane.SelectPlatformFunction("onChange", "Show alert"); + agHelper.TypeText( + propPane._actionSelectorFieldByLabel("Message"), + "Value Changed", + ); + agHelper.GetNClick(propPane._actionSelectorPopupClose); + // Change the slider value + agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); + agHelper.ValidateToastMessage("Value Changed"); + + // Verify in Preview mode + agHelper.GetNClick(locators._enterPreviewMode); + agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); + agHelper.ValidateToastMessage("Value Changed"); + agHelper.GetNClick(locators._exitPreviewMode); + + // Verifying onChange in Deploy mode + deployMode.DeployApp(); + agHelper.GetElement(locators._sliderThumb).focus().type("{rightArrow}"); + agHelper.ValidateToastMessage("Value Changed"); + deployMode.NavigateBacktoEditor(); + }); + + it("10. Verify size change and color change", () => { + EditorNavigation.SelectEntityByName("NumberSlider1", EntityType.Widget); + propPane.MoveToTab("Style"); + // Verify Size agHelper .GetWidgetCSSHeight(locators._sliderThumb) - .then((currentHeight) => { - expect(initialHeight).to.not.eq(currentHeight); + .then((initialHeight) => { + agHelper.GetNClick(propPane._styleSize("s")); + agHelper + .GetWidgetCSSHeight(locators._sliderThumb) + .then((currentHeight) => { + expect(initialHeight).to.not.eq(currentHeight); + }); + }); + + // Verify Color + agHelper + .GetWidgetCSSFrAttribute(locators._sliderThumb, "background-color") + .then((sliderColor) => { + agHelper.GetNClick( + propPane._propertyPanePropertyControl("color", "fillcolor"), + ); + agHelper + .GetWidgetCSSFrAttribute(propPane._themeColor, "background-color") + .then((themeColor) => { + expect(sliderColor).to.eq(themeColor); + }); + }); + + // Select color and verify + propPane.SelectColorFromColorPicker("fillcolor", 10); + agHelper + .GetWidgetCSSFrAttribute(locators._sliderThumb, "background-color") + .then((sliderColor) => { + agHelper + .GetWidgetCSSFrAttribute( + `${propPane._propertyControlSelectedColorButton("fillcolor")}`, + "background-color", + ) + .then((newColor) => { + expect(sliderColor).to.eq(newColor); + }); }); }); - // Verify Color - agHelper - .GetWidgetCSSFrAttribute(locators._sliderThumb, "background-color") - .then((sliderColor) => { - agHelper.GetNClick( - propPane._propertyPanePropertyControl("color", "fillcolor"), - ); - agHelper - .GetWidgetCSSFrAttribute(propPane._themeColor, "background-color") - .then((themeColor) => { - expect(sliderColor).to.eq(themeColor); - }); - }); + it("11. Verify Slider value change using left, right, up and down arrows", () => { + // Verify in Preview mode + // Verify slides right with right and up arrow + agHelper.GetNClick(locators._enterPreviewMode); + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{rightArrow}") + .type("{upArrow}"); - // Select color and verify - propPane.SelectColorFromColorPicker("fillcolor", 10); - agHelper - .GetWidgetCSSFrAttribute(locators._sliderThumb, "background-color") - .then((sliderColor) => { - agHelper - .GetWidgetCSSFrAttribute( - `${propPane._propertyControlSelectedColorButton("fillcolor")}`, - "background-color", - ) - .then((newColor) => { - expect(sliderColor).to.eq(newColor); - }); - }); - }); - - it("11. Verify Slider value change using left, right, up and down arrows", () => { - // Verify in Preview mode - // Verify slides right with right and up arrow - agHelper.GetNClick(locators._enterPreviewMode); - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{rightArrow}") - .type("{upArrow}"); - - agHelper.Sleep(200); - - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("30"); - }); + agHelper.Sleep(200); - // Verify slides left with left and down arrow - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{leftArrow}") - .type("{downArrow}"); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("30"); + }); - agHelper.Sleep(200); + // Verify slides left with left and down arrow + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{leftArrow}") + .type("{downArrow}"); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("10"); - }); + agHelper.Sleep(200); - agHelper.GetNClick(locators._exitPreviewMode); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("10"); + }); - //Verify in Deploy mode - deployMode.DeployApp(); + agHelper.GetNClick(locators._exitPreviewMode); - // Verify slides right with right and up arrow - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{rightArrow}") - .type("{upArrow}"); + //Verify in Deploy mode + deployMode.DeployApp(); - agHelper.Sleep(); + // Verify slides right with right and up arrow + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{rightArrow}") + .type("{upArrow}"); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("30"); - }); + agHelper.Sleep(); - // Verify slides left with left and down arrow - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{leftArrow}") - .type("{downArrow}"); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("30"); + }); - agHelper.Sleep(1000); + // Verify slides left with left and down arrow + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{leftArrow}") + .type("{downArrow}"); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("10"); - }); + agHelper.Sleep(1000); - deployMode.NavigateBacktoEditor(); - }); - - it("12. Verify various modes", () => { - // Verify in Preview mode - // Verify slides right with right and up arrow - agHelper.GetNClick(locators._enterPreviewMode); - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{rightArrow}") - .type("{upArrow}"); - - agHelper.Sleep(1000); - - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("30"); - }); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("10"); + }); - // Verify slides left with left and down arrow - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{leftArrow}") - .type("{downArrow}"); + deployMode.NavigateBacktoEditor(); + }); - agHelper.Sleep(1000); + it("12. Verify various modes", () => { + // Verify in Preview mode + // Verify slides right with right and up arrow + agHelper.GetNClick(locators._enterPreviewMode); + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{rightArrow}") + .type("{upArrow}"); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("10"); - }); + agHelper.Sleep(1000); + + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("30"); + }); - agHelper.GetNClick(locators._exitPreviewMode); + // Verify slides left with left and down arrow + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{leftArrow}") + .type("{downArrow}"); - // Verify in Deploy mode - deployMode.DeployApp(); + agHelper.Sleep(1000); - // Verify slides right with right and up arrow - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{rightArrow}") - .type("{upArrow}"); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("10"); + }); - agHelper.Sleep(1000); + agHelper.GetNClick(locators._exitPreviewMode); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("30"); - }); + // Verify in Deploy mode + deployMode.DeployApp(); - // Verify slides left with left and down arrow - agHelper - .GetElement(locators._sliderThumb) - .focus() - .type("{leftArrow}") - .type("{downArrow}"); + // Verify slides right with right and up arrow + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{rightArrow}") + .type("{upArrow}"); - agHelper.Sleep(1000); + agHelper.Sleep(1000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT)) - .then(($label) => { - expect($label).to.eq("10"); - }); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("30"); + }); - deployMode.NavigateBacktoEditor(); - }); -}); + // Verify slides left with left and down arrow + agHelper + .GetElement(locators._sliderThumb) + .focus() + .type("{leftArrow}") + .type("{downArrow}"); + + agHelper.Sleep(1000); + + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT)) + .then(($label) => { + expect($label).to.eq("10"); + }); + + deployMode.NavigateBacktoEditor(); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/RangeSlider_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/RangeSlider_spec.ts index 9e91e87030f..25353e17e6d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/RangeSlider_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Sliders/RangeSlider_spec.ts @@ -13,416 +13,438 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../../support/Pages/EditorNavigation"; -describe("Range Slider spec", { tags: ["@tag.Widget", "@tag.Slider"] }, () => { - before(() => { - entityExplorer.DragDropWidgetNVerify("rangesliderwidget", 550, 100); - entityExplorer.DragDropWidgetNVerify("textwidget", 300, 300); - entityExplorer.DragDropWidgetNVerify("textwidget", 600, 300); - EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Text", "{{RangeSlider1.end}}"); - EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Text", "{{RangeSlider1.start}}"); - }); - - it("1. Verify property visibility and default values", () => { - const dataSectionProperties = [ - "min\\.value", - "max\\.value", - "stepsize", - "min\\.range", - "defaultstartvalue", - "defaultendvalue", - ]; - const generalProperties = [ - "showmarks", - "marks", - "visible", - "disabled", - "animateloading", - "showvaluealways", - ]; - const eventsProperties = ["onstartvaluechange", "onendvaluechange"]; - - EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); - // Data Section properties - dataSectionProperties.forEach((dataSectionProperty) => { - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("data", `${dataSectionProperty}`), - ); - }); - // General Section Properties - generalProperties.forEach((generalProperty) => { - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("general", `${generalProperty}`), - ); - }); - // Events Section properties - eventsProperties.forEach((eventsProperty) => { - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("events", `${eventsProperty}`), - ); +describe( + "Range Slider spec", + { tags: ["@tag.Widget", "@tag.Slider", "@tag.Binding"] }, + () => { + before(() => { + entityExplorer.DragDropWidgetNVerify("rangesliderwidget", 550, 100); + entityExplorer.DragDropWidgetNVerify("textwidget", 300, 300); + entityExplorer.DragDropWidgetNVerify("textwidget", 600, 300); + EditorNavigation.SelectEntityByName("Text1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Text", "{{RangeSlider1.end}}"); + EditorNavigation.SelectEntityByName("Text2", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Text", "{{RangeSlider1.start}}"); }); - // Style Section properties - propPane.MoveToTab("Style"); - propPane._propertyControl("size"); - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl("color", "fillcolor"), - ); - - propPane.MoveToTab("Content"); - // Verify default value - propPane - .EvaluateExistingPropertyFieldValue("Min. value") - .then((val: any) => { - expect(val).to.eq("0"); - }); - propPane - .EvaluateExistingPropertyFieldValue("Max. value") - .then((val: any) => { - expect(val).to.eq("100"); - }); - propPane - .EvaluateExistingPropertyFieldValue("Step size") - .then((val: any) => { - expect(val).to.eq("1"); - }); - propPane - .EvaluateExistingPropertyFieldValue("Min. range") - .then((val: any) => { - expect(val).to.eq("5"); - }); - }); - - it("2. Validate accepted and unaccepted 'Min. value' values", () => { - propPane.UpdatePropertyFieldValue("Min. value", "110"); - - agHelper.VerifyEvaluatedErrorMessage( - "This value must be less than max value", - ); - - propPane.UpdatePropertyFieldValue("Min. value", ""); - - agHelper.VerifyEvaluatedErrorMessage("This value is required"); - - propPane.UpdatePropertyFieldValue("Min. value", "zero"); - - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - - propPane.UpdatePropertyFieldValue("Min. range", "10"); - propPane.UpdatePropertyFieldValue("Step size", "10"); - propPane.UpdatePropertyFieldValue("Min. value", "-10"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - - // Verify in Preview mode negative value - agHelper.GetNClick(locators._enterPreviewMode); - agHelper - .GetElement(locators._sliderThumb) - .eq(0) - .focus() - .type("{leftArrow}") - .type("{leftArrow}") - .type("{leftArrow}"); - agHelper.Sleep(3000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) - .then(($label) => { - expect($label).to.eq("-10"); - }); - agHelper.GetNClick(locators._exitPreviewMode); - - // Verify in Deploy mode negative value - deployMode.DeployApp(); - agHelper - .GetElement(locators._sliderThumb) - .eq(0) - .focus() - .type("{leftArrow}") - .type("{leftArrow}"); - agHelper.Sleep(3000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) - .then(($label) => { - expect($label).to.eq("-10"); + + it("1. Verify property visibility and default values", () => { + const dataSectionProperties = [ + "min\\.value", + "max\\.value", + "stepsize", + "min\\.range", + "defaultstartvalue", + "defaultendvalue", + ]; + const generalProperties = [ + "showmarks", + "marks", + "visible", + "disabled", + "animateloading", + "showvaluealways", + ]; + const eventsProperties = ["onstartvaluechange", "onendvaluechange"]; + + EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); + // Data Section properties + dataSectionProperties.forEach((dataSectionProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl( + "data", + `${dataSectionProperty}`, + ), + ); }); - deployMode.NavigateBacktoEditor(); - - // Allows decimal value - EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Min. value", "10.5"); - - // Verify Decimal value - agHelper - .GetElement(locators._sliderThumb) - .eq(0) - .focus() - .type("{leftArrow}"); - agHelper.Sleep(3000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) - .then(($label) => { - expect($label).to.eq("10.5"); + // General Section Properties + generalProperties.forEach((generalProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl( + "general", + `${generalProperty}`, + ), + ); }); - // Does not allow value greater than Max value - propPane.UpdatePropertyFieldValue("Min. value", "110"); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be less than max value", - ); - // Updating to allowed value - propPane.UpdatePropertyFieldValue("Min. value", "10"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - }); - - it("3. Validate accepted and unaccepted 'Max. value' values", () => { - propPane.UpdatePropertyFieldValue("Max. value", "0"); - - agHelper.VerifyEvaluatedErrorMessage( - "This value must be greater than min value", - ); - - propPane.UpdatePropertyFieldValue("Max. value", ""); - - agHelper.VerifyEvaluatedErrorMessage("This value is required"); - - propPane.UpdatePropertyFieldValue("Max. value", "asd"); - - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - - // Allows decimal value - propPane.UpdatePropertyFieldValue("Max. value", "100.5"); - // Updating step size to verify Max value - propPane.UpdatePropertyFieldValue("Step size", "90"); - // Verify decimal value - agHelper - .GetElement(locators._sliderThumb) - .eq(1) - .focus() - .type("{rightArrow}"); - agHelper.Sleep(3000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) - .then(($label) => { - expect($label).to.eq("100.5"); + // Events Section properties + eventsProperties.forEach((eventsProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl("events", `${eventsProperty}`), + ); }); + // Style Section properties + propPane.MoveToTab("Style"); + propPane._propertyControl("size"); + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl("color", "fillcolor"), + ); - // Does not allow value less than min value - propPane.UpdatePropertyFieldValue("Max. value", "-20"); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be greater than min value", - ); - - // Accepts negative value - propPane.UpdatePropertyFieldValue("Min. value", "-50"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - propPane.UpdatePropertyFieldValue("Max. value", "-30"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - - agHelper - .GetElement(locators._sliderThumb) - .eq(1) - .focus() - .type("{rightArrow}{rightArrow}{rightArrow}"); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) - .then(($label) => { - expect($label).to.eq("-30"); - }); + propPane.MoveToTab("Content"); + // Verify default value + propPane + .EvaluateExistingPropertyFieldValue("Min. value") + .then((val: any) => { + expect(val).to.eq("0"); + }); + propPane + .EvaluateExistingPropertyFieldValue("Max. value") + .then((val: any) => { + expect(val).to.eq("100"); + }); + propPane + .EvaluateExistingPropertyFieldValue("Step size") + .then((val: any) => { + expect(val).to.eq("1"); + }); + propPane + .EvaluateExistingPropertyFieldValue("Min. range") + .then((val: any) => { + expect(val).to.eq("5"); + }); + }); - // Verify in Preview mode negative value - agHelper.GetNClick(locators._enterPreviewMode); - agHelper - .GetElement(locators._sliderThumb) - .eq(1) - .focus() - .type("{rightArrow}"); - agHelper.Sleep(2000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) - .then(($label) => { - expect($label).to.eq("-30"); - }); - agHelper.GetNClick(locators._exitPreviewMode); - - // Verify in Deploy mode negative value - deployMode.DeployApp(); - agHelper - .GetElement(locators._sliderThumb) - .eq(1) - .focus() - .type("{rightArrow}"); - agHelper.Sleep(3000); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) - .then(($label) => { - expect($label).to.eq("-30"); - }); - deployMode.NavigateBacktoEditor(); - }); + it("2. Validate accepted and unaccepted 'Min. value' values", () => { + propPane.UpdatePropertyFieldValue("Min. value", "110"); + + agHelper.VerifyEvaluatedErrorMessage( + "This value must be less than max value", + ); - it("4. Validate accepted and unaccepted 'Step size' values", () => { - EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Min. range", "5"); - propPane.UpdatePropertyFieldValue("Step size", "10"); + propPane.UpdatePropertyFieldValue("Min. value", ""); + + agHelper.VerifyEvaluatedErrorMessage("This value is required"); + + propPane.UpdatePropertyFieldValue("Min. value", "zero"); + + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + + propPane.UpdatePropertyFieldValue("Min. range", "10"); + propPane.UpdatePropertyFieldValue("Step size", "10"); + propPane.UpdatePropertyFieldValue("Min. value", "-10"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + + // Verify in Preview mode negative value + agHelper.GetNClick(locators._enterPreviewMode); + agHelper + .GetElement(locators._sliderThumb) + .eq(0) + .focus() + .type("{leftArrow}") + .type("{leftArrow}") + .type("{leftArrow}"); + agHelper.Sleep(3000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) + .then(($label) => { + expect($label).to.eq("-10"); + }); + agHelper.GetNClick(locators._exitPreviewMode); + + // Verify in Deploy mode negative value + deployMode.DeployApp(); + agHelper + .GetElement(locators._sliderThumb) + .eq(0) + .focus() + .type("{leftArrow}") + .type("{leftArrow}"); + agHelper.Sleep(3000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) + .then(($label) => { + expect($label).to.eq("-10"); + }); + deployMode.NavigateBacktoEditor(); + + // Allows decimal value + EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Min. value", "10.5"); + + // Verify Decimal value + agHelper + .GetElement(locators._sliderThumb) + .eq(0) + .focus() + .type("{leftArrow}"); + agHelper.Sleep(3000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) + .then(($label) => { + expect($label).to.eq("10.5"); + }); + // Does not allow value greater than Max value + propPane.UpdatePropertyFieldValue("Min. value", "110"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be less than max value", + ); + // Updating to allowed value + propPane.UpdatePropertyFieldValue("Min. value", "10"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + }); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be less than or equal to minRange", - ); + it("3. Validate accepted and unaccepted 'Max. value' values", () => { + propPane.UpdatePropertyFieldValue("Max. value", "0"); - propPane.UpdatePropertyFieldValue("Step size", ""); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than min value", + ); - agHelper.VerifyEvaluatedErrorMessage("This value is required"); + propPane.UpdatePropertyFieldValue("Max. value", ""); + + agHelper.VerifyEvaluatedErrorMessage("This value is required"); + + propPane.UpdatePropertyFieldValue("Max. value", "asd"); + + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + + // Allows decimal value + propPane.UpdatePropertyFieldValue("Max. value", "100.5"); + // Updating step size to verify Max value + propPane.UpdatePropertyFieldValue("Step size", "90"); + // Verify decimal value + agHelper + .GetElement(locators._sliderThumb) + .eq(1) + .focus() + .type("{rightArrow}"); + agHelper.Sleep(3000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) + .then(($label) => { + expect($label).to.eq("100.5"); + }); + + // Does not allow value less than min value + propPane.UpdatePropertyFieldValue("Max. value", "-20"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than min value", + ); - propPane.UpdatePropertyFieldValue("Step size", "asd"); + // Accepts negative value + propPane.UpdatePropertyFieldValue("Min. value", "-50"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + propPane.UpdatePropertyFieldValue("Max. value", "-30"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + + agHelper + .GetElement(locators._sliderThumb) + .eq(1) + .focus() + .type("{rightArrow}{rightArrow}{rightArrow}"); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) + .then(($label) => { + expect($label).to.eq("-30"); + }); + + // Verify in Preview mode negative value + agHelper.GetNClick(locators._enterPreviewMode); + agHelper + .GetElement(locators._sliderThumb) + .eq(1) + .focus() + .type("{rightArrow}"); + agHelper.Sleep(2000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) + .then(($label) => { + expect($label).to.eq("-30"); + }); + agHelper.GetNClick(locators._exitPreviewMode); + + // Verify in Deploy mode negative value + deployMode.DeployApp(); + agHelper + .GetElement(locators._sliderThumb) + .eq(1) + .focus() + .type("{rightArrow}"); + agHelper.Sleep(3000); + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) + .then(($label) => { + expect($label).to.eq("-30"); + }); + deployMode.NavigateBacktoEditor(); + }); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + it("4. Validate accepted and unaccepted 'Step size' values", () => { + EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Min. range", "5"); + propPane.UpdatePropertyFieldValue("Step size", "10"); - // Does not allow value less than 0.1 - EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); - propPane.UpdatePropertyFieldValue("Step size", "0"); - agHelper.VerifyEvaluatedErrorMessage("This value must be greater than 0.1"); - // Does not allow negative value - propPane.UpdatePropertyFieldValue("Step size", "-10"); - agHelper.VerifyEvaluatedErrorMessage("This value must be greater than 0.1"); - propPane.UpdatePropertyFieldValue("Step size", "5"); - // Does not allow value greater than max value - propPane.UpdatePropertyFieldValue("Max. value", "100"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - propPane.UpdatePropertyFieldValue("Min. value", "10"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - propPane.UpdatePropertyFieldValue("Step size", "110"); - agHelper.VerifyEvaluatedErrorMessage("This value must be less than 90"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be less than or equal to minRange", + ); - // Updating to allowed value - propPane.UpdatePropertyFieldValue("Step size", "5"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - }); + propPane.UpdatePropertyFieldValue("Step size", ""); - it("5. Validate accepted and unaccepted 'Min Range' values", () => { - propPane.UpdatePropertyFieldValue("Min. range", "0"); + agHelper.VerifyEvaluatedErrorMessage("This value is required"); - agHelper.VerifyEvaluatedErrorMessage("This value must be greater than 0.1"); + propPane.UpdatePropertyFieldValue("Step size", "asd"); - propPane.UpdatePropertyFieldValue("Min. range", "-10"); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - agHelper.VerifyEvaluatedErrorMessage("This value must be greater than 0.1"); + // Does not allow value less than 0.1 + EditorNavigation.SelectEntityByName("RangeSlider1", EntityType.Widget); + propPane.UpdatePropertyFieldValue("Step size", "0"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than 0.1", + ); + // Does not allow negative value + propPane.UpdatePropertyFieldValue("Step size", "-10"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than 0.1", + ); + propPane.UpdatePropertyFieldValue("Step size", "5"); + // Does not allow value greater than max value + propPane.UpdatePropertyFieldValue("Max. value", "100"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + propPane.UpdatePropertyFieldValue("Min. value", "10"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + propPane.UpdatePropertyFieldValue("Step size", "110"); + agHelper.VerifyEvaluatedErrorMessage("This value must be less than 90"); + + // Updating to allowed value + propPane.UpdatePropertyFieldValue("Step size", "5"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + }); - propPane.UpdatePropertyFieldValue("Min. range", "asd"); + it("5. Validate accepted and unaccepted 'Min Range' values", () => { + propPane.UpdatePropertyFieldValue("Min. range", "0"); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than 0.1", + ); - propPane.UpdatePropertyFieldValue("Min. range", "110"); + propPane.UpdatePropertyFieldValue("Min. range", "-10"); - agHelper.VerifyEvaluatedErrorMessage("This value must be less than 90"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than 0.1", + ); - // Does not accept value less than step size - propPane.UpdatePropertyFieldValue("Min. range", "2"); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be greater than or equal to step size", - ); + propPane.UpdatePropertyFieldValue("Min. range", "asd"); - // Updating to allowed value - propPane.UpdatePropertyFieldValue("Min. range", "5"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - }); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - it("6. Validate accepted and unaccepted 'Default start' value", () => { - propPane.UpdatePropertyFieldValue("Default start value", "-100"); + propPane.UpdatePropertyFieldValue("Min. range", "110"); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be greater than or equal to the min value", - ); + agHelper.VerifyEvaluatedErrorMessage("This value must be less than 90"); - propPane.UpdatePropertyFieldValue("Default end value", "100"); - propPane.UpdatePropertyFieldValue("Default start value", "110"); + // Does not accept value less than step size + propPane.UpdatePropertyFieldValue("Min. range", "2"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than or equal to step size", + ); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be less than defaultEnd value", - ); + // Updating to allowed value + propPane.UpdatePropertyFieldValue("Min. range", "5"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + }); - propPane.UpdatePropertyFieldValue("Default start value", "asd"); + it("6. Validate accepted and unaccepted 'Default start' value", () => { + propPane.UpdatePropertyFieldValue("Default start value", "-100"); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than or equal to the min value", + ); - propPane.UpdatePropertyFieldValue("Default start value", "10"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + propPane.UpdatePropertyFieldValue("Default end value", "100"); + propPane.UpdatePropertyFieldValue("Default start value", "110"); - //Validate accepted and unaccepted 'Default end' value - propPane.UpdatePropertyFieldValue("Default end value", "-10"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be less than defaultEnd value", + ); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be greater than defaultStart value", - ); + propPane.UpdatePropertyFieldValue("Default start value", "asd"); - propPane.UpdatePropertyFieldValue("Default end value", "110"); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - agHelper.VerifyEvaluatedErrorMessage( - "This value must be less than or equal to the max value", - ); + propPane.UpdatePropertyFieldValue("Default start value", "10"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - propPane.UpdatePropertyFieldValue("Default end value", "asd"); + //Validate accepted and unaccepted 'Default end' value + propPane.UpdatePropertyFieldValue("Default end value", "-10"); - agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be greater than defaultStart value", + ); - propPane.UpdatePropertyFieldValue("Default end value", "100"); - agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); - }); + propPane.UpdatePropertyFieldValue("Default end value", "110"); - it("7. Change Step size and check if binding value changes", () => { - // Assert Text widget has value 10 - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) - .then(($label) => { - expect($label).to.eq("10"); - }); + agHelper.VerifyEvaluatedErrorMessage( + "This value must be less than or equal to the max value", + ); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) - .then(($label) => { - expect($label).to.eq("100"); - }); + propPane.UpdatePropertyFieldValue("Default end value", "asd"); - // Change the Step size to 10 - propPane.UpdatePropertyFieldValue("Min. range", "10", true, false); - propPane.UpdatePropertyFieldValue("Step size", "10", true, false); - - agHelper - .GetElement(locators._sliderThumb) - .eq(0) - .focus() - .type("{rightArrow}") - .wait(2000); - - // Assert the Text widget has value 20 - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) - .then(($label) => { - expect($label).to.eq("20"); - }); + agHelper.VerifyEvaluatedErrorMessage("This value must be a number"); - // Change the slider value - agHelper - .GetElement(locators._sliderThumb) - .eq(1) - .focus() - .type("{leftArrow}") - .type("{leftArrow}"); + propPane.UpdatePropertyFieldValue("Default end value", "100"); + agHelper.AssertElementAbsence(locators._evaluatedErrorMessage); + }); - agHelper.Sleep(2000); + it("7. Change Step size and check if binding value changes", () => { + // Assert Text widget has value 10 + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) + .then(($label) => { + expect($label).to.eq("10"); + }); + + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) + .then(($label) => { + expect($label).to.eq("100"); + }); + + // Change the Step size to 10 + propPane.UpdatePropertyFieldValue("Min. range", "10", true, false); + propPane.UpdatePropertyFieldValue("Step size", "10", true, false); + + agHelper + .GetElement(locators._sliderThumb) + .eq(0) + .focus() + .type("{rightArrow}") + .wait(2000); + + // Assert the Text widget has value 20 + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 1) + .then(($label) => { + expect($label).to.eq("20"); + }); + + // Change the slider value + agHelper + .GetElement(locators._sliderThumb) + .eq(1) + .focus() + .type("{leftArrow}") + .type("{leftArrow}"); + + agHelper.Sleep(2000); + + agHelper + .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) + .then(($label) => { + expect($label).to.eq("80"); + }); + }); - agHelper - .GetText(getWidgetSelector(draggableWidgets.TEXT), "text", 0) - .then(($label) => { - expect($label).to.eq("80"); - }); - }); - - it("8. Verify Range slider visibility in explorer", () => { - PageLeftPane.switchSegment(PagePaneSegment.UI); - PageLeftPane.switchToAddNew(); - agHelper.ClearTextField(locators._entityExplorersearch); - agHelper.TypeText(locators._entityExplorersearch, "Range"); - agHelper.AssertElementExist(locators._widgetPageIcon("rangesliderwidget")); - agHelper.ClearTextField(locators._entityExplorersearch); - agHelper.TypeText(locators._entityExplorersearch, "slider"); - agHelper.AssertElementExist(locators._widgetPageIcon("rangesliderwidget")); - }); -}); + it("8. Verify Range slider visibility in explorer", () => { + PageLeftPane.switchSegment(PagePaneSegment.UI); + PageLeftPane.switchToAddNew(); + agHelper.ClearTextField(locators._entityExplorersearch); + agHelper.TypeText(locators._entityExplorersearch, "Range"); + agHelper.AssertElementExist( + locators._widgetPageIcon("rangesliderwidget"), + ); + agHelper.ClearTextField(locators._entityExplorersearch); + agHelper.TypeText(locators._entityExplorersearch, "slider"); + agHelper.AssertElementExist( + locators._widgetPageIcon("rangesliderwidget"), + ); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Statbox/Statbox_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Statbox/Statbox_spec.ts index 03046026784..29b2902542b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Statbox/Statbox_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Statbox/Statbox_spec.ts @@ -12,140 +12,148 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../../support/Pages/EditorNavigation"; -describe("Statbox spec", { tags: ["@tag.Widget", "@tag.Statbox"] }, () => { - before(() => { - /** - * On the canvas we have a Statbox Widget - */ - entityExplorer.DragDropWidgetNVerify(draggableWidgets.STATBOX, 329, 124); - }); +describe( + "Statbox spec", + { tags: ["@tag.Widget", "@tag.Statbox", "@tag.Binding"] }, + () => { + before(() => { + /** + * On the canvas we have a Statbox Widget + */ + entityExplorer.DragDropWidgetNVerify(draggableWidgets.STATBOX, 329, 124); + }); - it("1. Validate all the respective properties are present on the Content and Style sections in the property pane", () => { - const generalProperties = ["visible", "animateloading", "height"]; + it("1. Validate all the respective properties are present on the Content and Style sections in the property pane", () => { + const generalProperties = ["visible", "animateloading", "height"]; - generalProperties.forEach((generalSectionProperty) => { - agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl( - "general", - `${generalSectionProperty}`, - ), - ); - }); + generalProperties.forEach((generalSectionProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl( + "general", + `${generalSectionProperty}`, + ), + ); + }); + + // Switch to the Style Tab + propPane.MoveToTab("Style"); - // Switch to the Style Tab - propPane.MoveToTab("Style"); + const colorProperties = ["backgroundcolor", "bordercolor"]; + colorProperties.forEach((labelStyleSectionProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl( + "color", + `${labelStyleSectionProperty}`, + ), + ); + }); - const colorProperties = ["backgroundcolor", "bordercolor"]; - colorProperties.forEach((labelStyleSectionProperty) => { + const borderShadows = ["borderwidth", "borderradius", "boxshadow"]; + borderShadows.forEach((borderShadowSectionProperty) => { + agHelper.AssertElementVisibility( + propPane._propertyPanePropertyControl( + "borderandshadow", + `${borderShadowSectionProperty}`, + ), + ); + }); + }); + it("2. Validate if the default widgets are present inside the statbox", () => { + PageLeftPane.switchSegment(PagePaneSegment.UI); + PageLeftPane.assertPresence("Statbox1"); + PageLeftPane.expandCollapseItem("Statbox1"); + PageLeftPane.assertPresence("Text1"); + PageLeftPane.assertPresence("Text2"); + PageLeftPane.assertPresence("IconButton1"); + PageLeftPane.assertPresence("Text3"); + }); + it("3. Validate visibility", () => { + EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); + propPane.MoveToTab("Content"); + propPane.TogglePropertyState("Visible", "Off"); + // Ensure that the widget isnt visible once deployed + deployMode.DeployApp(); + agHelper.AssertElementAbsence(locators._widgetInDeployed("statbox1")); + deployMode.NavigateBacktoEditor(); + //Ensure that the widget is not visible in preview mode + agHelper.GetNClick(locators._enterPreviewMode); + agHelper.AssertElementAbsence(locators._widgetInDeployed("statbox1")); + agHelper.GetNClick(locators._exitPreviewMode); + EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); + propPane.TogglePropertyState("Visible", "On"); + //Ensure that the widget is visible once deployed + deployMode.DeployApp(); + agHelper.AssertElementVisibility( + locators._widgetInDeployed("statbox1"), + true, + ); + deployMode.NavigateBacktoEditor(); + //Ensure that the widget is visible in preview mode + agHelper.GetNClick(locators._enterPreviewMode); agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl( - "color", - `${labelStyleSectionProperty}`, - ), + locators._widgetInDeployed("statbox1"), + true, ); + agHelper.GetNClick(locators._exitPreviewMode); }); - const borderShadows = ["borderwidth", "borderradius", "boxshadow"]; - borderShadows.forEach((borderShadowSectionProperty) => { + it("4. Validate if widgets can be D&D inside the Statbox widget", () => { + PageLeftPane.switchSegment(PagePaneSegment.UI); + PageLeftPane.expandCollapseItem("Statbox1"); + propPane.DeleteWidgetFromPropertyPane("IconButton1"); + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.ICONBUTTON, + 260, + 189, + ); + //Verifying if the dropped widget exists in the container + PageLeftPane.switchSegment(PagePaneSegment.UI); + PageLeftPane.expandCollapseItem("Statbox1"); + PageLeftPane.assertPresence("IconButton1"); + //Verifying if the dropped widget exists once deployed + deployMode.DeployApp(); + agHelper.AssertElementVisibility( + locators._widgetInDeployed("iconbutton1"), + true, + ); + deployMode.NavigateBacktoEditor(); + //Verifying if the dropped widget exists in preview mode + agHelper.GetNClick(locators._enterPreviewMode); agHelper.AssertElementVisibility( - propPane._propertyPanePropertyControl( - "borderandshadow", - `${borderShadowSectionProperty}`, - ), + locators._widgetInDeployed("iconbutton1"), + true, ); + agHelper.GetNClick(locators._exitPreviewMode); }); - }); - it("2. Validate if the default widgets are present inside the statbox", () => { - PageLeftPane.switchSegment(PagePaneSegment.UI); - PageLeftPane.assertPresence("Statbox1"); - PageLeftPane.expandCollapseItem("Statbox1"); - PageLeftPane.assertPresence("Text1"); - PageLeftPane.assertPresence("Text2"); - PageLeftPane.assertPresence("IconButton1"); - PageLeftPane.assertPresence("Text3"); - }); - it("3. Validate visibility", () => { - EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); - propPane.MoveToTab("Content"); - propPane.TogglePropertyState("Visible", "Off"); - // Ensure that the widget isnt visible once deployed - deployMode.DeployApp(); - agHelper.AssertElementAbsence(locators._widgetInDeployed("statbox1")); - deployMode.NavigateBacktoEditor(); - //Ensure that the widget is not visible in preview mode - agHelper.GetNClick(locators._enterPreviewMode); - agHelper.AssertElementAbsence(locators._widgetInDeployed("statbox1")); - agHelper.GetNClick(locators._exitPreviewMode); - EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); - propPane.TogglePropertyState("Visible", "On"); - //Ensure that the widget is visible once deployed - deployMode.DeployApp(); - agHelper.AssertElementVisibility( - locators._widgetInDeployed("statbox1"), - true, - ); - deployMode.NavigateBacktoEditor(); - //Ensure that the widget is visible in preview mode - agHelper.GetNClick(locators._enterPreviewMode); - agHelper.AssertElementVisibility( - locators._widgetInDeployed("statbox1"), - true, - ); - agHelper.GetNClick(locators._exitPreviewMode); - }); - - it("4. Validate if widgets can be D&D inside the Statbox widget", () => { - PageLeftPane.switchSegment(PagePaneSegment.UI); - PageLeftPane.expandCollapseItem("Statbox1"); - propPane.DeleteWidgetFromPropertyPane("IconButton1"); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.ICONBUTTON, 260, 189); - //Verifying if the dropped widget exists in the container - PageLeftPane.switchSegment(PagePaneSegment.UI); - PageLeftPane.expandCollapseItem("Statbox1"); - PageLeftPane.assertPresence("IconButton1"); - //Verifying if the dropped widget exists once deployed - deployMode.DeployApp(); - agHelper.AssertElementVisibility( - locators._widgetInDeployed("iconbutton1"), - true, - ); - deployMode.NavigateBacktoEditor(); - //Verifying if the dropped widget exists in preview mode - agHelper.GetNClick(locators._enterPreviewMode); - agHelper.AssertElementVisibility( - locators._widgetInDeployed("iconbutton1"), - true, - ); - agHelper.GetNClick(locators._exitPreviewMode); - }); - it("5: Verify statbox widget styles", () => { - EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); - //Switch to Style tab - propPane.MoveToTab("Style"); - propPane.EnterJSContext("Background color", "#f3e8ff"); - propPane.EnterJSContext("Border color", "#be185d"); - // Click on Deploy and ensure it is deployed appropriately - deployMode.DeployApp(); - // Ensure the Background Color is applied - agHelper.AssertCSS( - locators._statboxWidget, - "background-color", - "rgb(243, 232, 255)", - ); - //Ensure that the border colour is applied - agHelper.AssertCSS( - locators._statboxWidget, - "border-color", - "rgb(205, 213, 223)", - ); - deployMode.NavigateBacktoEditor(); - }); + it("5: Verify statbox widget styles", () => { + EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); + //Switch to Style tab + propPane.MoveToTab("Style"); + propPane.EnterJSContext("Background color", "#f3e8ff"); + propPane.EnterJSContext("Border color", "#be185d"); + // Click on Deploy and ensure it is deployed appropriately + deployMode.DeployApp(); + // Ensure the Background Color is applied + agHelper.AssertCSS( + locators._statboxWidget, + "background-color", + "rgb(243, 232, 255)", + ); + //Ensure that the border colour is applied + agHelper.AssertCSS( + locators._statboxWidget, + "border-color", + "rgb(205, 213, 223)", + ); + deployMode.NavigateBacktoEditor(); + }); - it("6. Rename, copy-paste and delete the widget", () => { - EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); - entityExplorer.RenameEntityFromExplorer("Statbox1", "Stats", true); - propPane.CopyPasteWidgetFromPropertyPane("Stats"); - entityExplorer.DeleteWidgetFromEntityExplorer("Stats"); - }); -}); + it("6. Rename, copy-paste and delete the widget", () => { + EditorNavigation.SelectEntityByName("Statbox1", EntityType.Widget); + entityExplorer.RenameEntityFromExplorer("Statbox1", "Stats", true); + propPane.CopyPasteWidgetFromPropertyPane("Stats"); + entityExplorer.DeleteWidgetFromEntityExplorer("Stats"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch2_spec.ts index 8effb0f12ed..50429c7df6c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch2_spec.ts @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Switch widget testcases", - { tags: ["@tag.Widget", "@tag.Switch"] }, + { tags: ["@tag.Widget", "@tag.Switch", "@tag.Binding"] }, () => { const jsonData = `[ { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup1_spec.ts index 2e965258b01..c1304c05669 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup1_spec.ts @@ -21,7 +21,7 @@ import EditorNavigation, { describe( "Switchgroup Widget Functionality", - { tags: ["@tag.Widget", "@tag.Switch"] }, + { tags: ["@tag.Widget", "@tag.Switch", "@tag.Binding"] }, function () { /** * Adding switch group, checkbox group and text widgets diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup2_spec.js index 0d8c730d46b..8cb895a3637 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/SwitchGroup2_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Switch Group Widget Functionality", - { tags: ["@tag.Widget", "@tag.Switch"] }, + { tags: ["@tag.Widget", "@tag.Switch", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("SwitchGroupWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch_spec.js index e15d11407d2..30b890e7705 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Switch/Switch_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Switch Widget Functionality", - { tags: ["@tag.Widget", "@tag.Switch"] }, + { tags: ["@tag.Widget", "@tag.Switch", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("newFormDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_Duplicate_TabName_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_Duplicate_TabName_spec.js index 658dfb75c7a..6aa3a264bf0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_Duplicate_TabName_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_Duplicate_TabName_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Tab widget test duplicate tab name validation", - { tags: ["@tag.Widget", "@tag.Tab"] }, + { tags: ["@tag.Widget", "@tag.Tab", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tabsWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_OnEvent_Navigation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_OnEvent_Navigation_spec.js index 62412658e7b..5ebdfc16884 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_OnEvent_Navigation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_OnEvent_Navigation_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Tabs widget on change of selection navigation usecases", - { tags: ["@tag.Widget", "@tag.Tab"] }, + { tags: ["@tag.Widget", "@tag.Tab", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tabsWidgetReset"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js index 0518c7bd948..f67c636c405 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tab_new_scenario_spec.js @@ -3,34 +3,38 @@ const publish = require("../../../../../locators/publishWidgetspage.json"); const widgetsPage = require("../../../../../locators/Widgets.json"); import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Tab widget test", { tags: ["@tag.Widget", "@tag.Tab"] }, function () { - before(() => { - _.agHelper.AddDsl("tabsWithWidgetDsl"); - }); - it("Tab Widget Functionality Test with Modal on change of selected tab", function () { - cy.openPropertyPane("tabswidget"); - cy.widgetText("tab", Layoutpage.tabWidget, widgetsPage.widgetNameSpan); - cy.AddActionWithModal(); - cy.get(".t--draggable-buttonwidget:contains('Close')").click({ - force: true, +describe( + "Tab widget test", + { tags: ["@tag.Widget", "@tag.Tab", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("tabsWithWidgetDsl"); + }); + it("Tab Widget Functionality Test with Modal on change of selected tab", function () { + cy.openPropertyPane("tabswidget"); + cy.widgetText("tab", Layoutpage.tabWidget, widgetsPage.widgetNameSpan); + cy.AddActionWithModal(); + cy.get(".t--draggable-buttonwidget:contains('Close')").click({ + force: true, + }); }); - }); - it("Publish the app and validate the widgets displayed under each tab", function () { - _.deployMode.DeployApp(); - cy.get(publish.buttonWidget).should("be.visible"); - cy.get(publish.textWidget).should("be.visible"); - cy.get(publish.datePickerNew).should("be.visible"); - cy.wait(3000); - cy.get(publish.tab).contains("Tab 2").click({ force: true }); - cy.get(publish.checkboxWidget).should("be.visible"); - cy.get(publish.radioWidget).should("be.visible"); + it("Publish the app and validate the widgets displayed under each tab", function () { + _.deployMode.DeployApp(); + cy.get(publish.buttonWidget).should("be.visible"); + cy.get(publish.textWidget).should("be.visible"); + cy.get(publish.datePickerNew).should("be.visible"); + cy.wait(3000); + cy.get(publish.tab).contains("Tab 2").click({ force: true }); + cy.get(publish.checkboxWidget).should("be.visible"); + cy.get(publish.radioWidget).should("be.visible"); - cy.get(publish.buttonWidget).contains("Confirm").click({ - force: true, + cy.get(publish.buttonWidget).contains("Confirm").click({ + force: true, + }); }); - }); -}); + }, +); afterEach(() => { // put your clean up code if any }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_2_spec.ts index 583a205e54d..2dc84c08f04 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Tabs_2_spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Tabs widget Tests", - { tags: ["@tag.Widget", "@tag.Tab"] }, + { tags: ["@tag.Widget", "@tag.Tab", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tabsDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Widget_Tab_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Widget_Tab_spec.js index 3e3b5104e5e..4a500f29d21 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Widget_Tab_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab/Widget_Tab_spec.js @@ -8,99 +8,102 @@ import { propPane, } from "../../../../../support/Objects/ObjectsCore"; -describe("Tab widget test", { tags: ["@tag.Widget", "@tag.Tab"] }, function () { - before(() => { - agHelper.AddDsl("layoutdsl"); - }); - it("1. Tab Widget Functionality Test", function () { - cy.openPropertyPane("tabswidget"); - /** - * @param{Text} Random Text - * @param{TabWidget}Mouseover - * @param{TabPre Css} Assertion - */ - cy.widgetText("tab", Layoutpage.tabWidget, widgetsPage.widgetNameSpan); - /** - * @param{IndexValue} Provide input Index Value - * @param{Text} Provide Index Text Value - */ - cy.tabVerify(0, "Aditya"); - cy.tabVerify(1, "test"); - //Default tab selection and validation - cy.testJsontext("defaulttab", "test"); - cy.get(Layoutpage.tabWidget) - .contains("test") - .click({ force: true }) - .should("be.visible"); - cy.get(Layoutpage.tabButton).last().click({ force: true }); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.tabVerify(1, "Day"); - cy.xpath(Layoutpage.deleteTab.replace("tabName", "Day")).click({ - force: true, +describe( + "Tab widget test", + { tags: ["@tag.Widget", "@tag.Tab", "@tag.Binding"] }, + function () { + before(() => { + agHelper.AddDsl("layoutdsl"); + }); + it("1. Tab Widget Functionality Test", function () { + cy.openPropertyPane("tabswidget"); + /** + * @param{Text} Random Text + * @param{TabWidget}Mouseover + * @param{TabPre Css} Assertion + */ + cy.widgetText("tab", Layoutpage.tabWidget, widgetsPage.widgetNameSpan); + /** + * @param{IndexValue} Provide input Index Value + * @param{Text} Provide Index Text Value + */ + cy.tabVerify(0, "Aditya"); + cy.tabVerify(1, "test"); + //Default tab selection and validation + cy.testJsontext("defaulttab", "test"); + cy.get(Layoutpage.tabWidget) + .contains("test") + .click({ force: true }) + .should("be.visible"); + cy.get(Layoutpage.tabButton).last().click({ force: true }); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.tabVerify(1, "Day"); + cy.xpath(Layoutpage.deleteTab.replace("tabName", "Day")).click({ + force: true, + }); + cy.get(Layoutpage.tabWidget).contains("Day").should("not.exist"); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(500); + /** + * @param{toggleButton Css} Assert to be checked + */ + agHelper.CheckUncheck(widgetsPage.Scrollbutton); + cy.get(Layoutpage.tabContainer) + .scrollIntoView({ easing: "linear" }) + .should("be.visible"); + agHelper.AssertAutoSave(); + deployMode.DeployApp(); }); - cy.get(Layoutpage.tabWidget).contains("Day").should("not.exist"); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(500); - /** - * @param{toggleButton Css} Assert to be checked - */ - agHelper.CheckUncheck(widgetsPage.Scrollbutton); - cy.get(Layoutpage.tabContainer) - .scrollIntoView({ easing: "linear" }) - .should("be.visible"); - agHelper.AssertAutoSave(); - deployMode.DeployApp(); - }); - it("2. Tab Widget Functionality To Select Tabs", function () { - cy.get(publish.tabWidget) - .contains(this.dataSet.tabName) - .last() - .click({ force: true }) - .should("have.class", "is-selected"); - deployMode.NavigateBacktoEditor(); - }); + it("2. Tab Widget Functionality To Select Tabs", function () { + cy.get(publish.tabWidget) + .contains(this.dataSet.tabName) + .last() + .click({ force: true }) + .should("have.class", "is-selected"); + deployMode.NavigateBacktoEditor(); + }); - it("3. Tab Widget Functionality To Unchecked Visible Widget", function () { - cy.openPropertyPane("tabswidget"); - agHelper.CheckUncheck(commonlocators.visibleCheckbox, false); - deployMode.DeployApp(); - cy.get(publish.tabWidget).should("not.exist"); - deployMode.NavigateBacktoEditor(); - }); + it("3. Tab Widget Functionality To Unchecked Visible Widget", function () { + cy.openPropertyPane("tabswidget"); + agHelper.CheckUncheck(commonlocators.visibleCheckbox, false); + deployMode.DeployApp(); + cy.get(publish.tabWidget).should("not.exist"); + deployMode.NavigateBacktoEditor(); + }); - it("4. Tab Widget Functionality To Check Visible Widget", function () { - cy.openPropertyPane("tabswidget"); - agHelper.CheckUncheck(commonlocators.visibleCheckbox); - deployMode.DeployApp(); - cy.get(publish.tabWidget).should("be.visible"); - deployMode.NavigateBacktoEditor(); - }); + it("4. Tab Widget Functionality To Check Visible Widget", function () { + cy.openPropertyPane("tabswidget"); + agHelper.CheckUncheck(commonlocators.visibleCheckbox); + deployMode.DeployApp(); + cy.get(publish.tabWidget).should("be.visible"); + deployMode.NavigateBacktoEditor(); + }); - it("5. Tab Widget Functionality To Check tab invisiblity", function () { - cy.openPropertyPane("tabswidget"); - cy.xpath(Layoutpage.tabEdit.replace("tabName", "Tab 1")).click({ - force: true, + it("5. Tab Widget Functionality To Check tab invisiblity", function () { + cy.openPropertyPane("tabswidget"); + cy.xpath(Layoutpage.tabEdit.replace("tabName", "Tab 1")).click({ + force: true, + }); + cy.get(Layoutpage.tabVisibility).first().click({ force: true }); + cy.get(Layoutpage.tabWidget).contains("Tab 1").should("not.exist"); + deployMode.DeployApp(); + cy.get(publish.tabWidget).contains("Tab 1").should("not.exist"); + deployMode.NavigateBacktoEditor(); }); - cy.get(Layoutpage.tabVisibility).first().click({ force: true }); - cy.get(Layoutpage.tabWidget).contains("Tab 1").should("not.exist"); - deployMode.DeployApp(); - cy.get(publish.tabWidget).contains("Tab 1").should("not.exist"); - deployMode.NavigateBacktoEditor(); - }); - it("6. Tab Widget Functionality To Check tab visibility", function () { - cy.openPropertyPane("tabswidget"); - cy.xpath(Layoutpage.tabEdit.replace("tabName", "Tab 1")).click({ - force: true, + it("6. Tab Widget Functionality To Check tab visibility", function () { + cy.openPropertyPane("tabswidget"); + cy.xpath(Layoutpage.tabEdit.replace("tabName", "Tab 1")).click({ + force: true, + }); + cy.get(Layoutpage.tabVisibility).first().click({ force: true }); + cy.get(Layoutpage.tabWidget).contains("Tab 1").should("be.visible"); + deployMode.DeployApp(); + cy.get(publish.tabWidget).contains("Tab 1").should("be.visible"); + deployMode.NavigateBacktoEditor(); }); - cy.get(Layoutpage.tabVisibility).first().click({ force: true }); - cy.get(Layoutpage.tabWidget).contains("Tab 1").should("be.visible"); - deployMode.DeployApp(); - cy.get(publish.tabWidget).contains("Tab 1").should("be.visible"); - deployMode.NavigateBacktoEditor(); - }); - /* Test to be revisted as the undo action is inconsistent in automation + /* Test to be revisted as the undo action is inconsistent in automation it("7. Tab Widget Functionality To Check undo action after delete", function() { cy.openPropertyPane("tabswidget"); cy.get(Layoutpage.tabDelete) @@ -125,58 +128,59 @@ describe("Tab widget test", { tags: ["@tag.Widget", "@tag.Tab"] }, function () { .should("be.visible"); }); */ - it("7. Tabs widget should have navigation arrows if tabs don't fit", function () { - const rightNavButtonSelector = - Layoutpage.tabWidget + " .scroll-nav-right-button"; - const leftNavButtonSelector = - Layoutpage.tabWidget + " .scroll-nav-left-button"; + it("7. Tabs widget should have navigation arrows if tabs don't fit", function () { + const rightNavButtonSelector = + Layoutpage.tabWidget + " .scroll-nav-right-button"; + const leftNavButtonSelector = + Layoutpage.tabWidget + " .scroll-nav-left-button"; - cy.openPropertyPane("tabswidget"); - // Add a new tab - agHelper.ClickButton("Add tab"); - agHelper.ClickButton("Add tab"); - cy.tabVerify(3, "Tab3-for-testing-scroll-navigation-controls"); - // Should show off right navigation arrow - cy.get(leftNavButtonSelector).should("exist"); - // Click on the right navigation arrow - cy.get(leftNavButtonSelector).click({ force: true }); - // Should show off left navigation arrow - cy.get(rightNavButtonSelector).should("exist"); - }); + cy.openPropertyPane("tabswidget"); + // Add a new tab + agHelper.ClickButton("Add tab"); + agHelper.ClickButton("Add tab"); + cy.tabVerify(3, "Tab3-for-testing-scroll-navigation-controls"); + // Should show off right navigation arrow + cy.get(leftNavButtonSelector).should("exist"); + // Click on the right navigation arrow + cy.get(leftNavButtonSelector).click({ force: true }); + // Should show off left navigation arrow + cy.get(rightNavButtonSelector).should("exist"); + }); - it("8. Tab Widget Functionality To Check Default Tab selected After Selected Tab Delete", function () { - propPane.UpdatePropertyFieldValue("Default tab", "Tab 1"); - cy.tabVerify(3, "Tab3-for-testing-scroll-navigation-controls"); - cy.get(Layoutpage.tabWidget) - .contains("Tab3-for-testing-scroll-navigation-controls") - .should("have.class", "is-selected"); - cy.xpath( - Layoutpage.deleteTab.replace( - "tabName", - "Tab3-for-testing-scroll-navigation-controls", - ), - ).click({ force: true }); - cy.get(Layoutpage.tabWidget) - .contains("Tab 1") - .should("have.class", "is-selected"); - }); + it("8. Tab Widget Functionality To Check Default Tab selected After Selected Tab Delete", function () { + propPane.UpdatePropertyFieldValue("Default tab", "Tab 1"); + cy.tabVerify(3, "Tab3-for-testing-scroll-navigation-controls"); + cy.get(Layoutpage.tabWidget) + .contains("Tab3-for-testing-scroll-navigation-controls") + .should("have.class", "is-selected"); + cy.xpath( + Layoutpage.deleteTab.replace( + "tabName", + "Tab3-for-testing-scroll-navigation-controls", + ), + ).click({ force: true }); + cy.get(Layoutpage.tabWidget) + .contains("Tab 1") + .should("have.class", "is-selected"); + }); - it("9. Tab Widget Functionality To Check First Tab Selected After Selected Tab(Default one) Delete", function () { - cy.get(Layoutpage.tabDelete).eq(1).click({ force: true }); - cy.wait(1000); - cy.get(Layoutpage.tabWidget) - .contains("Aditya") - .should("have.class", "is-selected"); - // Validates Total Number Of Tabs Displayed In The Property Pane - cy.get(Layoutpage.tabNumber).should("have.text", "2"); - // Validates Total Number Of Tabs Displayed In The Property Pane After Adding A Tab - agHelper.ClickButton("Add tab"); - cy.get(Layoutpage.tabNumber).should("have.text", "3"); - //Validates Total Number Of Tabs Displayed In The Property Pane After Deleting A Tab - cy.get(Layoutpage.tabDelete).eq(1).click({ force: true }); - cy.get(Layoutpage.tabNumber).should("have.text", "2"); - }); -}); + it("9. Tab Widget Functionality To Check First Tab Selected After Selected Tab(Default one) Delete", function () { + cy.get(Layoutpage.tabDelete).eq(1).click({ force: true }); + cy.wait(1000); + cy.get(Layoutpage.tabWidget) + .contains("Aditya") + .should("have.class", "is-selected"); + // Validates Total Number Of Tabs Displayed In The Property Pane + cy.get(Layoutpage.tabNumber).should("have.text", "2"); + // Validates Total Number Of Tabs Displayed In The Property Pane After Adding A Tab + agHelper.ClickButton("Add tab"); + cy.get(Layoutpage.tabNumber).should("have.text", "3"); + //Validates Total Number Of Tabs Displayed In The Property Pane After Deleting A Tab + cy.get(Layoutpage.tabDelete).eq(1).click({ force: true }); + cy.get(Layoutpage.tabNumber).should("have.text", "2"); + }); + }, +); afterEach(() => { // put your clean up code if any diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab_reset_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab_reset_spec.js index 14114f1e447..67e23d35d1e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab_reset_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Tab_reset_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Tabs widget resetting", - { tags: ["@tag.Widget", "@tag.Tab"] }, + { tags: ["@tag.Widget", "@tag.Tab", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tabsWidgetReset"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts index 76fe42474d3..37b6c2e9081 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableBugs_Spec.ts @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Verify various Table property bugs", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tablev1NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_1_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_1_Spec.ts index a71a25fcf9f..6c31e1130c4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_1_Spec.ts @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tablev1NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_2_Spec.ts index 94025e4ccc2..45d0400c73a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter1_2_Spec.ts @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tablev1NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_1_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_1_Spec.ts index c42b8718bc8..3d56cdaa62e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_1_Spec.ts @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tablev1NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_2_Spec.ts index 877b346348e..3b281a846e4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/TableFilter2_2_Spec.ts @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tablev1NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Button_Icon_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Button_Icon_validation_spec.js index e42974f76d3..e222542518f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Button_Icon_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Button_Icon_validation_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Color_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Color_spec.js index b32233f6c60..5d16abf0773 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Color_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Color_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Column_Resize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Column_Resize_spec.js index b3f62881bc2..4bae6884bf6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Column_Resize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Column_Resize_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget Functionality with Hidden and Resized Columns", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableResizedColumnsDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Derived_Column_Data_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Derived_Column_Data_validation_spec.js index 263a55a102d..8ca5779f33b 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Derived_Column_Data_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Derived_Column_Data_validation_spec.js @@ -13,7 +13,7 @@ import { describe( "Test Create Api and Bind to Table widget", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableTextPaginationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_EmptyRow_Color_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_EmptyRow_Color_spec.js index 380e7b6b4da..4e618fee900 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_EmptyRow_Color_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_EmptyRow_Color_spec.js @@ -3,7 +3,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Table Widget empty row color validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_FilteredTableData_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_FilteredTableData_spec.js index 4c4a94024e6..6d5898c59c7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_FilteredTableData_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_FilteredTableData_spec.js @@ -10,7 +10,7 @@ const dsl = require("../../../../../fixtures/tableAndTextDsl.json"); describe( "Table Widget Filtered Table data in autocomplete", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableAndTextDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_GeneralProperty_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_GeneralProperty_spec.js index 092bed9b509..c12a994ef63 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_GeneralProperty_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_GeneralProperty_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_dataUpdation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_dataUpdation_spec.js index 9bf78ecefb3..2515463b6c5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_dataUpdation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_dataUpdation_spec.js @@ -17,7 +17,7 @@ if the primary column value isn't updated. */ describe( "Table Widget row multi select validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("multiSelectedRowUpdationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_spec.js index f97940352cb..ba640223c23 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_MultiRowSelect_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget row multi select validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Number_column_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Number_column_spec.js index 74722e5c101..05da815adf2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Number_column_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Number_column_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Validate Table Widget Table data", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("basicNumberDataTableDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_1_spec.js index b0bf0d75d33..44422515353 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_1_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_2_spec.js index 3baf77db5d8..30f56530975 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_2_spec.js @@ -9,7 +9,7 @@ import { describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableNewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_IconName_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_IconName_spec.js index 0d4b64f3510..d8297951f0f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_IconName_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_PropertyPane_IconName_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Property_JsonUpdate_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Property_JsonUpdate_spec.js index fcf836a308c..e20ef022732 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Property_JsonUpdate_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Property_JsonUpdate_spec.js @@ -7,7 +7,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Test Create Api and Bind to Table widget", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableTextPaginationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Switch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Switch_spec.js index 6e5a05019f4..c76445ff7f1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Switch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Switch_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget and Switch binding Functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("swtchTableDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Add_button_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Add_button_spec.js index c182f1b9d64..ad7030e17bd 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Add_button_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Add_button_spec.js @@ -5,7 +5,7 @@ const testdata = require("../../../../../fixtures/testdata.json"); describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Copy_Paste_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Copy_Paste_spec.js index 687d25133b9..eb520e19fb6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Copy_Paste_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Copy_Paste_spec.js @@ -13,7 +13,7 @@ import { describe( "Test Suite to validate copy/paste table Widget", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Default_Row_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Default_Row_spec.js index 6fa76ba2f1f..7a73959022f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Default_Row_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Default_Row_spec.js @@ -5,7 +5,7 @@ import EditorNavigation, { describe( "Table Widget property pane deafult feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("defaultTableDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Derived_Column_Computed_value_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Derived_Column_Computed_value_spec.js index dd23e314ebc..6bc2f08ebf7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Derived_Column_Computed_value_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Derived_Column_Computed_value_spec.js @@ -3,7 +3,7 @@ const testdata = require("../../../../../fixtures/testdata.json"); describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Selected_row_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Selected_row_spec.js index def8bfdd59c..8d3c2ccc5d3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Selected_row_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Widget_Selected_row_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableAndTextDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_spec.js index ea0fa9163df..3ecac68fe13 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget Functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_tabledata_schema_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_tabledata_schema_spec.js index 8ed30919dfb..f91d34a5317 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_tabledata_schema_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_tabledata_schema_spec.js @@ -5,47 +5,51 @@ import { import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Table Widget", { tags: ["@tag.Widget", "@tag.Table"] }, function () { - before(() => { - _.agHelper.AddDsl("tableNewDsl"); - }); - it("1. Table Widget Functionality To Check with changing schema of tabledata", () => { - let jsContext = `{{Switch1.isSwitchedOn?[{name: "joe"}]:[{employee_name: "john"}];}}`; - cy.wait(5000); - cy.dragAndDropToCanvas("switchwidget", { x: 200, y: 200 }); - cy.wait(2000); - cy.openPropertyPane("tablewidget"); - cy.get(".t--property-control-tabledata").then(($el) => { - cy.updateCodeInput($el, jsContext); +describe( + "Table Widget", + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("tableNewDsl"); }); - _.deployMode.DeployApp(); - cy.getTableDataSelector("0", "0").then((element) => { - cy.get(element).should("be.visible"); + it("1. Table Widget Functionality To Check with changing schema of tabledata", () => { + let jsContext = `{{Switch1.isSwitchedOn?[{name: "joe"}]:[{employee_name: "john"}];}}`; + cy.wait(5000); + cy.dragAndDropToCanvas("switchwidget", { x: 200, y: 200 }); + cy.wait(2000); + cy.openPropertyPane("tablewidget"); + cy.get(".t--property-control-tabledata").then(($el) => { + cy.updateCodeInput($el, jsContext); + }); + _.deployMode.DeployApp(); + cy.getTableDataSelector("0", "0").then((element) => { + cy.get(element).should("be.visible"); + }); + cy.readTabledataPublish("0", "0").then((value) => { + expect(value).to.be.equal("joe"); + }); + cy.get(".t--switch-widget-active").first().click(); + cy.get(".t--widget-tablewidget").scrollIntoView(); + cy.wait(1000); + cy.getTableDataSelector("0", "0").then((element) => { + cy.get(element).should("be.visible"); + }); + cy.readTabledataPublish("0", "0").then((value) => { + expect(value).to.be.equal("john"); + }); + cy.get(".t--switch-widget-inactive").first().click(); + cy.wait(1000); + cy.get(".t--widget-tablewidget").scrollIntoView(); + cy.getTableDataSelector("0", "0").then((element) => { + cy.get(element).should("be.visible"); + }); + cy.readTabledataPublish("0", "0").then((value) => { + expect(value).to.be.equal("joe"); + }); + _.deployMode.NavigateBacktoEditor(); + PageLeftPane.switchSegment(PagePaneSegment.UI); + _.entityExplorer.DeleteWidgetFromEntityExplorer("Switch1"); + _.entityExplorer.DeleteWidgetFromEntityExplorer("Table1"); }); - cy.readTabledataPublish("0", "0").then((value) => { - expect(value).to.be.equal("joe"); - }); - cy.get(".t--switch-widget-active").first().click(); - cy.get(".t--widget-tablewidget").scrollIntoView(); - cy.wait(1000); - cy.getTableDataSelector("0", "0").then((element) => { - cy.get(element).should("be.visible"); - }); - cy.readTabledataPublish("0", "0").then((value) => { - expect(value).to.be.equal("john"); - }); - cy.get(".t--switch-widget-inactive").first().click(); - cy.wait(1000); - cy.get(".t--widget-tablewidget").scrollIntoView(); - cy.getTableDataSelector("0", "0").then((element) => { - cy.get(element).should("be.visible"); - }); - cy.readTabledataPublish("0", "0").then((value) => { - expect(value).to.be.equal("joe"); - }); - _.deployMode.NavigateBacktoEditor(); - PageLeftPane.switchSegment(PagePaneSegment.UI); - _.entityExplorer.DeleteWidgetFromEntityExplorer("Switch1"); - _.entityExplorer.DeleteWidgetFromEntityExplorer("Table1"); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_no_2dArray_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_no_2dArray_spec.js index 374631ebe8c..67c03653ff7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_no_2dArray_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_no_2dArray_spec.js @@ -4,7 +4,7 @@ import { seconds, testTimeout } from "../../../../../support/timeout"; describe( "Table widget edge case scenario testing", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableWithTextWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_selRowIndices_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_selRowIndices_spec.js index c7f153bd5be..f79c2e83490 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_selRowIndices_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV1/table_with_text_selRowIndices_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table widget edge case scenario testing", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableWithTextWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js index 6d641951891..ac1fb9c5855 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow1_spec.js @@ -10,7 +10,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Basic flow ", - { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js index 23508651c00..e6e3e81ac3d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow2_spec.js @@ -3,7 +3,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Validation flow", - { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { cy.startServerAndRoutes(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js index e6a161c1bb2..2a55cf9a3ea 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRow3_spec.js @@ -3,7 +3,7 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); describe( "Actions flow (save, discard)", - { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity", "@tag.Binding"] }, () => { before(() => { cy.startServerAndRoutes(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Custom_column_alias_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Custom_column_alias_spec.js index f7e579b3649..1fb746c0d46 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Custom_column_alias_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Custom_column_alias_spec.js @@ -14,7 +14,7 @@ const data = [ describe( "Custom column alias functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_1_spec.ts index 3a0614e7db0..243e4282ff0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_1_spec.ts @@ -11,7 +11,7 @@ import EditorNavigation, { describe( "Table widget date column inline editing functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("Table/DateCellEditingDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_2_spec.ts index 50728d23c91..87a0578ba43 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Date_column_editing_2_spec.ts @@ -13,7 +13,7 @@ import EditorNavigation, { describe( "Table widget date column inline editing functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { agHelper.AddDsl("Table/DateCellEditingDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js index 5431495adc5..36b3cdf7713 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Edge_case_spec.js @@ -12,7 +12,7 @@ import { describe( "Table widget v2 edge case scenario testing", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Image_resize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Image_resize_spec.js index 12684c40e2b..76b20ebdd7f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Image_resize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Image_resize_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget Image Resize feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("Table/ImageResizeDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_1_spec.js index 42cd834ce6e..08caa2414af 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_1_spec.js @@ -3,7 +3,7 @@ import { agHelper, table } from "../../../../../support/Objects/ObjectsCore"; describe( "Table widget inline editing functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_2_spec.js index 6336b7f58b0..fd2d3c3c749 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_2_spec.js @@ -15,7 +15,7 @@ const publish = require("../../../../../locators/publishWidgetspage.json"); describe( "Table widget inline editing functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js index 5a27f59e1e0..e0051272f93 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_3_spec.js @@ -10,7 +10,7 @@ import { PROPERTY_SELECTOR } from "../../../../../locators/WidgetLocators"; describe( "Table widget inline editing functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts index d29b6575889..e446d5e6196 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Pagesize_spec.ts @@ -4,7 +4,7 @@ import PageList from "../../../../../support/Pages/PageList"; describe( "Table widget v2", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { it("1. should test that pageSize is computed properly for all the row sizes", function () { PageList.AddNewPage(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts index f1f3c4884c7..cbfff43f43d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { it("1. Adding Data to Table Widget", function () { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts index 91360c4cd24..6832cb146a5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts @@ -11,7 +11,7 @@ import { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { it("1. Verify Table Filter for 'empty'", function () { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts index 552bdc4b1e5..4d0d311580c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts @@ -11,7 +11,7 @@ import { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { it("1. Adding Data to Table Widget", function () { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts index 76bef07b7b0..d6290210bf0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts @@ -12,7 +12,7 @@ import { describe( "Verify various Table_Filter combinations", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { it("1. Verify Full table data - download csv and download Excel", function () { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Button_Icon_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Button_Icon_validation_spec.js index 67dc5220953..c97520738f5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Button_Icon_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Button_Icon_validation_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget V2 property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Color_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Color_spec.js index 17bcc5fab18..104d1313653 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Color_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Color_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget V2 property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { beforeEach(() => { _.agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Order_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Order_spec.js index 9f783de0e87..d1a25264f1e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Order_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Order_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget V2 column order maintained on column change validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2ColumnOrderDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Resize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Resize_spec.js index d36e05be856..ead4a3dead0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Resize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Resize_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget V2 Functionality with Hidden and Resized Columns", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2ResizedColumnsDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js index 82d2f3a93e4..0a56162c813 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Derived_Column_Data_validation_spec.js @@ -13,7 +13,7 @@ import { describe( "Test Create Api and Bind to Table widget", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2TextPaginationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts index a62b58935c7..9b51a872dd2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts @@ -23,7 +23,7 @@ const data = [ describe( "Table V2 sort & filter using display text functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.ts index 8a0a2cdaba0..79969e09ae5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_FilteredTableData_spec.ts @@ -19,7 +19,7 @@ import { describe( "Table Widget V2 Filtered Table data in autocomplete", - { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity", "@tag.Binding"] }, function () { before("Table Widget V2 Functionality", () => { agHelper.AddDsl("tableV2AndTextDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_GeneralProperty_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_GeneralProperty_spec.js index ea9ad97ea21..7e5df3cf0ad 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_GeneralProperty_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_GeneralProperty_spec.js @@ -11,7 +11,7 @@ import { describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_dataUpdation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_dataUpdation_spec.js index 6056b97cb51..63c40532cc9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_dataUpdation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_dataUpdation_spec.js @@ -7,7 +7,7 @@ if the primary column value isn't updated. */ describe( "Table Widget V2 row multi select validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("multiSelectedRowUpdationTableV2Dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js index bf59c5bb5ba..ac3e84f41c6 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_MultiRowSelect_spec.js @@ -4,7 +4,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Table Widget V2 row multi select validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_1_spec.js index 8711ea6bf07..39ee101dd4a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_1_spec.js @@ -17,7 +17,7 @@ const emptyTableColumnNameData = require("../../../../../fixtures/TableWidgetDat describe( "Table Widget V2 property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2NewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js index 13694c0c9e4..0adedc40013 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_2_spec.js @@ -10,7 +10,7 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); describe( "Table Widget V2 property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2NewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_IconName_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_IconName_spec.js index 872098e63a5..1931c087598 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_IconName_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_PropertyPane_IconName_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2NewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Property_JsonUpdate_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Property_JsonUpdate_spec.js index 1ca0b4bcc39..21a4d635bd1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Property_JsonUpdate_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Property_JsonUpdate_spec.js @@ -8,7 +8,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Test Create Api and Bind to Table widget V2", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before("Create an API and Execute the API and bind with Table V", () => { _.agHelper.AddDsl("tableV2TextPaginationDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Sorting_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Sorting_spec.js index facb855e796..f95cdcda75c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Sorting_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Sorting_spec.js @@ -53,7 +53,7 @@ const demoTableData = ` describe( "Table Widget V2 Sorting", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { beforeEach(() => { PageList.AddNewPage(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Switch_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Switch_spec.js index 9feab8eeb3e..dfbdb4f4e52 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Switch_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Switch_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget V2 and Switch binding Functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("swtchTableV2Dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Url_Column_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Url_Column_spec.ts index 86497769e65..f866def606d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Url_Column_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Url_Column_spec.ts @@ -6,7 +6,7 @@ import { describe( "16108 - Verify Table URL column bugs", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2WithUrlColumnDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Add_button_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Add_button_spec.js index e33a1a4d8bf..80c7f0a1cd0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Add_button_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Add_button_spec.js @@ -14,7 +14,7 @@ import { describe( "Table Widget V2 property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js index 8f453239bc9..e141b38b994 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Copy_Paste_spec.js @@ -14,7 +14,7 @@ import { describe( "Test Suite to validate copy/paste table Widget V2", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Default_Row_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Default_Row_spec.js index 6215d66eec0..458ecb8adba 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Default_Row_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Default_Row_spec.js @@ -10,7 +10,7 @@ import { describe( "Table Widget V2 property pane deafult feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("defaultTableV2Dsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Derived_Column_Computed_value_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Derived_Column_Computed_value_spec.js index b550c866a88..5115c6fcce7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Derived_Column_Computed_value_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Derived_Column_Computed_value_spec.js @@ -3,7 +3,7 @@ const testdata = require("../../../../../fixtures/testdata.json"); describe( "Table Widget V2 property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Selected_row_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Selected_row_spec.js index f1c5cca4be9..dfb8e655442 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Selected_row_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Widget_Selected_row_spec.js @@ -8,7 +8,7 @@ import EditorNavigation, { describe( "Table Widget v2 property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableV2AndTextDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_header_menu_visibility_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_header_menu_visibility_spec.ts index 7056f91557e..3b32f35c0ef 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_header_menu_visibility_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_header_menu_visibility_spec.ts @@ -10,7 +10,7 @@ import { TABLE_DATA_STATIC } from "../../../../../support/Constants"; describe( "Table widget v2", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { it("1. Bug id #24005: should test that header menu should be hidden when sorting and freezing is disabled", function () { entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 500, 300); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js index d55d58c2124..8c0bfacbafb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_pagination_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget property pane feature validation", - { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Sanity", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2NewDslWithPagination"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js index afe576f7b45..19ecf513d67 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget V2 Functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("tableV2WidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_tabledata_schema_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_tabledata_schema_spec.js index 3a2c2a8974b..30ccde32991 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_tabledata_schema_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_tabledata_schema_spec.js @@ -6,50 +6,54 @@ import { import homePage from "../../../../../locators/HomePage"; import * as _ from "../../../../../support/Objects/ObjectsCore"; -describe("Table Widget", { tags: ["@tag.Widget", "@tag.Table"] }, function () { - it("1. Table Widget Functionality To Check with changing schema of tabledata", () => { - let jsContext = `{{Switch1.isSwitchedOn?[{name: "joe"}]:[{employee_name: "john"}];}}`; - _.homePage.NavigateToHome(); - _.homePage.CreateNewApplication(); - cy.wait("@createNewApplication").should( - "have.nested.property", - "response.body.responseMeta.status", - 201, - ); - cy.dragAndDropToCanvas("switchwidget", { x: 200, y: 200 }); - cy.dragAndDropToCanvas("tablewidgetv2", { x: 200, y: 300 }); - _.propPane.EnterJSContext("Table data", jsContext); - _.deployMode.DeployApp(); - cy.wait(5000); - cy.getTableV2DataSelector("0", "0").then((element) => { - cy.get(element).should("be.visible"); - }); - cy.wait(2000); - cy.readTableV2dataPublish("0", "0").then((value) => { - expect(value).to.be.equal("joe"); - }); - cy.get(".t--switch-widget-active").first().click(); - cy.wait(3000); - cy.getTableV2DataSelector("0", "0").then((element) => { - cy.get(element).should("be.visible"); - }); - cy.readTableV2dataPublish("0", "0").then((value) => { - expect(value).to.be.equal("john"); - }); - cy.get(".t--switch-widget-inactive").first().click(); - cy.wait(1000); - cy.getTableV2DataSelector("0", "0").then((element) => { - cy.get(element).should("be.visible"); - }); - cy.readTableV2dataPublish("0", "0").then((value) => { - expect(value).to.be.equal("joe"); - }); +describe( + "Table Widget", + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, + function () { + it("1. Table Widget Functionality To Check with changing schema of tabledata", () => { + let jsContext = `{{Switch1.isSwitchedOn?[{name: "joe"}]:[{employee_name: "john"}];}}`; + _.homePage.NavigateToHome(); + _.homePage.CreateNewApplication(); + cy.wait("@createNewApplication").should( + "have.nested.property", + "response.body.responseMeta.status", + 201, + ); + cy.dragAndDropToCanvas("switchwidget", { x: 200, y: 200 }); + cy.dragAndDropToCanvas("tablewidgetv2", { x: 200, y: 300 }); + _.propPane.EnterJSContext("Table data", jsContext); + _.deployMode.DeployApp(); + cy.wait(5000); + cy.getTableV2DataSelector("0", "0").then((element) => { + cy.get(element).should("be.visible"); + }); + cy.wait(2000); + cy.readTableV2dataPublish("0", "0").then((value) => { + expect(value).to.be.equal("joe"); + }); + cy.get(".t--switch-widget-active").first().click(); + cy.wait(3000); + cy.getTableV2DataSelector("0", "0").then((element) => { + cy.get(element).should("be.visible"); + }); + cy.readTableV2dataPublish("0", "0").then((value) => { + expect(value).to.be.equal("john"); + }); + cy.get(".t--switch-widget-inactive").first().click(); + cy.wait(1000); + cy.getTableV2DataSelector("0", "0").then((element) => { + cy.get(element).should("be.visible"); + }); + cy.readTableV2dataPublish("0", "0").then((value) => { + expect(value).to.be.equal("joe"); + }); - _.deployMode.NavigateBacktoEditor(); - cy.wait(5000); - PageLeftPane.switchSegment(PagePaneSegment.UI); + _.deployMode.NavigateBacktoEditor(); + cy.wait(5000); + PageLeftPane.switchSegment(PagePaneSegment.UI); - _.entityExplorer.DeleteWidgetFromEntityExplorer("Switch1"); - _.entityExplorer.DeleteWidgetFromEntityExplorer("Table1"); - }); -}); + _.entityExplorer.DeleteWidgetFromEntityExplorer("Switch1"); + _.entityExplorer.DeleteWidgetFromEntityExplorer("Table1"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Text_wrapping_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Text_wrapping_spec.js index fb0e037a8df..a1735c561ec 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Text_wrapping_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/Text_wrapping_spec.js @@ -3,7 +3,7 @@ import { agHelper, propPane } from "../../../../../support/Objects/ObjectsCore"; describe( "Table Widget text wrapping functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { afterEach(() => { agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/VirtualRow_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/VirtualRow_spec.js index b860bb831c9..727044b2208 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/VirtualRow_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/VirtualRow_spec.js @@ -8,7 +8,7 @@ const totalRows = 100; describe( "Table Widget Virtualized Row", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { cy.dragAndDropToCanvas("tablewidgetv2", { x: 300, y: 600 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypeMenubutton_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypeMenubutton_spec.js index cc97da7aca9..32375135802 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypeMenubutton_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypeMenubutton_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../../support/Objects/ObjectsCore"; describe( "Custom column alias functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { cy.dragAndDropToCanvas("tablewidgetv2", { x: 150, y: 300 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypesSelect2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypesSelect2_spec.ts index 00c63976e1f..4b2618adf07 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypesSelect2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/ColumnTypesSelect2_spec.ts @@ -8,7 +8,7 @@ import { describe( "Table widget v2: select column type test", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE, 300, 100); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts index dd77c5338ad..38a4f617c46 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts @@ -9,7 +9,7 @@ import { featureFlagIntercept } from "../../../../../../support/Objects/FeatureF describe( "Table widget - Select column type functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { cy.dragAndDropToCanvas("tablewidgetv2", { x: 350, y: 500 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js index 1a1b9e6aa83..ece9e034ffb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js @@ -30,7 +30,7 @@ const tableData = `[ const checkboxSelector = " .bp3-checkbox input[type='checkbox']"; describe( "Checkbox column type funtionality test", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TABLE); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/currency_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/currency_spec.ts index bdfc5b46a93..535dcecec81 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/currency_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/currency_spec.ts @@ -13,113 +13,122 @@ function updateCellValue(value) { _.agHelper.Sleep(500); } -describe("Currency column", { tags: ["@tag.Widget", "@tag.Table"] }, () => { - before(() => { - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 300, 400); - _.propPane.UpdatePropertyFieldValue( - "Text", - `{{Table1.editableCell.value}}|{{Table1.editableCell.inputValue}}|{{typeof Table1.editableCell.value}}|{{typeof Table1.editableCell.inputValue}}`, - ); - - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TABLE); - _.propPane.EnterJSContext("Table data", tableData); - _.table.toggleColumnEditableViaColSettingsPane("amount", "v2", true, true); - }); - - it("1. should test that currency column is available", () => { - cy.editColumn("amount"); - cy.changeColumnType("Currency"); - cy.get(".t--property-control-currency").should("exist"); - }); - - it("2. should test that currency column properties are displayed and working", () => { - cy.get(".t--property-control-currency").should("exist"); - - cy.get(".t--property-control-decimalsallowed").should("exist"); - - cy.get(".t--property-control-notation").should("exist"); - - cy.get(".t--property-control-thousandseparator").should("exist"); - }); - - it("3. should test that currency column is formatted correctly", () => { - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("$ 10,000"); +describe( + "Currency column", + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, + () => { + before(() => { + _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 300, 400); + _.propPane.UpdatePropertyFieldValue( + "Text", + `{{Table1.editableCell.value}}|{{Table1.editableCell.inputValue}}|{{typeof Table1.editableCell.value}}|{{typeof Table1.editableCell.inputValue}}`, + ); + + _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TABLE); + _.propPane.EnterJSContext("Table data", tableData); + _.table.toggleColumnEditableViaColSettingsPane( + "amount", + "v2", + true, + true, + ); }); - _.propPane.ToggleJSMode("Currency", true); + it("1. should test that currency column is available", () => { + cy.editColumn("amount"); + cy.changeColumnType("Currency"); + cy.get(".t--property-control-currency").should("exist"); + }); - _.propPane.EnterJSContext("Currency", "INR"); + it("2. should test that currency column properties are displayed and working", () => { + cy.get(".t--property-control-currency").should("exist"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 10,000"); - }); + cy.get(".t--property-control-decimalsallowed").should("exist"); - _.propPane.SelectPropertiesDropDown("Decimals allowed", "1"); + cy.get(".t--property-control-notation").should("exist"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 10,000.0"); + cy.get(".t--property-control-thousandseparator").should("exist"); }); - _.propPane.SelectPropertiesDropDown("Decimals allowed", "2"); + it("3. should test that currency column is formatted correctly", () => { + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("$ 10,000"); + }); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 10,000.01"); - }); + _.propPane.ToggleJSMode("Currency", true); - _.propPane.TogglePropertyState("Thousand separator", false); + _.propPane.EnterJSContext("Currency", "INR"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 10000.01"); - }); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 10,000"); + }); - _.propPane.SelectPropertiesDropDown("Notation", "Compact"); + _.propPane.SelectPropertiesDropDown("Decimals allowed", "1"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 10.00K"); - }); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 10,000.0"); + }); - _.propPane.SelectPropertiesDropDown("Decimals allowed", "0"); + _.propPane.SelectPropertiesDropDown("Decimals allowed", "2"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 10K"); - }); - }); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 10,000.01"); + }); - it("4. shoudl test that currency column is editable", () => { - _.propPane.SelectPropertiesDropDown("Notation", "Standard"); + _.propPane.TogglePropertyState("Thousand separator", false); - updateCellValue("1,234.23"); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 10000.01"); + }); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 123423"); - }); + _.propPane.SelectPropertiesDropDown("Notation", "Compact"); - _.propPane.SelectPropertiesDropDown("Decimals allowed", "1"); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 10.00K"); + }); - updateCellValue("4321.23"); + _.propPane.SelectPropertiesDropDown("Decimals allowed", "0"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 4321.2"); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 10K"); + }); }); - _.propPane.SelectPropertiesDropDown("Decimals allowed", "2"); + it("4. shoudl test that currency column is editable", () => { + _.propPane.SelectPropertiesDropDown("Notation", "Standard"); - updateCellValue("1234.23"); + updateCellValue("1,234.23"); - cy.readTableV2data(0, 0).then((val) => { - expect(val).to.equal("₹ 1234.23"); - }); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 123423"); + }); - cy.editTableCell(0, 0); + _.propPane.SelectPropertiesDropDown("Decimals allowed", "1"); - cy.enterTableCellValue(0, 0, 6543.23); + updateCellValue("4321.23"); - cy.get(".t--widget-textwidget .t--text-widget-container").should( - "have.text", - "6543.23|6543.23|number|string", - ); + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 4321.2"); + }); - cy.saveTableCellValue(0, 0); - }); -}); + _.propPane.SelectPropertiesDropDown("Decimals allowed", "2"); + + updateCellValue("1234.23"); + + cy.readTableV2data(0, 0).then((val) => { + expect(val).to.equal("₹ 1234.23"); + }); + + cy.editTableCell(0, 0); + + cy.enterTableCellValue(0, 0, 6543.23); + + cy.get(".t--widget-textwidget .t--text-widget-container").should( + "have.text", + "6543.23|6543.23|number|string", + ); + + cy.saveTableCellValue(0, 0); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js index bec3425f26c..7288e635b50 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js @@ -36,7 +36,7 @@ const tableData = `[ const switchSelector = " .bp3-switch input[type='checkbox']"; describe( "Switch column type funtionality test", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column1_spec.js index bf7400a4e57..59311ee00d5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column1_spec.js @@ -9,7 +9,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Column freeze & unfreeze in canavs mode", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { cy.dragAndDropToCanvas(_.draggableWidgets.TABLE, { x: 200, y: 200 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column2_spec.js index ce0337d57bd..2df209b3fd3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column2_spec.js @@ -2,7 +2,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Column freeze & unfreeze in page mode", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { cy.dragAndDropToCanvas(_.draggableWidgets.TABLE, { x: 200, y: 200 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column3_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column3_spec.js index ef9855b27f3..93c778a7d74 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column3_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column3_spec.js @@ -5,7 +5,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json"); describe( "Server-side pagination when turned on test of re-ordering columns", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { cy.dragAndDropToCanvas(_.draggableWidgets.TABLE, { x: 500, y: 200 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column_query_change_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column_query_change_spec.js index 03de7702f9c..e606409aebc 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column_query_change_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/freeze_column_query_change_spec.js @@ -12,7 +12,7 @@ const widgetsPage = require("../../../../../locators/Widgets.json"); describe( "1. Check frozen common and/or custom columns retain position on query change", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { cy.dragAndDropToCanvas(WIDGET.TABLE, { x: 600, y: 200 }); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/inline_editing_validations_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/inline_editing_validations_spec.js index 5330643d0a7..cb25d3b6667 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/inline_editing_validations_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/inline_editing_validations_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Table widget inline editing validation functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { afterEach(() => { _.agHelper.SaveLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/non_ascii_column_name_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/non_ascii_column_name_spec.js index dd913d96165..e7340e94016 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/non_ascii_column_name_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/non_ascii_column_name_spec.js @@ -13,7 +13,7 @@ const data = [ describe( "Non ASCII character functionality", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, () => { before(() => { _.agHelper.AddDsl("tableV2NewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/scrollbar_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/scrollbar_spec.ts index 46ea5ab0227..daafb18945e 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/scrollbar_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/scrollbar_spec.ts @@ -10,7 +10,7 @@ import { describe( "Table widget v2: tableData change test", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("Table/ScrollbarDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts index 427fa103ece..e8b145a2a9d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/table_data_change_spec.ts @@ -104,7 +104,7 @@ const TABLE_DATA_2 = `[ describe( "Table widget v2: tableData change test", - { tags: ["@tag.Widget", "@tag.Table"] }, + { tags: ["@tag.Widget", "@tag.Table", "@tag.Binding"] }, function () { before(() => { agHelper.ClearLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text2_Spec.ts index 436e421c409..c233ee88749 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text2_Spec.ts @@ -14,7 +14,7 @@ import EditorNavigation, { describe( "Text widget tests", - { tags: ["@tag.Widget", "@tag.Text"] }, + { tags: ["@tag.Widget", "@tag.Text", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_BgColor_TextSize_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_BgColor_TextSize_spec.js index e57ec52c35f..51b20499aa3 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_BgColor_TextSize_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_BgColor_TextSize_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Text Widget Cell Background and Text Size Validation", - { tags: ["@tag.Widget", "@tag.Text"] }, + { tags: ["@tag.Widget", "@tag.Text", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("textWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js index b473a01b24d..d0966f4692a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/TextWidget_LintErrorValidation_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Linting warning validation with text widget", - { tags: ["@tag.Widget", "@tag.Text"] }, + { tags: ["@tag.Widget", "@tag.Text", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("textLintErrorDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_new_feature_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_new_feature_spec.js index 1f2cabcf57e..f082695a557 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_new_feature_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_new_feature_spec.js @@ -8,7 +8,7 @@ import { describe( "Text Widget color/font/alignment Functionality", - { tags: ["@tag.Widget", "@tag.Text"] }, + { tags: ["@tag.Widget", "@tag.Text", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("textDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_spec.js index 4078aaeaa14..7ec3c3819f0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_spec.js @@ -4,7 +4,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Text Widget Functionality", - { tags: ["@tag.Widget", "@tag.Text"] }, + { tags: ["@tag.Widget", "@tag.Text", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("displayWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_truncate_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_truncate_spec.js index 6ed7cd0cfe2..f9e0943f4ba 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_truncate_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Text/Text_truncate_spec.js @@ -3,7 +3,7 @@ import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "Text Widget Truncate Functionality", - { tags: ["@tag.Widget", "@tag.Text"] }, + { tags: ["@tag.Widget", "@tag.Text", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("textNewDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Select_TreeSelect_MultiSelect_Empty_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Select_TreeSelect_MultiSelect_Empty_spec.ts index 31ace1c9d8b..6b8e2ae88c9 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Select_TreeSelect_MultiSelect_Empty_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Select_TreeSelect_MultiSelect_Empty_spec.ts @@ -2,7 +2,7 @@ import formWidgetsPage from "../../../../../locators/FormWidgets.json"; import * as _ from "../../../../../support/Objects/ObjectsCore"; describe( "MultiSelect, Tree Select and Multi Tree Select Widget Empty Options Functionality", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("SelectDslWithEmptyOptions"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Single_Select_Tree_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Single_Select_Tree_spec.ts index 8969c96e44a..a6e2f3131e1 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Single_Select_Tree_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Single_Select_Tree_spec.ts @@ -13,7 +13,7 @@ const toggleJSButton = (name) => `.t--property-control-${name} .t--js-toggle`; describe( "Single Select Widget Functionality", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("TreeSelectDsl"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts index 67d20b2511d..2a8b761d3a0 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_2_spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "Tree Select widget Tests", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify("formwidget", 500, 100); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_spec.ts index 7573dbcbffb..8e1f95fff08 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/TreeSelect/Tree_Select_spec.ts @@ -5,7 +5,7 @@ import commonlocators from "../../../../../locators/commonlocators.json"; describe( "Tree Select Widget", - { tags: ["@tag.Widget", "@tag.Select"] }, + { tags: ["@tag.Widget", "@tag.Select", "@tag.Binding"] }, function () { before(() => { _.agHelper.AddDsl("emptyDSL"); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video2_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video2_Spec.ts index ad7e177f8ec..1179888d202 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video2_Spec.ts @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Video widget tests", - { tags: ["@tag.Widget", "@tag.Video"] }, + { tags: ["@tag.Widget", "@tag.Video", "@tag.Binding"] }, function () { before(() => { homePage.NavigateToHome(); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video_spec.ts index 4cec636c401..78d0fc8d2a2 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Video/Video_spec.ts @@ -9,7 +9,7 @@ import { describe( "Video Widget Functionality", - { tags: ["@tag.Widget", "@tag.Video"] }, + { tags: ["@tag.Widget", "@tag.Video", "@tag.Binding"] }, function () { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.VIDEO); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetCopyPaste_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetCopyPaste_spec.js index a00829489b7..04f5e84b09a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetCopyPaste_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetCopyPaste_spec.js @@ -10,159 +10,163 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; import PageList from "../../../../support/Pages/PageList"; const widgetSelector = (name) => `[data-widgetname-cy="${name}"]`; -describe("Widget Copy paste", { tags: ["@tag.Widget"] }, function () { - const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; - before(() => { - _.agHelper.AddDsl("WidgetCopyPaste"); - }); - - it("1. When non Layout widget is selected, it should place below the widget selected", function () { - // Selection - cy.get(`#${dsl.dsl.children[1].widgetId}`).click({ - ctrlKey: true, +describe( + "Widget Copy paste", + { tags: ["@tag.Widget", "@tag.Binding"] }, + function () { + const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl"; + before(() => { + _.agHelper.AddDsl("WidgetCopyPaste"); }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 1); - - //copy - cy.get("body").type(`{${modifierKey}}{c}`); - cy.get(commonLocators.toastmsg).contains("Copied"); - - //paste - cy.get("body").type(`{${modifierKey}}{v}`); - cy.get(widgetsPage.chartWidget).should("have.length", 2); - - // verify the position - cy.get(widgetsPage.chartWidget) - .eq(0) - .then((element) => { - const elementTop = parseFloat(element.css("top")); - const elementHeight = parseFloat(element.css("height")); - const pastedWidgetTop = - (elementTop + elementHeight + 10).toString() + "px"; - cy.get(widgetsPage.chartWidget) - .eq(1) - .invoke("attr", "style") - .should("contain", `left: ${element.css("left")}`) - .should("contain", `top: ${pastedWidgetTop}`); + + it("1. When non Layout widget is selected, it should place below the widget selected", function () { + // Selection + cy.get(`#${dsl.dsl.children[1].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 1); + + //copy + cy.get("body").type(`{${modifierKey}}{c}`); + cy.get(commonLocators.toastmsg).contains("Copied"); + + //paste + cy.get("body").type(`{${modifierKey}}{v}`); + cy.get(widgetsPage.chartWidget).should("have.length", 2); + + // verify the position + cy.get(widgetsPage.chartWidget) + .eq(0) + .then((element) => { + const elementTop = parseFloat(element.css("top")); + const elementHeight = parseFloat(element.css("height")); + const pastedWidgetTop = + (elementTop + elementHeight + 10).toString() + "px"; + cy.get(widgetsPage.chartWidget) + .eq(1) + .invoke("attr", "style") + .should("contain", `left: ${element.css("left")}`) + .should("contain", `top: ${pastedWidgetTop}`); + }); + }); + + it("2. When Layout widget is selected, it should place it inside the layout widget", function () { + cy.get(`#div-selection-0`).click({ + force: true, + }); + + // Selection + cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ + ctrlKey: true, }); - }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 1); + + //paste + cy.get("body").type(`{${modifierKey}}{v}`); - it("2. When Layout widget is selected, it should place it inside the layout widget", function () { - cy.get(`#div-selection-0`).click({ - force: true, + cy.get(`#${dsl.dsl.children[0].widgetId}`) + .find(widgetsPage.chartWidget) + .should("have.length", 1); }); - // Selection - cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ - ctrlKey: true, + it("3. When widget inside the layout widget is selected, then it should paste inside the layout widget below the selected widget", function () { + cy.get(`#div-selection-0`).click({ + force: true, + }); + + // Selection + cy.get(`#${dsl.dsl.children[0].widgetId}`) + .find(widgetsPage.chartWidget) + .click({ + ctrlKey: true, + }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 1); + + //paste + cy.get("body").type(`{${modifierKey}}{v}`); + cy.get(`#${dsl.dsl.children[0].widgetId}`) + .find(widgetsPage.chartWidget) + .should("have.length", 2); }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 1); - //paste - cy.get("body").type(`{${modifierKey}}{v}`); + it("4. When modal is open, it should paste inside the modal", () => { + //add modal widget + cy.dragAndDropToCanvas("modalwidget", { x: 300, y: 700 }); + cy.get(".t--modal-widget").should("exist"); - cy.get(`#${dsl.dsl.children[0].widgetId}`) - .find(widgetsPage.chartWidget) - .should("have.length", 1); - }); + //paste + cy.get("body").type(`{${modifierKey}}{v}`); + cy.get(".t--modal-widget") + .find(widgetsPage.chartWidget) + .should("have.length", 1); + }); - it("3. When widget inside the layout widget is selected, then it should paste inside the layout widget below the selected widget", function () { - cy.get(`#div-selection-0`).click({ - force: true, + it("5. When widget Inside a modal is selected, it should paste inside the modal", () => { + //verify modal and selected widget + cy.get(".t--modal-widget").should("exist"); + cy.get(".t--modal-widget") + .find(`div[data-testid='t--selected']`) + .should("have.length", 1); + + //paste + cy.get("body").type(`{${modifierKey}}{v}`); + // cy.get(explorer.entityModal).click(); + cy.get(".t--modal-widget") + .find(widgetsPage.chartWidget) + .should("have.length", 2); }); - // Selection - cy.get(`#${dsl.dsl.children[0].widgetId}`) - .find(widgetsPage.chartWidget) - .click({ - ctrlKey: true, - }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 1); - - //paste - cy.get("body").type(`{${modifierKey}}{v}`); - cy.get(`#${dsl.dsl.children[0].widgetId}`) - .find(widgetsPage.chartWidget) - .should("have.length", 2); - }); - - it("4. When modal is open, it should paste inside the modal", () => { - //add modal widget - cy.dragAndDropToCanvas("modalwidget", { x: 300, y: 700 }); - cy.get(".t--modal-widget").should("exist"); - - //paste - cy.get("body").type(`{${modifierKey}}{v}`); - cy.get(".t--modal-widget") - .find(widgetsPage.chartWidget) - .should("have.length", 1); - }); - - it("5. When widget Inside a modal is selected, it should paste inside the modal", () => { - //verify modal and selected widget - cy.get(".t--modal-widget").should("exist"); - cy.get(".t--modal-widget") - .find(`div[data-testid='t--selected']`) - .should("have.length", 1); - - //paste - cy.get("body").type(`{${modifierKey}}{v}`); - // cy.get(explorer.entityModal).click(); - cy.get(".t--modal-widget") - .find(widgetsPage.chartWidget) - .should("have.length", 2); - }); - - it("6. Should be able to paste list widget inside another list widget", function () { - //clean up - PageList.AddNewPage("New blank page"); - - //add list widget - PageLeftPane.switchToAddNew(); - cy.dragAndDropToCanvas("listwidgetv2", { x: 500, y: 700 }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 1); - - //copy - cy.get("body").type(`{${modifierKey}}{c}`); - - //paste - cy.get(`${widgetSelector("List1")} [type="CONTAINER_WIDGET"]`) - .first() - .type(`{${modifierKey}}{v}`); - cy.get(widgetsPage.listWidgetv2).should("have.length", 4); - cy.get(`${widgetSelector("List1")} [type="CONTAINER_WIDGET"]`) - .first() - .find(widgetsPage.listWidgetv2) - .should("have.length", 1); - }); - - it("7. Should be able to paste widget on the initial generate Page", function () { - cy.Createpage("NewPage", false); - - //paste - cy.get("body").type(`{${modifierKey}}{v}`); - - //verify a pasted list widget - cy.get(widgetsPage.listWidgetv2).should("have.length", 1); - }); - - it("8. Should not be able to copy/cut canvas widgets (i.e. Individual Tabs) of tabs widget", function () { - PageList.AddNewPage("New blank page"); - - _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TAB, 400, 200); - - EditorNavigation.SelectEntityByName("Tab 1", EntityType.Widget, {}, [ - "Tabs1", - ]); - - cy.get("body").type(`{${modifierKey}}{c}`); - - _.agHelper.ValidateToastMessage("This selected widget cannot be copied."); - - _.agHelper.WaitUntilAllToastsDisappear(); - - cy.get("body").type(`{${modifierKey}}{x}`); - - _.agHelper.ValidateToastMessage("This selected widget cannot be cut."); - }); -}); + it("6. Should be able to paste list widget inside another list widget", function () { + //clean up + PageList.AddNewPage("New blank page"); + + //add list widget + PageLeftPane.switchToAddNew(); + cy.dragAndDropToCanvas("listwidgetv2", { x: 500, y: 700 }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 1); + + //copy + cy.get("body").type(`{${modifierKey}}{c}`); + + //paste + cy.get(`${widgetSelector("List1")} [type="CONTAINER_WIDGET"]`) + .first() + .type(`{${modifierKey}}{v}`); + cy.get(widgetsPage.listWidgetv2).should("have.length", 4); + cy.get(`${widgetSelector("List1")} [type="CONTAINER_WIDGET"]`) + .first() + .find(widgetsPage.listWidgetv2) + .should("have.length", 1); + }); + + it("7. Should be able to paste widget on the initial generate Page", function () { + cy.Createpage("NewPage", false); + + //paste + cy.get("body").type(`{${modifierKey}}{v}`); + + //verify a pasted list widget + cy.get(widgetsPage.listWidgetv2).should("have.length", 1); + }); + + it("8. Should not be able to copy/cut canvas widgets (i.e. Individual Tabs) of tabs widget", function () { + PageList.AddNewPage("New blank page"); + + _.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TAB, 400, 200); + + EditorNavigation.SelectEntityByName("Tab 1", EntityType.Widget, {}, [ + "Tabs1", + ]); + + cy.get("body").type(`{${modifierKey}}{c}`); + + _.agHelper.ValidateToastMessage("This selected widget cannot be copied."); + + _.agHelper.WaitUntilAllToastsDisappear(); + + cy.get("body").type(`{${modifierKey}}{x}`); + + _.agHelper.ValidateToastMessage("This selected widget cannot be cut."); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetGrouping_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetGrouping_spec.js index 63d71bf3d03..e54e3031acb 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetGrouping_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetGrouping_spec.js @@ -1,48 +1,52 @@ const dsl = require("../../../../fixtures/widgetSelection.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("Widget Grouping", { tags: ["@tag.Widget"] }, function () { - before(() => { - _.agHelper.AddDsl("widgetSelection"); - }); - - it("Select widgets using cmd + click and group using cmd + G", function () { - // Selection - cy.get(`#${dsl.dsl.children[2].widgetId}`).click({ - ctrlKey: true, - }); - cy.get(`#${dsl.dsl.children[3].widgetId}`).click({ - ctrlKey: true, +describe( + "Widget Grouping", + { tags: ["@tag.Widget", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("widgetSelection"); }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 2); - cy.get(`.t--multi-selection-box`).should("have.length", 1); - const isMac = Cypress.platform === "darwin"; - // Grouping - if (isMac) { - cy.get("body").type("{cmd}{g}"); - } else { - cy.get("body").type("{ctrl}{g}"); - } - cy.wait(2000); - cy.get(`div[data-testid='t--selected']`) - .should("have.length", 1) - .as("group"); - cy.get("body").click(); - cy.get(`@group`) - .find(`[data-testid="test-widget"]`) - .should("have.length", 2); - cy.get(`@group`).find(`.t--draggable-buttonwidget`); - cy.get(`@group`).find(`.t--draggable-imagewidget`); - // verify the position so that the camera widget is still below the newly grouped container - cy.get(`.t--widget-containerwidget`) - .eq(1) - .then((element) => { - const elementTop = parseFloat(element.css("top")); - cy.get(`.t--widget-camerawidget`).then((element2) => { - const containerTop = parseFloat(element2.css("top")); - expect(containerTop).to.be.greaterThan(elementTop); - }); + it("Select widgets using cmd + click and group using cmd + G", function () { + // Selection + cy.get(`#${dsl.dsl.children[2].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`#${dsl.dsl.children[3].widgetId}`).click({ + ctrlKey: true, }); - }); -}); + cy.get(`div[data-testid='t--selected']`).should("have.length", 2); + cy.get(`.t--multi-selection-box`).should("have.length", 1); + const isMac = Cypress.platform === "darwin"; + // Grouping + if (isMac) { + cy.get("body").type("{cmd}{g}"); + } else { + cy.get("body").type("{ctrl}{g}"); + } + cy.wait(2000); + cy.get(`div[data-testid='t--selected']`) + .should("have.length", 1) + .as("group"); + cy.get("body").click(); + cy.get(`@group`) + .find(`[data-testid="test-widget"]`) + .should("have.length", 2); + cy.get(`@group`).find(`.t--draggable-buttonwidget`); + cy.get(`@group`).find(`.t--draggable-imagewidget`); + + // verify the position so that the camera widget is still below the newly grouped container + cy.get(`.t--widget-containerwidget`) + .eq(1) + .then((element) => { + const elementTop = parseFloat(element.css("top")); + cy.get(`.t--widget-camerawidget`).then((element2) => { + const containerTop = parseFloat(element2.css("top")); + expect(containerTop).to.be.greaterThan(elementTop); + }); + }); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetSelection_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetSelection_spec.js index 85e75b0b90f..fad3c44d435 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetSelection_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/WidgetSelection_spec.js @@ -8,62 +8,66 @@ import { const dsl = require("../../../../fixtures/widgetSelection.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("Widget Selection", { tags: ["@tag.Widget"] }, function () { - before(() => { - _.agHelper.AddDsl("widgetSelection"); - }); - - it("1. Multi Select widgets using cmd + click", function () { - cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ - ctrlKey: true, - }); - cy.get(`#${dsl.dsl.children[1].widgetId}`).click({ - ctrlKey: true, - }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 2); - cy.get(`#${dsl.dsl.children[2].widgetId}`).click({ - ctrlKey: true, +describe( + "Widget Selection", + { tags: ["@tag.Widget", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("widgetSelection"); }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 3); - cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ - ctrlKey: true, - }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 2); - cy.get(`.t--multi-selection-box`).should("have.length", 1); - }); + it("1. Multi Select widgets using cmd + click", function () { + cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`#${dsl.dsl.children[1].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 2); + cy.get(`#${dsl.dsl.children[2].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 3); + cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 2); - it("2. Select widgets using cmd + click and open property pane by clicking on the widget from right side panel", function () { - // Selection - cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ - ctrlKey: true, - }); - cy.get(`#${dsl.dsl.children[2].widgetId}`).click({ - ctrlKey: true, + cy.get(`.t--multi-selection-box`).should("have.length", 1); }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 2); - cy.get(`.t--multi-selection-box`).should("have.length", 1); - //select on one of the widgets from the right side panel - cy.get(`.t-multi-widget-property-pane`).should("have.length", 1); - cy.get(`#${dsl.dsl.children[2].widgetId}`).should("have.length", 1); - cy.get(`#widget_name_${dsl.dsl.children[2].widgetId}`).click({ - force: true, - }); + it("2. Select widgets using cmd + click and open property pane by clicking on the widget from right side panel", function () { + // Selection + cy.get(`#${dsl.dsl.children[0].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`#${dsl.dsl.children[2].widgetId}`).click({ + ctrlKey: true, + }); + cy.get(`div[data-testid='t--selected']`).should("have.length", 2); + cy.get(`.t--multi-selection-box`).should("have.length", 1); + + //select on one of the widgets from the right side panel + cy.get(`.t-multi-widget-property-pane`).should("have.length", 1); + cy.get(`#${dsl.dsl.children[2].widgetId}`).should("have.length", 1); + cy.get(`#widget_name_${dsl.dsl.children[2].widgetId}`).click({ + force: true, + }); - //should open property pane - cy.get(`.t--property-pane-view`).should("have.length", 1); - }); + //should open property pane + cy.get(`.t--property-pane-view`).should("have.length", 1); + }); - it("3. Should not select widgets if we hit CTRL + A on other Pages", function () { - // Click to create a New Data Source - _.dataSources.NavigateToDSCreateNew(); - // Hit CTRL +A - cy.get("body").type("{ctrl}{a}"); - // Switch to the Canvas - AppSidebar.navigate(AppSidebarButton.Editor); - PageLeftPane.switchSegment(PagePaneSegment.UI); - // Widgets should not be selected - cy.get(".t--multi-selection-box").should("not.exist"); - }); -}); + it("3. Should not select widgets if we hit CTRL + A on other Pages", function () { + // Click to create a New Data Source + _.dataSources.NavigateToDSCreateNew(); + // Hit CTRL +A + cy.get("body").type("{ctrl}{a}"); + // Switch to the Canvas + AppSidebar.navigate(AppSidebarButton.Editor); + PageLeftPane.switchSegment(PagePaneSegment.UI); + // Widgets should not be selected + cy.get(".t--multi-selection-box").should("not.exist"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Widgets_Labels_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Widgets_Labels_spec.js index 5fa084c1be3..81328b3a81a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/Widgets_Labels_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/Widgets_Labels_spec.js @@ -1,6 +1,6 @@ let COLUMN_SPACE = 0; -describe("Label feature", { tags: ["@tag.Widget"] }, () => { +describe("Label feature", { tags: ["@tag.Widget", "@tag.Binding"] }, () => { before(() => { cy.get("#canvas-viewport").invoke("width", `640px`); // 72 - gutter width diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/deprecatedWidgets_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Widgets/deprecatedWidgets_spec.js index f3532f72d33..c18f1524543 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Widgets/deprecatedWidgets_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/deprecatedWidgets_spec.js @@ -1,28 +1,35 @@ const dsl = require("../../../../fixtures/deprecatedWidgets.json"); import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("Deprecation warning feature", { tags: ["@tag.Widget"] }, function () { - before(() => { - _.agHelper.AddDsl("deprecatedWidgets"); - }); - - it("should have deprecation warning on all the deprecated widgets", function () { - cy.get(`#div-selection-0`).click({ - force: true, +describe( + "Deprecation warning feature", + { tags: ["@tag.Widget", "@tag.Binding"] }, + function () { + before(() => { + _.agHelper.AddDsl("deprecatedWidgets"); }); - for (const widgets of dsl.dsl.children) { + it("should have deprecation warning on all the deprecated widgets", function () { cy.get(`#div-selection-0`).click({ force: true, }); - cy.get(`#${widgets.widgetId}`).click({ - ctrlKey: true, - }); + for (const widgets of dsl.dsl.children) { + cy.get(`#div-selection-0`).click({ + force: true, + }); - cy.get(`div[data-testid='t--selected']`).should("have.length", 1); + cy.get(`#${widgets.widgetId}`).click({ + ctrlKey: true, + }); - cy.get(`[data-testid='t--deprecation-warning']`).should("have.length", 1); - } - }); -}); + cy.get(`div[data-testid='t--selected']`).should("have.length", 1); + + cy.get(`[data-testid='t--deprecation-warning']`).should( + "have.length", + 1, + ); + } + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateAppWithSameNameInWorkspace_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateAppWithSameNameInWorkspace_spec.js index 53a40823ec3..578a482c416 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateAppWithSameNameInWorkspace_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateAppWithSameNameInWorkspace_spec.js @@ -7,7 +7,7 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; describe( "Create workspace and a new app / delete and recreate app", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, function () { let workspaceId; let appid; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateSameAppInDiffWorkspace_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateSameAppInDiffWorkspace_spec.js index 0f7441e383c..4cfb7b0032f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateSameAppInDiffWorkspace_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/CreateSameAppInDiffWorkspace_spec.js @@ -6,7 +6,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Create app same name in different workspace", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, function () { let workspaceId; let appid; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/DeleteWorkspace_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/DeleteWorkspace_spec.ts index ba1a8ebf24e..34acb3ad1f8 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/DeleteWorkspace_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/DeleteWorkspace_spec.ts @@ -10,7 +10,7 @@ import { describe( "Delete workspace test spec", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, function () { let newWorkspaceName: any; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/LeaveWorkspaceTest_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/LeaveWorkspaceTest_spec.js index dfa129f097e..a22854042b4 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/LeaveWorkspaceTest_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/LeaveWorkspaceTest_spec.js @@ -9,7 +9,7 @@ import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO"; describe( "Leave workspace test spec", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, function () { let newWorkspaceName; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginFromUIApp_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginFromUIApp_spec.js index 397d2527479..4b35e95cc5d 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginFromUIApp_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/LoginFromUIApp_spec.js @@ -8,7 +8,7 @@ import EditorNavigation, { describe( "Create page & delete page from UI", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, function () { let pageid; it("1. Create page & delete page from UI", function () { diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts index f747ffc96d2..85fab422673 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/MemberRoles_Spec.ts @@ -5,7 +5,7 @@ let workspaceId: any, appid: any; describe( "Create new workspace and invite user & validate all roles", - { tags: ["@tag.Workspace", "@tag.Sanity"] }, + { tags: ["@tag.Workspace", "@tag.Sanity", "@tag.AccessControl"] }, () => { it("1. Create new Workspace, Share with a user from UI & verify", () => { if (CURRENT_REPO === REPO.EE) _.adminSettings.EnableGAC(true, false); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts index 9510055ae67..94cc7ba412f 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/ShareAppTests_Spec.ts @@ -13,7 +13,7 @@ const appNavigationLocators = require("../../../../locators/AppNavigation.json") describe( "Create new workspace and share with a user", - { tags: ["@tag.Workspace", "@tag.Sanity"] }, + { tags: ["@tag.Workspace", "@tag.Sanity", "@tag.AccessControl"] }, function () { let workspaceId: string, appid: string, currentUrl: any; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/UpdateWorkspaceTests_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/UpdateWorkspaceTests_spec.js index aa3f46cad05..1f52daa85e5 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/UpdateWorkspaceTests_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/UpdateWorkspaceTests_spec.js @@ -1,92 +1,96 @@ import homePage from "../../../../locators/HomePage"; import * as _ from "../../../../support/Objects/ObjectsCore"; -describe("Update Workspace", { tags: ["@tag.Workspace"] }, function () { - let workspaceId; - let newWorkspaceName; - let appid; - - it("1. Open the workspace general settings and update workspace name. The update should reflect in the workspace. It should also reflect in the workspace names on the left side and the workspace dropdown. ", function () { - _.homePage.NavigateToHome(); - _.homePage.NavigateToHome(); - _.agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - appid = "App" + uid; - workspaceId = uid; - _.homePage.CreateNewWorkspace(workspaceId); - cy.get(homePage.workspaceSettingOption).click({ force: true }); - //_.homePage.CreateAppInWorkspace(workspaceId, appid); - cy.get(homePage.workspaceNameInput).click({ force: true }); - cy.get(homePage.workspaceNameInput).clear(); - cy.get(homePage.workspaceNameInput).type(workspaceId); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(2000); - cy.get(homePage.workspaceHeaderName).should( - "have.text", - `${workspaceId}`, - ); +describe( + "Update Workspace", + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, + function () { + let workspaceId; + let newWorkspaceName; + let appid; + it("1. Open the workspace general settings and update workspace name. The update should reflect in the workspace. It should also reflect in the workspace names on the left side and the workspace dropdown. ", function () { + _.homePage.NavigateToHome(); _.homePage.NavigateToHome(); - cy.get(homePage.leftPanelContainer).within(() => { - cy.get("span").should((item) => { - expect(item).to.contain.text(workspaceId); + _.agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + appid = "App" + uid; + workspaceId = uid; + _.homePage.CreateNewWorkspace(workspaceId); + cy.get(homePage.workspaceSettingOption).click({ force: true }); + //_.homePage.CreateAppInWorkspace(workspaceId, appid); + cy.get(homePage.workspaceNameInput).click({ force: true }); + cy.get(homePage.workspaceNameInput).clear(); + cy.get(homePage.workspaceNameInput).type(workspaceId); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(2000); + cy.get(homePage.workspaceHeaderName).should( + "have.text", + `${workspaceId}`, + ); + + _.homePage.NavigateToHome(); + cy.get(homePage.leftPanelContainer).within(() => { + cy.get("span").should((item) => { + expect(item).to.contain.text(workspaceId); + }); }); }); }); - }); - it("2. Open the workspace general settings and update workspace email. The update should reflect in the workspace.", function () { - _.agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - newWorkspaceName = "SettingsUpdate" + uid; - _.homePage.CreateNewWorkspace(newWorkspaceName); + it("2. Open the workspace general settings and update workspace email. The update should reflect in the workspace.", function () { + _.agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + newWorkspaceName = "SettingsUpdate" + uid; + _.homePage.CreateNewWorkspace(newWorkspaceName); + }); + cy.get(homePage.workspaceSettingOption).click({ force: true }); + cy.get(homePage.workspaceEmailInput).clear(); + cy.get(homePage.workspaceEmailInput).type(Cypress.env("TESTUSERNAME2")); + cy.wait("@updateWorkspace").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.get(homePage.workspaceEmailInput).should( + "have.value", + Cypress.env("TESTUSERNAME2"), + ); + // update workspace website + cy.get(homePage.workspaceWebsiteInput).clear(); + cy.get(homePage.workspaceWebsiteInput).type("demowebsite.com"); + cy.wait("@updateWorkspace").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.get(homePage.workspaceWebsiteInput).should( + "have.value", + "demowebsite.com", + ); }); - cy.get(homePage.workspaceSettingOption).click({ force: true }); - cy.get(homePage.workspaceEmailInput).clear(); - cy.get(homePage.workspaceEmailInput).type(Cypress.env("TESTUSERNAME2")); - cy.wait("@updateWorkspace").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.get(homePage.workspaceEmailInput).should( - "have.value", - Cypress.env("TESTUSERNAME2"), - ); - // update workspace website - cy.get(homePage.workspaceWebsiteInput).clear(); - cy.get(homePage.workspaceWebsiteInput).type("demowebsite.com"); - cy.wait("@updateWorkspace").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.get(homePage.workspaceWebsiteInput).should( - "have.value", - "demowebsite.com", - ); - }); - it("3. Upload logo / delete logo and validate", function () { - const fixturePath = "cypress/fixtures/appsmithlogo.png"; - cy.xpath(homePage.uploadLogo).first().selectFile(fixturePath, { - force: true, + it("3. Upload logo / delete logo and validate", function () { + const fixturePath = "cypress/fixtures/appsmithlogo.png"; + cy.xpath(homePage.uploadLogo).first().selectFile(fixturePath, { + force: true, + }); + cy.wait("@updateLogo").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); + cy.wait(1000); + cy.get(homePage.removeLogo) + .last() + .should("be.hidden") + .invoke("show") + .click({ force: true }); + cy.wait("@deleteLogo").should( + "have.nested.property", + "response.body.responseMeta.status", + 200, + ); }); - cy.wait("@updateLogo").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - cy.wait(1000); - cy.get(homePage.removeLogo) - .last() - .should("be.hidden") - .invoke("show") - .click({ force: true }); - cy.wait("@deleteLogo").should( - "have.nested.property", - "response.body.responseMeta.status", - 200, - ); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js index ba5a8f83d1d..33033fa577a 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/WorkspaceImportApplication_spec.js @@ -3,7 +3,7 @@ import { agHelper, homePage } from "../../../../support/Objects/ObjectsCore"; describe( "Workspace Import Application", - { tags: ["@tag.Workspace", "@tag.Sanity"] }, + { tags: ["@tag.Workspace", "@tag.Sanity", "@tag.AccessControl"] }, function () { let workspaceId; let newWorkspaceName; diff --git a/app/client/cypress/e2e/Regression/ClientSide/Workspace/Workspace_validation_spec.js b/app/client/cypress/e2e/Regression/ClientSide/Workspace/Workspace_validation_spec.js index 98ed4776f68..60f80565235 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/Workspace/Workspace_validation_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/Workspace/Workspace_validation_spec.js @@ -5,7 +5,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Workspace name validation spec", - { tags: ["@tag.Workspace"] }, + { tags: ["@tag.Workspace", "@tag.AccessControl"] }, function () { let workspaceId; let newWorkspaceName; diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_All_Verb_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_All_Verb_spec.js index d88c2c7ba3e..8c4cfa434ed 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_All_Verb_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_All_Verb_spec.js @@ -16,7 +16,7 @@ import { describe( "API Panel Test Functionality", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { const successMsg = "Executed successfully from user request"; afterEach(function () { diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Auto_Generated_Header_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Auto_Generated_Header_spec.ts index 5acbf74d906..bead7f2dc5c 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Auto_Generated_Header_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Auto_Generated_Header_spec.ts @@ -2,7 +2,7 @@ import * as _ from "../../../../support/Objects/ObjectsCore"; describe( "Validate API Auto generated headers", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { it("1. Check whether auto generated header is set and overidden", () => { _.apiPage.CreateApi("FirstAPI"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js index 7feda064b36..8f1a58ebc09 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js @@ -18,211 +18,217 @@ import { } from "../../../../support/Objects/ObjectsCore"; import PageList from "../../../../support/Pages/PageList"; -describe("Rest Bugs tests", { tags: ["@tag.Datasource"] }, function () { - beforeEach(() => { - agHelper.RestoreLocalStorageCache(); - }); - - afterEach(() => { - agHelper.SaveLocalStorageCache(); - }); - - it("1. Bug 5550: Not able to run APIs in parallel", function () { - agHelper.AddDsl("apiParallelDsl"); - cy.get(".ads-v2-spinner").should("not.exist"); - - //Api 1 - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].flowerImageUrl1, - "FlowerImage1", - ); - agHelper.PressEscape(); - - //Api 2 - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].flowerImageUrl2, - "FlowerImage2", - ); - agHelper.PressEscape(); - - //Api 3 - apiPage.CreateAndFillApi( - "http://host.docker.internal:8000/a.txt", - "SampleText", - ); - agHelper.PressEscape(); - - //Api 4 - apiPage.CreateAndFillApi( - "http://host.docker.internal:5001/v1/dynamicrecords/getrecordsArray", - "dynamicRecords", - ); - agHelper.PressEscape(); - - PageLeftPane.switchSegment(PagePaneSegment.UI); - agHelper.ClickButton("Invoke APIs!"); - cy.wait(12000); // for all api calls to complete! - - //Flower1 Image - cy.xpath("//img/parent::div") - .eq(0) - .find("img") - .invoke("attr", "src") - .then(($src) => { - expect($src).not.eq( - "http://host.docker.internal:4200/clouddefaultImage.png", - ); - //expect($src).contains("cat"); - }); +describe( + "Rest Bugs tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + beforeEach(() => { + agHelper.RestoreLocalStorageCache(); + }); - // cy.wait("@postExecute").then(({ response }) => { - // expect(response.body.data.isExecutionSuccess).to.eq(true); - // expect(response.body.data.body[0].url.length).to.be.above(0); //Cat image - // }); - - // cy.wait("@postExecute").then(({ response }) => { - // expect(response.body.data.isExecutionSuccess).to.eq(true); - // expect(response.body.data.body.message.length).to.be.above(0); //Dog Image - // }); - - //Flower2 Image - cy.xpath("//img/parent::div") - .eq(1) - .find("img") - .invoke("attr", "src") - .then(($src) => { - expect($src).not.eq( - "http://host.docker.internal:4200/clouddefaultImage.png", - ); - //expect($src).contains("dog"); - }); + afterEach(() => { + agHelper.SaveLocalStorageCache(); + }); - // cy.wait("@postExecute").then(({ response }) => { - // expect(response.body.data.isExecutionSuccess).to.eq(true); - // expect(response.body.data.body.length).to.be.above(0); //Number fact - // }); - - cy.get(".t--widget-buttonwidget").scrollIntoView(); - - cy.get(".t--widget-textwidget") - .eq(0) - .invoke("text") - .then(($txt) => expect($txt).to.have.length.greaterThan(20)); - - // cy.wait("@postExecute").then(({ response }) => { - // //cy.log("Response is :"+ JSON.stringify(response.body)) - // expect(response.body.data.isExecutionSuccess).to.eq(true); - // expect(response.body.data.request.url.length).to.be.above(0); //Cocktail - // }); - - //Cocktail DB - cy.xpath("//img/parent::div") - .eq(2) - .find("img") - .invoke("attr", "src") - .then(($src) => { - expect($src).not.eq( - "http://host.docker.internal:4200/clouddefaultImage.png", - ); - //expect($src).contains("cocktail"); - }); + it("1. Bug 5550: Not able to run APIs in parallel", function () { + agHelper.AddDsl("apiParallelDsl"); + cy.get(".ads-v2-spinner").should("not.exist"); + + //Api 1 + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].flowerImageUrl1, + "FlowerImage1", + ); + agHelper.PressEscape(); + + //Api 2 + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].flowerImageUrl2, + "FlowerImage2", + ); + agHelper.PressEscape(); + + //Api 3 + apiPage.CreateAndFillApi( + "http://host.docker.internal:8000/a.txt", + "SampleText", + ); + agHelper.PressEscape(); + + //Api 4 + apiPage.CreateAndFillApi( + "http://host.docker.internal:5001/v1/dynamicrecords/getrecordsArray", + "dynamicRecords", + ); + agHelper.PressEscape(); + + PageLeftPane.switchSegment(PagePaneSegment.UI); + agHelper.ClickButton("Invoke APIs!"); + cy.wait(12000); // for all api calls to complete! + + //Flower1 Image + cy.xpath("//img/parent::div") + .eq(0) + .find("img") + .invoke("attr", "src") + .then(($src) => { + expect($src).not.eq( + "http://host.docker.internal:4200/clouddefaultImage.png", + ); + //expect($src).contains("cat"); + }); + + // cy.wait("@postExecute").then(({ response }) => { + // expect(response.body.data.isExecutionSuccess).to.eq(true); + // expect(response.body.data.body[0].url.length).to.be.above(0); //Cat image + // }); + + // cy.wait("@postExecute").then(({ response }) => { + // expect(response.body.data.isExecutionSuccess).to.eq(true); + // expect(response.body.data.body.message.length).to.be.above(0); //Dog Image + // }); + + //Flower2 Image + cy.xpath("//img/parent::div") + .eq(1) + .find("img") + .invoke("attr", "src") + .then(($src) => { + expect($src).not.eq( + "http://host.docker.internal:4200/clouddefaultImage.png", + ); + //expect($src).contains("dog"); + }); + + // cy.wait("@postExecute").then(({ response }) => { + // expect(response.body.data.isExecutionSuccess).to.eq(true); + // expect(response.body.data.body.length).to.be.above(0); //Number fact + // }); + + cy.get(".t--widget-buttonwidget").scrollIntoView(); + + cy.get(".t--widget-textwidget") + .eq(0) + .invoke("text") + .then(($txt) => expect($txt).to.have.length.greaterThan(20)); + + // cy.wait("@postExecute").then(({ response }) => { + // //cy.log("Response is :"+ JSON.stringify(response.body)) + // expect(response.body.data.isExecutionSuccess).to.eq(true); + // expect(response.body.data.request.url.length).to.be.above(0); //Cocktail + // }); + + //Cocktail DB + cy.xpath("//img/parent::div") + .eq(2) + .find("img") + .invoke("attr", "src") + .then(($src) => { + expect($src).not.eq( + "http://host.docker.internal:4200/clouddefaultImage.png", + ); + //expect($src).contains("cocktail"); + }); + + //Spread to check later! + // cy.wait(['@postExecute', '@postExecute', '@postExecute', '@postExecute'], { timeout: 8000 }).spread( + // (postExecute1, postExecute2, postExecute3, postExecute4) => { + // expect(postExecute1.body.data.isExecutionSuccess).to.eq(true); + // expect(postExecute1.body.data.body.url.length).to.be.above(0); + + // expect(postExecute2.body.data.isExecutionSuccess).to.eq(true); + // expect(postExecute2.body.data.body.type).to.eq('cat'); + + // expect(postExecute3.body.data.isExecutionSuccess).to.eq(true); + // expect(postExecute3.body.data.body.message.length).to.be.above(0); + + // expect(postExecute4.body.data.isExecutionSuccess).to.eq(true); + // expect(postExecute4.body.data.body.type).to.eq('dog'); + + // }) + }); - //Spread to check later! - // cy.wait(['@postExecute', '@postExecute', '@postExecute', '@postExecute'], { timeout: 8000 }).spread( - // (postExecute1, postExecute2, postExecute3, postExecute4) => { - // expect(postExecute1.body.data.isExecutionSuccess).to.eq(true); - // expect(postExecute1.body.data.body.url.length).to.be.above(0); - - // expect(postExecute2.body.data.isExecutionSuccess).to.eq(true); - // expect(postExecute2.body.data.body.type).to.eq('cat'); - - // expect(postExecute3.body.data.isExecutionSuccess).to.eq(true); - // expect(postExecute3.body.data.body.message.length).to.be.above(0); - - // expect(postExecute4.body.data.isExecutionSuccess).to.eq(true); - // expect(postExecute4.body.data.body.type).to.eq('dog'); - - // }) - }); - - it("2. Bug 6863: Clicking on 'debug' crashes the appsmith application", function () { - cy.startErrorRoutes(); - PageList.AddNewPage(); - //Api 1 - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].flowerImageUrl1, - "InternalServerErrorApi", - ); - apiPage.RunAPI(false); - cy.wait("@postExecuteError"); - cy.get(commonlocators.errorTab).should("be.visible").click({ force: true }); - cy.get(commonlocators.debuggerLabel) - .invoke("text") - .then(($text) => { - expect($text).to.eq("An unexpected error occurred"); - }); - }); - - it("3. Bug 4775: No Cyclical dependency when Api returns an error", function () { - entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE); - propPane.EnterJSContext("Table data", "{{MockApi.data}}"); - //Api 1 - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - "MockApi", - ); - apiPage.RunAPI(); - cy.ResponseStatusCheck(testdata.successStatusCode); - EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); - table.WaitUntilTableLoad(0, 0, "v2"); - - EditorNavigation.SelectEntityByName("MockApi", EntityType.Api); - apiPage.EnterURL( - dataManager.dsValues[dataManager.defaultEnviorment].mockHttpCodeUrl + - "404", - ); - apiPage.RunAPI(false); - agHelper.AssertElementAbsence( - locators._specificToast("Cyclic dependency found while evaluating"), - ); - cy.ResponseStatusCheck("404 NOT_FOUND"); - agHelper.GetNClick(commonlocators.errorTab); - agHelper.GetNClick(commonlocators.debuggerToggle); - cy.get(commonlocators.debuggerLabel) - .invoke("text") - .then(($text) => { - expect($text.toLowerCase()).contains("Not Found".toLowerCase()); + it("2. Bug 6863: Clicking on 'debug' crashes the appsmith application", function () { + cy.startErrorRoutes(); + PageList.AddNewPage(); + //Api 1 + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].flowerImageUrl1, + "InternalServerErrorApi", + ); + apiPage.RunAPI(false); + cy.wait("@postExecuteError"); + cy.get(commonlocators.errorTab) + .should("be.visible") + .click({ force: true }); + cy.get(commonlocators.debuggerLabel) + .invoke("text") + .then(($text) => { + expect($text).to.eq("An unexpected error occurred"); + }); + }); + + it("3. Bug 4775: No Cyclical dependency when Api returns an error", function () { + entityExplorer.DragDropWidgetNVerify(draggableWidgets.TABLE); + propPane.EnterJSContext("Table data", "{{MockApi.data}}"); + //Api 1 + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + "MockApi", + ); + apiPage.RunAPI(); + cy.ResponseStatusCheck(testdata.successStatusCode); + EditorNavigation.SelectEntityByName("Table1", EntityType.Widget); + table.WaitUntilTableLoad(0, 0, "v2"); + + EditorNavigation.SelectEntityByName("MockApi", EntityType.Api); + apiPage.EnterURL( + dataManager.dsValues[dataManager.defaultEnviorment].mockHttpCodeUrl + + "404", + ); + apiPage.RunAPI(false); + agHelper.AssertElementAbsence( + locators._specificToast("Cyclic dependency found while evaluating"), + ); + cy.ResponseStatusCheck("404 NOT_FOUND"); + agHelper.GetNClick(commonlocators.errorTab); + agHelper.GetNClick(commonlocators.debuggerToggle); + cy.get(commonlocators.debuggerLabel) + .invoke("text") + .then(($text) => { + expect($text.toLowerCase()).contains("Not Found".toLowerCase()); + }); + }); + + it("4. Bug 13515: API Response gets garbled if encoded with gzip", function () { + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockGzipApi, + "GarbledResponseAPI", + ); + apiPage.RunAPI(false); + apiPage.SelectPaneTab("Response"); + cy.wait("@postExecute").then(({ response }) => { + expect(response.body.data.isExecutionSuccess).to.eq(true); + const bodyArr = response.body.data.body; + expect(bodyArr).to.have.any.keys("gzipped"); }); - }); - - it("4. Bug 13515: API Response gets garbled if encoded with gzip", function () { - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockGzipApi, - "GarbledResponseAPI", - ); - apiPage.RunAPI(false); - apiPage.SelectPaneTab("Response"); - cy.wait("@postExecute").then(({ response }) => { - expect(response.body.data.isExecutionSuccess).to.eq(true); - const bodyArr = response.body.data.body; - expect(bodyArr).to.have.any.keys("gzipped"); }); - }); - - // this test applies to other fields as well - params and body formdata - it("5. Bug 25817: Assert that header fields are correctly updated.", function () { - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockGzipApi, - "HeaderTest", - ); - apiPage.EnterHeader("hello", "world", 0); - apiPage.EnterHeader("", "", 1); - agHelper.GetNClick(apiPage._addMoreHeaderFieldButton); - apiPage.EnterHeader("hey", "there", 2); - - agHelper.RefreshPage(); - - apiPage.ValidateHeaderParams({ key: "hello", value: "world" }, 0); - apiPage.ValidateHeaderParams({ key: "hey", value: "there" }, 1); - }); -}); + + // this test applies to other fields as well - params and body formdata + it("5. Bug 25817: Assert that header fields are correctly updated.", function () { + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockGzipApi, + "HeaderTest", + ); + apiPage.EnterHeader("hello", "world", 0); + apiPage.EnterHeader("", "", 1); + agHelper.GetNClick(apiPage._addMoreHeaderFieldButton); + apiPage.EnterHeader("hey", "there", 2); + + agHelper.RefreshPage(); + + apiPage.ValidateHeaderParams({ key: "hello", value: "world" }, 0); + apiPage.ValidateHeaderParams({ key: "hey", value: "there" }, 1); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_ContextMenu_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_ContextMenu_spec.js index aef13e574d2..3c717e80e37 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_ContextMenu_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_ContextMenu_spec.js @@ -15,7 +15,7 @@ import { describe( "API Panel Test Functionality ", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("1. Test API copy/Move/delete feature", function () { cy.Createpage("SecondPage"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_CurlPOSTImport_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_CurlPOSTImport_spec.js index a5e910cff0a..573b74152c3 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_CurlPOSTImport_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_CurlPOSTImport_spec.js @@ -1,48 +1,52 @@ const apiwidget = require("../../../../locators/apiWidgetslocator.json"); import { apiPage, assertHelper } from "../../../../support/Objects/ObjectsCore"; -describe("Test curl import flow", { tags: ["@tag.Datasource"] }, function () { - it("1. Test curl import flow for POST action with JSON body", function () { - cy.fixture("datasources").then((datasourceFormData) => { - localStorage.setItem("ApiPaneV2", "ApiPaneV2"); - apiPage.FillCurlNImport( - 'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST ' + - datasourceFormData["echoApiUrl"], - { - force: true, - parseSpecialCharSequences: false, - }, - ); - assertHelper.AssertNetworkExecutionSuccess("@postExecute"); - cy.get("@curlImport").then((response) => { - cy.expect(response.response.body.responseMeta.success).to.eq(true); - cy.get(apiwidget.ApiName) - .invoke("text") - .then((text) => { - const someText = text; - expect(someText).to.equal(response.response.body.data.name); - }); +describe( + "Test curl import flow", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. Test curl import flow for POST action with JSON body", function () { + cy.fixture("datasources").then((datasourceFormData) => { + localStorage.setItem("ApiPaneV2", "ApiPaneV2"); + apiPage.FillCurlNImport( + 'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST ' + + datasourceFormData["echoApiUrl"], + { + force: true, + parseSpecialCharSequences: false, + }, + ); + assertHelper.AssertNetworkExecutionSuccess("@postExecute"); + cy.get("@curlImport").then((response) => { + cy.expect(response.response.body.responseMeta.success).to.eq(true); + cy.get(apiwidget.ApiName) + .invoke("text") + .then((text) => { + const someText = text; + expect(someText).to.equal(response.response.body.data.name); + }); + }); }); }); - }); - it("2. Test curl import flow for POST action with multipart form data", function () { - cy.fixture("datasources").then((datasourceFormData) => { - apiPage.FillCurlNImport( - `curl --request POST ${datasourceFormData["multipartAPI"]} -F 'randomKey=randomValue' --form 'randomKey2=\"randomValue2\"'`, - ); - cy.get("@postExecute").then((response) => { - cy.log(response); - cy.expect(response.response.body.responseMeta.success).to.eq(true); - // Asserting if the form key value are returned in the response - cy.expect(response.response.body.data.body.data.randomKey).to.eq( - "randomValue", + it("2. Test curl import flow for POST action with multipart form data", function () { + cy.fixture("datasources").then((datasourceFormData) => { + apiPage.FillCurlNImport( + `curl --request POST ${datasourceFormData["multipartAPI"]} -F 'randomKey=randomValue' --form 'randomKey2=\"randomValue2\"'`, ); - apiPage.ValidateHeaderParams({ - key: "Content-Type", - value: "multipart/form-data", + cy.get("@postExecute").then((response) => { + cy.log(response); + cy.expect(response.response.body.responseMeta.success).to.eq(true); + // Asserting if the form key value are returned in the response + cy.expect(response.response.body.data.body.data.randomKey).to.eq( + "randomValue", + ); + apiPage.ValidateHeaderParams({ + key: "Content-Type", + value: "multipart/form-data", + }); }); }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_DefaultContentType_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_DefaultContentType_spec.js index 75f2ba07d7d..a673acae0ed 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_DefaultContentType_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_DefaultContentType_spec.js @@ -8,70 +8,74 @@ import appPage from "../../../../locators/CMSApplocators"; import apiEditor from "../../../../locators/ApiEditor"; import { apiPage } from "../../../../support/Objects/ObjectsCore"; -describe("API Panel request body", { tags: ["@tag.Datasource"] }, function () { - it("1. Check whether the default content-type changes on changing method types and remains unchanged on switching to GET", function () { - cy.CreateAPI("FirstAPI"); +describe( + "API Panel request body", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. Check whether the default content-type changes on changing method types and remains unchanged on switching to GET", function () { + cy.CreateAPI("FirstAPI"); - // Checking for default Body type to be NONE - cy.contains(apiEditor.bodyTab).click({ force: true }); - cy.get(apiEditor.bodyTypeSelected).should("have.text", "NONE"); + // Checking for default Body type to be NONE + cy.contains(apiEditor.bodyTab).click({ force: true }); + cy.get(apiEditor.bodyTypeSelected).should("have.text", "NONE"); - apiPage.SelectSubTab("JSON"); + apiPage.SelectSubTab("JSON"); - //Switch to headers tab - cy.contains(apiEditor.headersTab).click(); + //Switch to headers tab + cy.contains(apiEditor.headersTab).click(); - // Changing method type to POST - cy.get(apiEditor.ApiVerb).click(); - cy.get(appPage.selectPost).click(); + // Changing method type to POST + cy.get(apiEditor.ApiVerb).click(); + cy.get(appPage.selectPost).click(); - // Checking Header for POST Type - cy.get(apiwidget.autoGeneratedHeaderKey) - .first() - .should("have.text", "content-type"); - cy.get(apiwidget.autoGeneratedHeaderValue) - .first() - .should("have.text", "application/json"); + // Checking Header for POST Type + cy.get(apiwidget.autoGeneratedHeaderKey) + .first() + .should("have.text", "content-type"); + cy.get(apiwidget.autoGeneratedHeaderValue) + .first() + .should("have.text", "application/json"); - // Checking Body type to be JSON - cy.contains(apiEditor.bodyTab).click({ force: true }); - apiPage.SelectSubTab("JSON"); - cy.get(apiEditor.bodyTypeSelected).should("have.text", "JSON"); + // Checking Body type to be JSON + cy.contains(apiEditor.bodyTab).click({ force: true }); + apiPage.SelectSubTab("JSON"); + cy.get(apiEditor.bodyTypeSelected).should("have.text", "JSON"); - // Changing method type to GET - cy.get(apiEditor.ApiVerb).first().click(); - cy.get(appPage.selectGet).first().click(); + // Changing method type to GET + cy.get(apiEditor.ApiVerb).first().click(); + cy.get(appPage.selectGet).first().click(); - // Checking Header for GET Type - cy.contains(apiEditor.headersTab).click(); - cy.get(apiwidget.autoGeneratedHeaderKey) - .first() - .should("have.text", "content-type"); - cy.get(apiwidget.autoGeneratedHeaderValue) - .first() - .should("have.text", "application/json"); + // Checking Header for GET Type + cy.contains(apiEditor.headersTab).click(); + cy.get(apiwidget.autoGeneratedHeaderKey) + .first() + .should("have.text", "content-type"); + cy.get(apiwidget.autoGeneratedHeaderValue) + .first() + .should("have.text", "application/json"); - cy.DeleteAPI(); - }); + cy.DeleteAPI(); + }); - it("2. Bug 14624 - Verifying the content-type none is not added", function () { - AppSidebar.navigate(AppSidebarButton.Editor); - cy.CreateAPI("FirstAPI"); + it("2. Bug 14624 - Verifying the content-type none is not added", function () { + AppSidebar.navigate(AppSidebarButton.Editor); + cy.CreateAPI("FirstAPI"); - // Checking for default Body type to be NONE - cy.contains(apiEditor.bodyTab).click({ force: true }); - cy.get(apiEditor.bodyTypeSelected).should("have.text", "NONE"); + // Checking for default Body type to be NONE + cy.contains(apiEditor.bodyTab).click({ force: true }); + cy.get(apiEditor.bodyTypeSelected).should("have.text", "NONE"); - //Switch to headers tab - cy.contains(apiEditor.headersTab).click(); + //Switch to headers tab + cy.contains(apiEditor.headersTab).click(); - // Checking Header to not have content-type:none - cy.get(`${apiwidget.headerKey} .CodeMirror .CodeMirror-code`) - .first() - .should("not.have.text", "content-type"); - cy.get(`${apiwidget.headerValue} .CodeMirror .CodeMirror-code`) - .first() - .should("not.have.text", "none"); - cy.DeleteAPI(); - }); -}); + // Checking Header to not have content-type:none + cy.get(`${apiwidget.headerKey} .CodeMirror .CodeMirror-code`) + .first() + .should("not.have.text", "content-type"); + cy.get(`${apiwidget.headerValue} .CodeMirror .CodeMirror-code`) + .first() + .should("not.have.text", "none"); + cy.DeleteAPI(); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Edit_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Edit_spec.js index 32f675a51fa..d0f1a21dd87 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Edit_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Edit_spec.js @@ -16,7 +16,7 @@ import { describe( "API Panel Test Functionality", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { before(() => { agHelper.AddDsl("uiBindDsl"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_EvaluatedValue_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_EvaluatedValue_spec.ts index 81439b394ae..03350665009 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_EvaluatedValue_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_EvaluatedValue_spec.ts @@ -2,7 +2,7 @@ import { apiPage, dataManager } from "../../../../support/Objects/ObjectsCore"; describe( "Validate API URL Evaluated value", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { it("1. Check if url object does not crash App", () => { apiPage.CreateApi("FirstAPI"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts index 7d05cf8f040..44800a8afb2 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts @@ -17,7 +17,7 @@ import EditorNavigation, { describe( "Validate API request body panel", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Mustache_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Mustache_spec.js index 3fe95948339..625b54243b5 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Mustache_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Mustache_spec.js @@ -8,7 +8,7 @@ import { agHelper } from "../../../../support/Objects/ObjectsCore"; describe( "Moustache test Functionality", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { beforeEach(() => { agHelper.AddDsl("commondsl"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_RequestBody_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_RequestBody_spec.ts index 950aa5c90a2..b1d11a12a5e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_RequestBody_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_RequestBody_spec.ts @@ -4,16 +4,20 @@ import { agHelper, } from "../../../../support/Objects/ObjectsCore"; -describe("API Panel request body", { tags: ["@tag.Datasource"] }, function () { - it("1. Check whether input exists when form-encoded is selected", function () { - apiPage.CreateApi("FirstAPI"); - apiPage.SelectAPIVerb("POST"); - apiPage.SelectPaneTab("Body"); - apiPage.SelectSubTab("FORM_URLENCODED"); - agHelper.AssertElementVisibility(apiPage._bodyKey(0)); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Api, +describe( + "API Panel request body", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. Check whether input exists when form-encoded is selected", function () { + apiPage.CreateApi("FirstAPI"); + apiPage.SelectAPIVerb("POST"); + apiPage.SelectPaneTab("Body"); + apiPage.SelectSubTab("FORM_URLENCODED"); + agHelper.AssertElementVisibility(apiPage._bodyKey(0)); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Api, + }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Response_View_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Response_View_spec.js index 71a4106f6fd..630146e5d5e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Response_View_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Response_View_spec.js @@ -11,7 +11,7 @@ const testUrl1 = describe( "Bug 14666: Api Response Test Functionality ", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("1. Test table loading when data is in array format", function () { cy.log("Login Successful"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js index bf98cae0b2d..a2e9fc56c0c 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Search_spec.js @@ -20,7 +20,7 @@ const testUrl3 = describe( "API Panel Test Functionality ", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("1. Test Search API fetaure", function () { cy.log("Login Successful"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Styles_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Styles_spec.js index eb249e75cf6..12f5ad350a9 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Styles_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Styles_spec.js @@ -12,7 +12,7 @@ import EditorNavigation, { describe( "Validate API Panel CSS Styles", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { const backgroundColorGray200 = "rgb(227, 232, 239)"; const backgroundColorwhite = "rgb(255, 255, 255)"; diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts index 36df01ae346..bdc97797f40 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_TestExecuteWithDynamicBindingInUrl_spec.ts @@ -8,7 +8,9 @@ import { describe( "Test API execution with dynamic binding in URL - Bug #24218", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, () => { it("1. Test API execution with dynamic binding in URL", () => { // Create JS Object to set Appsmith store variable to mockApiUrl diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Unique_name_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Unique_name_spec.js index fcf9d24b21b..4679e43b267 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Unique_name_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Unique_name_spec.js @@ -1,13 +1,17 @@ import { apiPage } from "../../../../support/Objects/ObjectsCore"; -describe("Name uniqueness test", { tags: ["@tag.Datasource"] }, function () { - it("1. Validate Unique Name", () => { - apiPage.CreateApi("Uni"); //Creation of UniqueName Action successful - cy.CreationOfUniqueAPIcheck("Uni"); - //2. Validate download apiname check - cy.CreationOfUniqueAPIcheck("download"); - //3. Validate dedicated worker scope object property(Blob)apiname check - cy.CreationOfUniqueAPIcheck("Blob"); - // expect(2 + 2).to.equal(5); - }); -}); +describe( + "Name uniqueness test", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. Validate Unique Name", () => { + apiPage.CreateApi("Uni"); //Creation of UniqueName Action successful + cy.CreationOfUniqueAPIcheck("Uni"); + //2. Validate download apiname check + cy.CreationOfUniqueAPIcheck("download"); + //3. Validate dedicated worker scope object property(Blob)apiname check + cy.CreationOfUniqueAPIcheck("Blob"); + // expect(2 + 2).to.equal(5); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts index 3acaf340054..574ffee3f7e 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/Api_XSS_Vulnerability_spec.ts @@ -2,7 +2,7 @@ import { apiPage, agHelper } from "../../../../support/Objects/ObjectsCore"; describe( "Ensure XSS vulnerability are handled", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { const test_rest_api_url1 = "http://host.docker.internal:5001/v1/mock-api?records=20"; diff --git a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/CurlImportFlow_spec.js b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/CurlImportFlow_spec.js index 5059038431e..68bd1520957 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ApiTests/CurlImportFlow_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/ApiTests/CurlImportFlow_spec.js @@ -15,36 +15,40 @@ import { dataManager, } from "../../../../support/Objects/ObjectsCore"; -describe("Test curl import flow", { tags: ["@tag.Datasource"] }, function () { - it("1. Test curl import flow Run and Delete", function () { - localStorage.setItem("ApiPaneV2", "ApiPaneV2"); - apiPage.FillCurlNImport( - "curl -X GET " + - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - ); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Api, - }); - }); - - it("2. Bug:15175 Creating new cURL import query from entity explorer crashes the app", function () { - cy.fixture("datasources").then((datasourceFormData) => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); +describe( + "Test curl import flow", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + it("1. Test curl import flow Run and Delete", function () { + localStorage.setItem("ApiPaneV2", "ApiPaneV2"); apiPage.FillCurlNImport( - 'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST ' + - datasourceFormData["echoApiUrl"], + "curl -X GET " + + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, ); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Api, + }); }); - }); - it("3. Bug:19214 Test curl import flow for request without any headers", function () { - cy.fixture("datasources").then((datasourceFormData) => { - apiPage.FillCurlNImport( - "curl -X GET " + datasourceFormData["echoApiUrl"], - ); - apiPage.AssertEmptyHeaderKeyValuePairsPresent(0); - apiPage.AssertEmptyHeaderKeyValuePairsPresent(1); + it("2. Bug:15175 Creating new cURL import query from entity explorer crashes the app", function () { + cy.fixture("datasources").then((datasourceFormData) => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + apiPage.FillCurlNImport( + 'curl -d \'{"name":"morpheus","job":"leader"}\' -H Content-Type:application/json -X POST ' + + datasourceFormData["echoApiUrl"], + ); + }); + }); + + it("3. Bug:19214 Test curl import flow for request without any headers", function () { + cy.fixture("datasources").then((datasourceFormData) => { + apiPage.FillCurlNImport( + "curl -X GET " + datasourceFormData["echoApiUrl"], + ); + apiPage.AssertEmptyHeaderKeyValuePairsPresent(0); + apiPage.AssertEmptyHeaderKeyValuePairsPresent(1); + }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/AppLevelImport/AppImportwithDS_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/AppLevelImport/AppImportwithDS_Spec.ts index b57c449e551..2574b63898d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/AppLevelImport/AppImportwithDS_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/AppLevelImport/AppImportwithDS_Spec.ts @@ -11,7 +11,7 @@ import { describe( "App level import with Datasource", - { tags: ["@tag.ImportExport"] }, + { tags: ["@tag.ImportExport", "@tag.Git"] }, () => { //this tests coveres Applevel import for MySql, Gsheet is covered in Gsheet folder it("1. Bug #26024 - Import an app at App Level with Datasource - MySql", () => { diff --git a/app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts index 27933ddf85e..9b7e3aeff01 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Datasources/ConnectionErrors_Spec.ts @@ -8,7 +8,7 @@ import { describe( "Validate Empty DS error messages", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { let dataSourceName: string; diff --git a/app/client/cypress/e2e/Regression/ServerSide/Datasources/ElasticSearch_Basic_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Datasources/ElasticSearch_Basic_Spec.ts index 37685be9ec5..ca372a29f6a 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Datasources/ElasticSearch_Basic_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Datasources/ElasticSearch_Basic_Spec.ts @@ -4,21 +4,24 @@ import { entityItems, } from "../../../../support/Objects/ObjectsCore"; -describe("Validate Elasticsearch DS", { tags: ["@tag.Datasource"] }, () => { - let dsName: any, - books: any, - containerName = "elasticsearch"; - - before("Create a new ElasticSearch DS", () => { - dataSources.StartContainerNVerify("Elasticsearch", containerName, 45000); - dataSources.CreateDataSource("Elasticsearch"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; - }); - }); - - it("1. Validate POST/GET/PUT/DELETE", () => { - let singleBook = `{ +describe( + "Validate Elasticsearch DS", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + () => { + let dsName: any, + books: any, + containerName = "elasticsearch"; + + before("Create a new ElasticSearch DS", () => { + dataSources.StartContainerNVerify("Elasticsearch", containerName, 45000); + dataSources.CreateDataSource("Elasticsearch"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); + }); + + it("1. Validate POST/GET/PUT/DELETE", () => { + let singleBook = `{ "title": "The Lord of the Rings", "author": "J.R.R. Tolkien", "genre": ["Fantasy", "Adventure"], @@ -27,187 +30,194 @@ describe("Validate Elasticsearch DS", { tags: ["@tag.Datasource"] }, () => { "description": "The Lord of the Rings is an epic high fantasy novel written by English author and scholar J. R. R. Tolkien. The story began as a sequel to Tolkien's earlier fantasy book The Hobbit and soon developed into a much larger story." }`; - let bulkBooks = `{ "index": {"_index": "books", "_id": "2"}} + let bulkBooks = `{ "index": {"_index": "books", "_id": "2"}} { "title": "To Kill a Mockingbird", "author": "Harper Lee", "genre": ["Classic Literature", "Coming-of-Age"], "rating": 4.5, "published_date": "1960-07-11", "description": "To Kill a Mockingbird is a novel by Harper Lee, published in 1960. It is a coming-of-age story about a young girl named Scout Finch in a fictional town in Alabama during the Great Depression. The novel is renowned for its warmth and humor, despite dealing with serious issues of rape and racial inequality." } { "index": {"_index": "books", "_id": "3"}} { "title": "The Hitchhiker's Guide to the Galaxy", "author": "Douglas Adams", "genre": ["Science Fiction", "Comedy"], "rating": 4.4, "published_date": "1979-10-12", "description": "The Hitchhiker's Guide to the Galaxy is a comedy science fiction series created by Douglas Adams. It follows the misadventures of hapless human Arthur Dent and his alien friend Ford Prefect as they travel through space and time." }`; - dataSources.CreateQueryAfterDSSaved(); - - //POST - single record - dataSources.ValidateNSelectDropdown("Method", "GET", "POST"); - - agHelper.EnterValue("/books/_doc/1", { - propFieldName: "", - directInput: false, - inputFieldName: "Path", - }); - - agHelper.EnterValue(singleBook, { - propFieldName: "", - directInput: false, - inputFieldName: "Body", - }); - - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - books = JSON.parse(JSON.stringify(resObj.response.body.data.body.result)); - expect(books).to.eq("created"); - }); - - //GET - single record - dataSources.ValidateNSelectDropdown("Method", "POST", "GET"); - agHelper.EnterValue("", { - propFieldName: "", - directInput: false, - inputFieldName: "Body", - }); - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - books = JSON.parse( - JSON.stringify(resObj.response.body.data.body._source.title), - ); - expect(books).to.eq("The Lord of the Rings"); - }); - - //POST - bulk record - dataSources.ValidateNSelectDropdown("Method", "GET", "POST"); - - agHelper.EnterValue("/_bulk", { - propFieldName: "", - directInput: false, - inputFieldName: "Path", - }); - - //We need to enter new line at end, since without that body data not getting considered - agHelper.EnterValue(bulkBooks, { - propFieldName: "", - directInput: false, - inputFieldName: "Body", - }); - - agHelper - .GetElement(dataSources._bodyCodeMirror) - .type("{downarrow}".repeat(10)); - - agHelper.PressEnter(); - - agHelper.Sleep(2000); - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - expect( - JSON.parse( - JSON.stringify(resObj.response.body.data.body.items[0].index._id), - ), - ).to.eq("2"); - expect( - JSON.parse( - JSON.stringify(resObj.response.body.data.body.items[1].index._id), - ), - ).to.eq("3"); - }); - - //GET - All inserted record - dataSources.ValidateNSelectDropdown("Method", "POST", "GET"); - agHelper.EnterValue("", { - propFieldName: "", - directInput: false, - inputFieldName: "Body", - }); - - agHelper.EnterValue("/books/_search", { - propFieldName: "", - directInput: false, - inputFieldName: "Path", - }); - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - books = JSON.parse( - JSON.stringify(resObj.response.body.data.body.hits.total.value), - ); - expect(books).to.be.oneOf([1, 3]); - }); - - //PUT - update - let updateBook = `{ "title": "Pride and Prejudice", "author": "Jane Austen", "genre": ["Romance", "Classic Literature"], "rating": 4.5, "published_date": "1813-01-28", "description": "Pride and Prejudice is a romantic novel by Jane Austen, first published in 1813. The story follows the main character Elizabeth Bennet as she deals with issues of manners, upbringing, morality, education, and marriage in the society of the landed gentry of the British Regency." }`; - dataSources.ValidateNSelectDropdown("Method", "GET", "PUT"); - - agHelper.EnterValue("/books/_doc/1", { - propFieldName: "", - directInput: false, - inputFieldName: "Path", - }); - - agHelper.EnterValue(updateBook, { - propFieldName: "", - directInput: false, - inputFieldName: "Body", - }); - - agHelper - .GetElement(dataSources._bodyCodeMirror) - .type("{downarrow}".repeat(5)); - - agHelper.PressEnter(); - agHelper.Sleep(2000); - dataSources.RunQuery(); - - cy.get("@postExecute").then((resObj: any) => { - books = JSON.parse(JSON.stringify(resObj.response.body.data.body.result)); - expect(books).to.eq("updated"); - }); - - //GET - single record - after update - dataSources.ValidateNSelectDropdown("Method", "PUT", "GET"); - agHelper.EnterValue("", { - propFieldName: "", - directInput: false, - inputFieldName: "Body", - }); - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - books = JSON.parse( - JSON.stringify(resObj.response.body.data.body._source.title), - ); - expect(books).to.eq("Pride and Prejudice"); - }); - - //DELETE - single record - dataSources.ValidateNSelectDropdown("Method", "GET", "DELETE"); - - agHelper.EnterValue("/books/_doc/1", { - propFieldName: "", - directInput: false, - inputFieldName: "Path", - }); - dataSources.RunQuery(); - - cy.get("@postExecute").then((resObj: any) => { - books = JSON.parse(JSON.stringify(resObj.response.body.data.body.result)); - expect(books).to.eq("deleted"); - }); - - //DELETE - all records - agHelper.EnterValue("/_all", { - propFieldName: "", - directInput: false, - inputFieldName: "Path", - }); - dataSources.RunQuery(); - - cy.get("@postExecute").then((resObj: any) => { - books = JSON.parse( - JSON.stringify(resObj.response.body.data.body.acknowledged), - ); - expect(books).to.be.true; - }); - }); - - after("Delete the query & datasource", () => { - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, - }); - dataSources.DeleteDatasourceFromWithinDS(dsName); - dataSources.StopNDeleteContainer(containerName); - }); -}); + dataSources.CreateQueryAfterDSSaved(); + + //POST - single record + dataSources.ValidateNSelectDropdown("Method", "GET", "POST"); + + agHelper.EnterValue("/books/_doc/1", { + propFieldName: "", + directInput: false, + inputFieldName: "Path", + }); + + agHelper.EnterValue(singleBook, { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }); + + dataSources.RunQuery(); + cy.get("@postExecute").then((resObj: any) => { + books = JSON.parse( + JSON.stringify(resObj.response.body.data.body.result), + ); + expect(books).to.eq("created"); + }); + + //GET - single record + dataSources.ValidateNSelectDropdown("Method", "POST", "GET"); + agHelper.EnterValue("", { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }); + dataSources.RunQuery(); + cy.get("@postExecute").then((resObj: any) => { + books = JSON.parse( + JSON.stringify(resObj.response.body.data.body._source.title), + ); + expect(books).to.eq("The Lord of the Rings"); + }); + + //POST - bulk record + dataSources.ValidateNSelectDropdown("Method", "GET", "POST"); + + agHelper.EnterValue("/_bulk", { + propFieldName: "", + directInput: false, + inputFieldName: "Path", + }); + + //We need to enter new line at end, since without that body data not getting considered + agHelper.EnterValue(bulkBooks, { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }); + + agHelper + .GetElement(dataSources._bodyCodeMirror) + .type("{downarrow}".repeat(10)); + + agHelper.PressEnter(); + + agHelper.Sleep(2000); + dataSources.RunQuery(); + cy.get("@postExecute").then((resObj: any) => { + expect( + JSON.parse( + JSON.stringify(resObj.response.body.data.body.items[0].index._id), + ), + ).to.eq("2"); + expect( + JSON.parse( + JSON.stringify(resObj.response.body.data.body.items[1].index._id), + ), + ).to.eq("3"); + }); + + //GET - All inserted record + dataSources.ValidateNSelectDropdown("Method", "POST", "GET"); + agHelper.EnterValue("", { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }); + + agHelper.EnterValue("/books/_search", { + propFieldName: "", + directInput: false, + inputFieldName: "Path", + }); + dataSources.RunQuery(); + cy.get("@postExecute").then((resObj: any) => { + books = JSON.parse( + JSON.stringify(resObj.response.body.data.body.hits.total.value), + ); + expect(books).to.be.oneOf([1, 3]); + }); + + //PUT - update + let updateBook = `{ "title": "Pride and Prejudice", "author": "Jane Austen", "genre": ["Romance", "Classic Literature"], "rating": 4.5, "published_date": "1813-01-28", "description": "Pride and Prejudice is a romantic novel by Jane Austen, first published in 1813. The story follows the main character Elizabeth Bennet as she deals with issues of manners, upbringing, morality, education, and marriage in the society of the landed gentry of the British Regency." }`; + dataSources.ValidateNSelectDropdown("Method", "GET", "PUT"); + + agHelper.EnterValue("/books/_doc/1", { + propFieldName: "", + directInput: false, + inputFieldName: "Path", + }); + + agHelper.EnterValue(updateBook, { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }); + + agHelper + .GetElement(dataSources._bodyCodeMirror) + .type("{downarrow}".repeat(5)); + + agHelper.PressEnter(); + agHelper.Sleep(2000); + dataSources.RunQuery(); + + cy.get("@postExecute").then((resObj: any) => { + books = JSON.parse( + JSON.stringify(resObj.response.body.data.body.result), + ); + expect(books).to.eq("updated"); + }); + + //GET - single record - after update + dataSources.ValidateNSelectDropdown("Method", "PUT", "GET"); + agHelper.EnterValue("", { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }); + dataSources.RunQuery(); + cy.get("@postExecute").then((resObj: any) => { + books = JSON.parse( + JSON.stringify(resObj.response.body.data.body._source.title), + ); + expect(books).to.eq("Pride and Prejudice"); + }); + + //DELETE - single record + dataSources.ValidateNSelectDropdown("Method", "GET", "DELETE"); + + agHelper.EnterValue("/books/_doc/1", { + propFieldName: "", + directInput: false, + inputFieldName: "Path", + }); + dataSources.RunQuery(); + + cy.get("@postExecute").then((resObj: any) => { + books = JSON.parse( + JSON.stringify(resObj.response.body.data.body.result), + ); + expect(books).to.eq("deleted"); + }); + + //DELETE - all records + agHelper.EnterValue("/_all", { + propFieldName: "", + directInput: false, + inputFieldName: "Path", + }); + dataSources.RunQuery(); + + cy.get("@postExecute").then((resObj: any) => { + books = JSON.parse( + JSON.stringify(resObj.response.body.data.body.acknowledged), + ); + expect(books).to.be.true; + }); + }); + + after("Delete the query & datasource", () => { + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + dataSources.DeleteDatasourceFromWithinDS(dsName); + dataSources.StopNDeleteContainer(containerName); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Firestore_Basic_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Firestore_Basic_Spec.ts index 8412f77a9ca..733ce02fff3 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Firestore_Basic_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Firestore_Basic_Spec.ts @@ -19,165 +19,97 @@ let dsName: any, newCityPath: any, createCity: any, cityName = "LA_"; -describe("Validate Firestore DS", { tags: ["@tag.Datasource"] }, () => { - before("Generate GUID for new Firestore DS", () => { - agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - guid = uid; - dsName = "Firestore" + " " + uid; +describe( + "Validate Firestore DS", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + () => { + before("Generate GUID for new Firestore DS", () => { + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + guid = uid; + dsName = "Firestore" + " " + uid; + }); }); - }); - - it("1. Firestore placeholder & mandatory mark verification", () => { - dataSources.NavigateToDSCreateNew(); - dataSources.CreatePlugIn("Firestore"); - agHelper.AssertElementVisibility(dataSources._imgFireStoreLogo); - agHelper.GetNAssertContains(locators._dsName, "Untitled datasource"); - agHelper.GetNClick(locators._dsName); - agHelper.ClearTextField(locators._dsNameTxt); //removing ds name - agHelper.AssertTooltip(Cypress.env("MESSAGES").ACTION_INVALID_NAME_ERROR()); - agHelper.TypeText(locators._dsNameTxt, dsName); - agHelper.PressEnter(); - agHelper.AssertAttribute( - locators._inputFieldByName("Database URL") + "//" + locators._inputField, - "placeholder", - "https://your-project-id.firebaseio.com", - ); - agHelper - .GetElement( - locators._inputFieldByName("Project Id") + "//" + locators._inputField, - ) - .should("not.have.attr", "placeholder"); - dataSources.TestDatasource(false); - agHelper.ValidateToastMessage("Missing Firestore URL."); - agHelper.ValidateToastMessage("Missing ProjectID in datasource."); - agHelper.ValidateToastMessage("Missing ClientJSON in datasource."); - dataSources.FillFirestoreDSForm(); - dataSources.TestSaveDatasource(); - }); - - it("2. Validate List/Create/Update/Get", () => { - agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - cityName += uid; - createCity = - `{ + + it("1. Firestore placeholder & mandatory mark verification", () => { + dataSources.NavigateToDSCreateNew(); + dataSources.CreatePlugIn("Firestore"); + agHelper.AssertElementVisibility(dataSources._imgFireStoreLogo); + agHelper.GetNAssertContains(locators._dsName, "Untitled datasource"); + agHelper.GetNClick(locators._dsName); + agHelper.ClearTextField(locators._dsNameTxt); //removing ds name + agHelper.AssertTooltip( + Cypress.env("MESSAGES").ACTION_INVALID_NAME_ERROR(), + ); + agHelper.TypeText(locators._dsNameTxt, dsName); + agHelper.PressEnter(); + agHelper.AssertAttribute( + locators._inputFieldByName("Database URL") + + "//" + + locators._inputField, + "placeholder", + "https://your-project-id.firebaseio.com", + ); + agHelper + .GetElement( + locators._inputFieldByName("Project Id") + + "//" + + locators._inputField, + ) + .should("not.have.attr", "placeholder"); + dataSources.TestDatasource(false); + agHelper.ValidateToastMessage("Missing Firestore URL."); + agHelper.ValidateToastMessage("Missing ProjectID in datasource."); + agHelper.ValidateToastMessage("Missing ClientJSON in datasource."); + dataSources.FillFirestoreDSForm(); + dataSources.TestSaveDatasource(); + }); + + it("2. Validate List/Create/Update/Get", () => { + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + cityName += uid; + createCity = + `{ "name": "` + - cityName + - `", + cityName + + `", "state": "CA", "country": "USA", "capital": false, "population": 3900000, "regions": ["west_coast", "socal"] }`; - dataSources.CreateQueryAfterDSSaved(); - - //Create - dataSources.ValidateNSelectDropdown( - "Command", - "List Documents", - "Create document", - ); - - agHelper.EnterValue( - "cities/{{Math.random().toString(36).substring(2, 24)}}", - { - propFieldName: "", - directInput: false, - inputFieldName: "Collection Name", - }, - ); - - agHelper.EnterValue(createCity, { - propFieldName: "", - directInput: false, - inputFieldName: "Body", - }); - - dataSources.RunQuery(); //Create the document - - //Find the document id of the newly inserted record + Verify List all records - dataSources.ValidateNSelectDropdown( - "Command", - "Create document", - "List Documents", - ); - agHelper.EnterValue("cities", { - propFieldName: "", - directInput: false, - inputFieldName: "Collection Name", - }); - - agHelper.TypeDynamicInputValueNValidate( - "name", - dataSources._nestedWhereClauseKey(0), - ); - agHelper.TypeDynamicInputValueNValidate( - cityName, - dataSources._nestedWhereClauseValue(0), - ); - - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); - - cy.wrap(cities) - .should("be.an", "array") - .its(0) - .should("have.property", "name", cityName); //making sure newly inserted record is returned - const newCity = cities.find( - (city: { name: string }) => city.name === cityName, - ); - newCityPath = newCity._ref.path; - - agHelper.GetNClick(dataSources._whereDelete(0)); //removign where clause, add new condition - agHelper.TypeDynamicInputValueNValidate( - "capital", - dataSources._nestedWhereClauseKey(0), - ); - agHelper.TypeDynamicInputValueNValidate( - "true", - dataSources._nestedWhereClauseValue(0), - ); - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - cities = JSON.stringify(resObj.response.body.data.body); - cy.wrap(cities).should("deep.equal", "[]"); //validating no record is returned - }); - - agHelper.GetNClick(dataSources._whereDelete(0)); //removign where clause + dataSources.CreateQueryAfterDSSaved(); - //Update document + //Create dataSources.ValidateNSelectDropdown( "Command", "List Documents", - "Update document", + "Create document", ); - agHelper.EnterValue(newCityPath, { - propFieldName: "", - directInput: false, - inputFieldName: "Collection Name", - }); - agHelper.EnterValue( - `{ - "state": "LL" - }`, + "cities/{{Math.random().toString(36).substring(2, 24)}}", { propFieldName: "", directInput: false, - inputFieldName: "Body", + inputFieldName: "Collection Name", }, ); - dataSources.RunQuery(); //Update the document + agHelper.EnterValue(createCity, { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }); + + dataSources.RunQuery(); //Create the document - //Validate the update happened fine + //Find the document id of the newly inserted record + Verify List all records dataSources.ValidateNSelectDropdown( "Command", - "Update document", + "Create document", "List Documents", ); agHelper.EnterValue("cities", { @@ -185,6 +117,7 @@ describe("Validate Firestore DS", { tags: ["@tag.Datasource"] }, () => { directInput: false, inputFieldName: "Collection Name", }); + agHelper.TypeDynamicInputValueNValidate( "name", dataSources._nestedWhereClauseKey(0), @@ -193,178 +126,255 @@ describe("Validate Firestore DS", { tags: ["@tag.Datasource"] }, () => { cityName, dataSources._nestedWhereClauseValue(0), ); - dataSources.RunQuery(); + dataSources.RunQuery(); cy.get("@postExecute").then((resObj: any) => { cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); - const losAngeles = cities.find( + + cy.wrap(cities) + .should("be.an", "array") + .its(0) + .should("have.property", "name", cityName); //making sure newly inserted record is returned + const newCity = cities.find( (city: { name: string }) => city.name === cityName, ); - expect(losAngeles.state).to.eq("LL"); //Verifying update is fine - }); + newCityPath = newCity._ref.path; - //Get Document - dataSources.ValidateNSelectDropdown( - "Command", - "List Documents", - "Get Document", - ); + agHelper.GetNClick(dataSources._whereDelete(0)); //removign where clause, add new condition + agHelper.TypeDynamicInputValueNValidate( + "capital", + dataSources._nestedWhereClauseKey(0), + ); + agHelper.TypeDynamicInputValueNValidate( + "true", + dataSources._nestedWhereClauseValue(0), + ); + dataSources.RunQuery(); + cy.get("@postExecute").then((resObj: any) => { + cities = JSON.stringify(resObj.response.body.data.body); + cy.wrap(cities).should("deep.equal", "[]"); //validating no record is returned + }); + + agHelper.GetNClick(dataSources._whereDelete(0)); //removign where clause + + //Update document + dataSources.ValidateNSelectDropdown( + "Command", + "List Documents", + "Update document", + ); - agHelper.EnterValue(newCityPath, { - propFieldName: "", - directInput: false, - inputFieldName: "Collection/Document path", - }); + agHelper.EnterValue(newCityPath, { + propFieldName: "", + directInput: false, + inputFieldName: "Collection Name", + }); - dataSources.RunQuery(); - cy.get("@postExecute").then((resObj: any) => { - cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); - cy.wrap(cities).should("have.property", "name", cityName); //making sure inserted record is returned + agHelper.EnterValue( + `{ + "state": "LL" + }`, + { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }, + ); + + dataSources.RunQuery(); //Update the document + + //Validate the update happened fine + dataSources.ValidateNSelectDropdown( + "Command", + "Update document", + "List Documents", + ); + agHelper.EnterValue("cities", { + propFieldName: "", + directInput: false, + inputFieldName: "Collection Name", + }); + agHelper.TypeDynamicInputValueNValidate( + "name", + dataSources._nestedWhereClauseKey(0), + ); + agHelper.TypeDynamicInputValueNValidate( + cityName, + dataSources._nestedWhereClauseValue(0), + ); + dataSources.RunQuery(); + + cy.get("@postExecute").then((resObj: any) => { + cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); + const losAngeles = cities.find( + (city: { name: string }) => city.name === cityName, + ); + expect(losAngeles.state).to.eq("LL"); //Verifying update is fine + }); + + //Get Document + dataSources.ValidateNSelectDropdown( + "Command", + "List Documents", + "Get Document", + ); + + agHelper.EnterValue(newCityPath, { + propFieldName: "", + directInput: false, + inputFieldName: "Collection/Document path", + }); + + dataSources.RunQuery(); + cy.get("@postExecute").then((resObj: any) => { + cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); + cy.wrap(cities).should("have.property", "name", cityName); //making sure inserted record is returned + }); }); }); }); - }); - - it("3. Validate Widget binding & Deploy app", () => { - dataSources.ValidateNSelectDropdown( - "Command", - "Get Document", - "List Documents", - ); - agHelper.EnterValue("cities", { - propFieldName: "", - directInput: false, - inputFieldName: "Collection Name", - }); - agHelper.GetNClick(dataSources._whereDelete(0)); //removign where clause, add new condition - dataSources.RunQuery(); - dataSources.AddSuggestedWidget(Widgets.Table); - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); - table.WaitUntilTableLoad(0, 0, "v2"); - deployMode.NavigateBacktoEditor(); - EditorNavigation.SelectEntityByName("Query1", EntityType.Query); - }); - - it("4. Validate Upsert [Update & Insert]/Delete documents", () => { - //Validating Upsert - dataSources.ValidateNSelectDropdown( - "Command", - "List Documents", - "Upsert Document", - ); - - agHelper.EnterValue(newCityPath, { - propFieldName: "", - directInput: false, - inputFieldName: "Collection/Document path", + + it("3. Validate Widget binding & Deploy app", () => { + dataSources.ValidateNSelectDropdown( + "Command", + "Get Document", + "List Documents", + ); + agHelper.EnterValue("cities", { + propFieldName: "", + directInput: false, + inputFieldName: "Collection Name", + }); + agHelper.GetNClick(dataSources._whereDelete(0)); //removign where clause, add new condition + dataSources.RunQuery(); + dataSources.AddSuggestedWidget(Widgets.Table); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); + table.WaitUntilTableLoad(0, 0, "v2"); + deployMode.NavigateBacktoEditor(); + EditorNavigation.SelectEntityByName("Query1", EntityType.Query); }); - agHelper.EnterValue( - `{ + it("4. Validate Upsert [Update & Insert]/Delete documents", () => { + //Validating Upsert + dataSources.ValidateNSelectDropdown( + "Command", + "List Documents", + "Upsert Document", + ); + + agHelper.EnterValue(newCityPath, { + propFieldName: "", + directInput: false, + inputFieldName: "Collection/Document path", + }); + + agHelper.EnterValue( + `{ "population": 4000000 }`, - { + { + propFieldName: "", + directInput: false, + inputFieldName: "Body", + }, + ); + dataSources.RunQuery(); //Upsert the document + + dataSources.ValidateNSelectDropdown( + "Command", + "Upsert Document", + "List Documents", + ); + agHelper.EnterValue("cities", { propFieldName: "", directInput: false, - inputFieldName: "Body", - }, - ); - dataSources.RunQuery(); //Upsert the document - - dataSources.ValidateNSelectDropdown( - "Command", - "Upsert Document", - "List Documents", - ); - agHelper.EnterValue("cities", { - propFieldName: "", - directInput: false, - inputFieldName: "Collection Name", - }); - // agHelper.EnterValue('["population"]', { - // propFieldName: "", - // directInput: false, - // inputFieldName: "Order By", - // }); - - agHelper.TypeDynamicInputValueNValidate( - "population", - dataSources._nestedWhereClauseKey(0), - ); - agHelper.TypeDynamicInputValueNValidate( - "4000000", - dataSources._nestedWhereClauseValue(0), - ); - dataSources.RunQuery(); - - const expectedKeys = ["_ref", "population"]; - cy.get("@postExecute").then((resObj: any) => { - cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); - const firstRecordFields = Object.keys(cities[0]); - cy.log("firstRecordFields is " + firstRecordFields); - expect(firstRecordFields.every((key) => expectedKeys.includes(key))).to.be - .true; //Validating Upsert! - }); + inputFieldName: "Collection Name", + }); + // agHelper.EnterValue('["population"]', { + // propFieldName: "", + // directInput: false, + // inputFieldName: "Order By", + // }); - //Validating Delete - dataSources.ValidateNSelectDropdown( - "Command", - "List Documents", - "Delete document", - ); - - agHelper.EnterValue(newCityPath, { - propFieldName: "", - directInput: false, - inputFieldName: "Collection/Document path", - }); - dataSources.RunQuery(); //Delete the record - - //Validate Deletion - dataSources.ValidateNSelectDropdown( - "Command", - "Delete document", - "List Documents", - ); - agHelper.EnterValue("cities", { - propFieldName: "", - directInput: false, - inputFieldName: "Collection Name", - }); - agHelper.TypeDynamicInputValueNValidate( - "name", - dataSources._nestedWhereClauseKey(0), - ); - agHelper.TypeDynamicInputValueNValidate( - cityName, - dataSources._nestedWhereClauseValue(0), - ); - dataSources.RunQuery(); - - cy.get("@postExecute").then((resObj: any) => { - cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); - const hasNoInsertedCity = () => { - return Array.isArray(cities) && cities.length === 0; - }; - expect(hasNoInsertedCity()).to.be.true; //Validating Deletion! + agHelper.TypeDynamicInputValueNValidate( + "population", + dataSources._nestedWhereClauseKey(0), + ); + agHelper.TypeDynamicInputValueNValidate( + "4000000", + dataSources._nestedWhereClauseValue(0), + ); + dataSources.RunQuery(); + + const expectedKeys = ["_ref", "population"]; + cy.get("@postExecute").then((resObj: any) => { + cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); + const firstRecordFields = Object.keys(cities[0]); + cy.log("firstRecordFields is " + firstRecordFields); + expect(firstRecordFields.every((key) => expectedKeys.includes(key))).to + .be.true; //Validating Upsert! + }); + + //Validating Delete + dataSources.ValidateNSelectDropdown( + "Command", + "List Documents", + "Delete document", + ); + + agHelper.EnterValue(newCityPath, { + propFieldName: "", + directInput: false, + inputFieldName: "Collection/Document path", + }); + dataSources.RunQuery(); //Delete the record + + //Validate Deletion + dataSources.ValidateNSelectDropdown( + "Command", + "Delete document", + "List Documents", + ); + agHelper.EnterValue("cities", { + propFieldName: "", + directInput: false, + inputFieldName: "Collection Name", + }); + agHelper.TypeDynamicInputValueNValidate( + "name", + dataSources._nestedWhereClauseKey(0), + ); + agHelper.TypeDynamicInputValueNValidate( + cityName, + dataSources._nestedWhereClauseValue(0), + ); + dataSources.RunQuery(); + + cy.get("@postExecute").then((resObj: any) => { + cities = JSON.parse(JSON.stringify(resObj.response.body.data.body)); + const hasNoInsertedCity = () => { + return Array.isArray(cities) && cities.length === 0; + }; + expect(hasNoInsertedCity()).to.be.true; //Validating Deletion! + }); }); - }); - after("Delete the query & datasource", () => { - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, + after("Delete the query & datasource", () => { + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + dataSources.DeleteDatasourceFromWithinDS(dsName, 409); + //commenting below since after query delete, we run into risk of not seeing the datasource in EntityExplorer + // EditorNavigation.SelectEntityByName(dsName, EntityType.Datasource); + // entityExplorer.ActionContextMenuByEntityName({ + // entityNameinLeftSidebar: dsName, + // action: "Delete", + // entityType: entityItems.Datasource, + // }); + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dsName, 200); }); - dataSources.DeleteDatasourceFromWithinDS(dsName, 409); - //commenting below since after query delete, we run into risk of not seeing the datasource in EntityExplorer - // EditorNavigation.SelectEntityByName(dsName, EntityType.Datasource); - // entityExplorer.ActionContextMenuByEntityName({ - // entityNameinLeftSidebar: dsName, - // action: "Delete", - // entityType: entityItems.Datasource, - // }); - deployMode.DeployApp(); - deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dsName, 200); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts index fff33025788..64eee959604 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts @@ -20,114 +20,131 @@ import EditorNavigation, { } from "../../../../support/Pages/EditorNavigation"; import PageList from "../../../../support/Pages/PageList"; -describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => { - let dataSourceName: string, guid: any, query: string, selectQuery: string; +describe( + "Validate Oracle DS", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + () => { + let dataSourceName: string, guid: any, query: string, selectQuery: string; - before("Generate GUID", () => { - agHelper.GenerateUUID(); - cy.get("@guid").then((uid) => { - guid = uid; - dataSourceName = "Oracle" + " " + uid; + before("Generate GUID", () => { + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + guid = uid; + dataSourceName = "Oracle" + " " + uid; + }); }); - }); - it("1. Tc #2354, #2204 - Oracle placeholder, port default value & mandatory mark verification", () => { - dataSources.NavigateToDSCreateNew(); - dataSources.CreatePlugIn("Oracle"); - agHelper.GetNAssertContains(locators._dsName, "Untitled datasource"); - agHelper.GetNClick(locators._dsName); - agHelper.ClearTextField(locators._dsNameTxt); //removing ds name - agHelper.AssertTooltip(Cypress.env("MESSAGES").ACTION_INVALID_NAME_ERROR()); - agHelper.TypeText(locators._dsNameTxt, dataSourceName); - agHelper.PressEnter(); - agHelper.AssertAttribute( - dataSources._host(), - "placeholder", - "myapp.abcde.oracle.net", - ); - agHelper.AssertAttribute(dataSources._port, "value", "1521"); - agHelper.AssertAttribute( - dataSources._databaseName, - "placeholder", - "gfb284db6bcee33_testdb_high.adb.oraclecloud.com", - ); - agHelper.AssertAttribute(dataSources._username, "placeholder", "admin"); - agHelper.AssertAttribute(dataSources._password, "placeholder", "password"); - agHelper.AssertElementLength(dataSources._mandatoryMark, 4); //verifyng all 4 fields are mandatory - agHelper.AssertText(dataSources._host(), "val", ""); - agHelper.ClearNType( - dataSources._host(), - dataManager.dsValues[dataManager.environments[1]].oracle_host, - ); - agHelper.AssertText( - dataSources._host(), - "val", - dataManager.dsValues[dataManager.environments[1]].oracle_host, - ); - agHelper.GetNClick(dataSources._deleteDSHostPort); //Delete the value & verify - agHelper.AssertText(dataSources._host(), "val", ""); - agHelper.ClickButton("Add more"); - agHelper.AssertElementVisibility(dataSources._host("1")); - agHelper.ClickButton("Add more"); - agHelper.AssertElementVisibility(dataSources._host("2")); - Cypress._.times(2, () => { - //Delete the added extra hosts - agHelper.GetNClick(dataSources._deleteDSHostPort); + it("1. Tc #2354, #2204 - Oracle placeholder, port default value & mandatory mark verification", () => { + dataSources.NavigateToDSCreateNew(); + dataSources.CreatePlugIn("Oracle"); + agHelper.GetNAssertContains(locators._dsName, "Untitled datasource"); + agHelper.GetNClick(locators._dsName); + agHelper.ClearTextField(locators._dsNameTxt); //removing ds name + agHelper.AssertTooltip( + Cypress.env("MESSAGES").ACTION_INVALID_NAME_ERROR(), + ); + agHelper.TypeText(locators._dsNameTxt, dataSourceName); + agHelper.PressEnter(); + agHelper.AssertAttribute( + dataSources._host(), + "placeholder", + "myapp.abcde.oracle.net", + ); + agHelper.AssertAttribute(dataSources._port, "value", "1521"); + agHelper.AssertAttribute( + dataSources._databaseName, + "placeholder", + "gfb284db6bcee33_testdb_high.adb.oraclecloud.com", + ); + agHelper.AssertAttribute(dataSources._username, "placeholder", "admin"); + agHelper.AssertAttribute( + dataSources._password, + "placeholder", + "password", + ); + agHelper.AssertElementLength(dataSources._mandatoryMark, 4); //verifyng all 4 fields are mandatory + agHelper.AssertText(dataSources._host(), "val", ""); + agHelper.ClearNType( + dataSources._host(), + dataManager.dsValues[dataManager.environments[1]].oracle_host, + ); + agHelper.AssertText( + dataSources._host(), + "val", + dataManager.dsValues[dataManager.environments[1]].oracle_host, + ); + agHelper.GetNClick(dataSources._deleteDSHostPort); //Delete the value & verify + agHelper.AssertText(dataSources._host(), "val", ""); + agHelper.ClickButton("Add more"); + agHelper.AssertElementVisibility(dataSources._host("1")); + agHelper.ClickButton("Add more"); + agHelper.AssertElementVisibility(dataSources._host("2")); + Cypress._.times(2, () => { + //Delete the added extra hosts + agHelper.GetNClick(dataSources._deleteDSHostPort); + }); }); - }); - it("2. Tc #2357, #2356, #2355, #2354 Verify Oracle connection errors", () => { - dataSources.TestDatasource(false); - agHelper.ValidateToastMessage("Missing endpoint"); - agHelper.ValidateToastMessage("Missing authentication details"); - agHelper.WaitUntilAllToastsDisappear(); + it("2. Tc #2357, #2356, #2355, #2354 Verify Oracle connection errors", () => { + dataSources.TestDatasource(false); + agHelper.ValidateToastMessage("Missing endpoint"); + agHelper.ValidateToastMessage("Missing authentication details"); + agHelper.WaitUntilAllToastsDisappear(); - agHelper.ClearNType( - dataSources._host(), - dataManager.dsValues[dataManager.defaultEnviorment].oracle_host, - ); - agHelper.ClearNType( - dataSources._databaseName, - dataManager.dsValues[dataManager.defaultEnviorment].oracle_service, - ); - dataSources.TestDatasource(false); - agHelper.ValidateToastMessage("Missing username for authentication"); - agHelper.ValidateToastMessage("Missing password for authentication"); + agHelper.ClearNType( + dataSources._host(), + dataManager.dsValues[dataManager.defaultEnviorment].oracle_host, + ); + agHelper.ClearNType( + dataSources._databaseName, + dataManager.dsValues[dataManager.defaultEnviorment].oracle_service, + ); + dataSources.TestDatasource(false); + agHelper.ValidateToastMessage("Missing username for authentication"); + agHelper.ValidateToastMessage("Missing password for authentication"); - agHelper.ClearNType( - dataSources._username, - dataManager.dsValues[dataManager.defaultEnviorment].oracle_username, - ); - agHelper.ClearNType( - dataSources._password, - dataManager.dsValues[dataManager.defaultEnviorment].oracle_password, - ); - dataSources.TestDatasource(false); - agHelper.ValidateToastMessage( - "An exception occurred while creating connection pool. One or more arguments in the datasource configuration may be invalid.", - ); - agHelper.ValidateToastMessage("Failed to initialize pool:"); - propPane.AssertPropertiesDropDownValues("SSL mode", ["Disable", "TLS"]); - dataSources.ValidateNSelectDropdown("SSL mode", "TLS", "Disable"); - dataSources.TestSaveDatasource(); - //Validate Review page - dataSources.AssertDataSourceInfo(["Host address", "Port", "Service Name"]); - agHelper.ClickButton("Edit"); //Navigate to Edit page & check if DS edit is opened - dataSources.ValidateNSelectDropdown("SSL mode", "Disable"); - AppSidebar.navigate(AppSidebarButton.Editor); - AppSidebar.navigate(AppSidebarButton.Data); - dataSources.AssertDSInActiveList(dataSourceName); - }); + agHelper.ClearNType( + dataSources._username, + dataManager.dsValues[dataManager.defaultEnviorment].oracle_username, + ); + agHelper.ClearNType( + dataSources._password, + dataManager.dsValues[dataManager.defaultEnviorment].oracle_password, + ); + dataSources.TestDatasource(false); + agHelper.ValidateToastMessage( + "An exception occurred while creating connection pool. One or more arguments in the datasource configuration may be invalid.", + ); + agHelper.ValidateToastMessage("Failed to initialize pool:"); + propPane.AssertPropertiesDropDownValues("SSL mode", ["Disable", "TLS"]); + dataSources.ValidateNSelectDropdown("SSL mode", "TLS", "Disable"); + dataSources.TestSaveDatasource(); + //Validate Review page + dataSources.AssertDataSourceInfo([ + "Host address", + "Port", + "Service Name", + ]); + agHelper.ClickButton("Edit"); //Navigate to Edit page & check if DS edit is opened + dataSources.ValidateNSelectDropdown("SSL mode", "Disable"); + AppSidebar.navigate(AppSidebarButton.Editor); + AppSidebar.navigate(AppSidebarButton.Data); + dataSources.AssertDSInActiveList(dataSourceName); + }); - it("3. Tc #2359, Tc # 2360 , Tc # 2358, Tc # 2366 - Create Insert, Alter & Select queries, Widgets to query binding", () => { - const currentDate = new Date().toISOString().slice(0, 10); + it("3. Tc #2359, Tc # 2360 , Tc # 2358, Tc # 2366 - Create Insert, Alter & Select queries, Widgets to query binding", () => { + const currentDate = new Date().toISOString().slice(0, 10); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.DATEPICKER, 200, 50); - propPane.SelectPropertiesDropDown("Date format", "YYYY-MM-DD"); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT, 500, 50); - propPane.EnterJSContext( - "Source Data", - `[{ + entityExplorer.DragDropWidgetNVerify( + draggableWidgets.DATEPICKER, + 200, + 50, + ); + propPane.SelectPropertiesDropDown("Date format", "YYYY-MM-DD"); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT, 500, 50); + propPane.EnterJSContext( + "Source Data", + `[{ "name": "Cargo Plane", "value": "Cargo Plane" }, @@ -139,30 +156,33 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => { "name": "Helicopter", "code": "Helicopter" }]`, - ); - propPane.UpdatePropertyFieldValue("Default selected value", "Cargo Plane"); - propPane.AssertPropertiesDropDownValues("Label key", [ - "name", - "code", - "value", - ]); - propPane.SelectPropertiesDropDown( - "Label key", - "value", - "Action", - 0, - 0, - true, - ); - propPane.SelectPropertiesDropDown( - "Value key", - "name", - "Action", - 0, - 1, - true, - ); - query = `CREATE TABLE ${guid} ( + ); + propPane.UpdatePropertyFieldValue( + "Default selected value", + "Cargo Plane", + ); + propPane.AssertPropertiesDropDownValues("Label key", [ + "name", + "code", + "value", + ]); + propPane.SelectPropertiesDropDown( + "Label key", + "value", + "Action", + 0, + 0, + true, + ); + propPane.SelectPropertiesDropDown( + "Value key", + "name", + "Action", + 0, + 1, + true, + ); + query = `CREATE TABLE ${guid} ( aircraft_id NUMBER(5) PRIMARY KEY, aircraft_type VARCHAR2(50) NOT NULL, registration_number VARCHAR2(20) UNIQUE, @@ -174,10 +194,10 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => { maintenance_last_date DATE, notes CLOB );`; - dataSources.CreateQueryForDS(dataSourceName, query); - dataSources.RunQuery(); + dataSources.CreateQueryForDS(dataSourceName, query); + dataSources.RunQuery(); - query = `INSERT INTO ${guid} ( + query = `INSERT INTO ${guid} ( aircraft_id, aircraft_type, registration_number, @@ -198,30 +218,32 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => { TO_DATE('2020-01-15', 'YYYY-MM-DD'), TO_DATE('{{DatePicker1.formattedDate}}', 'YYYY-MM-DD'), 'This aircraft is used for domestic flights.')`; - selectQuery = `SELECT * FROM ${guid} WHERE ROWNUM < 10`; - dataSources.EnterQuery(selectQuery); + selectQuery = `SELECT * FROM ${guid} WHERE ROWNUM < 10`; + dataSources.EnterQuery(selectQuery); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - dataSources.EnterQuery(query); - agHelper.VerifyEvaluatedValue( - `INSERT INTO ${guid} (\n aircraft_id,\n aircraft_type,\n registration_number,\n manufacturer,\n seating_capacity,\n maximum_speed,\n range,\n purchase_date,\n maintenance_last_date,\n notes) VALUES (\n 1,\n $1,\n 'N12345',\n 'Boeing',\n 150,\n 550.03,\n 3500.30,\n TO_DATE('2020-01-15', 'YYYY-MM-DD'),\n TO_DATE($2, 'YYYY-MM-DD'),\n 'This aircraft is used for domestic flights.')`, - ); - dataSources.ToggleUsePreparedStatement(false); - agHelper.GetNClick(locators._codeEditorTarget); - agHelper.VerifyEvaluatedValue( - `INSERT INTO ${guid} (\n aircraft_id,\n aircraft_type,\n registration_number,\n manufacturer,\n seating_capacity,\n maximum_speed,\n range,\n purchase_date,\n maintenance_last_date,\n notes) VALUES (\n 1,\n 'Cargo Plane',\n 'N12345',\n 'Boeing',\n 150,\n 550.03,\n 3500.30,\n TO_DATE('2020-01-15', 'YYYY-MM-DD'),\n TO_DATE('${currentDate}', 'YYYY-MM-DD'),\n 'This aircraft is used for domestic flights.')`, - ); - dataSources.RunQuery(); - dataSources.EnterQuery(selectQuery); - dataSources.RunQueryNVerifyResponseViews(); - dataSources.ToggleUsePreparedStatement(true); - query = `ALTER TABLE ${guid} ADD (raw_data RAW(16), maintenance_interval INTERVAL YEAR(3) TO MONTH);`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - query = `INSERT INTO ${guid} ( + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); + dataSources.EnterQuery(query); + agHelper.VerifyEvaluatedValue( + `INSERT INTO ${guid} (\n aircraft_id,\n aircraft_type,\n registration_number,\n manufacturer,\n seating_capacity,\n maximum_speed,\n range,\n purchase_date,\n maintenance_last_date,\n notes) VALUES (\n 1,\n $1,\n 'N12345',\n 'Boeing',\n 150,\n 550.03,\n 3500.30,\n TO_DATE('2020-01-15', 'YYYY-MM-DD'),\n TO_DATE($2, 'YYYY-MM-DD'),\n 'This aircraft is used for domestic flights.')`, + ); + dataSources.ToggleUsePreparedStatement(false); + agHelper.GetNClick(locators._codeEditorTarget); + agHelper.VerifyEvaluatedValue( + `INSERT INTO ${guid} (\n aircraft_id,\n aircraft_type,\n registration_number,\n manufacturer,\n seating_capacity,\n maximum_speed,\n range,\n purchase_date,\n maintenance_last_date,\n notes) VALUES (\n 1,\n 'Cargo Plane',\n 'N12345',\n 'Boeing',\n 150,\n 550.03,\n 3500.30,\n TO_DATE('2020-01-15', 'YYYY-MM-DD'),\n TO_DATE('${currentDate}', 'YYYY-MM-DD'),\n 'This aircraft is used for domestic flights.')`, + ); + dataSources.RunQuery(); + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(); + dataSources.ToggleUsePreparedStatement(true); + query = `ALTER TABLE ${guid} ADD (raw_data RAW(16), maintenance_interval INTERVAL YEAR(3) TO MONTH);`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + query = `INSERT INTO ${guid} ( aircraft_id, aircraft_type, registration_number, @@ -247,11 +269,11 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => { UTL_RAW.CAST_TO_RAW('raw_value'), INTERVAL '1' YEAR(3) -- 1 year maintenance interval );`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.EnterQuery(selectQuery); - dataSources.RunQueryNVerifyResponseViews(2); - query = `INSERT ALL + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(2); + query = `INSERT ALL INTO ${guid} ( aircraft_id, aircraft_type, @@ -309,34 +331,34 @@ describe("Validate Oracle DS", { tags: ["@tag.Datasource"] }, () => { INTERVAL '6' MONTH -- Six-month maintenance interval ); SELECT * FROM DUAL;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.EnterQuery(selectQuery); - dataSources.RunQueryNVerifyResponseViews(4); - selectQuery = selectQuery + ` and aircraft_id IN (1, 6)`; - dataSources.EnterQuery(selectQuery); - dataSources.RunQueryNVerifyResponseViews(2); - dataSources.AddSuggestedWidget(Widgets.Table); - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); - table.WaitUntilTableLoad(0, 0, "v2"); - table.ReadTableRowColumnData(0, 10, "v2").then(($cellData) => { - expect($cellData).to.be.empty; - }); - table.ReadTableRowColumnData(0, 11, "v2").then(($cellData) => { - expect($cellData).to.be.empty; - }); - table.ReadTableRowColumnData(1, 10, "v2").then(($cellData) => { - expect($cellData).not.to.be.empty; - }); - table.ReadTableRowColumnData(1, 11, "v2").then(($cellData) => { - expect($cellData).not.to.be.empty; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(4); + selectQuery = selectQuery + ` and aircraft_id IN (1, 6)`; + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(2); + dataSources.AddSuggestedWidget(Widgets.Table); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); + table.WaitUntilTableLoad(0, 0, "v2"); + table.ReadTableRowColumnData(0, 10, "v2").then(($cellData) => { + expect($cellData).to.be.empty; + }); + table.ReadTableRowColumnData(0, 11, "v2").then(($cellData) => { + expect($cellData).to.be.empty; + }); + table.ReadTableRowColumnData(1, 10, "v2").then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + table.ReadTableRowColumnData(1, 11, "v2").then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + deployMode.NavigateBacktoEditor(); }); - deployMode.NavigateBacktoEditor(); - }); - it("4. Tc #2362 - Update query validation", () => { - EditorNavigation.SelectEntityByName("Query1", EntityType.Query); - query = `UPDATE ${guid} + it("4. Tc #2362 - Update query validation", () => { + EditorNavigation.SelectEntityByName("Query1", EntityType.Query); + query = `UPDATE ${guid} SET maximum_speed = CASE WHEN seating_capacity <= 100 THEN 400.89 @@ -349,117 +371,118 @@ SET ELSE TO_YMINTERVAL('1-0') END WHERE aircraft_type = 'Passenger Plane'`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - selectQuery = selectQuery + ` or aircraft_type = 'Passenger Plane'`; - dataSources.EnterQuery(selectQuery); - dataSources.RunQueryNVerifyResponseViews(3); - dataSources.AddSuggestedWidget( - Widgets.Table, - dataSources._addSuggestedExisting, - ); - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); - table.WaitUntilTableLoad(0, 0, "v2"); - table.ReadTableRowColumnData(1, 5, "v2").then(($cellData) => { - expect($cellData).to.eq("400.89"); - }); - table.ReadTableRowColumnData(1, 11, "v2").then(($cellData) => { - expect($cellData).to.eq("0-6"); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + selectQuery = selectQuery + ` or aircraft_type = 'Passenger Plane'`; + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(3); + dataSources.AddSuggestedWidget( + Widgets.Table, + dataSources._addSuggestedExisting, + ); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); + table.WaitUntilTableLoad(0, 0, "v2"); + table.ReadTableRowColumnData(1, 5, "v2").then(($cellData) => { + expect($cellData).to.eq("400.89"); + }); + table.ReadTableRowColumnData(1, 11, "v2").then(($cellData) => { + expect($cellData).to.eq("0-6"); + }); + deployMode.NavigateBacktoEditor(); }); - deployMode.NavigateBacktoEditor(); - }); - it("5. Tc #2361 - Delete query validation", () => { - EditorNavigation.SelectEntityByName("Query1", EntityType.Query); - query = `DELETE FROM ${guid} + it("5. Tc #2361 - Delete query validation", () => { + EditorNavigation.SelectEntityByName("Query1", EntityType.Query); + query = `DELETE FROM ${guid} WHERE (aircraft_type = 'Cargo Plane' AND seating_capacity <= 100) OR (aircraft_type = 'Passenger Plane' AND purchase_date < TO_DATE('2020-01-01', 'YYYY-MM-DD')) OR (aircraft_type = 'Helicopter' AND manufacturer = 'Robinson' AND maintenance_interval = INTERVAL '6' MONTH)`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - selectQuery = `SELECT * FROM ${guid}`; - dataSources.EnterQuery(selectQuery); - dataSources.RunQueryNVerifyResponseViews(2); - dataSources.AddSuggestedWidget( - Widgets.Table, - dataSources._addSuggestedExisting, - ); - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); - table.WaitUntilTableLoad(0, 0, "v2"); - for (let i = 0; i < 2; i++) { - table.ReadTableRowColumnData(i, 1, "v2").then(($cellData) => { - expect($cellData).to.eq("Cargo Plane"); - }); - } + dataSources.EnterQuery(query); + dataSources.RunQuery(); + selectQuery = `SELECT * FROM ${guid}`; + dataSources.EnterQuery(selectQuery); + dataSources.RunQueryNVerifyResponseViews(2); + dataSources.AddSuggestedWidget( + Widgets.Table, + dataSources._addSuggestedExisting, + ); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); + table.WaitUntilTableLoad(0, 0, "v2"); + for (let i = 0; i < 2; i++) { + table.ReadTableRowColumnData(i, 1, "v2").then(($cellData) => { + expect($cellData).to.eq("Cargo Plane"); + }); + } - table.OpenNFilterTable("MAINTENANCE_INTERVAL", "not empty"); - table.ReadTableRowColumnData(0, 0, "v2").then(($cellData) => { - expect($cellData).to.eq("5"); + table.OpenNFilterTable("MAINTENANCE_INTERVAL", "not empty"); + table.ReadTableRowColumnData(0, 0, "v2").then(($cellData) => { + expect($cellData).to.eq("5"); + }); + agHelper + .GetText(table._showPageItemsCount) + .then(($count) => expect($count).contain("1")); + table.CloseFilter(); + agHelper + .GetText(table._filtersCount) + .then(($count) => expect($count).contain("1")); + deployMode.NavigateBacktoEditor(); }); - agHelper - .GetText(table._showPageItemsCount) - .then(($count) => expect($count).contain("1")); - table.CloseFilter(); - agHelper - .GetText(table._filtersCount) - .then(($count) => expect($count).contain("1")); - deployMode.NavigateBacktoEditor(); - }); - it("6. Tc #2363 - Copy & Move query validations", () => { - EditorNavigation.SelectEntityByName("Query1", EntityType.Query); - agHelper.ActionContextMenuWithInPane({ - action: "Copy to page", - subAction: "Page1", - toastToValidate: "copied to page", - }); - agHelper.GetNAssertContains(locators._queryName, "Query1Copy"); - dataSources.RunQueryNVerifyResponseViews(2); - PageList.AddNewPage(); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - agHelper.ActionContextMenuWithInPane({ - action: "Move to page", - subAction: "Page2", - toastToValidate: "moved to page", - }); - agHelper.WaitUntilAllToastsDisappear(); - agHelper.GetNAssertContains(locators._queryName, "Query1Copy"); - dataSources.RunQueryNVerifyResponseViews(2); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, + it("6. Tc #2363 - Copy & Move query validations", () => { + EditorNavigation.SelectEntityByName("Query1", EntityType.Query); + agHelper.ActionContextMenuWithInPane({ + action: "Copy to page", + subAction: "Page1", + toastToValidate: "copied to page", + }); + agHelper.GetNAssertContains(locators._queryName, "Query1Copy"); + dataSources.RunQueryNVerifyResponseViews(2); + PageList.AddNewPage(); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + agHelper.ActionContextMenuWithInPane({ + action: "Move to page", + subAction: "Page2", + toastToValidate: "moved to page", + }); + agHelper.WaitUntilAllToastsDisappear(); + agHelper.GetNAssertContains(locators._queryName, "Query1Copy"); + dataSources.RunQueryNVerifyResponseViews(2); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Query1", EntityType.Query); }); - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - EditorNavigation.SelectEntityByName("Query1", EntityType.Query); - }); - it("7. Tc #2365 - Query settings tab validations", () => { - apiPage.ToggleOnPageLoadRun(false); // ALl above cases validated for onpage load run with confirmation dialog set to false - apiPage.ToggleConfirmBeforeRunning(true); - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); - table.WaitForTableEmpty("v2"); - deployMode.NavigateBacktoEditor(); - entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 500); - propPane.EnterJSContext("onClick", `{{Query1.run()}}`); - deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); - agHelper.ClickButton("Submit"); - jsEditor.ConfirmationClick("No"); //Handling both No & Yes from confirmation dialog - - table.WaitUntilTableLoad(0, 0, "v2"); - deployMode.NavigateBacktoEditor(); - }); + it("7. Tc #2365 - Query settings tab validations", () => { + apiPage.ToggleOnPageLoadRun(false); // ALl above cases validated for onpage load run with confirmation dialog set to false + apiPage.ToggleConfirmBeforeRunning(true); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); + table.WaitForTableEmpty("v2"); + deployMode.NavigateBacktoEditor(); + entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 500); + propPane.EnterJSContext("onClick", `{{Query1.run()}}`); + deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE)); + agHelper.ClickButton("Submit"); + jsEditor.ConfirmationClick("No"); //Handling both No & Yes from confirmation dialog - after( - "Verify Deletion of the Oracle datasource after all created queries are deleted", - () => { - dataSources.DeleteDatasourceFromWithinDS(dataSourceName, 409); //Since all queries exists - entityExplorer.DeleteAllQueriesForDB(dataSourceName); - deployMode.DeployApp(); + table.WaitUntilTableLoad(0, 0, "v2"); deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dataSourceName, 200); - }, - ); -}); + }); + + after( + "Verify Deletion of the Oracle datasource after all created queries are deleted", + () => { + dataSources.DeleteDatasourceFromWithinDS(dataSourceName, 409); //Since all queries exists + entityExplorer.DeleteAllQueriesForDB(dataSourceName); + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dataSourceName, 200); + }, + ); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts index 27453308848..01e4106a445 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Datasources/Redis_Basic_Spec.ts @@ -6,103 +6,107 @@ import { let dsName: any; -describe("Validate Redis DS", { tags: ["@tag.Datasource"] }, () => { - before("Create a new Redis DS", () => { - dataSources.CreateDataSource("Redis"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; +describe( + "Validate Redis DS", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + () => { + before("Create a new Redis DS", () => { + dataSources.CreateDataSource("Redis"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); }); - }); - - it("1. Create HAST set (Multiple key value pair under single key name) in redis DB, Read, Delete", () => { - let hSetReceipe = `HSET recipe:1 name "Vegetable Stir Fry" ingredients "2 cups mixed vegetables (broccoli, carrots, bell peppers, mushrooms, snow peas), 2 cloves garlic, minced" instructions "1. Heat vegetable oil in a large skillet over medium-high heat. 2. Add mixed vegetables and garlic to the skillet and cook for 3-4 minutes. 3. In a small bowl, whisk together soy sauce and cornstarch. 4. Pour the soy sauce mixture over the vegetables and stir until the vegetables are coated. 5. Cook for an additional 1-2 minutes. 6. Serve hot." difficulty "easy"`; - let hGetKeys = "HGET recipe:1 name"; - let hMGet = "HMGET recipe:1 difficulty name"; // getting multiple keys - let hUpdate = "HSET recipe:1 difficulty medium"; - let getUpdatedKey = "HGET recipe:1 difficulty"; - let getAll = "HGETALL recipe:1"; - let addNewKeyValue = `HSET recipe:1 prep_time "10 minutes"`; - let deletehKey = "DEL recipe:1"; - - //Add HSET - dataSources.CreateQueryAfterDSSaved(); - dataSources.EnterQuery(hSetReceipe); - dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! - dataSources.AssertQueryTableResponse(0, "4"); //Success response for 4 keys inserted via above HSET! - - //Read only one key from above HSET - dataSources.EnterQuery(hGetKeys); - dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! - dataSources.AssertQueryTableResponse(0, "Vegetable Stir Fry"); - - //Read more than one key from above HSET - dataSources.EnterQuery(hMGet); - dataSources.RunQueryNVerifyResponseViews(2); - dataSources.AssertQueryTableResponse(0, "easy"); - dataSources.AssertQueryTableResponse(1, "Vegetable Stir Fry"); - - //Update key value in HSET - dataSources.EnterQuery(hUpdate); - dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! - - //validate updated key - dataSources.EnterQuery(getUpdatedKey); - dataSources.RunQueryNVerifyResponseViews(1); - dataSources.AssertQueryTableResponse(0, "medium"); - - //Get All keys from HSET - dataSources.EnterQuery(getAll); - dataSources.RunQueryNVerifyResponseViews(8); //4 keys, 4 values - dataSources.ReadQueryTableResponse(0).then(($cellData: any) => { - expect($cellData).to.be.oneOf([ - "name", - "ingredients", - "instructions", - "difficulty", - ]); - }); - // dataSources.ReadQueryTableResponse(6).then(($cellData: any) => { - // expect($cellData).to.eq("instructions"); - // });//order not always matching - hence commented - - //Ading one more key/value to HSET - dataSources.EnterQuery(addNewKeyValue); - dataSources.RunQueryNVerifyResponseViews(1); - - //Verify new key/value also added to HSET - dataSources.EnterQuery(getAll); - dataSources.RunQueryNVerifyResponseViews(10); //5 keys, 5 values - dataSources.ReadQueryTableResponse(0).then(($cellData: any) => { - expect($cellData).to.be.oneOf([ - "name", - "ingredients", - "instructions", - "difficulty", - "prep_time", - ]); - }); - - //Deleting the Hash key - dataSources.EnterQuery(deletehKey); - dataSources.RunQueryNVerifyResponseViews(1); - //Verify Deletion is success - dataSources.EnterQuery(hGetKeys); - dataSources.RunQueryNVerifyResponseViews(); //5 keys, 5 values - dataSources.AssertQueryTableResponse(0, "null"); - - // Delete the query & datasource - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, + it("1. Create HAST set (Multiple key value pair under single key name) in redis DB, Read, Delete", () => { + let hSetReceipe = `HSET recipe:1 name "Vegetable Stir Fry" ingredients "2 cups mixed vegetables (broccoli, carrots, bell peppers, mushrooms, snow peas), 2 cloves garlic, minced" instructions "1. Heat vegetable oil in a large skillet over medium-high heat. 2. Add mixed vegetables and garlic to the skillet and cook for 3-4 minutes. 3. In a small bowl, whisk together soy sauce and cornstarch. 4. Pour the soy sauce mixture over the vegetables and stir until the vegetables are coated. 5. Cook for an additional 1-2 minutes. 6. Serve hot." difficulty "easy"`; + let hGetKeys = "HGET recipe:1 name"; + let hMGet = "HMGET recipe:1 difficulty name"; // getting multiple keys + let hUpdate = "HSET recipe:1 difficulty medium"; + let getUpdatedKey = "HGET recipe:1 difficulty"; + let getAll = "HGETALL recipe:1"; + let addNewKeyValue = `HSET recipe:1 prep_time "10 minutes"`; + let deletehKey = "DEL recipe:1"; + + //Add HSET + dataSources.CreateQueryAfterDSSaved(); + dataSources.EnterQuery(hSetReceipe); + dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! + dataSources.AssertQueryTableResponse(0, "4"); //Success response for 4 keys inserted via above HSET! + + //Read only one key from above HSET + dataSources.EnterQuery(hGetKeys); + dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! + dataSources.AssertQueryTableResponse(0, "Vegetable Stir Fry"); + + //Read more than one key from above HSET + dataSources.EnterQuery(hMGet); + dataSources.RunQueryNVerifyResponseViews(2); + dataSources.AssertQueryTableResponse(0, "easy"); + dataSources.AssertQueryTableResponse(1, "Vegetable Stir Fry"); + + //Update key value in HSET + dataSources.EnterQuery(hUpdate); + dataSources.RunQueryNVerifyResponseViews(1); //verify all views are returned! + + //validate updated key + dataSources.EnterQuery(getUpdatedKey); + dataSources.RunQueryNVerifyResponseViews(1); + dataSources.AssertQueryTableResponse(0, "medium"); + + //Get All keys from HSET + dataSources.EnterQuery(getAll); + dataSources.RunQueryNVerifyResponseViews(8); //4 keys, 4 values + dataSources.ReadQueryTableResponse(0).then(($cellData: any) => { + expect($cellData).to.be.oneOf([ + "name", + "ingredients", + "instructions", + "difficulty", + ]); + }); + // dataSources.ReadQueryTableResponse(6).then(($cellData: any) => { + // expect($cellData).to.eq("instructions"); + // });//order not always matching - hence commented + + //Ading one more key/value to HSET + dataSources.EnterQuery(addNewKeyValue); + dataSources.RunQueryNVerifyResponseViews(1); + + //Verify new key/value also added to HSET + dataSources.EnterQuery(getAll); + dataSources.RunQueryNVerifyResponseViews(10); //5 keys, 5 values + dataSources.ReadQueryTableResponse(0).then(($cellData: any) => { + expect($cellData).to.be.oneOf([ + "name", + "ingredients", + "instructions", + "difficulty", + "prep_time", + ]); + }); + + //Deleting the Hash key + dataSources.EnterQuery(deletehKey); + dataSources.RunQueryNVerifyResponseViews(1); + + //Verify Deletion is success + dataSources.EnterQuery(hGetKeys); + dataSources.RunQueryNVerifyResponseViews(); //5 keys, 5 values + dataSources.AssertQueryTableResponse(0, "null"); + + // Delete the query & datasource + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + dataSources.DeleteDatasourceFromWithinDS(dsName); }); - dataSources.DeleteDatasourceFromWithinDS(dsName); - }); - it("2. Verify the default port for the datasource", function () { - dataSources.NavigateToDSCreateNew(); - dataSources.CreatePlugIn("Redis"); + it("2. Verify the default port for the datasource", function () { + dataSources.NavigateToDSCreateNew(); + dataSources.CreatePlugIn("Redis"); - agHelper.AssertAttribute(dataSources._port, "value", "6379"); - }); -}); + agHelper.AssertAttribute(dataSources._port, "value", "6379"); + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts index 4b1d780a9ec..0f7ab34774b 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MongoURI_Spec.ts @@ -19,7 +19,7 @@ import data from "../../../../fixtures/mongouri_data_spec.json"; describe( "Validate Mongo URI CRUD with JSON Form", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { let dsName: any; let importDataCollectionName: string; diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts index c6fbdd13f5b..e85c63d70c1 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts @@ -16,7 +16,9 @@ import PageList from "../../../../support/Pages/PageList"; describe( "Validate Mongo CRUD with JSON Form", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, () => { let dsName: any; diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts index d0ee3d3d609..e174cd171cf 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL1_Spec.ts @@ -21,7 +21,7 @@ let dsName: any; describe( "Validate MySQL Generate CRUD with JSON Form", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { // beforeEach(function() { // if (INTERCEPT.MYSQL) { diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts index 3271e32094d..ce5773313e8 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/MySQL2_Spec.ts @@ -19,7 +19,7 @@ let dsName: any, newStoreSecret: any; describe( "Validate MySQL Generate CRUD with JSON Form", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { // beforeEach(function() { // if (INTERCEPT.MYSQL) { diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts index 70e6147c56e..8177679f27d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres1_Spec.ts @@ -22,7 +22,7 @@ let dsName: any; describe( "Postgres Generate CRUD with JSON Form", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { it("1. Create DS & then Add new Page and generate CRUD template using created datasource", () => { dataSources.CreateDataSource("Postgres"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts index 1dfb8b5e19a..09a77eb14b2 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/Postgres2_Spec.ts @@ -18,7 +18,7 @@ let dsName: any, newCallsign: any; describe( "Validate Postgres Generate CRUD with JSON Form", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { before("Create DS for generate CRUD template test", () => { dataSources.CreateDataSource("Postgres"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/S3_Spec.js b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/S3_Spec.js index ab6851b3249..cb1be5c1cd5 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/S3_Spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/GenerateCRUD/S3_Spec.js @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Generate New CRUD Page Inside from entity explorer", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { let datasourceName; diff --git a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts index feff456776c..69dc83da04d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/Fetch_Spec.ts @@ -10,7 +10,7 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Tests fetch calls", { tags: ["@tag.JS"] }, () => { +describe("Tests fetch calls", { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Ensures that cookies are not passed with fetch calls", function () { jsEditor.CreateJSObject( `export default { diff --git a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts index 71c7ac4762c..a704db310d0 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts @@ -30,7 +30,7 @@ let onPageLoadAndConfirmExecuteFunctionsLength: number, describe( "JS Function Execution", - { tags: ["@tag.JS", "@tag.Sanity"] }, + { tags: ["@tag.JS", "@tag.Sanity", "@tag.Binding"] }, function () { const FUNCTIONS_SETTINGS_DEFAULT_DATA: IFunctionSettingData[] = [ { diff --git a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/PlatformFn_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/PlatformFn_spec.ts index 32c1fca7424..a9cd4d73410 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/PlatformFn_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/PlatformFn_spec.ts @@ -11,7 +11,7 @@ import EditorNavigation from "../../../../support/Pages/EditorNavigation"; describe( "Tests functionality of platform function", - { tags: ["@tag.JS"] }, + { tags: ["@tag.JS", "@tag.Binding"] }, () => { it("1. Tests access to outer variable", () => { apiPage.CreateAndFillApi( diff --git a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts index fed88aed596..59fb56693b3 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts @@ -9,10 +9,13 @@ import { let userName: string; -describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { - it("1. Executes showAlert after 3 seconds and uses default value", () => { - jsEditor.CreateJSObject( - `export default { +describe( + "Tests setTimeout API", + { tags: ["@tag.JS", "@tag.Binding"] }, + function () { + it("1. Executes showAlert after 3 seconds and uses default value", () => { + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1: (x = "default") => { @@ -21,23 +24,23 @@ describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { }, 3000); } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: true, - }, - ); - agHelper.Sleep(2000); - jsEditor.RunJSObj(); - agHelper.Sleep(3000); - agHelper.AssertContains("Hello world - default", "exist"); - }); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: true, + }, + ); + agHelper.Sleep(2000); + jsEditor.RunJSObj(); + agHelper.Sleep(3000); + agHelper.AssertContains("Hello world - default", "exist"); + }); - it("2. Executes all three alerts in parallel after 3 seconds", () => { - jsEditor.CreateJSObject( - `export default { + it("2. Executes all three alerts in parallel after 3 seconds", () => { + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1: (x = "default") => { @@ -51,26 +54,26 @@ describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { this.myFun1(3) } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: true, - }, - ); - agHelper.Sleep(2000); - jsEditor.SelectFunctionDropdown("myFun2"); - jsEditor.RunJSObj(); - agHelper.Sleep(3000); - agHelper.AssertContains("Hello world - 1", "exist"); - agHelper.AssertContains("Hello world - 2", "exist"); - agHelper.AssertContains("Hello world - 3", "exist"); - }); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: true, + }, + ); + agHelper.Sleep(2000); + jsEditor.SelectFunctionDropdown("myFun2"); + jsEditor.RunJSObj(); + agHelper.Sleep(3000); + agHelper.AssertContains("Hello world - 1", "exist"); + agHelper.AssertContains("Hello world - 2", "exist"); + agHelper.AssertContains("Hello world - 3", "exist"); + }); - it("3. Resolves promise after 3 seconds and shows alert", () => { - jsEditor.CreateJSObject( - `export default { + it("3. Resolves promise after 3 seconds and shows alert", () => { + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1: (x) => { @@ -79,22 +82,22 @@ describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { }); }, }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: true, - }, - ); - agHelper.Sleep(2000); - jsEditor.RunJSObj(); - agHelper.Sleep(3000); - agHelper.AssertContains("resolved"); - }); - it("4. Verifies code execution order when using setTimeout", () => { - jsEditor.CreateJSObject( - `export default { + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: true, + }, + ); + agHelper.Sleep(2000); + jsEditor.RunJSObj(); + agHelper.Sleep(3000); + agHelper.AssertContains("resolved"); + }); + it("4. Verifies code execution order when using setTimeout", () => { + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1: (x) => { @@ -103,27 +106,27 @@ describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { console.log("Bye!"); }, }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: true, - }, - ); - agHelper.Sleep(2000); - jsEditor.RunJSObj(); - agHelper.GetNClick(jsEditor._logsTab); - debuggerHelper.DoesConsoleLogExist("Hey there!"); - debuggerHelper.DoesConsoleLogExist("Bye!"); - debuggerHelper.DoesConsoleLogExist("Working!", false); - agHelper.Sleep(4000); - debuggerHelper.DoesConsoleLogExist("Working!"); - }); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: true, + }, + ); + agHelper.Sleep(2000); + jsEditor.RunJSObj(); + agHelper.GetNClick(jsEditor._logsTab); + debuggerHelper.DoesConsoleLogExist("Hey there!"); + debuggerHelper.DoesConsoleLogExist("Bye!"); + debuggerHelper.DoesConsoleLogExist("Working!", false); + agHelper.Sleep(4000); + debuggerHelper.DoesConsoleLogExist("Working!"); + }); - it("5. Resolves promise after 3 seconds and shows alert", () => { - jsEditor.CreateJSObject( - `export default { + it("5. Resolves promise after 3 seconds and shows alert", () => { + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1: (x) => { @@ -132,26 +135,26 @@ describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { }); }, }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: true, - }, - ); - agHelper.Sleep(2000); - jsEditor.RunJSObj(); - agHelper.Sleep(3000); - agHelper.AssertContains("resolved"); - }); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: true, + }, + ); + agHelper.Sleep(2000); + jsEditor.RunJSObj(); + agHelper.Sleep(3000); + agHelper.AssertContains("resolved"); + }); - it("6. Access to args passed into success/error callback functions in API.run when using setTimeout", () => { - apiPage.CreateAndFillApi( - dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, - ); - jsEditor.CreateJSObject( - `export default { + it("6. Access to args passed into success/error callback functions in API.run when using setTimeout", () => { + apiPage.CreateAndFillApi( + dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl, + ); + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1: (x) => { @@ -171,42 +174,42 @@ describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { }); } }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: true, - }, - ); - jsEditor.RenameJSObjFromPane("Timeouts"); - agHelper.Sleep(2000); - jsEditor.RunJSObj(); - agHelper.Sleep(3000); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: true, + }, + ); + jsEditor.RenameJSObjFromPane("Timeouts"); + agHelper.Sleep(2000); + jsEditor.RunJSObj(); + agHelper.Sleep(3000); - cy.wait("@postExecute").then((interception: any) => { - //Js function to match any name returned from API - userName = JSON.stringify( - interception.response.body.data.body[0].name, - ).replace(/['"]+/g, ""); //removing double quotes - agHelper.AssertContains(userName); - }); + cy.wait("@postExecute").then((interception: any) => { + //Js function to match any name returned from API + userName = JSON.stringify( + interception.response.body.data.body[0].name, + ).replace(/['"]+/g, ""); //removing double quotes + agHelper.AssertContains(userName); + }); - agHelper.Sleep(2000); - jsEditor.SelectFunctionDropdown("myFun2"); - jsEditor.RunJSObj(); - agHelper.Sleep(3000); - cy.wait("@postExecute").then((interception: any) => { - userName = JSON.stringify( - interception.response.body.data.body[0].name, - ).replace(/['"]+/g, ""); - agHelper.AssertContains(userName); + agHelper.Sleep(2000); + jsEditor.SelectFunctionDropdown("myFun2"); + jsEditor.RunJSObj(); + agHelper.Sleep(3000); + cy.wait("@postExecute").then((interception: any) => { + userName = JSON.stringify( + interception.response.body.data.body[0].name, + ).replace(/['"]+/g, ""); + agHelper.AssertContains(userName); + }); }); - }); - it("7. Verifies whether setTimeout executes on page load", () => { - jsEditor.CreateJSObject( - `export default { + it("7. Verifies whether setTimeout executes on page load", () => { + jsEditor.CreateJSObject( + `export default { myVar1: [], myVar2: {}, myFun1: (x) => { @@ -216,24 +219,25 @@ describe("Tests setTimeout API", { tags: ["@tag.JS"] }, function () { }, 3000) }, }`, - { - paste: true, - completeReplace: true, - toRun: false, - shouldCreateNewJSObj: true, - prettify: true, - }, - ); - jsEditor.EnableDisableAsyncFuncSettings("myFun1", true, false); - deployMode.DeployApp(); - agHelper.Sleep(1000); //DeployApp already waiting 2000ms hence reducing it here to equate to 3000 timeout - agHelper.AssertContains("Success!"); - agHelper.Sleep(1000); - cy.wait("@postExecute").then((interception: any) => { - userName = JSON.stringify( - interception.response.body.data.body[0].name, - ).replace(/['"]+/g, ""); - agHelper.AssertContains(userName); + { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + prettify: true, + }, + ); + jsEditor.EnableDisableAsyncFuncSettings("myFun1", true, false); + deployMode.DeployApp(); + agHelper.Sleep(1000); //DeployApp already waiting 2000ms hence reducing it here to equate to 3000 timeout + agHelper.AssertContains("Success!"); + agHelper.Sleep(1000); + cy.wait("@postExecute").then((interception: any) => { + userName = JSON.stringify( + interception.response.body.data.body[0].name, + ).replace(/['"]+/g, ""); + agHelper.AssertContains(userName); + }); }); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/Basic_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/Basic_Spec.ts index dd05424b0a1..77211348bab 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/Basic_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/Basic_Spec.ts @@ -20,138 +20,148 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; let dsName: any, query: string; -describe("MySQL Datatype tests", { tags: ["@tag.Datasource"] }, function () { - before("Load dsl, Change theme, Create Mysql DS", () => { - agHelper.AddDsl("Datatypes/mySQLdsl"); +describe( + "MySQL Datatype tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + before("Load dsl, Change theme, Create Mysql DS", () => { + agHelper.AddDsl("Datatypes/mySQLdsl"); - appSettings.OpenPaneAndChangeTheme("Moon"); - dataSources.CreateDataSource("MySql"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; + appSettings.OpenPaneAndChangeTheme("Moon"); + dataSources.CreateDataSource("MySql"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); + AppSidebar.navigate(AppSidebarButton.Editor); }); - AppSidebar.navigate(AppSidebarButton.Editor); - }); - it("1. Creating mysqlDTs table & queries", () => { - //IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if table exists. - //But if we add this option then next case could fail inn that case. - query = inputData.query.createTable; + it("1. Creating mysqlDTs table & queries", () => { + //IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if table exists. + //But if we add this option then next case could fail inn that case. + query = inputData.query.createTable; - dataSources.CreateQueryFromOverlay(dsName, query, "createTable"); //Creating query from EE overlay - dataSources.RunQuery(); + dataSources.CreateQueryFromOverlay(dsName, query, "createTable"); //Creating query from EE overlay + dataSources.RunQuery(); - //Other queries - query = inputData.query.insertRecord; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - inputData.tableName, - "Insert", - ); - agHelper.RenameWithInPane("insertRecord"); - dataSources.EnterQuery(query); + //Other queries + query = inputData.query.insertRecord; + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + inputData.tableName, + "Insert", + ); + agHelper.RenameWithInPane("insertRecord"); + dataSources.EnterQuery(query); - query = inputData.query.dropTable; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - inputData.tableName, - "Delete", - ); - agHelper.RenameWithInPane("dropTable"); - dataSources.EnterQuery(query); + query = inputData.query.dropTable; + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + inputData.tableName, + "Delete", + ); + agHelper.RenameWithInPane("dropTable"); + dataSources.EnterQuery(query); - //Creating SELECT query - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - inputData.tableName, - "Select", - ); - agHelper.RenameWithInPane("selectRecords"); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - }); + //Creating SELECT query + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + inputData.tableName, + "Select", + ); + agHelper.RenameWithInPane("selectRecords"); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); + }); - //Insert valid/true values into datasource - it("2. Inserting record", () => { - deployMode.DeployApp(); - table.WaitForTableEmpty(); //asserting table is empty before inserting! - agHelper.ClickButton("Run InsertQuery"); - inputData.input.forEach((valueArr, i) => { + //Insert valid/true values into datasource + it("2. Inserting record", () => { + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! agHelper.ClickButton("Run InsertQuery"); - valueArr.forEach((value, index) => { - if (value !== "") - agHelper.EnterInputText(inputData.inputFieldName[index], value); + inputData.input.forEach((valueArr, i) => { + agHelper.ClickButton("Run InsertQuery"); + valueArr.forEach((value, index) => { + if (value !== "") + agHelper.EnterInputText(inputData.inputFieldName[index], value); + }); + i % 2 && agHelper.ToggleSwitch("Bool_column"); + agHelper.ClickButton("insertRecord"); + agHelper.Sleep(2000); //for the modal to close after entering all values & value to reflect in table + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + agHelper.Sleep(3000); }); - i % 2 && agHelper.ToggleSwitch("Bool_column"); - agHelper.ClickButton("insertRecord"); - agHelper.Sleep(2000); //for the modal to close after entering all values & value to reflect in table - agHelper.AssertElementVisibility( - locators._buttonByText("Run InsertQuery"), - ); - agHelper.Sleep(3000); }); - }); - //Verify weather expected value is present in each cell - //i.e. weather right data is pushed and fetched from datasource. - it("3. Validating values in each cell", () => { - cy.wait(2000); - inputData.result.forEach((res_array, i) => { - res_array.forEach((value, j) => { - table.ReadTableRowColumnData(j, i, "v1", 0).then(($cellData) => { - if (i === inputData.result.length - 1) { - const obj = JSON.parse($cellData); - expect(JSON.stringify(obj)).to.eq(JSON.stringify(value)); - } else { - expect($cellData).to.eq(value); - } + //Verify weather expected value is present in each cell + //i.e. weather right data is pushed and fetched from datasource. + it("3. Validating values in each cell", () => { + cy.wait(2000); + inputData.result.forEach((res_array, i) => { + res_array.forEach((value, j) => { + table.ReadTableRowColumnData(j, i, "v1", 0).then(($cellData) => { + if (i === inputData.result.length - 1) { + const obj = JSON.parse($cellData); + expect(JSON.stringify(obj)).to.eq(JSON.stringify(value)); + } else { + expect($cellData).to.eq(value); + } + }); }); }); }); - }); - //null will be displayed as empty string in tables - //So test null we have to intercept execute request. - //And check response payload. - it("4. Testing null value", () => { - deployMode.NavigateBacktoEditor(); - EditorNavigation.SelectEntityByName("selectRecords", EntityType.Query); - dataSources.RunQuery({ toValidateResponse: false }); - cy.wait("@postExecute").then((intercept) => { - expect( - typeof intercept.response?.body.data.body[5].varchar_column, - ).to.be.equal("object"); - expect(intercept.response?.body.data.body[5].varchar_column).to.be.equal( - null, - ); + //null will be displayed as empty string in tables + //So test null we have to intercept execute request. + //And check response payload. + it("4. Testing null value", () => { + deployMode.NavigateBacktoEditor(); + EditorNavigation.SelectEntityByName("selectRecords", EntityType.Query); + dataSources.RunQuery({ toValidateResponse: false }); + cy.wait("@postExecute").then((intercept) => { + expect( + typeof intercept.response?.body.data.body[5].varchar_column, + ).to.be.equal("object"); + expect( + intercept.response?.body.data.body[5].varchar_column, + ).to.be.equal(null); + }); }); - }); - after( - "Verify Drop of tables & Deletion of the datasource after all created queries are deleted", - () => { - EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); - dataSources.RunQuery(); - dataSources.AssertQueryTableResponse(0, "0"); //Success response for dropped table! - dataSources.AssertTableInVirtuosoList(dsName, inputData.tableName, false); + after( + "Verify Drop of tables & Deletion of the datasource after all created queries are deleted", + () => { + EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); + dataSources.RunQuery(); + dataSources.AssertQueryTableResponse(0, "0"); //Success response for dropped table! + dataSources.AssertTableInVirtuosoList( + dsName, + inputData.tableName, + false, + ); - //DS deletion - dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists - AppSidebar.navigate(AppSidebarButton.Editor); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - ["createTable", "dropTable", "insertRecord", "selectRecords"].forEach( - (type) => { - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: type, - action: "Delete", - entityType: entityItems.Query, - }); - }, - ); - deployMode.DeployApp(); - deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dsName, 200); - }, - ); -}); + //DS deletion + dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists + AppSidebar.navigate(AppSidebarButton.Editor); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + ["createTable", "dropTable", "insertRecord", "selectRecords"].forEach( + (type) => { + entityExplorer.ActionContextMenuByEntityName({ + entityNameinLeftSidebar: type, + action: "Delete", + entityType: entityItems.Query, + }); + }, + ); + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dsName, 200); + }, + ); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/False_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/False_Spec.ts index c32baac8721..821b89ff3f7 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/False_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/MySQL_Datatypes/False_Spec.ts @@ -9,67 +9,71 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; let dsName: any, query: string; -describe("MySQL Datatype tests", { tags: ["@tag.Datasource"] }, function () { - before("Create Mysql DS & Create mysqlDTs table", function () { - dataSources.CreateDataSource("MySql"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; - //IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if table exists. - //But if we add this option then next case could fail inn that case. - query = inputData.query.createTable; - dataSources.CreateQueryAfterDSSaved(query, "createTable"); //Creating query from EE overlay - dataSources.RunQuery(); - }); - }); - - //Insert false values to each column and check for the error status of the request. - it("1. False Cases & Long Integer as query param", () => { - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - inputData.tableName, - "Insert", - ); - agHelper.RenameWithInPane("falseCases"); - inputData.falseResult.forEach((res_array, i) => { - res_array.forEach((value) => { - query = - typeof value === "string" - ? `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{"${value}"}})` - : `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{${value}}})`; - dataSources.EnterQuery(query); - dataSources.RunQuery({ expectedStatus: false }); +describe( + "MySQL Datatype tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + before("Create Mysql DS & Create mysqlDTs table", function () { + dataSources.CreateDataSource("MySql"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + //IF NOT EXISTS can be used - which creates tabel if it does not exist and donot throw any error if table exists. + //But if we add this option then next case could fail inn that case. + query = inputData.query.createTable; + dataSources.CreateQueryAfterDSSaved(query, "createTable"); //Creating query from EE overlay + dataSources.RunQuery(); }); }); - agHelper.Sleep(2000); - //agHelper.WaitUntilAllToastsDisappear(); - //This is a special case. - //Added due to server side checks, which was handled in Datatype handling. - //Long Integer as query param + //Insert false values to each column and check for the error status of the request. + it("1. False Cases & Long Integer as query param", () => { + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + inputData.tableName, + "Insert", + ); + agHelper.RenameWithInPane("falseCases"); + inputData.falseResult.forEach((res_array, i) => { + res_array.forEach((value) => { + query = + typeof value === "string" + ? `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{"${value}"}})` + : `INSERT INTO ${inputData.tableName} (${inputData.inputFieldName[i]}) VALUES ({{${value}}})`; + dataSources.EnterQuery(query); + dataSources.RunQuery({ expectedStatus: false }); + }); + }); + agHelper.Sleep(2000); + //agHelper.WaitUntilAllToastsDisappear(); - query = `SELECT * FROM ${inputData.tableName} LIMIT {{2147483648}}`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - }); + //This is a special case. + //Added due to server side checks, which was handled in Datatype handling. + //Long Integer as query param - after( - "Verify Drop table & Deletion of the datasource after all created queries are deleted", - () => { - query = inputData.query.dropTable; + query = `SELECT * FROM ${inputData.tableName} LIMIT {{2147483648}}`; dataSources.EnterQuery(query); dataSources.RunQuery(); + }); - // ["falseCases", "createTable"].forEach((type) => { - // entityExplorer.ActionContextMenuByEntityName( - // type, - // "Delete", - // "Are you sure?", - // ); - // }); - entityExplorer.DeleteAllQueriesForDB(dsName); - deployMode.DeployApp(); - deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dsName, 200); - }, - ); -}); + after( + "Verify Drop table & Deletion of the datasource after all created queries are deleted", + () => { + query = inputData.query.dropTable; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + + // ["falseCases", "createTable"].forEach((type) => { + // entityExplorer.ActionContextMenuByEntityName( + // type, + // "Delete", + // "Are you sure?", + // ); + // }); + entityExplorer.DeleteAllQueriesForDB(dsName); + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dsName, 200); + }, + ); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts index 440487f3521..f5fe03d92b1 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts @@ -15,7 +15,7 @@ import EditorNavigation, { describe( "JSObjects OnLoad Actions tests", - { tags: ["@tag.PropertyPane", "@tag.JS"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Binding"] }, function () { before(() => { agHelper.AddDsl("tableWidgetDsl"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/ExecuteAction_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/ExecuteAction_Spec.ts index c4653d3f430..72a9a83cdc1 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/ExecuteAction_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/ExecuteAction_Spec.ts @@ -8,7 +8,7 @@ import { describe( "Execute Action Functionality", - { tags: ["@tag.PropertyPane", "@tag.JS"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Binding"] }, function () { before(() => { homePage.ImportApp("executeAction.json"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts index 300d27e0578..3e01eada4ec 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts @@ -12,7 +12,15 @@ import EditorNavigation, { describe( "JSObjects OnLoad Actions tests", - { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.ImportExport"] }, + { + tags: [ + "@tag.PropertyPane", + "@tag.JS", + "@tag.ImportExport", + "@tag.Binding", + "@tag.Git", + ], + }, function () { before(() => { homePage.CreateNewWorkspace("JSOnLoadTest", true); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts index 44e9d377341..4d86a896aa8 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts @@ -11,7 +11,7 @@ let jsName: any; describe( "JSObjects OnLoad Actions tests", - { tags: ["@tag.PropertyPane", "@tag.JS"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Binding"] }, function () { it("1. Tc 51, 52 Verify that JS editor function has a settings button available for functions", () => { jsEditor.CreateJSObject( diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad_cyclic_dependency_errors_spec.js b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad_cyclic_dependency_errors_spec.js index bb8cb9c8b9e..28b69166499 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad_cyclic_dependency_errors_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad_cyclic_dependency_errors_spec.js @@ -30,7 +30,7 @@ let dsname; describe( "Cyclic Dependency Informational Error Messages", - { tags: ["@tag.PropertyPane", "@tag.JS"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Binding"] }, function () { before(() => { //appId = localStorage.getItem("applicationId"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts index bfda4a01b53..ac26d827c7d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JsOnLoad3_Spec.ts @@ -17,7 +17,7 @@ let jsName: any; describe( "JSObjects OnLoad Actions tests", - { tags: ["@tag.PropertyPane", "@tag.JS"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Binding"] }, function () { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts index d3c0632939b..92a8ce84c28 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/OnLoadActions_Spec.ts @@ -16,7 +16,7 @@ import EditorNavigation, { describe( "Layout OnLoad Actions tests", - { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Sanity"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Sanity", "@tag.Binding"] }, function () { beforeEach(() => { agHelper.RestoreLocalStorageCache(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts index 62d096a0f37..df94b5bc09d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/PostgresConnections_spec.ts @@ -17,7 +17,7 @@ let guid: any, dsName_1: any, dsName_2: any; describe( "Test Postgres number of connections on page load + Bug 11572, Bug 11202", - { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Sanity"] }, + { tags: ["@tag.PropertyPane", "@tag.JS", "@tag.Sanity", "@tag.Binding"] }, function () { before(() => { agHelper.GenerateUUID(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Params/ExecutionParams_spec.js b/app/client/cypress/e2e/Regression/ServerSide/Params/ExecutionParams_spec.js index 6e2974a0c77..700bc2da2cf 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Params/ExecutionParams_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/Params/ExecutionParams_spec.js @@ -13,7 +13,7 @@ import { describe( "API Panel Test Functionality", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { let datasourceName; before(() => { diff --git a/app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts index 3abcb2829e4..b5a82ab53da 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts @@ -22,7 +22,7 @@ let jsName: any, dsName: any; describe( "Bug #10784 - Passing params from JS to SQL query should not break", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { before(() => { entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 100, 100); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Array_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Array_Spec.ts index 8ac68212e08..7def8bf3e6d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Array_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Array_Spec.ts @@ -17,524 +17,544 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../support/Pages/EditorNavigation"; -describe("Array Datatype tests", { tags: ["@tag.Datasource"] }, function () { - let dsName: any, query: string; - - before("Create DS, Add DS & setting theme", () => { - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; +describe( + "Array Datatype tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + let dsName: any, query: string; + + before("Create DS, Add DS & setting theme", () => { + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); + agHelper.AddDsl("Datatypes/ArrayDTdsl"); + appSettings.OpenPaneAndChangeThemeColors(-31, -27); }); - agHelper.AddDsl("Datatypes/ArrayDTdsl"); - appSettings.OpenPaneAndChangeThemeColors(-31, -27); - }); - - it("1. Creating table query - arraytypes + Bug 14493", () => { - dataSources.CreateQueryForDS( - dsName, - `CREATE TABLE arraytypes (serialId SERIAL not null primary key, name text, pay_by_quarter integer[], schedule text[][]);`, - "createTable", - ); - dataSources.RunQuery(); - //Creating other queries - query = `INSERT INTO arraytypes ("name", "pay_by_quarter", "schedule") VALUES ('{{Insertname.text}}', ARRAY{{Insertpaybyquarter.text.split(',').map(Number)}}, ARRAY[['{{Insertschedule.text.split(',').slice(0,2).toString()}}'],['{{Insertschedule.text.split(',').slice(2,4).toString()}}']]);`; + it("1. Creating table query - arraytypes + Bug 14493", () => { + dataSources.CreateQueryForDS( + dsName, + `CREATE TABLE arraytypes (serialId SERIAL not null primary key, name text, pay_by_quarter integer[], schedule text[][]);`, + "createTable", + ); + dataSources.RunQuery(); + + //Creating other queries + query = `INSERT INTO arraytypes ("name", "pay_by_quarter", "schedule") VALUES ('{{Insertname.text}}', ARRAY{{Insertpaybyquarter.text.split(',').map(Number)}}, ARRAY[['{{Insertschedule.text.split(',').slice(0,2).toString()}}'],['{{Insertschedule.text.split(',').slice(2,4).toString()}}']]);`; - dataSources.CreateQueryFromOverlay(dsName, query, "insertRecord"); //Creating query from EE overlay - dataSources.ToggleUsePreparedStatement(false); + dataSources.CreateQueryFromOverlay(dsName, query, "insertRecord"); //Creating query from EE overlay + dataSources.ToggleUsePreparedStatement(false); - query = `UPDATE public."arraytypes" SET "name" = '{{Updatename.text}}', "pay_by_quarter" = ARRAY{{Updatepaybyquarter.text.split(',').map(Number)}}, + query = `UPDATE public."arraytypes" SET "name" = '{{Updatename.text}}', "pay_by_quarter" = ARRAY{{Updatepaybyquarter.text.split(',').map(Number)}}, "schedule" = ARRAY[['{{Updateschedule.text.split(',').slice(0,2).toString()}}'],['{{Updateschedule.text.split(',').slice(2,4).toString()}}']] WHERE serialid = {{Table1.selectedRow.serialid}};`; - dataSources.CreateQueryFromOverlay(dsName, query, "updateRecord"); //Creating query from EE overlay - dataSources.ToggleUsePreparedStatement(false); + dataSources.CreateQueryFromOverlay(dsName, query, "updateRecord"); //Creating query from EE overlay + dataSources.ToggleUsePreparedStatement(false); - query = `DELETE FROM public."arraytypes" WHERE serialId = {{Table1.selectedRow.serialid}}`; - dataSources.CreateQueryFromOverlay(dsName, query, "deleteRecord"); //Creating query from EE overlay + query = `DELETE FROM public."arraytypes" WHERE serialId = {{Table1.selectedRow.serialid}}`; + dataSources.CreateQueryFromOverlay(dsName, query, "deleteRecord"); //Creating query from EE overlay - query = `DELETE FROM public."arraytypes"`; - dataSources.CreateQueryFromOverlay(dsName, query, "deleteAllRecords"); //Creating query from EE overlay + query = `DELETE FROM public."arraytypes"`; + dataSources.CreateQueryFromOverlay(dsName, query, "deleteAllRecords"); //Creating query from EE overlay - query = `DROP table public."arraytypes"`; - dataSources.CreateQueryFromOverlay(dsName, query, "dropTable"); //Creating query from EE overlay + query = `DROP table public."arraytypes"`; + dataSources.CreateQueryFromOverlay(dsName, query, "dropTable"); //Creating query from EE overlay - //Creating SELECT query - arraytypes + Bug 14493 - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.arraytypes", - "Select", - ); - agHelper.RenameWithInPane("selectRecords"); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - }); - - it("2. Inserting record - arraytypes", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - deployMode.DeployApp(); - table.WaitForTableEmpty(); //asserting table is empty before inserting! - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.EnterInputText("Name", "Lily Bush"); - agHelper.EnterInputText("Pay_by_quarter", "100,200,300,400"); - agHelper.EnterInputText("Schedule", "Arrival,Breakfast,Meeting,Lunch"); - - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence + //Creating SELECT query - arraytypes + Bug 14493 + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.arraytypes", + "Select", + ); + agHelper.RenameWithInPane("selectRecords"); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { - expect($cellData).not.to.eq(""); + + it("2. Inserting record - arraytypes", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.EnterInputText("Name", "Lily Bush"); + agHelper.EnterInputText("Pay_by_quarter", "100,200,300,400"); + agHelper.EnterInputText("Schedule", "Arrival,Breakfast,Meeting,Lunch"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); }); - }); - it("3. Inserting another record - arraytypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); + it("3. Inserting another record - arraytypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Name", "Josh William"); - agHelper.EnterInputText("Pay_by_quarter", "8700,5454,9898,23257"); - agHelper.EnterInputText("Schedule", "Stand up,Update,Report,Executive"); + agHelper.EnterInputText("Name", "Josh William"); + agHelper.EnterInputText("Pay_by_quarter", "8700,5454,9898,23257"); + agHelper.EnterInputText("Schedule", "Stand up,Update,Report,Executive"); - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => { - expect($cellData).not.to.eq(""); + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); }); - }); - it("4. Inserting another record - arraytypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); + it("4. Inserting another record - arraytypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Name", "Mary Clark"); - agHelper.EnterInputText("Pay_by_quarter", "9898,21726,87387,8372837"); - agHelper.EnterInputText( - "Schedule", - "Travel,Meet Sales,Take Action,Sky Rocket", - ); + agHelper.EnterInputText("Name", "Mary Clark"); + agHelper.EnterInputText("Pay_by_quarter", "9898,21726,87387,8372837"); + agHelper.EnterInputText( + "Schedule", + "Travel,Meet Sales,Take Action,Sky Rocket", + ); - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { - expect($cellData).not.to.eq(""); + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); }); - }); - - it("5. Updating record - arraytypes", () => { - table.SelectTableRow(1); - agHelper.ClickButton("Run UpdateQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.EnterInputText("Name", "Josh Clarion", true); - agHelper.EnterInputText("Pay_by_quarter", "3232,3232,4567,12234", true); - agHelper.EnterInputText( - "Schedule", - "Breakfat,Presentation,Consulting,Training", - true, - ); - agHelper.ClickButton("Update"); - agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Update did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run UpdateQuery")); - table.WaitUntilTableLoad(); - agHelper.Sleep(5000); //some more time for rows to rearrange! - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("3"); - }); - table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("2"); //Since recently updated column to pushed to last! - }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { - expect($cellData).not.to.eq(""); + it("5. Updating record - arraytypes", () => { + table.SelectTableRow(1); + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.EnterInputText("Name", "Josh Clarion", true); + agHelper.EnterInputText("Pay_by_quarter", "3232,3232,4567,12234", true); + agHelper.EnterInputText( + "Schedule", + "Breakfat,Presentation,Consulting,Training", + true, + ); + + agHelper.ClickButton("Update"); + agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Update did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run UpdateQuery"), + ); + table.WaitUntilTableLoad(); + agHelper.Sleep(5000); //some more time for rows to rearrange! + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("3"); + }); + table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //Since recently updated column to pushed to last! + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); }); - }); - - it("6. Validating JSON functions", () => { - deployMode.NavigateBacktoEditor(); - table.WaitUntilTableLoad(); - AppSidebar.navigate(AppSidebarButton.Editor); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - dataSources.CreateQueryForDS(dsName); - agHelper.RenameWithInPane("verifyArrayFunctions"); - - query = `SELECT name FROM arraytypes WHERE pay_by_quarter[1] <> pay_by_quarter[2];`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["name"]); - dataSources.AssertQueryTableResponse(0, "Lily Bush"); - dataSources.AssertQueryTableResponse(1, "Mary Clark"); - - query = `SELECT pay_by_quarter[3] FROM arraytypes;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["pay_by_quarter"]); - dataSources.AssertQueryTableResponse(0, "300"); - dataSources.AssertQueryTableResponse(1, "87387"); - dataSources.AssertQueryTableResponse(2, "4567"); - - //Verifying OR - query = `SELECT * FROM arraytypes WHERE pay_by_quarter[1] = 300 OR pay_by_quarter[2] = 200 OR pay_by_quarter[3] = 4567 OR pay_by_quarter[4] = 10000;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "serialid", - "name", - "pay_by_quarter", - "schedule", - ]); - dataSources.AssertQueryTableResponse(0, "1"); - dataSources.AssertQueryTableResponse(1, "Lily Bush"); - dataSources.AssertQueryTableResponse(4, "2"); - dataSources.AssertQueryTableResponse(5, "Josh Clarion"); - - //Verifying && - query = `SELECT * FROM arraytypes WHERE pay_by_quarter && ARRAY[87387];`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "serialid", - "name", - "pay_by_quarter", - "schedule", - ]); - dataSources.AssertQueryTableResponse(0, "3"); - dataSources.AssertQueryTableResponse(1, "Mary Clark"); - dataSources.AssertQueryTableResponse(2, "[9898,21726,87387,8372837]"); - dataSources.AssertQueryTableResponse( - 3, - `[["Travel,Meet Sales"],["Take Action,Sky Rocket"]]`, - ); - //Verifying ANY - query = `SELECT * FROM arraytypes WHERE 9898 = ANY (pay_by_quarter);`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "serialid", - "name", - "pay_by_quarter", - "schedule", - ]); - dataSources.AssertQueryTableResponse(0, "3"); - dataSources.AssertQueryTableResponse(1, "Mary Clark"); - - //Verifying generate_script - query = `SELECT * FROM + it("6. Validating JSON functions", () => { + deployMode.NavigateBacktoEditor(); + table.WaitUntilTableLoad(); + AppSidebar.navigate(AppSidebarButton.Editor); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + dataSources.CreateQueryForDS(dsName); + agHelper.RenameWithInPane("verifyArrayFunctions"); + + query = `SELECT name FROM arraytypes WHERE pay_by_quarter[1] <> pay_by_quarter[2];`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["name"]); + dataSources.AssertQueryTableResponse(0, "Lily Bush"); + dataSources.AssertQueryTableResponse(1, "Mary Clark"); + + query = `SELECT pay_by_quarter[3] FROM arraytypes;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["pay_by_quarter"]); + dataSources.AssertQueryTableResponse(0, "300"); + dataSources.AssertQueryTableResponse(1, "87387"); + dataSources.AssertQueryTableResponse(2, "4567"); + + //Verifying OR + query = `SELECT * FROM arraytypes WHERE pay_by_quarter[1] = 300 OR pay_by_quarter[2] = 200 OR pay_by_quarter[3] = 4567 OR pay_by_quarter[4] = 10000;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "serialid", + "name", + "pay_by_quarter", + "schedule", + ]); + dataSources.AssertQueryTableResponse(0, "1"); + dataSources.AssertQueryTableResponse(1, "Lily Bush"); + dataSources.AssertQueryTableResponse(4, "2"); + dataSources.AssertQueryTableResponse(5, "Josh Clarion"); + + //Verifying && + query = `SELECT * FROM arraytypes WHERE pay_by_quarter && ARRAY[87387];`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "serialid", + "name", + "pay_by_quarter", + "schedule", + ]); + dataSources.AssertQueryTableResponse(0, "3"); + dataSources.AssertQueryTableResponse(1, "Mary Clark"); + dataSources.AssertQueryTableResponse(2, "[9898,21726,87387,8372837]"); + dataSources.AssertQueryTableResponse( + 3, + `[["Travel,Meet Sales"],["Take Action,Sky Rocket"]]`, + ); + + //Verifying ANY + query = `SELECT * FROM arraytypes WHERE 9898 = ANY (pay_by_quarter);`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "serialid", + "name", + "pay_by_quarter", + "schedule", + ]); + dataSources.AssertQueryTableResponse(0, "3"); + dataSources.AssertQueryTableResponse(1, "Mary Clark"); + + //Verifying generate_script + query = `SELECT * FROM (SELECT pay_by_quarter, generate_subscripts(pay_by_quarter, 1) AS position FROM arraytypes) AS foo WHERE pay_by_quarter[position] = 100;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["pay_by_quarter", "position"]); - dataSources.AssertQueryTableResponse(0, "[100,200,300,400]"); - dataSources.AssertQueryTableResponse(1, "1"); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["pay_by_quarter", "position"]); + dataSources.AssertQueryTableResponse(0, "[100,200,300,400]"); + dataSources.AssertQueryTableResponse(1, "1"); - query = `SELECT * FROM + query = `SELECT * FROM (SELECT pay_by_quarter, generate_subscripts(pay_by_quarter, 1) AS position FROM arraytypes) AS foo WHERE pay_by_quarter[position] = 3232;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["pay_by_quarter", "position"]); - dataSources.AssertQueryTableResponse(0, "[3232,3232,4567,12234]"); - dataSources.AssertQueryTableResponse(1, "1"); - dataSources.AssertQueryTableResponse(2, "[3232,3232,4567,12234]"); - dataSources.AssertQueryTableResponse(3, "2"); - - //Verifying ALL - query = `SELECT * FROM arraytypes WHERE 100 = ALL (pay_by_quarter);`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - - //Verifying unnest - query = `SELECT name, unnest(schedule) FROM arraytypes;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["name", "unnest"]); - dataSources.AssertQueryTableResponse(0, "Lily Bush"); - dataSources.AssertQueryTableResponse(1, "Arrival,Breakfast"); - dataSources.AssertQueryTableResponse(4, "Mary Clark"); - dataSources.AssertQueryTableResponse(5, "Travel,Meet Sales"); - dataSources.AssertQueryTableResponse(10, "Josh Clarion"); - dataSources.AssertQueryTableResponse(11, "Consulting,Training"); - - //Verifying index access - query = `SELECT schedule[1:2][1:1] FROM arraytypes WHERE name = 'Lily Bush';`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["schedule"]); - dataSources.AssertQueryTableResponse( - 0, - `[["Arrival,Breakfast"],["Meeting,Lunch"]]`, - ); - - //Verifying index access - query = `SELECT schedule[1:2][2] FROM arraytypes WHERE name = 'Josh Clarion';`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["schedule"]); - dataSources.AssertQueryTableResponse( - 0, - `[["Breakfat,Presentation"],["Consulting,Training"]]`, - ); + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["pay_by_quarter", "position"]); + dataSources.AssertQueryTableResponse(0, "[3232,3232,4567,12234]"); + dataSources.AssertQueryTableResponse(1, "1"); + dataSources.AssertQueryTableResponse(2, "[3232,3232,4567,12234]"); + dataSources.AssertQueryTableResponse(3, "2"); + + //Verifying ALL + query = `SELECT * FROM arraytypes WHERE 100 = ALL (pay_by_quarter);`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); + + //Verifying unnest + query = `SELECT name, unnest(schedule) FROM arraytypes;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["name", "unnest"]); + dataSources.AssertQueryTableResponse(0, "Lily Bush"); + dataSources.AssertQueryTableResponse(1, "Arrival,Breakfast"); + dataSources.AssertQueryTableResponse(4, "Mary Clark"); + dataSources.AssertQueryTableResponse(5, "Travel,Meet Sales"); + dataSources.AssertQueryTableResponse(10, "Josh Clarion"); + dataSources.AssertQueryTableResponse(11, "Consulting,Training"); + + //Verifying index access + query = `SELECT schedule[1:2][1:1] FROM arraytypes WHERE name = 'Lily Bush';`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["schedule"]); + dataSources.AssertQueryTableResponse( + 0, + `[["Arrival,Breakfast"],["Meeting,Lunch"]]`, + ); - query = `SELECT schedule[:1][1:] FROM arraytypes WHERE name = 'Mary Clark';`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["schedule"]); - dataSources.AssertQueryTableResponse(0, `[["Travel,Meet Sales"]]`); - - query = `SELECT schedule[2:2][:] FROM arraytypes WHERE name = 'Mary Clark';`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["schedule"]); - dataSources.AssertQueryTableResponse(0, `[["Take Action,Sky Rocket"]]`); - - //Verifying array_dims - query = `SELECT array_dims(schedule) FROM arraytypes WHERE name = 'Lily Bush';`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["array_dims"]); - dataSources.AssertQueryTableResponse(0, "[1:2][1:1]"); - - //Verifying array_length - query = `SELECT array_length(schedule, 1) FROM arraytypes WHERE name = 'Mary Clark';`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["array_length"]); - dataSources.AssertQueryTableResponse(0, "2"); - - //Verifying array_upper, cardinality - query = `SELECT array_upper(pay_by_quarter, 1), cardinality(schedule) FROM arraytypes WHERE name = 'Josh Clarion';`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["array_upper", "cardinality"]); - dataSources.AssertQueryTableResponse(0, "4"); - dataSources.AssertQueryTableResponse(1, "2"); - - //Verifying || - query = `SELECT ARRAY[1,2] || ARRAY[3,4] as "Test ||", ARRAY[5,6] || ARRAY[[1,2],[3,4]] as "Test || of 2D Array", ARRAY[1, 2] || '{3, 4}' as "Test || with {}"`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "Test ||", - "Test || of 2D Array", - "Test || with {}", - ]); - dataSources.AssertQueryTableResponse(0, "[1,2,3,4]"); - dataSources.AssertQueryTableResponse(1, "[[5,6],[1,2],[3,4]]"); - dataSources.AssertQueryTableResponse(2, "[1,2,3,4]"); - - //Verifying array_dims - query = `SELECT array_dims(1 || '[0:1]={2,3}'::int[]) as "array_dims1", array_dims(ARRAY[1,2] || 3) as "array_dims2", array_dims(ARRAY[1,2] || ARRAY[3,4,5]) as "array_dims3", array_dims(ARRAY[[1,2],[3,4]] || ARRAY[[5,6],[7,8],[9,0]]) as "array_dims4";`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "array_dims1", - "array_dims2", - "array_dims3", - "array_dims4", - ]); - dataSources.AssertQueryTableResponse(0, "[0:2]"); - dataSources.AssertQueryTableResponse(1, "[1:3]"); - dataSources.AssertQueryTableResponse(2, "[1:5]"); - dataSources.AssertQueryTableResponse(3, "[1:5][1:2]"); - - //Verifying array_prepend, array_append - query = `SELECT array_prepend(1, ARRAY[2,3]) as "array_prepend", array_append(ARRAY[1,2], 3) as "array_append";`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["array_prepend", "array_append"]); - dataSources.AssertQueryTableResponse(0, "[1,2,3]"); - dataSources.AssertQueryTableResponse(1, "[1,2,3]"); - - //Verifying array_cat - query = `SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) as "array_cat1", array_cat(ARRAY[[1,2],[3,4]], ARRAY[5,6]) as "array_cat2", array_cat(ARRAY[5,6], ARRAY[[1,2],[3,4]]) as "array_cat3"`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "array_cat1", - "array_cat2", - "array_cat3", - ]); - dataSources.AssertQueryTableResponse(0, "[1,2,3,4]"); - dataSources.AssertQueryTableResponse(1, "[[1,2],[3,4],[5,6]]"); - dataSources.AssertQueryTableResponse(2, "[[5,6],[1,2],[3,4]]"); - - //Verifying || with NULL - query = `SELECT ARRAY[1, 2] || NULL as "|| with NULL", array_append(ARRAY[1, 2], NULL) as "array_append";`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["|| with NULL", "array_append"]); - dataSources.AssertQueryTableResponse(0, "[1,2]"); - dataSources.AssertQueryTableResponse(1, "[1,2,null]"); - - //Verifying array_position, array_positions - query = `SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat'), array_positions(ARRAY[1, 4, 3, 1, 3, 4, 2, 1], 1);`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "array_position", - "array_positions", - ]); - dataSources.AssertQueryTableResponse(0, "7"); - dataSources.AssertQueryTableResponse(1, "[1,4,8]"); - - //Verifying input & output syntaxes - query = `SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2 FROM (SELECT '[1:1][-2:-1] [3:5]={ {{1,2,3},{4,5,6} } }'::int[] AS f1) AS ss;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["e1", "e2"]); - dataSources.AssertQueryTableResponse(0, "1"); - dataSources.AssertQueryTableResponse(1, "6"); - - //Verifying array_remove - query = `SELECT array_remove(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'wed') as "array_remove"`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders(["array_remove"]); - dataSources.AssertQueryTableResponse( - 0, - `["sun","mon","tue","thu","fri","sat"]`, - ); + //Verifying index access + query = `SELECT schedule[1:2][2] FROM arraytypes WHERE name = 'Josh Clarion';`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["schedule"]); + dataSources.AssertQueryTableResponse( + 0, + `[["Breakfat,Presentation"],["Consulting,Training"]]`, + ); - //Verifying array_replace - query = `select ARRAY[1,2,3,2,5] as "before_replace", array_replace(ARRAY[1,2,3,2,5], 2, 10) as two_becomes_ten;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "before_replace", - "two_becomes_ten", - ]); - dataSources.AssertQueryTableResponse(0, `[1,2,3,2,5]`); - dataSources.AssertQueryTableResponse(1, `[1,10,3,10,5]`); - - //Verifying operators - query = `select ARRAY[1.1,2.1,3.1]::int[] = ARRAY[1,2,3] as "=", ARRAY[1,2,3] <> ARRAY[1,2,4] as "<>", ARRAY[1,2,3] < ARRAY[1,2,4] as "<", ARRAY[1,4,3] > ARRAY[1,2,4] as ">", ARRAY[1,2,3] <= ARRAY[1,2,3] as "<=", ARRAY[1,4,3] >= ARRAY[1,4,3] as ">=", ARRAY[1,4,3] @> ARRAY[3,1,3] as "@>", ARRAY[2,2,7] <@ ARRAY[1,7,4,2,6] as "<@", ARRAY[1,4,3] && ARRAY[2,1] as "&&"`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "=", - "<>", - "<", - ">", - "<=", - ">=", - "@>", - "<@", - "&&", - ]); - dataSources.AssertQueryTableResponse(0, "true"); - dataSources.AssertQueryTableResponse(8, "true"); - - //Verifying array_to_string - query = `SELECT array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*') as array_to_string, string_to_array('xx~^~yy~^~zz', '~^~', 'yy') as string_to_array;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "array_to_string", - "string_to_array", - ]); - dataSources.AssertQueryTableResponse(0, "1,2,3,*,5"); - dataSources.AssertQueryTableResponse(1, `["xx",null,"zz"]`); - - //Verifying error - query = `SELECT ARRAY[1, 2] || '7';`; - dataSources.EnterQuery(query); - agHelper.FocusElement(locators._codeMirrorTextArea); - dataSources.RunQuery({ expectedStatus: false }); - agHelper - .GetText(dataSources._queryError) - .then(($errorText) => - expect($errorText).to.contain( - `ERROR: malformed array literal: "7"\n Detail: Array value must start with "{" or dimension information`, - ), + query = `SELECT schedule[:1][1:] FROM arraytypes WHERE name = 'Mary Clark';`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["schedule"]); + dataSources.AssertQueryTableResponse(0, `[["Travel,Meet Sales"]]`); + + query = `SELECT schedule[2:2][:] FROM arraytypes WHERE name = 'Mary Clark';`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["schedule"]); + dataSources.AssertQueryTableResponse(0, `[["Take Action,Sky Rocket"]]`); + + //Verifying array_dims + query = `SELECT array_dims(schedule) FROM arraytypes WHERE name = 'Lily Bush';`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["array_dims"]); + dataSources.AssertQueryTableResponse(0, "[1:2][1:1]"); + + //Verifying array_length + query = `SELECT array_length(schedule, 1) FROM arraytypes WHERE name = 'Mary Clark';`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["array_length"]); + dataSources.AssertQueryTableResponse(0, "2"); + + //Verifying array_upper, cardinality + query = `SELECT array_upper(pay_by_quarter, 1), cardinality(schedule) FROM arraytypes WHERE name = 'Josh Clarion';`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["array_upper", "cardinality"]); + dataSources.AssertQueryTableResponse(0, "4"); + dataSources.AssertQueryTableResponse(1, "2"); + + //Verifying || + query = `SELECT ARRAY[1,2] || ARRAY[3,4] as "Test ||", ARRAY[5,6] || ARRAY[[1,2],[3,4]] as "Test || of 2D Array", ARRAY[1, 2] || '{3, 4}' as "Test || with {}"`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "Test ||", + "Test || of 2D Array", + "Test || with {}", + ]); + dataSources.AssertQueryTableResponse(0, "[1,2,3,4]"); + dataSources.AssertQueryTableResponse(1, "[[5,6],[1,2],[3,4]]"); + dataSources.AssertQueryTableResponse(2, "[1,2,3,4]"); + + //Verifying array_dims + query = `SELECT array_dims(1 || '[0:1]={2,3}'::int[]) as "array_dims1", array_dims(ARRAY[1,2] || 3) as "array_dims2", array_dims(ARRAY[1,2] || ARRAY[3,4,5]) as "array_dims3", array_dims(ARRAY[[1,2],[3,4]] || ARRAY[[5,6],[7,8],[9,0]]) as "array_dims4";`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "array_dims1", + "array_dims2", + "array_dims3", + "array_dims4", + ]); + dataSources.AssertQueryTableResponse(0, "[0:2]"); + dataSources.AssertQueryTableResponse(1, "[1:3]"); + dataSources.AssertQueryTableResponse(2, "[1:5]"); + dataSources.AssertQueryTableResponse(3, "[1:5][1:2]"); + + //Verifying array_prepend, array_append + query = `SELECT array_prepend(1, ARRAY[2,3]) as "array_prepend", array_append(ARRAY[1,2], 3) as "array_append";`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["array_prepend", "array_append"]); + dataSources.AssertQueryTableResponse(0, "[1,2,3]"); + dataSources.AssertQueryTableResponse(1, "[1,2,3]"); + + //Verifying array_cat + query = `SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) as "array_cat1", array_cat(ARRAY[[1,2],[3,4]], ARRAY[5,6]) as "array_cat2", array_cat(ARRAY[5,6], ARRAY[[1,2],[3,4]]) as "array_cat3"`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "array_cat1", + "array_cat2", + "array_cat3", + ]); + dataSources.AssertQueryTableResponse(0, "[1,2,3,4]"); + dataSources.AssertQueryTableResponse(1, "[[1,2],[3,4],[5,6]]"); + dataSources.AssertQueryTableResponse(2, "[[5,6],[1,2],[3,4]]"); + + //Verifying || with NULL + query = `SELECT ARRAY[1, 2] || NULL as "|| with NULL", array_append(ARRAY[1, 2], NULL) as "array_append";`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["|| with NULL", "array_append"]); + dataSources.AssertQueryTableResponse(0, "[1,2]"); + dataSources.AssertQueryTableResponse(1, "[1,2,null]"); + + //Verifying array_position, array_positions + query = `SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat'), array_positions(ARRAY[1, 4, 3, 1, 3, 4, 2, 1], 1);`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "array_position", + "array_positions", + ]); + dataSources.AssertQueryTableResponse(0, "7"); + dataSources.AssertQueryTableResponse(1, "[1,4,8]"); + + //Verifying input & output syntaxes + query = `SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2 FROM (SELECT '[1:1][-2:-1] [3:5]={ {{1,2,3},{4,5,6} } }'::int[] AS f1) AS ss;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["e1", "e2"]); + dataSources.AssertQueryTableResponse(0, "1"); + dataSources.AssertQueryTableResponse(1, "6"); + + //Verifying array_remove + query = `SELECT array_remove(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'wed') as "array_remove"`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders(["array_remove"]); + dataSources.AssertQueryTableResponse( + 0, + `["sun","mon","tue","thu","fri","sat"]`, ); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, - }); - AppSidebar.navigate(AppSidebarButton.Editor); - }); - - it("7. Deleting records - arraytypes", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - deployMode.DeployApp(); - table.WaitUntilTableLoad(); - table.SelectTableRow(1); - agHelper.ClickButton("DeleteQuery", 1); - assertHelper.AssertNetworkStatus("@postExecute", 200); - assertHelper.AssertNetworkStatus("@postExecute", 200); - agHelper.Sleep(2500); //Allwowing time for delete to be success - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).not.to.eq("3"); //asserting 2nd record is deleted - }); - table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("2"); + //Verifying array_replace + query = `select ARRAY[1,2,3,2,5] as "before_replace", array_replace(ARRAY[1,2,3,2,5], 2, 10) as two_becomes_ten;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "before_replace", + "two_becomes_ten", + ]); + dataSources.AssertQueryTableResponse(0, `[1,2,3,2,5]`); + dataSources.AssertQueryTableResponse(1, `[1,10,3,10,5]`); + + //Verifying operators + query = `select ARRAY[1.1,2.1,3.1]::int[] = ARRAY[1,2,3] as "=", ARRAY[1,2,3] <> ARRAY[1,2,4] as "<>", ARRAY[1,2,3] < ARRAY[1,2,4] as "<", ARRAY[1,4,3] > ARRAY[1,2,4] as ">", ARRAY[1,2,3] <= ARRAY[1,2,3] as "<=", ARRAY[1,4,3] >= ARRAY[1,4,3] as ">=", ARRAY[1,4,3] @> ARRAY[3,1,3] as "@>", ARRAY[2,2,7] <@ ARRAY[1,7,4,2,6] as "<@", ARRAY[1,4,3] && ARRAY[2,1] as "&&"`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "=", + "<>", + "<", + ">", + "<=", + ">=", + "@>", + "<@", + "&&", + ]); + dataSources.AssertQueryTableResponse(0, "true"); + dataSources.AssertQueryTableResponse(8, "true"); + + //Verifying array_to_string + query = `SELECT array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*') as array_to_string, string_to_array('xx~^~yy~^~zz', '~^~', 'yy') as string_to_array;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "array_to_string", + "string_to_array", + ]); + dataSources.AssertQueryTableResponse(0, "1,2,3,*,5"); + dataSources.AssertQueryTableResponse(1, `["xx",null,"zz"]`); + + //Verifying error + query = `SELECT ARRAY[1, 2] || '7';`; + dataSources.EnterQuery(query); + agHelper.FocusElement(locators._codeMirrorTextArea); + dataSources.RunQuery({ expectedStatus: false }); + agHelper + .GetText(dataSources._queryError) + .then(($errorText) => + expect($errorText).to.contain( + `ERROR: malformed array literal: "7"\n Detail: Array value must start with "{" or dimension information`, + ), + ); + + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + AppSidebar.navigate(AppSidebarButton.Editor); }); - //Deleting all records from table - arraytypes - agHelper.GetNClick(locators._deleteIcon); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - agHelper.Sleep(2000); - table.WaitForTableEmpty(); - }); - - it("8. Inserting another record (to check serial column) - arraytypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.EnterInputText("Name", "Bob Sim"); - agHelper.EnterInputText("Pay_by_quarter", "121,3234,4454,21213"); - agHelper.EnterInputText("Schedule", "Travel,Chillax,Hire,Give rewards"); - - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence + it("7. Deleting records - arraytypes", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + deployMode.DeployApp(); + table.WaitUntilTableLoad(); + table.SelectTableRow(1); + agHelper.ClickButton("DeleteQuery", 1); + assertHelper.AssertNetworkStatus("@postExecute", 200); + assertHelper.AssertNetworkStatus("@postExecute", 200); + agHelper.Sleep(2500); //Allwowing time for delete to be success + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).not.to.eq("3"); //asserting 2nd record is deleted + }); + table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("2"); + }); + + //Deleting all records from table - arraytypes + agHelper.GetNClick(locators._deleteIcon); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + agHelper.Sleep(2000); + table.WaitForTableEmpty(); }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { - expect($cellData).not.to.eq(""); + + it("8. Inserting another record (to check serial column) - arraytypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.EnterInputText("Name", "Bob Sim"); + agHelper.EnterInputText("Pay_by_quarter", "121,3234,4454,21213"); + agHelper.EnterInputText("Schedule", "Travel,Chillax,Hire,Give rewards"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { + expect($cellData).not.to.eq(""); + }); }); - }); - - it("9. Validate Drop of the Newly Created - arraytypes - Table from Postgres datasource", () => { - deployMode.NavigateBacktoEditor(); - EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); - dataSources.RunQuery(); - dataSources.AssertQueryTableResponse(0, "0"); - dataSources.AssertTableInVirtuosoList(dsName, "public.arraytypes", false); - }); - - after( - "Verify Deletion of all created queries & Deletion of datasource", - () => { - //Verify Deletion of all created queries - dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists - entityExplorer.DeleteAllQueriesForDB(dsName); - //Ds Deletion - deployMode.DeployApp(); + + it("9. Validate Drop of the Newly Created - arraytypes - Table from Postgres datasource", () => { deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dsName, 200); - AppSidebar.navigate(AppSidebarButton.Editor); - }, - ); -}); + EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); + dataSources.RunQuery(); + dataSources.AssertQueryTableResponse(0, "0"); + dataSources.AssertTableInVirtuosoList(dsName, "public.arraytypes", false); + }); + + after( + "Verify Deletion of all created queries & Deletion of datasource", + () => { + //Verify Deletion of all created queries + dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists + entityExplorer.DeleteAllQueriesForDB(dsName); + //Ds Deletion + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dsName, 200); + AppSidebar.navigate(AppSidebarButton.Editor); + }, + ); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Binary_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Binary_Spec.ts index bb8ad38cb77..d3b406336b5 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Binary_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Binary_Spec.ts @@ -16,354 +16,378 @@ import EditorNavigation, { PagePaneSegment, } from "../../../../support/Pages/EditorNavigation"; -describe("Binary Datatype tests", { tags: ["@tag.Datasource"] }, function () { - let dsName: any, query: string, imageNameToUpload: string; - - before("Create DS, Importing App & setting theme", () => { - agHelper.AddDsl("Datatypes/BinaryDTdsl"); - appSettings.OpenPaneAndChangeThemeColors(7, -9); - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; - }); - }); - - it("1. Creating SELECT query - binarytype + Bug 14493", () => { - query = `CREATE table binarytype (serialid SERIAL primary key, imagename TEXT, existingImage bytea, newImage bytea);`; - dataSources.CreateQueryAfterDSSaved(query, "createTable"); - dataSources.RunQuery(); - - //Creating SELECT query - binarytype + Bug 14493 - query = `SELECT binarytype.serialid, binarytype.imagename, encode(binarytype.existingimage, 'escape') as "OldImage", encode(binarytype.newimage, 'escape') as "NewImage" from public."binarytype";`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.binarytype", - "Select", - ); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("selectRecords"); - }); - - it("2. Creating all queries- binarytype", () => { - //Other queries - query = `INSERT INTO public."binarytype" ("imagename", "existingimage", "newimage") VALUES ('{{Insertimagename.text}}', '{{Insertimage.files[0].data}}', '{{Insertimage.files[0].data}}');`; - dataSources.CreateQueryFromOverlay(dsName, query, "insertRecord"); - dataSources.SetQueryTimeout(30000); - - query = `UPDATE public."binarytype" SET "imagename" ='{{Updatename.text}}', "existingimage" = '{{Table1.selectedRow.OldImage}}', "newimage" = '{{Updateimage.files[0].data}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; - dataSources.CreateQueryFromOverlay(dsName, query, "updateRecord"); - dataSources.SetQueryTimeout(30000); - - query = `DELETE FROM public."binarytype" WHERE serialId = {{Table1.selectedRow.serialid}}`; - dataSources.CreateQueryFromOverlay(dsName, query, "deleteRecord"); - dataSources.SetQueryTimeout(30000); - - query = `DELETE FROM public."binarytype"`; - dataSources.CreateQueryFromOverlay(dsName, query, "deleteAllRecords"); - dataSources.SetQueryTimeout(30000); - - query = `DROP table public."binarytype"`; - dataSources.CreateQueryFromOverlay(dsName, query, "dropTable"); - dataSources.SetQueryTimeout(30000); - - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - deployMode.DeployApp(); - table.WaitForTableEmpty(); //asserting table is empty before inserting! - }); - - it("3. Inserting another record - binarytype", () => { - imageNameToUpload = "Datatypes/Georgia.jpeg"; - - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Select New Image"); - agHelper.UploadFile(imageNameToUpload); - - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - agHelper.AssertElementAbsence(locators._btnSpinner, 20000); //for the update row to appear at last - table.WaitUntilTableLoad(); - const rowIndex = 0; - table.ReadTableRowColumnData(rowIndex, 0).then(($cellData) => { - expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(rowIndex, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("Georgia.jpeg"); +describe( + "Binary Datatype tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + let dsName: any, query: string, imageNameToUpload: string; + + before("Create DS, Importing App & setting theme", () => { + agHelper.AddDsl("Datatypes/BinaryDTdsl"); + appSettings.OpenPaneAndChangeThemeColors(7, -9); + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); }); - table.AssertTableRowImageColumnIsLoaded(rowIndex, 2).then(($oldimage) => { - table.AssertTableRowImageColumnIsLoaded(rowIndex, 3).then(($newimage) => { - expect($oldimage).to.eq($newimage); + + it("1. Creating SELECT query - binarytype + Bug 14493", () => { + query = `CREATE table binarytype (serialid SERIAL primary key, imagename TEXT, existingImage bytea, newImage bytea);`; + dataSources.CreateQueryAfterDSSaved(query, "createTable"); + dataSources.RunQuery(); + + //Creating SELECT query - binarytype + Bug 14493 + query = `SELECT binarytype.serialid, binarytype.imagename, encode(binarytype.existingimage, 'escape') as "OldImage", encode(binarytype.newimage, 'escape') as "NewImage" from public."binarytype";`; + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.binarytype", + "Select", + ); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("selectRecords"); + }); + + it("2. Creating all queries- binarytype", () => { + //Other queries + query = `INSERT INTO public."binarytype" ("imagename", "existingimage", "newimage") VALUES ('{{Insertimagename.text}}', '{{Insertimage.files[0].data}}', '{{Insertimage.files[0].data}}');`; + dataSources.CreateQueryFromOverlay(dsName, query, "insertRecord"); + dataSources.SetQueryTimeout(30000); + + query = `UPDATE public."binarytype" SET "imagename" ='{{Updatename.text}}', "existingimage" = '{{Table1.selectedRow.OldImage}}', "newimage" = '{{Updateimage.files[0].data}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; + dataSources.CreateQueryFromOverlay(dsName, query, "updateRecord"); + dataSources.SetQueryTimeout(30000); + + query = `DELETE FROM public."binarytype" WHERE serialId = {{Table1.selectedRow.serialid}}`; + dataSources.CreateQueryFromOverlay(dsName, query, "deleteRecord"); + dataSources.SetQueryTimeout(30000); + + query = `DELETE FROM public."binarytype"`; + dataSources.CreateQueryFromOverlay(dsName, query, "deleteAllRecords"); + dataSources.SetQueryTimeout(30000); + + query = `DROP table public."binarytype"`; + dataSources.CreateQueryFromOverlay(dsName, query, "dropTable"); + dataSources.SetQueryTimeout(30000); + + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! + }); + + it("3. Inserting another record - binarytype", () => { + imageNameToUpload = "Datatypes/Georgia.jpeg"; + + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Select New Image"); + agHelper.UploadFile(imageNameToUpload); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + agHelper.AssertElementAbsence(locators._btnSpinner, 20000); //for the update row to appear at last + table.WaitUntilTableLoad(); + const rowIndex = 0; + table.ReadTableRowColumnData(rowIndex, 0).then(($cellData) => { + expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(rowIndex, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("Georgia.jpeg"); + }); + table.AssertTableRowImageColumnIsLoaded(rowIndex, 2).then(($oldimage) => { + table + .AssertTableRowImageColumnIsLoaded(rowIndex, 3) + .then(($newimage) => { + expect($oldimage).to.eq($newimage); + }); }); }); - }); - it("4. Inserting another record - binarytype", () => { - imageNameToUpload = "Datatypes/Maine.jpeg"; + it("4. Inserting another record - binarytype", () => { + imageNameToUpload = "Datatypes/Maine.jpeg"; - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); - agHelper.ClickButton("Select New Image"); - agHelper.UploadFile(imageNameToUpload); + agHelper.ClickButton("Select New Image"); + agHelper.UploadFile(imageNameToUpload); - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - agHelper.AssertElementAbsence(locators._btnSpinner, 20000); //for the update row to appear at last - table.WaitUntilTableLoad(); - const rowIndex = 1; - table.ReadTableRowColumnData(rowIndex, 0).then(($cellData) => { - expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(rowIndex, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("Maine.jpeg"); - }); - table.AssertTableRowImageColumnIsLoaded(rowIndex, 2).then(($oldimage) => { - table.AssertTableRowImageColumnIsLoaded(rowIndex, 3).then(($newimage) => { - expect($oldimage).to.eq($newimage); + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + agHelper.AssertElementAbsence(locators._btnSpinner, 20000); //for the update row to appear at last + table.WaitUntilTableLoad(); + const rowIndex = 1; + table.ReadTableRowColumnData(rowIndex, 0).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence }); - }); - }); - - it("5. Updating record - binarytype", () => { - imageNameToUpload = "Datatypes/NewJersey.jpeg"; - - table.SelectTableRow(1); - agHelper.ClickButton("Run UpdateQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Select update image"); - agHelper.UploadFile(imageNameToUpload); - - agHelper.ClickButton("Update"); - agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Update did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run UpdateQuery")); - agHelper.AssertElementAbsence(locators._btnSpinner, 20000); //for the update row to appear at last - table.WaitUntilTableLoad(); - const rowIndex = 1; - table.ReadTableRowColumnData(rowIndex, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(rowIndex, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("NewJersey.jpeg"); - }); - table.AssertTableRowImageColumnIsLoaded(rowIndex, 2).then(($oldimage) => { - table.AssertTableRowImageColumnIsLoaded(rowIndex, 3).then(($newimage) => { - expect($oldimage).to.not.eq($newimage); + table.ReadTableRowColumnData(rowIndex, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("Maine.jpeg"); + }); + table.AssertTableRowImageColumnIsLoaded(rowIndex, 2).then(($oldimage) => { + table + .AssertTableRowImageColumnIsLoaded(rowIndex, 3) + .then(($newimage) => { + expect($oldimage).to.eq($newimage); + }); }); }); - }); - - it("6. Deleting records - binarytype", () => { - table.WaitUntilTableLoad(); - table.SelectTableRow(1); - agHelper.ClickButton("DeleteQuery", 1); - assertHelper.AssertNetworkStatus("@postExecute", 200); - assertHelper.AssertNetworkStatus("@postExecute", 200); - agHelper.WaitUntilEleDisappear(locators._btnSpinner); //Allowing time for delete to be success - table.ReadTableRowColumnData(0, 0).then(($cellData) => { - expect($cellData).to.eq("1"); + + it("5. Updating record - binarytype", () => { + imageNameToUpload = "Datatypes/NewJersey.jpeg"; + + table.SelectTableRow(1); + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Select update image"); + agHelper.UploadFile(imageNameToUpload); + + agHelper.ClickButton("Update"); + agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Update did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run UpdateQuery"), + ); + agHelper.AssertElementAbsence(locators._btnSpinner, 20000); //for the update row to appear at last + table.WaitUntilTableLoad(); + const rowIndex = 1; + table + .ReadTableRowColumnData(rowIndex, 0, "v1", 2000) + .then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(rowIndex, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("NewJersey.jpeg"); + }); + table.AssertTableRowImageColumnIsLoaded(rowIndex, 2).then(($oldimage) => { + table + .AssertTableRowImageColumnIsLoaded(rowIndex, 3) + .then(($newimage) => { + expect($oldimage).to.not.eq($newimage); + }); + }); }); - //Deleting all records from .table - agHelper.GetNClick(locators._deleteIcon); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.WaitForTableEmpty(); - }); + it("6. Deleting records - binarytype", () => { + table.WaitUntilTableLoad(); + table.SelectTableRow(1); + agHelper.ClickButton("DeleteQuery", 1); + assertHelper.AssertNetworkStatus("@postExecute", 200); + assertHelper.AssertNetworkStatus("@postExecute", 200); + agHelper.WaitUntilEleDisappear(locators._btnSpinner); //Allowing time for delete to be success + table.ReadTableRowColumnData(0, 0).then(($cellData) => { + expect($cellData).to.eq("1"); + }); + + //Deleting all records from .table + agHelper.GetNClick(locators._deleteIcon); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.WaitForTableEmpty(); + }); - it("7. Inserting another record (to check serial column) - binarytype", () => { - imageNameToUpload = "Datatypes/Massachusetts.jpeg"; + it("7. Inserting another record (to check serial column) - binarytype", () => { + imageNameToUpload = "Datatypes/Massachusetts.jpeg"; - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); - //agHelper.EnterInputText("Imagename", "Massachusetts"); - agHelper.ClickButton("Select New Image"); - agHelper.UploadFile(imageNameToUpload); + //agHelper.EnterInputText("Imagename", "Massachusetts"); + agHelper.ClickButton("Select New Image"); + agHelper.UploadFile(imageNameToUpload); - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.WaitUntilTableLoad(); - table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("Massachusetts.jpeg"); - }); - table.AssertTableRowImageColumnIsLoaded(0, 2).then(($oldimage) => { - table.AssertTableRowImageColumnIsLoaded(0, 3).then(($newimage) => { - expect($oldimage).to.eq($newimage); + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence(locators._toastMsg); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.WaitUntilTableLoad(); + table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("Massachusetts.jpeg"); + }); + table.AssertTableRowImageColumnIsLoaded(0, 2).then(($oldimage) => { + table.AssertTableRowImageColumnIsLoaded(0, 3).then(($newimage) => { + expect($oldimage).to.eq($newimage); + }); }); - }); - }); - - it("8. Validating Binary (bytea) - escape, hex, base64 functions", () => { - deployMode.NavigateBacktoEditor(); - table.WaitUntilTableLoad(); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - //Validating zero octet - query = `select encode('\\000'::bytea, 'hex') as "zero octet Hex", encode('\\000'::bytea, 'escape') as "zero octet Escape";`; - dataSources.CreateQueryForDS(dsName, query, "verifyBinaryFunctions"); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "zero octet Hex", - "zero octet Escape", - ]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("00"); - }); - dataSources.ReadQueryTableResponse(1).then(($cellData) => { - expect($cellData).to.eq(`\\000`); }); - //Validating single quote - query = `select encode(''''::bytea, 'escape') as "single quote Escape1", encode('\\047'::bytea, 'escape') as "single quote Escape2", encode(''''::bytea, 'hex') as "single quote Hex1", encode('\\047'::bytea, 'hex') as "single quote Hex2", encode(''''::bytea, 'base64') as "single quote Base64";`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "single quote Escape1", - "single quote Escape2", - "single quote Hex1", - "single quote Hex2", - "single quote Base64", - ]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("'"); - }); - dataSources.ReadQueryTableResponse(1).then(($cellData) => { - expect($cellData).to.eq("'"); - }); - dataSources.ReadQueryTableResponse(2).then(($cellData) => { - expect($cellData).to.eq("27"); - }); - dataSources.ReadQueryTableResponse(3).then(($cellData) => { - expect($cellData).to.eq("27"); - }); - dataSources.ReadQueryTableResponse(4).then(($cellData) => { - expect($cellData).to.eq("Jw=="); - }); - }); - - it("9. Validating Binary (bytea) - escape, hex, base64 functions, conts", () => { - //Validating backslash - query = `select encode('\\\\'::bytea, 'escape') as "backslash Escape1", encode('\\134'::bytea, 'escape') as "backslash Escape2", encode('\\\\'::bytea, 'hex') as "backslash Hex1", encode('\\134'::bytea, 'hex') as "backslash Hex2", encode('\\\\'::bytea, 'base64') as "backslash Base64";`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "backslash Escape1", - "backslash Escape2", - "backslash Hex1", - "backslash Hex2", - "backslash Base64", - ]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("\\\\"); - }); - dataSources.ReadQueryTableResponse(1).then(($cellData) => { - expect($cellData).to.eq("\\\\"); - }); - dataSources.ReadQueryTableResponse(2).then(($cellData) => { - expect($cellData).to.eq("5c"); - }); - dataSources.ReadQueryTableResponse(3).then(($cellData) => { - expect($cellData).to.eq("5c"); - }); - dataSources.ReadQueryTableResponse(4).then(($cellData) => { - expect($cellData).to.eq("XA=="); - }); + it("8. Validating Binary (bytea) - escape, hex, base64 functions", () => { + deployMode.NavigateBacktoEditor(); + table.WaitUntilTableLoad(); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + //Validating zero octet + query = `select encode('\\000'::bytea, 'hex') as "zero octet Hex", encode('\\000'::bytea, 'escape') as "zero octet Escape";`; + dataSources.CreateQueryForDS(dsName, query, "verifyBinaryFunctions"); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "zero octet Hex", + "zero octet Escape", + ]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("00"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq(`\\000`); + }); - //Validating random string - query = `select encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'escape') as "string bytea_output Escape", encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'hex') as "string bytea_output Hex", encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'base64') as "string bytea_output Base64";`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "string bytea_output Escape", - "string bytea_output Hex", - "string bytea_output Base64", - ]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq(`abc klm *\\251T`); - }); - dataSources.ReadQueryTableResponse(1).then(($cellData) => { - expect($cellData).to.eq("616263206b6c6d202aa954"); - }); - dataSources.ReadQueryTableResponse(2).then(($cellData) => { - expect($cellData).to.eq("YWJjIGtsbSAqqVQ="); + //Validating single quote + query = `select encode(''''::bytea, 'escape') as "single quote Escape1", encode('\\047'::bytea, 'escape') as "single quote Escape2", encode(''''::bytea, 'hex') as "single quote Hex1", encode('\\047'::bytea, 'hex') as "single quote Hex2", encode(''''::bytea, 'base64') as "single quote Base64";`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "single quote Escape1", + "single quote Escape2", + "single quote Hex1", + "single quote Hex2", + "single quote Base64", + ]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("'"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("'"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("27"); + }); + dataSources.ReadQueryTableResponse(3).then(($cellData) => { + expect($cellData).to.eq("27"); + }); + dataSources.ReadQueryTableResponse(4).then(($cellData) => { + expect($cellData).to.eq("Jw=="); + }); }); - //Validating text value1 - query = `select encode(E'123abc456', 'escape') as "Escape1", encode(E'123abc456', 'hex') as "Hex1", encode('abc456', 'escape') as "Escape2", encode('abc456', 'hex') as "Hex2", encode(E'123\\\\000456'::bytea, 'escape') as "Escape3", encode(E'123\\\\000456'::bytea, 'hex') as "Hex3";`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "Escape1", - "Hex1", - "Escape2", - "Hex2", - "Escape3", - "Hex3", - ]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("123abc456"); - }); - dataSources.ReadQueryTableResponse(1).then(($cellData) => { - expect($cellData).to.eq("313233616263343536"); - }); - dataSources.ReadQueryTableResponse(2).then(($cellData) => { - expect($cellData).to.eq("abc456"); - }); - dataSources.ReadQueryTableResponse(3).then(($cellData) => { - expect($cellData).to.eq("616263343536"); - }); - dataSources.ReadQueryTableResponse(4).then(($cellData) => { - expect($cellData).to.eq(`123\\000456`); - }); - dataSources.ReadQueryTableResponse(5).then(($cellData) => { - expect($cellData).to.eq("31323300343536"); - }); + it("9. Validating Binary (bytea) - escape, hex, base64 functions, conts", () => { + //Validating backslash + query = `select encode('\\\\'::bytea, 'escape') as "backslash Escape1", encode('\\134'::bytea, 'escape') as "backslash Escape2", encode('\\\\'::bytea, 'hex') as "backslash Hex1", encode('\\134'::bytea, 'hex') as "backslash Hex2", encode('\\\\'::bytea, 'base64') as "backslash Base64";`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "backslash Escape1", + "backslash Escape2", + "backslash Hex1", + "backslash Hex2", + "backslash Base64", + ]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("\\\\"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("\\\\"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("5c"); + }); + dataSources.ReadQueryTableResponse(3).then(($cellData) => { + expect($cellData).to.eq("5c"); + }); + dataSources.ReadQueryTableResponse(4).then(($cellData) => { + expect($cellData).to.eq("XA=="); + }); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, - }); - AppSidebar.navigate(AppSidebarButton.Editor); - }); - // after( - // "Validate Drop of the Newly Created - binarytype - Table & Verify Deletion of all created queries", - // () => { - // //Drop table - // deployMode.NavigateBacktoEditor(); - // entityExplorer.ExpandCollapseEntity("Queries/JS"); - // entityExplorer.SelectEntityByName("dropTable"); - // dataSources.RunQuery(); - // dataSources.ReadQueryTableResponse(0).then(($cellData) => { - // expect($cellData).to.eq("0"); //Success response for dropped table! - // }); - // entityExplorer.ExpandCollapseEntity("Queries/JS", false); - // entityExplorer.ExpandCollapseEntity("Datasources"); - // entityExplorer.ExpandCollapseEntity(dsName); - // entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh"); - // agHelper.AssertElementAbsence( - // entityExplorer._entityNameInExplorer("public.binarytype"), - // ); - - // //Delete all queries - // dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists - // entityExplorer.ExpandCollapseEntity("Queries/JS"); - // entityExplorer.DeleteAllQueriesForDB(dsName); - - // //Delete DS - // deployMode.DeployApp(); - // deployMode.NavigateBacktoEditor(); - // entityExplorer.ExpandCollapseEntity("Queries/JS"); - // dataSources.DeleteDatasourceFromWithinDS(dsName, 200); - // }, - // ); -}); + //Validating random string + query = `select encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'escape') as "string bytea_output Escape", encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'hex') as "string bytea_output Hex", encode('abc \\153\\154\\155 \\052\\251\\124'::bytea::bytea, 'base64') as "string bytea_output Base64";`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "string bytea_output Escape", + "string bytea_output Hex", + "string bytea_output Base64", + ]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq(`abc klm *\\251T`); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("616263206b6c6d202aa954"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("YWJjIGtsbSAqqVQ="); + }); + + //Validating text value1 + query = `select encode(E'123abc456', 'escape') as "Escape1", encode(E'123abc456', 'hex') as "Hex1", encode('abc456', 'escape') as "Escape2", encode('abc456', 'hex') as "Hex2", encode(E'123\\\\000456'::bytea, 'escape') as "Escape3", encode(E'123\\\\000456'::bytea, 'hex') as "Hex3";`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "Escape1", + "Hex1", + "Escape2", + "Hex2", + "Escape3", + "Hex3", + ]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("123abc456"); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq("313233616263343536"); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq("abc456"); + }); + dataSources.ReadQueryTableResponse(3).then(($cellData) => { + expect($cellData).to.eq("616263343536"); + }); + dataSources.ReadQueryTableResponse(4).then(($cellData) => { + expect($cellData).to.eq(`123\\000456`); + }); + dataSources.ReadQueryTableResponse(5).then(($cellData) => { + expect($cellData).to.eq("31323300343536"); + }); + + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + AppSidebar.navigate(AppSidebarButton.Editor); + }); + // after( + // "Validate Drop of the Newly Created - binarytype - Table & Verify Deletion of all created queries", + // () => { + // //Drop table + // deployMode.NavigateBacktoEditor(); + // entityExplorer.ExpandCollapseEntity("Queries/JS"); + // entityExplorer.SelectEntityByName("dropTable"); + // dataSources.RunQuery(); + // dataSources.ReadQueryTableResponse(0).then(($cellData) => { + // expect($cellData).to.eq("0"); //Success response for dropped table! + // }); + // entityExplorer.ExpandCollapseEntity("Queries/JS", false); + // entityExplorer.ExpandCollapseEntity("Datasources"); + // entityExplorer.ExpandCollapseEntity(dsName); + // entityExplorer.ActionContextMenuByEntityName(dsName, "Refresh"); + // agHelper.AssertElementAbsence( + // entityExplorer._entityNameInExplorer("public.binarytype"), + // ); + + // //Delete all queries + // dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists + // entityExplorer.ExpandCollapseEntity("Queries/JS"); + // entityExplorer.DeleteAllQueriesForDB(dsName); + + // //Delete DS + // deployMode.DeployApp(); + // deployMode.NavigateBacktoEditor(); + // entityExplorer.ExpandCollapseEntity("Queries/JS"); + // dataSources.DeleteDatasourceFromWithinDS(dsName, 200); + // }, + // ); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/BooleanEnum_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/BooleanEnum_Spec.ts index fc0f5f1c7ae..ed587c29a7c 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/BooleanEnum_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/BooleanEnum_Spec.ts @@ -17,7 +17,7 @@ import EditorNavigation, { describe( "Boolean & Enum Datatype tests", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { let dsName: any, query: string; diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Character_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Character_Spec.ts index 5f4cc6862d0..a8ed6a0d73f 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Character_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Character_Spec.ts @@ -17,7 +17,7 @@ import EditorNavigation, { describe( "Character Datatype tests", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { let dsName: any, query: string; diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/DateTime_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/DateTime_Spec.ts index c0ad3c9fb1c..d63bcee9d3c 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/DateTime_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/DateTime_Spec.ts @@ -16,325 +16,353 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("DateTime Datatype tests", { tags: ["@tag.Datasource"] }, function () { - let dsName: any, query: string; +describe( + "DateTime Datatype tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + let dsName: any, query: string; - before("Create Postgress DS", () => { - agHelper.AddDsl("Datatypes/DateTimeDTdsl"); - appSettings.OpenPaneAndChangeThemeColors(22, 32); - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; + before("Create Postgress DS", () => { + agHelper.AddDsl("Datatypes/DateTimeDTdsl"); + appSettings.OpenPaneAndChangeThemeColors(22, 32); + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); }); - }); - it("1. Creating table - datetimetypes", () => { - query = `CREATE TABLE datetimeTypes (serialId serial primary key, ts TIMESTAMP not null DEFAULT NOW(), + it("1. Creating table - datetimetypes", () => { + query = `CREATE TABLE datetimeTypes (serialId serial primary key, ts TIMESTAMP not null DEFAULT NOW(), tstz TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, dater date NOT NULL, timer time NOT NULL, timertz time with time zone not null default now(), intervaler interval not null);`; - dataSources.CreateQueryForDS(dsName, query, "createTable"); - agHelper.FocusElement(locators._codeMirrorTextArea); - dataSources.RunQuery(); - }); + dataSources.CreateQueryForDS(dsName, query, "createTable"); + agHelper.FocusElement(locators._codeMirrorTextArea); + dataSources.RunQuery(); + }); - it("2. Creating SELECT query - datetimetypes + Bug 14493", () => { - query = `SELECT *, TO_CHAR(datetimeT.dater , 'dd.mm.yyyy') as "dd.mm.yyyy", + it("2. Creating SELECT query - datetimetypes + Bug 14493", () => { + query = `SELECT *, TO_CHAR(datetimeT.dater , 'dd.mm.yyyy') as "dd.mm.yyyy", TO_CHAR (datetimeT.ts, 'MM/DD/YYYY HH12:MI:SS AM') as "MM/DD/YYYY", TO_CHAR (datetimeT.ts, 'YYYY')||' / ' || TO_CHAR (datetimeT.dater, 'YYY') as "YYYY/YYY", TO_CHAR (datetimeT.ts, 'MONTH') ||' / ' || TO_CHAR(datetimeT.dater, 'Month') as "MONTH/Month", TO_CHAR (datetimeT.dater, 'D') ||' / ' || TO_CHAR(datetimeT.dater, 'day') as "Day of the wentityExplorer.k/WentityExplorer.kday", TO_CHAR (datetimeT.dater, 'W') as "WentityExplorer.k of Month" FROM public."datetimetypes" as datetimeT;`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.datetimetypes", - "Select", - ); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("selectRecords"); - }); + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.datetimetypes", + "Select", + ); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("selectRecords"); + }); - it("3. Creating all queries - datetimetypes", () => { - query = `INSERT INTO public."datetimetypes" (ts, tstz, dater, timer, intervaler) + it("3. Creating all queries - datetimetypes", () => { + query = `INSERT INTO public."datetimetypes" (ts, tstz, dater, timer, intervaler) VALUES('{{Insertts.text}}', '{{Inserttstz.text}}', '{{Insertdater.text}}', '{{Inserttimer.text}}', '{{Insertintervaler.text}}');`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.datetimetypes", - "Insert", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("insertRecord"); - dataSources.ToggleUsePreparedStatement(false); + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.datetimetypes", + "Insert", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("insertRecord"); + dataSources.ToggleUsePreparedStatement(false); - query = `UPDATE public."datetimetypes" SET + query = `UPDATE public."datetimetypes" SET "ts" = '{{Updatets.text}}', "tstz" = '{{Updatetstz.text}}', "dater" = '{{Updatedater.text}}', "timer" = '{{Updatetimer.text}}', "intervaler" = '{{Updateintervaler.text}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.datetimetypes", - "Update", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("updateRecord"); - dataSources.ToggleUsePreparedStatement(false); + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.datetimetypes", + "Update", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("updateRecord"); + dataSources.ToggleUsePreparedStatement(false); - query = `DELETE FROM public."datetimetypes"`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.datetimetypes", - "Delete", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("deleteAllRecords"); + query = `DELETE FROM public."datetimetypes"`; + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.datetimetypes", + "Delete", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("deleteAllRecords"); - query = `drop table public."datetimetypes"`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.datetimetypes", - "Delete", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("dropTable"); + query = `drop table public."datetimetypes"`; + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.datetimetypes", + "Delete", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("dropTable"); - query = `DELETE FROM public."datetimetypes" + query = `DELETE FROM public."datetimetypes" WHERE serialId = {{Table1.selectedRow.serialid}};`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.datetimetypes", - "Delete", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("deleteRecord"); - }); + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.datetimetypes", + "Delete", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("deleteRecord"); + }); - it("4. Validating interval methods", () => { - query = `SELECT + it("4. Validating interval methods", () => { + query = `SELECT justify_interval(interval '1 year - 1 hour'), justify_days(INTERVAL '30 days'), justify_hours(INTERVAL '24 hours'), EXTRACT (MINUTE FROM INTERVAL '5 hours 21 minutes');`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.datetimetypes", - "Select", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("intervalRecords"); - dataSources.RunQuery(); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq( - "0 years 11 mons 29 days 23 hours 0 mins 0.0 secs", + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.datetimetypes", + "Select", ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("intervalRecords"); + dataSources.RunQuery(); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq( + "0 years 11 mons 29 days 23 hours 0 mins 0.0 secs", + ); + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).to.eq( + "0 years 1 mons 0 days 0 hours 0 mins 0.0 secs", + ); + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).to.eq( + "0 years 0 mons 1 days 0 hours 0 mins 0.0 secs", + ); + }); + dataSources.ReadQueryTableResponse(3).then(($cellData) => { + expect($cellData).to.eq("21"); + }); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + AppSidebar.navigate(AppSidebarButton.Editor); }); - dataSources.ReadQueryTableResponse(1).then(($cellData) => { - expect($cellData).to.eq("0 years 1 mons 0 days 0 hours 0 mins 0.0 secs"); - }); - dataSources.ReadQueryTableResponse(2).then(($cellData) => { - expect($cellData).to.eq("0 years 0 mons 1 days 0 hours 0 mins 0.0 secs"); - }); - dataSources.ReadQueryTableResponse(3).then(($cellData) => { - expect($cellData).to.eq("21"); - }); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, - }); - AppSidebar.navigate(AppSidebarButton.Editor); - }); - it("5. Inserting record - datetimetypes", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - deployMode.DeployApp(); - table.WaitForTableEmpty(); //asserting table is empty before inserting! - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); + it("5. Inserting record - datetimetypes", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Ts", "2016-06-22 19:10:25-07"); - agHelper.EnterInputText("Tstz", "2016-06-22 19:10:25-07"); - agHelper.EnterInputText("Dater", "January 19, 1989"); - agHelper.EnterInputText("Timer", "04:05 PM"); - agHelper.EnterInputText("Intervaler", "P6Y5M4DT3H2M1S"); + agHelper.EnterInputText("Ts", "2016-06-22 19:10:25-07"); + agHelper.EnterInputText("Tstz", "2016-06-22 19:10:25-07"); + agHelper.EnterInputText("Dater", "January 19, 1989"); + agHelper.EnterInputText("Timer", "04:05 PM"); + agHelper.EnterInputText("Intervaler", "P6Y5M4DT3H2M1S"); - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($ts) => { - table.ReadTableRowColumnData(0, 2, "v1", 200).then(($tstz) => { - expect($ts).to.not.eq($tstz); //ts & tstz not equal since tstz is time zone applied + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($ts) => { + table.ReadTableRowColumnData(0, 2, "v1", 200).then(($tstz) => { + expect($ts).to.not.eq($tstz); //ts & tstz not equal since tstz is time zone applied + }); + }); + table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("1989-01-19"); //date format! + }); + table.ReadTableRowColumnData(0, 4, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("16:05:00"); //time format + }); + table.ReadTableRowColumnData(0, 6, "v1", 200).then(($cellData) => { + expect($cellData).to.eq( + "6 years 5 mons 4 days 3 hours 2 mins 1.0 secs", + ); //Interval format! + }); + table.ReadTableRowColumnData(0, 7).then(($cellData) => { + expect($cellData).to.eq("19.01.1989"); + }); + agHelper + .GetText(table._showPageItemsCount) + .then(($count) => expect($count).contain("1")); }); - table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("1989-01-19"); //date format! - }); - table.ReadTableRowColumnData(0, 4, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("16:05:00"); //time format - }); - table.ReadTableRowColumnData(0, 6, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("6 years 5 mons 4 days 3 hours 2 mins 1.0 secs"); //Interval format! - }); - table.ReadTableRowColumnData(0, 7).then(($cellData) => { - expect($cellData).to.eq("19.01.1989"); - }); - agHelper - .GetText(table._showPageItemsCount) - .then(($count) => expect($count).contain("1")); - }); - it("6. Inserting another format of record - datetimetypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); + it("6. Inserting another format of record - datetimetypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Ts", "2020-10-05 14:01:10-08"); - agHelper.EnterInputText("Tstz", "2020-10-05 14:01:10-08"); - agHelper.EnterInputText("Dater", "20451229"); - agHelper.EnterInputText("Timer", "04:05 AM"); - agHelper.EnterInputText("Intervaler", "3 4:05:06"); + agHelper.EnterInputText("Ts", "2020-10-05 14:01:10-08"); + agHelper.EnterInputText("Tstz", "2020-10-05 14:01:10-08"); + agHelper.EnterInputText("Dater", "20451229"); + agHelper.EnterInputText("Timer", "04:05 AM"); + agHelper.EnterInputText("Intervaler", "3 4:05:06"); - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(1, 1, "v1", 200).then(($ts) => { - table.ReadTableRowColumnData(1, 2, "v1", 200).then(($tstz) => { - expect($ts).to.not.eq($tstz); //ts & tstz not equal since tstz is time zone applied + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence }); + table.ReadTableRowColumnData(1, 1, "v1", 200).then(($ts) => { + table.ReadTableRowColumnData(1, 2, "v1", 200).then(($tstz) => { + expect($ts).to.not.eq($tstz); //ts & tstz not equal since tstz is time zone applied + }); + }); + table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("2045-12-29"); + }); + table.ReadTableRowColumnData(1, 4, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("04:05:00"); + }); + table.ReadTableRowColumnData(1, 6, "v1", 200).then(($cellData) => { + expect($cellData).to.eq( + "0 years 0 mons 3 days 4 hours 5 mins 6.0 secs", + ); + }); + table.ReadTableRowColumnData(1, 7, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("29.12.2045"); + }); + agHelper + .GetText(table._showPageItemsCount) + .then(($count) => expect($count).contain("2")); }); - table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("2045-12-29"); - }); - table.ReadTableRowColumnData(1, 4, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("04:05:00"); - }); - table.ReadTableRowColumnData(1, 6, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("0 years 0 mons 3 days 4 hours 5 mins 6.0 secs"); - }); - table.ReadTableRowColumnData(1, 7, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("29.12.2045"); - }); - agHelper - .GetText(table._showPageItemsCount) - .then(($count) => expect($count).contain("2")); - }); - it("7. Updating record (emtying some field) - datetimetypes", () => { - table.SelectTableRow(1); - agHelper.ClickButton("Run UpdateQuery"); - agHelper.AssertElementVisibility(locators._modal); + it("7. Updating record (emtying some field) - datetimetypes", () => { + table.SelectTableRow(1); + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Ts", "2019-07-01", true); - agHelper.EnterInputText("Tstz", "2019-07-01 00:00:00+11", true); - agHelper.EnterInputText("Dater", "17-Mar-2014", true); - agHelper.EnterInputText("Timer", "04:05:06.789", true); - agHelper.EnterInputText("Intervaler", "P0001-03-02T06:04:05", true); + agHelper.EnterInputText("Ts", "2019-07-01", true); + agHelper.EnterInputText("Tstz", "2019-07-01 00:00:00+11", true); + agHelper.EnterInputText("Dater", "17-Mar-2014", true); + agHelper.EnterInputText("Timer", "04:05:06.789", true); + agHelper.EnterInputText("Intervaler", "P0001-03-02T06:04:05", true); - agHelper.ClickButton("Update"); - agHelper.AssertElementVisibility(locators._buttonByText("Run UpdateQuery")); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("2"); //asserting serial column is same - }); - table.ReadTableRowColumnData(1, 1, "v1", 200).then(($ts) => { - table.ReadTableRowColumnData(1, 2, "v1", 200).then(($tstz) => { - expect($ts).to.not.eq($tstz); + agHelper.ClickButton("Update"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run UpdateQuery"), + ); + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is same }); + table.ReadTableRowColumnData(1, 1, "v1", 200).then(($ts) => { + table.ReadTableRowColumnData(1, 2, "v1", 200).then(($tstz) => { + expect($ts).to.not.eq($tstz); + }); + }); + table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("2014-03-17"); + }); + table.ReadTableRowColumnData(1, 4, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("04:05:06.789"); + }); + table.ReadTableRowColumnData(1, 6, "v1", 200).then(($cellData) => { + expect($cellData).to.eq( + "1 years 3 mons 2 days 6 hours 4 mins 5.0 secs", + ); + }); + table.ReadTableRowColumnData(1, 7, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("17.03.2014"); + }); + agHelper + .GetText(table._showPageItemsCount) + .then(($count) => expect($count).contain("2")); }); - table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("2014-03-17"); - }); - table.ReadTableRowColumnData(1, 4, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("04:05:06.789"); - }); - table.ReadTableRowColumnData(1, 6, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("1 years 3 mons 2 days 6 hours 4 mins 5.0 secs"); - }); - table.ReadTableRowColumnData(1, 7, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("17.03.2014"); - }); - agHelper - .GetText(table._showPageItemsCount) - .then(($count) => expect($count).contain("2")); - }); - it("8. Deleting records - datetimetypes", () => { - agHelper.ClickButton("DeleteQuery", 1); - assertHelper.AssertNetworkStatus("@postExecute", 200); - assertHelper.AssertNetworkStatus("@postExecute", 200); - agHelper.Sleep(2500); //Allwowing time for delete to be success - agHelper - .GetText(table._showPageItemsCount) - .then(($count) => expect($count).contain("1")); //asserting 2nd record is deleted - }); + it("8. Deleting records - datetimetypes", () => { + agHelper.ClickButton("DeleteQuery", 1); + assertHelper.AssertNetworkStatus("@postExecute", 200); + assertHelper.AssertNetworkStatus("@postExecute", 200); + agHelper.Sleep(2500); //Allwowing time for delete to be success + agHelper + .GetText(table._showPageItemsCount) + .then(($count) => expect($count).contain("1")); //asserting 2nd record is deleted + }); - it("9. Inserting another record (+ve record - to check serial column) - datetimetypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); + it("9. Inserting another record (+ve record - to check serial column) - datetimetypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Ts", "February 8 04:05:06 1999"); - agHelper.EnterInputText("Tstz", "February 10 04:05:06 1999 PST"); - agHelper.EnterInputText("Dater", "J2451187"); // 20451229 - agHelper.EnterInputText("Timer", "181416"); - agHelper.EnterInputText("Intervaler", "1-2"); + agHelper.EnterInputText("Ts", "February 8 04:05:06 1999"); + agHelper.EnterInputText("Tstz", "February 10 04:05:06 1999 PST"); + agHelper.EnterInputText("Dater", "J2451187"); // 20451229 + agHelper.EnterInputText("Timer", "181416"); + agHelper.EnterInputText("Intervaler", "1-2"); - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(1, 1, "v1", 200).then(($ts) => { - table.ReadTableRowColumnData(1, 2, "v1", 200).then(($tstz) => { - expect($ts).to.not.eq($tstz); //ts & tstz not equal since tstz is time zone applied + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence }); + table.ReadTableRowColumnData(1, 1, "v1", 200).then(($ts) => { + table.ReadTableRowColumnData(1, 2, "v1", 200).then(($tstz) => { + expect($ts).to.not.eq($tstz); //ts & tstz not equal since tstz is time zone applied + }); + }); + table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("1999-01-08"); + }); + table.ReadTableRowColumnData(1, 4, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("18:14:16"); + }); + table.ReadTableRowColumnData(1, 6, "v1", 200).then(($cellData) => { + expect($cellData).to.eq( + "1 years 2 mons 0 days 0 hours 0 mins 0.0 secs", + ); + }); + table.ReadTableRowColumnData(1, 7, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("08.01.1999"); + }); + agHelper + .GetText(table._showPageItemsCount) + .then(($count) => expect($count).contain("2")); }); - table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("1999-01-08"); - }); - table.ReadTableRowColumnData(1, 4, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("18:14:16"); - }); - table.ReadTableRowColumnData(1, 6, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("1 years 2 mons 0 days 0 hours 0 mins 0.0 secs"); - }); - table.ReadTableRowColumnData(1, 7, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("08.01.1999"); - }); - agHelper - .GetText(table._showPageItemsCount) - .then(($count) => expect($count).contain("2")); - }); - it("10. Deleting all records from table - datetimetypes", () => { - agHelper.GetNClick(locators._deleteIcon); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - agHelper.Sleep(2000); - table.WaitForTableEmpty(); - }); + it("10. Deleting all records from table - datetimetypes", () => { + agHelper.GetNClick(locators._deleteIcon); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + agHelper.Sleep(2000); + table.WaitForTableEmpty(); + }); - it("11. Validate Drop of the Newly Created - datetimetypes - Table from Postgres datasource", () => { - deployMode.NavigateBacktoEditor(); - EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); - dataSources.RunQuery(); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("0"); //Success response for dropped table! + it("11. Validate Drop of the Newly Created - datetimetypes - Table from Postgres datasource", () => { + deployMode.NavigateBacktoEditor(); + EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); + dataSources.RunQuery(); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); //Success response for dropped table! + }); + dataSources.AssertTableInVirtuosoList( + dsName, + "public.datetimetypes", + false, + ); }); - dataSources.AssertTableInVirtuosoList( - dsName, - "public.datetimetypes", - false, - ); - }); - it("12. Verify Deletion of the datasource after all created queries are deleted", () => { - dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists - entityExplorer.DeleteAllQueriesForDB(dsName); - deployMode.DeployApp(); - deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dsName, 200); //ProductLines, EmployentityExplorer.s pages are still using this ds - }); -}); + it("12. Verify Deletion of the datasource after all created queries are deleted", () => { + dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists + entityExplorer.DeleteAllQueriesForDB(dsName); + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dsName, 200); //ProductLines, EmployentityExplorer.s pages are still using this ds + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Json_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Json_Spec.ts index 01a6a7ba2ed..03371dcfb95 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Json_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Json_Spec.ts @@ -18,7 +18,7 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; describe( "Json & JsonB Datatype tests", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { let dsName: any, query: string; diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Numeric_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Numeric_Spec.ts index d28ef7683d5..db11106b543 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Numeric_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/Numeric_Spec.ts @@ -12,300 +12,328 @@ import EditorNavigation, { EntityType, } from "../../../../support/Pages/EditorNavigation"; -describe("Numeric Datatype tests", { tags: ["@tag.Datasource"] }, function () { - let dsName: any, query: string; +describe( + "Numeric Datatype tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + let dsName: any, query: string; - before("Create Postgress DS, set Theme", () => { - agHelper.AddDsl("Datatypes/NumericDTdsl"); + before("Create Postgress DS, set Theme", () => { + agHelper.AddDsl("Datatypes/NumericDTdsl"); - appSettings.OpenPaneAndChangeTheme("Moon"); - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; + appSettings.OpenPaneAndChangeTheme("Moon"); + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); }); - }); - it("1. Creating table - numerictypes", () => { - query = `create table numerictypes (serialId SERIAL not null primary key, bigintId bigint not null, decimalId decimal not null, numericId numeric not null)`; - dataSources.CreateQueryForDS(dsName, query, "createTable"); - agHelper.FocusElement(locators._codeMirrorTextArea); - dataSources.RunQuery(); - }); + it("1. Creating table - numerictypes", () => { + query = `create table numerictypes (serialId SERIAL not null primary key, bigintId bigint not null, decimalId decimal not null, numericId numeric not null)`; + dataSources.CreateQueryForDS(dsName, query, "createTable"); + agHelper.FocusElement(locators._codeMirrorTextArea); + dataSources.RunQuery(); + }); - it("2. Creating SELECT query - numerictypes + Bug 14493", () => { - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.numerictypes", - "Select", - ); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - agHelper.RenameWithInPane("selectRecords"); - }); + it("2. Creating SELECT query - numerictypes + Bug 14493", () => { + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.numerictypes", + "Select", + ); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); + agHelper.RenameWithInPane("selectRecords"); + }); - it("3. Creating all queries - numerictypes", () => { - query = `INSERT INTO public."numerictypes" ("bigintid", "decimalid", "numericid") + it("3. Creating all queries - numerictypes", () => { + query = `INSERT INTO public."numerictypes" ("bigintid", "decimalid", "numericid") VALUES ({{Insertbigint.text}}, {{Insertdecimal.text}}, {{Insertnumeric.text}})`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.numerictypes", - "Insert", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("insertRecord"); + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.numerictypes", + "Insert", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("insertRecord"); - query = `UPDATE public."numerictypes" SET + query = `UPDATE public."numerictypes" SET "bigintid" = {{Updatebigint.text}}, "decimalid" = {{Updatedecimal.text}}, "numericid" = {{Updatenumeric.text}} WHERE serialid = {{Table1.selectedRow.serialid}};`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.numerictypes", - "Update", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("updateRecord"); + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.numerictypes", + "Update", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("updateRecord"); - query = `DELETE FROM public."numerictypes"`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.numerictypes", - "Delete", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("deleteAllRecords"); + query = `DELETE FROM public."numerictypes"`; + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.numerictypes", + "Delete", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("deleteAllRecords"); - query = `drop table public."numerictypes"`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.numerictypes", - "Delete", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("dropTable"); + query = `drop table public."numerictypes"`; + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.numerictypes", + "Delete", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("dropTable"); - query = `DELETE FROM public."numerictypes" + query = `DELETE FROM public."numerictypes" WHERE serialId ={{Table1.selectedRow.serialid}}`; - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.numerictypes", - "Delete", - ); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("deleteRecord"); - }); - - it("4. Inserting record (+ve limit) - numerictypes + Bug 14516", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - deployMode.DeployApp(); - table.WaitForTableEmpty(); //asserting table is empty before inserting! - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Bigintid", "922337203685477"); //9223372036854775807 - agHelper.EnterInputText("Decimalid", "865456.987654567"); - agHelper.EnterInputText("Numericid", "2147483647.2147484"); //2147483647.2147483647 - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("922337203685477"); + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.numerictypes", + "Delete", + ); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("deleteRecord"); }); - table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("865456.987654567"); - }); - table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("2147483647.2147484"); - }); - }); - it("5. Inserting record (-ve limit) - numerictypes + Bug 14516", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Bigintid", "-922337203685477"); //-9223372036854775808 - agHelper.EnterInputText("Decimalid", "232143455655456.34"); //232143455655456.3434456565 - agHelper.EnterInputText("Numericid", "9877700000.143423"); //9877700000.14342340008876 - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("-922337203685477"); //-9223372036854775808 + it("4. Inserting record (+ve limit) - numerictypes + Bug 14516", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + agHelper.EnterInputText("Bigintid", "922337203685477"); //9223372036854775807 + agHelper.EnterInputText("Decimalid", "865456.987654567"); + agHelper.EnterInputText("Numericid", "2147483647.2147484"); //2147483647.2147483647 + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("922337203685477"); + }); + table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("865456.987654567"); + }); + table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("2147483647.2147484"); + }); }); - table.ReadTableRowColumnData(1, 2, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("232143455655456.34"); - }); - table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("9877700000.143423"); - }); - }); - it("6. Inserting another record (+ve record) - numerictypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Bigintid", "12233720368547758"); - agHelper.EnterInputText("Decimalid", "877675655441232.1"); //877675655441232.00998765 , 877675655441232.111 - agHelper.EnterInputText("Numericid", "86542300099.1"); //86542300099.1000099999876 - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("12233720368547758"); - }); - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("877675655441232.1"); + it("5. Inserting record (-ve limit) - numerictypes + Bug 14516", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + agHelper.EnterInputText("Bigintid", "-922337203685477"); //-9223372036854775808 + agHelper.EnterInputText("Decimalid", "232143455655456.34"); //232143455655456.3434456565 + agHelper.EnterInputText("Numericid", "9877700000.143423"); //9877700000.14342340008876 + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("-922337203685477"); //-9223372036854775808 + }); + table.ReadTableRowColumnData(1, 2, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("232143455655456.34"); + }); + table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("9877700000.143423"); + }); }); - table.ReadTableRowColumnData(2, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("86542300099.1"); - }); - }); - it("7. Updating record (permissible value) - numerictypes", () => { - table.SelectTableRow(2); - agHelper.ClickButton("Run UpdateQuery"); - agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Bigintid", "11233720368547758", true); - agHelper.EnterInputText("Decimalid", "777675655441232.1", true); //777675655441232.00998765 , 777675655441232.111 - agHelper.EnterInputText("Numericid", "76542300099.10988", true); //76542300099.109876788 - agHelper.ClickButton("Update"); - agHelper.AssertElementVisibility(locators._buttonByText("Run UpdateQuery")); - table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("11233720368547758"); - }); - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("777675655441232.1"); + it("6. Inserting another record (+ve record) - numerictypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + agHelper.EnterInputText("Bigintid", "12233720368547758"); + agHelper.EnterInputText("Decimalid", "877675655441232.1"); //877675655441232.00998765 , 877675655441232.111 + agHelper.EnterInputText("Numericid", "86542300099.1"); //86542300099.1000099999876 + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("12233720368547758"); + }); + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("877675655441232.1"); + }); + table.ReadTableRowColumnData(2, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("86542300099.1"); + }); }); - table.ReadTableRowColumnData(2, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("76542300099.10988"); - }); - }); - it("8. Deleting records - numerictypes", () => { - table.SelectTableRow(1); - agHelper.ClickButton("DeleteQuery", 1); - assertHelper.AssertNetworkStatus("@postExecute", 200); - assertHelper.AssertNetworkStatus("@postExecute", 200); - agHelper.Sleep(2500); //Allwowing time for delete to be success - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).not.to.eq("2"); //asserting 2nd record is deleted - }); - table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("3"); + it("7. Updating record (permissible value) - numerictypes", () => { + table.SelectTableRow(2); + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisibility(locators._modal); + agHelper.EnterInputText("Bigintid", "11233720368547758", true); + agHelper.EnterInputText("Decimalid", "777675655441232.1", true); //777675655441232.00998765 , 777675655441232.111 + agHelper.EnterInputText("Numericid", "76542300099.10988", true); //76542300099.109876788 + agHelper.ClickButton("Update"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run UpdateQuery"), + ); + table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("11233720368547758"); + }); + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("777675655441232.1"); + }); + table.ReadTableRowColumnData(2, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("76542300099.10988"); + }); }); - }); - it("9. Updating record again - numerictypes", () => { - table.SelectTableRow(1); - agHelper.ClickButton("Run UpdateQuery"); - agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Bigintid", "11133720368547700", true); - agHelper.EnterInputText("Decimalid", "777575655441232.1", true); //777575655441232.716716716716 , 777575655441232.1115 - agHelper.EnterInputText("Numericid", "66542300099.00088", true); //66542300099.0008767675 - agHelper.ClickButton("Update"); - agHelper.AssertElementVisibility(locators._buttonByText("Run UpdateQuery")); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("11133720368547700"); - }); - table.ReadTableRowColumnData(1, 2, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("777575655441232.1"); + it("8. Deleting records - numerictypes", () => { + table.SelectTableRow(1); + agHelper.ClickButton("DeleteQuery", 1); + assertHelper.AssertNetworkStatus("@postExecute", 200); + assertHelper.AssertNetworkStatus("@postExecute", 200); + agHelper.Sleep(2500); //Allwowing time for delete to be success + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).not.to.eq("2"); //asserting 2nd record is deleted + }); + table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("3"); + }); }); - table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("66542300099.00088"); - }); - }); - it("10. Inserting another record (+ve record - to check serial column) - numerictypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Bigintid", "11111720368547700"); - agHelper.EnterInputText("Decimalid", "8765456.987654345"); //8765456.98765434567 - agHelper.EnterInputText("Numericid", "87654356.98765436"); // 87654356.987654356 - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("11111720368547700"); - }); - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("8765456.987654345"); + it("9. Updating record again - numerictypes", () => { + table.SelectTableRow(1); + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisibility(locators._modal); + agHelper.EnterInputText("Bigintid", "11133720368547700", true); + agHelper.EnterInputText("Decimalid", "777575655441232.1", true); //777575655441232.716716716716 , 777575655441232.1115 + agHelper.EnterInputText("Numericid", "66542300099.00088", true); //66542300099.0008767675 + agHelper.ClickButton("Update"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run UpdateQuery"), + ); + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(1, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("11133720368547700"); + }); + table.ReadTableRowColumnData(1, 2, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("777575655441232.1"); + }); + table.ReadTableRowColumnData(1, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("66542300099.00088"); + }); }); - table.ReadTableRowColumnData(2, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("87654356.98765436"); - }); - }); - it("11. Deleting records - numerictypes", () => { - table.SelectTableRow(1); - agHelper.ClickButton("DeleteQuery", 1); - agHelper.Sleep(3000); //for CI to finish delete - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).not.to.eq("3"); //asserting 3rd record is deleted - }); - table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("4"); + it("10. Inserting another record (+ve record - to check serial column) - numerictypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + agHelper.EnterInputText("Bigintid", "11111720368547700"); + agHelper.EnterInputText("Decimalid", "8765456.987654345"); //8765456.98765434567 + agHelper.EnterInputText("Numericid", "87654356.98765436"); // 87654356.987654356 + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(2, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("11111720368547700"); + }); + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("8765456.987654345"); + }); + table.ReadTableRowColumnData(2, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("87654356.98765436"); + }); }); - }); - - it("12. Deleting all records from table - numerictypes", () => { - agHelper.GetNClick(locators._deleteIcon); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - agHelper.Sleep(2000); - table.WaitForTableEmpty(); - }); - it("13. Inserting record (+ve record - to check serial column) - numerictypes", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - agHelper.EnterInputText("Bigintid", "11111720368547700"); - agHelper.EnterInputText("Decimalid", "8765456.987654345"); - agHelper.EnterInputText("Numericid", "87654356.98765436"); // 87654356.9876543567 - agHelper.ClickButton("Insert"); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { - expect($cellData).to.eq("5"); //asserting serial column is inserting fine in sequence + it("11. Deleting records - numerictypes", () => { + table.SelectTableRow(1); + agHelper.ClickButton("DeleteQuery", 1); + agHelper.Sleep(3000); //for CI to finish delete + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).not.to.eq("3"); //asserting 3rd record is deleted + }); + table.ReadTableRowColumnData(1, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("4"); + }); }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("11111720368547700"); - }); - table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("8765456.987654345"); + + it("12. Deleting all records from table - numerictypes", () => { + agHelper.GetNClick(locators._deleteIcon); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + agHelper.Sleep(2000); + table.WaitForTableEmpty(); }); - table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => { - expect($cellData).to.eq("87654356.98765436"); + + it("13. Inserting record (+ve record - to check serial column) - numerictypes", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + agHelper.EnterInputText("Bigintid", "11111720368547700"); + agHelper.EnterInputText("Decimalid", "8765456.987654345"); + agHelper.EnterInputText("Numericid", "87654356.98765436"); // 87654356.9876543567 + agHelper.ClickButton("Insert"); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => { + expect($cellData).to.eq("5"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("11111720368547700"); + }); + table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("8765456.987654345"); + }); + table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => { + expect($cellData).to.eq("87654356.98765436"); + }); }); - }); - it("14. Validate Drop of the Newly Created - numerictypes - Table from Postgres datasource", () => { - deployMode.NavigateBacktoEditor(); - EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); - dataSources.RunQuery(); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("0"); //Success response for dropped table! + it("14. Validate Drop of the Newly Created - numerictypes - Table from Postgres datasource", () => { + deployMode.NavigateBacktoEditor(); + EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); + dataSources.RunQuery(); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); //Success response for dropped table! + }); + dataSources.AssertTableInVirtuosoList( + dsName, + "public.numerictypes", + false, + ); }); - dataSources.AssertTableInVirtuosoList(dsName, "public.numerictypes", false); - }); - it("15. Verify Deletion of the datasource after all created queries are deleted", () => { - dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists - entityExplorer.DeleteAllQueriesForDB(dsName); - deployMode.DeployApp(); - deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dsName, 200); //ProductLines, Employees pages are still using this ds - }); -}); + it("15. Verify Deletion of the datasource after all created queries are deleted", () => { + dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists + entityExplorer.DeleteAllQueriesForDB(dsName); + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dsName, 200); //ProductLines, Employees pages are still using this ds + }); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts index b910774ba8c..d63fde861a2 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/Postgres_DataTypes/UUID_Spec.ts @@ -19,371 +19,395 @@ import EditorNavigation, { } from "../../../../support/Pages/EditorNavigation"; import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags"; -describe("UUID Datatype tests", { tags: ["@tag.Datasource"] }, function () { - let dsName: any, query: string, imageNameToUpload: string; +describe( + "UUID Datatype tests", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + let dsName: any, query: string, imageNameToUpload: string; + + before("Importing App & setting theme", () => { + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + dsName = $dsName; + }); + AppSidebar.navigate(AppSidebarButton.Editor); + agHelper.AddDsl("Datatypes/UUIDDTdsl"); - before("Importing App & setting theme", () => { - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - dsName = $dsName; + appSettings.OpenPaneAndChangeTheme("Earth"); }); - AppSidebar.navigate(AppSidebarButton.Editor); - agHelper.AddDsl("Datatypes/UUIDDTdsl"); - - appSettings.OpenPaneAndChangeTheme("Earth"); - }); - it("1. Creating supporting api's for generating random UUID's", () => { - cy.fixture("datasources").then((datasourceFormData) => { - apiPage.CreateAndFillApi(datasourceFormData.uuid1Api, "version1"); - apiPage.CreateAndFillApi(datasourceFormData.uuid4Api, "version4"); - apiPage.CreateAndFillApi(datasourceFormData.nillApi, "nill"); - }); - }); - - it("2. Creating table query - uuidtype", () => { - query = `CREATE table uuidtype (serialid SERIAL primary key, v1 uuid, v4 uuid, nil uuid);`; - dataSources.CreateQueryForDS(dsName, query, "createTable"); - dataSources.RunQuery(); - }); - - it("3. Creating SELECT query - uuidtype + Bug 14493", () => { - dataSources.createQueryWithDatasourceSchemaTemplate( - dsName, - "public.uuidtype", - "Select", - ); - dataSources.RunQuery(); - agHelper - .GetText(dataSources._noRecordFound) - .then(($noRecMsg) => expect($noRecMsg).to.eq("No data records to show")); - agHelper.RenameWithInPane("selectRecords"); - }); - - it("4. Creating all queries - uuidtype", () => { - query = `INSERT INTO public."uuidtype" ("v1", "v4", "nil") VALUES ('{{version1.data}}', '{{version4.data}}', '{{nill.data}}');`; - entityExplorer.CreateNewDsQuery(dsName); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("insertRecord"); - - query = `UPDATE public."uuidtype" SET "v1" ='{{version1.data ? version1.data : Table1.selectedRow.v1}}', "v4" ='{{version4.data ? version4.data : Table1.selectedRow.v4}}', "nil" ='{{nill.data ? nill.data : Table1.selectedRow.nil}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; - entityExplorer.CreateNewDsQuery(dsName); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("updateRecord"); - - query = `DELETE FROM public."uuidtype"`; - entityExplorer.CreateNewDsQuery(dsName); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("deleteAllRecords"); - - query = `drop table public."uuidtype"`; - entityExplorer.CreateNewDsQuery(dsName); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("dropTable"); - - query = `DELETE FROM public."uuidtype" WHERE serialId = {{Table1.selectedRow.serialid}}`; - entityExplorer.CreateNewDsQuery(dsName); - dataSources.EnterQuery(query); - agHelper.RenameWithInPane("deleteRecord"); - }); - - it("5. Inserting record - uuidtype", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - deployMode.DeployApp(); - table.WaitForTableEmpty(); //asserting table is empty before inserting! - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Generate UUID's"); - agHelper.AssertContains("All UUIDs generated & available"); - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._specificToast("failed to execute")); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.WaitUntilTableLoad(); - table.ReadTableRowColumnData(0, 0).then(($cellData) => { - expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($v1) => { - expect($v1).not.empty; - }); - table.ReadTableRowColumnData(0, 2, "v1", 200).then(($v4) => { - expect($v4).not.empty; - }); - table.ReadTableRowColumnData(0, 3, "v1", 200).then(($nil) => { - expect($nil).not.empty; - }); - }); - - it("6. Inserting another record - uuidtype", () => { - agHelper.WaitUntilAllToastsDisappear(); - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Generate UUID's"); - agHelper.AssertContains("All UUIDs generated & available"); - - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._specificToast("failed to execute")); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.WaitUntilTableLoad(); - table.ReadTableRowColumnData(1, 0).then(($cellData) => { - expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(1, 1, "v1", 200).then(($v1) => { - expect($v1).not.empty; - }); - table.ReadTableRowColumnData(1, 2, "v1", 200).then(($v4) => { - expect($v4).not.empty; - }); - table.ReadTableRowColumnData(1, 3, "v1", 200).then(($nil) => { - expect($nil).not.empty; + it("1. Creating supporting api's for generating random UUID's", () => { + cy.fixture("datasources").then((datasourceFormData) => { + apiPage.CreateAndFillApi(datasourceFormData.uuid1Api, "version1"); + apiPage.CreateAndFillApi(datasourceFormData.uuid4Api, "version4"); + apiPage.CreateAndFillApi(datasourceFormData.nillApi, "nill"); + }); }); - }); - - it("7. Inserting another record - uuidtype", () => { - agHelper.WaitUntilAllToastsDisappear(); - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Generate UUID's"); - agHelper.AssertContains("All UUIDs generated & available"); - - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._specificToast("failed to execute")); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.WaitUntilTableLoad(); - table.ReadTableRowColumnData(2, 0).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + + it("2. Creating table query - uuidtype", () => { + query = `CREATE table uuidtype (serialid SERIAL primary key, v1 uuid, v4 uuid, nil uuid);`; + dataSources.CreateQueryForDS(dsName, query, "createTable"); + dataSources.RunQuery(); }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($v1) => { - expect($v1).not.empty; + + it("3. Creating SELECT query - uuidtype + Bug 14493", () => { + dataSources.createQueryWithDatasourceSchemaTemplate( + dsName, + "public.uuidtype", + "Select", + ); + dataSources.RunQuery(); + agHelper + .GetText(dataSources._noRecordFound) + .then(($noRecMsg) => + expect($noRecMsg).to.eq("No data records to show"), + ); + agHelper.RenameWithInPane("selectRecords"); + }); + + it("4. Creating all queries - uuidtype", () => { + query = `INSERT INTO public."uuidtype" ("v1", "v4", "nil") VALUES ('{{version1.data}}', '{{version4.data}}', '{{nill.data}}');`; + entityExplorer.CreateNewDsQuery(dsName); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("insertRecord"); + + query = `UPDATE public."uuidtype" SET "v1" ='{{version1.data ? version1.data : Table1.selectedRow.v1}}', "v4" ='{{version4.data ? version4.data : Table1.selectedRow.v4}}', "nil" ='{{nill.data ? nill.data : Table1.selectedRow.nil}}' WHERE serialid = {{Table1.selectedRow.serialid}};`; + entityExplorer.CreateNewDsQuery(dsName); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("updateRecord"); + + query = `DELETE FROM public."uuidtype"`; + entityExplorer.CreateNewDsQuery(dsName); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("deleteAllRecords"); + + query = `drop table public."uuidtype"`; + entityExplorer.CreateNewDsQuery(dsName); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("dropTable"); + + query = `DELETE FROM public."uuidtype" WHERE serialId = {{Table1.selectedRow.serialid}}`; + entityExplorer.CreateNewDsQuery(dsName); + dataSources.EnterQuery(query); + agHelper.RenameWithInPane("deleteRecord"); + }); + + it("5. Inserting record - uuidtype", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + deployMode.DeployApp(); + table.WaitForTableEmpty(); //asserting table is empty before inserting! + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Generate UUID's"); + agHelper.AssertContains("All UUIDs generated & available"); + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence( + locators._specificToast("failed to execute"), + ); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.WaitUntilTableLoad(); + table.ReadTableRowColumnData(0, 0).then(($cellData) => { + expect($cellData).to.eq("1"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($v1) => { + expect($v1).not.empty; + }); + table.ReadTableRowColumnData(0, 2, "v1", 200).then(($v4) => { + expect($v4).not.empty; + }); + table.ReadTableRowColumnData(0, 3, "v1", 200).then(($nil) => { + expect($nil).not.empty; + }); }); - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($v4) => { - expect($v4).not.empty; + + it("6. Inserting another record - uuidtype", () => { + agHelper.WaitUntilAllToastsDisappear(); + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Generate UUID's"); + agHelper.AssertContains("All UUIDs generated & available"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence( + locators._specificToast("failed to execute"), + ); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.WaitUntilTableLoad(); + table.ReadTableRowColumnData(1, 0).then(($cellData) => { + expect($cellData).to.eq("2"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(1, 1, "v1", 200).then(($v1) => { + expect($v1).not.empty; + }); + table.ReadTableRowColumnData(1, 2, "v1", 200).then(($v4) => { + expect($v4).not.empty; + }); + table.ReadTableRowColumnData(1, 3, "v1", 200).then(($nil) => { + expect($nil).not.empty; + }); }); - table.ReadTableRowColumnData(2, 3, "v1", 200).then(($nil) => { - expect($nil).not.empty; + + it("7. Inserting another record - uuidtype", () => { + agHelper.WaitUntilAllToastsDisappear(); + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Generate UUID's"); + agHelper.AssertContains("All UUIDs generated & available"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence( + locators._specificToast("failed to execute"), + ); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.WaitUntilTableLoad(); + table.ReadTableRowColumnData(2, 0).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($v1) => { + expect($v1).not.empty; + }); + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($v4) => { + expect($v4).not.empty; + }); + table.ReadTableRowColumnData(2, 3, "v1", 200).then(($nil) => { + expect($nil).not.empty; + }); }); - }); - - it("8. Updating record - uuidtype - updating only v1", () => { - table.SelectTableRow(2); //As Table Selected row has issues due to fast selction - agHelper.Sleep(2000); //for table selection to be captured - - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($oldV1) => { - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($oldV4) => { - agHelper.ClickButton("Run UpdateQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Generate new v1"); - agHelper.AssertContains("New V1 UUID available!"); - - agHelper.ClickButton("Update"); - agHelper.AssertElementAbsence( - locators._specificToast("failed to execute"), - ); //Assert that Insert did not fail - agHelper.AssertElementVisibility( - locators._buttonByText("Run UpdateQuery"), - ); - table.WaitUntilTableLoad(); - agHelper.Sleep(5000); //some more time for rows to rearrange for CI flakyness! - table.ReadTableRowColumnData(2, 0).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($newV1) => { - expect($oldV1).to.not.eq($newV1); //making sure new v1 is updated - }); - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($newV4) => { - expect($oldV4).to.eq($newV4); //making sure new v4 is not updated + + it("8. Updating record - uuidtype - updating only v1", () => { + table.SelectTableRow(2); //As Table Selected row has issues due to fast selction + agHelper.Sleep(2000); //for table selection to be captured + + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($oldV1) => { + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($oldV4) => { + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Generate new v1"); + agHelper.AssertContains("New V1 UUID available!"); + + agHelper.ClickButton("Update"); + agHelper.AssertElementAbsence( + locators._specificToast("failed to execute"), + ); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run UpdateQuery"), + ); + table.WaitUntilTableLoad(); + agHelper.Sleep(5000); //some more time for rows to rearrange for CI flakyness! + table.ReadTableRowColumnData(2, 0).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($newV1) => { + expect($oldV1).to.not.eq($newV1); //making sure new v1 is updated + }); + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($newV4) => { + expect($oldV4).to.eq($newV4); //making sure new v4 is not updated + }); }); }); }); - }); - - it("9. Updating record - uuidtype - updating v4 ", () => { - //table.SelectTableRow(2); //As Table Selected row has issues due to fast selction - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($oldV1) => { - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($oldV4) => { - //table.ReadTableRowColumnData(2, 3, "v1", 200).then(($oldguid) => { - agHelper.ClickButton("Run UpdateQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Generate new v4"); - agHelper.AssertContains("New V4 UUID available!"); - - agHelper.ClickButton("Update"); - agHelper.AssertElementAbsence( - locators._specificToast("failed to execute"), - ); //Assert that Insert did not fail - agHelper.AssertElementVisibility( - locators._buttonByText("Run UpdateQuery"), - ); - table.WaitUntilTableLoad(); - table.ReadTableRowColumnData(2, 0).then(($cellData) => { - expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(2, 1, "v1", 200).then(($newV1) => { - expect($oldV1).to.eq($newV1); //making sure v1 is same - }); - table.ReadTableRowColumnData(2, 2, "v1", 200).then(($newV4) => { - expect($oldV4).to.not.eq($newV4); //making sure new v4 is updated - }); - /*table.ReadTableRowColumnData(2, 3, "v1", 200).then(($newguid) => { + + it("9. Updating record - uuidtype - updating v4 ", () => { + //table.SelectTableRow(2); //As Table Selected row has issues due to fast selction + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($oldV1) => { + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($oldV4) => { + //table.ReadTableRowColumnData(2, 3, "v1", 200).then(($oldguid) => { + agHelper.ClickButton("Run UpdateQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Generate new v4"); + agHelper.AssertContains("New V4 UUID available!"); + + agHelper.ClickButton("Update"); + agHelper.AssertElementAbsence( + locators._specificToast("failed to execute"), + ); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run UpdateQuery"), + ); + table.WaitUntilTableLoad(); + table.ReadTableRowColumnData(2, 0).then(($cellData) => { + expect($cellData).to.eq("3"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(2, 1, "v1", 200).then(($newV1) => { + expect($oldV1).to.eq($newV1); //making sure v1 is same + }); + table.ReadTableRowColumnData(2, 2, "v1", 200).then(($newV4) => { + expect($oldV4).to.not.eq($newV4); //making sure new v4 is updated + }); + /*table.ReadTableRowColumnData(2, 3, "v1", 200).then(($newguid) => { expect($oldguid).to.not.eq($newguid); //making sure new guid is updated }); */ + }); }); }); - }); - - it("10. Validating UUID functions", () => { - deployMode.NavigateBacktoEditor(); - table.WaitUntilTableLoad(); - PageLeftPane.switchSegment(PagePaneSegment.Queries); - //Validating use of extention - query = `CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE EXTENSION IF NOT EXISTS "pgcrypto"`; - dataSources.CreateQueryForDS(dsName, query, "verifyUUIDFunctions"); - dataSources.RunQueryNVerifyResponseViews(1); - dataSources.AssertQueryResponseHeaders(["affectedRows"]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("0"); - }); - agHelper.Sleep(2000); // Above entensions settling time - - //Validating generation of new uuid via the extension package - query = `SELECT uuid_generate_v1() as v1, uuid_generate_v4() as v4, gen_random_uuid() as cryptov4, uuid_in(overlay(overlay(md5(random()::text || ':' || random()::text) placing '4' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring) as form_uuid1, uuid_in(md5(random()::text || random()::text)::cstring) as form_uuid2;`; - dataSources.EnterQuery(query); - dataSources.RunQuery(); - dataSources.AssertQueryResponseHeaders([ - "v1", - "v4", - "cryptov4", - "form_uuid1", - "form_uuid2", - ]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).not.to.be.empty; - }); - dataSources.ReadQueryTableResponse(1).then(($cellData) => { - expect($cellData).not.to.be.empty; - }); - dataSources.ReadQueryTableResponse(2).then(($cellData) => { - expect($cellData).not.to.be.empty; - }); - dataSources.ReadQueryTableResponse(3).then(($cellData) => { - expect($cellData).not.to.be.empty; - }); - dataSources.ReadQueryTableResponse(4).then(($cellData) => { - expect($cellData).not.to.be.empty; - }); + it("10. Validating UUID functions", () => { + deployMode.NavigateBacktoEditor(); + table.WaitUntilTableLoad(); + PageLeftPane.switchSegment(PagePaneSegment.Queries); + //Validating use of extention + query = `CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE EXTENSION IF NOT EXISTS "pgcrypto"`; + dataSources.CreateQueryForDS(dsName, query, "verifyUUIDFunctions"); + dataSources.RunQueryNVerifyResponseViews(1); + dataSources.AssertQueryResponseHeaders(["affectedRows"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); + }); - //Validating Addition of new column taking default value form package method - query = `ALTER TABLE uuidtype ADD COLUMN newUUID uuid DEFAULT uuid_generate_v4();`; - dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(1); - dataSources.AssertQueryResponseHeaders(["affectedRows"]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("0"); - }); - deployMode.DeployApp(); - table.WaitUntilTableLoad(); - deployMode.NavigateBacktoEditor(); - table.WaitUntilTableLoad(); - EditorNavigation.SelectEntityByName( - "verifyUUIDFunctions", - EntityType.Query, - ); - - //Validating altering the new column default value to generate id from pgcrypto package - query = `ALTER TABLE uuidtype ALTER COLUMN newUUID SET DEFAULT gen_random_uuid();`; - dataSources.EnterQuery(query); - dataSources.RunQueryNVerifyResponseViews(1); - dataSources.AssertQueryResponseHeaders(["affectedRows"]); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("0"); - }); - deployMode.DeployApp(); - table.WaitUntilTableLoad(); - - deployMode.NavigateBacktoEditor(); - table.WaitUntilTableLoad(); - EditorNavigation.SelectEntityByName( - "verifyUUIDFunctions", - EntityType.Query, - ); - agHelper.ActionContextMenuWithInPane({ - action: "Delete", - entityType: entityItems.Query, - }); - AppSidebar.navigate(AppSidebarButton.Editor); - }); - - it("11. Deleting records - uuidtype", () => { - EditorNavigation.SelectEntityByName("Page1", EntityType.Page); - deployMode.DeployApp(); - table.WaitUntilTableLoad(); - table.SelectTableRow(1); - agHelper.ClickButton("DeleteQuery", 1); - assertHelper.AssertNetworkStatus("@postExecute", 200); - assertHelper.AssertNetworkStatus("@postExecute", 200); - table.ReadTableRowColumnData(1, 0).then(($cellData) => { - expect($cellData).not.to.eq("2"); //asserting 2nd record is deleted - }); - }); - - it("12. Deleting all records from table - uuidtype", () => { - agHelper.GetNClick(locators._deleteIcon); - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - agHelper.Sleep(2000); - table.WaitForTableEmpty(); - }); - - it("13. Inserting another record (to check serial column & new default column added) - uuidtype", () => { - agHelper.ClickButton("Run InsertQuery"); - agHelper.AssertElementVisibility(locators._modal); - - agHelper.ClickButton("Generate UUID's"); - agHelper.AssertContains("All UUIDs generated & available"); - - agHelper.ClickButton("Insert"); - agHelper.AssertElementAbsence(locators._specificToast("failed to execute")); //Assert that Insert did not fail - agHelper.AssertElementVisibility(locators._buttonByText("Run InsertQuery")); - table.WaitUntilTableLoad(); - table.ReadTableRowColumnData(0, 0).then(($cellData) => { - expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence - }); - table.ReadTableRowColumnData(0, 1, "v1", 200).then(($v1) => { - expect($v1).not.empty; + agHelper.Sleep(2000); // Above entensions settling time + + //Validating generation of new uuid via the extension package + query = `SELECT uuid_generate_v1() as v1, uuid_generate_v4() as v4, gen_random_uuid() as cryptov4, uuid_in(overlay(overlay(md5(random()::text || ':' || random()::text) placing '4' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring) as form_uuid1, uuid_in(md5(random()::text || random()::text)::cstring) as form_uuid2;`; + dataSources.EnterQuery(query); + dataSources.RunQuery(); + dataSources.AssertQueryResponseHeaders([ + "v1", + "v4", + "cryptov4", + "form_uuid1", + "form_uuid2", + ]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + dataSources.ReadQueryTableResponse(1).then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + dataSources.ReadQueryTableResponse(2).then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + dataSources.ReadQueryTableResponse(3).then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + dataSources.ReadQueryTableResponse(4).then(($cellData) => { + expect($cellData).not.to.be.empty; + }); + + //Validating Addition of new column taking default value form package method + query = `ALTER TABLE uuidtype ADD COLUMN newUUID uuid DEFAULT uuid_generate_v4();`; + dataSources.EnterQuery(query); + dataSources.RunQueryNVerifyResponseViews(1); + dataSources.AssertQueryResponseHeaders(["affectedRows"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); + }); + deployMode.DeployApp(); + table.WaitUntilTableLoad(); + deployMode.NavigateBacktoEditor(); + table.WaitUntilTableLoad(); + EditorNavigation.SelectEntityByName( + "verifyUUIDFunctions", + EntityType.Query, + ); + + //Validating altering the new column default value to generate id from pgcrypto package + query = `ALTER TABLE uuidtype ALTER COLUMN newUUID SET DEFAULT gen_random_uuid();`; + dataSources.EnterQuery(query); + dataSources.RunQueryNVerifyResponseViews(1); + dataSources.AssertQueryResponseHeaders(["affectedRows"]); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); + }); + deployMode.DeployApp(); + table.WaitUntilTableLoad(); + + deployMode.NavigateBacktoEditor(); + table.WaitUntilTableLoad(); + EditorNavigation.SelectEntityByName( + "verifyUUIDFunctions", + EntityType.Query, + ); + agHelper.ActionContextMenuWithInPane({ + action: "Delete", + entityType: entityItems.Query, + }); + AppSidebar.navigate(AppSidebarButton.Editor); + }); + + it("11. Deleting records - uuidtype", () => { + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + deployMode.DeployApp(); + table.WaitUntilTableLoad(); + table.SelectTableRow(1); + agHelper.ClickButton("DeleteQuery", 1); + assertHelper.AssertNetworkStatus("@postExecute", 200); + assertHelper.AssertNetworkStatus("@postExecute", 200); + table.ReadTableRowColumnData(1, 0).then(($cellData) => { + expect($cellData).not.to.eq("2"); //asserting 2nd record is deleted + }); }); - table.ReadTableRowColumnData(0, 2, "v1", 200).then(($v4) => { - expect($v4).not.empty; + + it("12. Deleting all records from table - uuidtype", () => { + agHelper.GetNClick(locators._deleteIcon); + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + agHelper.Sleep(2000); + table.WaitForTableEmpty(); + }); + + it("13. Inserting another record (to check serial column & new default column added) - uuidtype", () => { + agHelper.ClickButton("Run InsertQuery"); + agHelper.AssertElementVisibility(locators._modal); + + agHelper.ClickButton("Generate UUID's"); + agHelper.AssertContains("All UUIDs generated & available"); + + agHelper.ClickButton("Insert"); + agHelper.AssertElementAbsence( + locators._specificToast("failed to execute"), + ); //Assert that Insert did not fail + agHelper.AssertElementVisibility( + locators._buttonByText("Run InsertQuery"), + ); + table.WaitUntilTableLoad(); + table.ReadTableRowColumnData(0, 0).then(($cellData) => { + expect($cellData).to.eq("4"); //asserting serial column is inserting fine in sequence + }); + table.ReadTableRowColumnData(0, 1, "v1", 200).then(($v1) => { + expect($v1).not.empty; + }); + table.ReadTableRowColumnData(0, 2, "v1", 200).then(($v4) => { + expect($v4).not.empty; + }); + table.ReadTableRowColumnData(0, 3, "v1", 200).then(($nil) => { + expect($nil).not.empty; + }); + table.ReadTableRowColumnData(0, 4, "v1", 200).then(($newGenUUID) => { + expect($newGenUUID).not.empty; + }); }); - table.ReadTableRowColumnData(0, 3, "v1", 200).then(($nil) => { - expect($nil).not.empty; + + it("14. Validate Drop of the Newly Created - uuidtype - Table from Postgres datasource", () => { + deployMode.NavigateBacktoEditor(); + EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); + dataSources.RunQuery(); + dataSources.ReadQueryTableResponse(0).then(($cellData) => { + expect($cellData).to.eq("0"); //Success response for dropped table! + }); + dataSources.AssertTableInVirtuosoList(dsName, "public.uuidtype", false); }); - table.ReadTableRowColumnData(0, 4, "v1", 200).then(($newGenUUID) => { - expect($newGenUUID).not.empty; + + it("15. Verify Deletion of all created queries", () => { + dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists + entityExplorer.DeleteAllQueriesForDB(dsName); }); - }); - - it("14. Validate Drop of the Newly Created - uuidtype - Table from Postgres datasource", () => { - deployMode.NavigateBacktoEditor(); - EditorNavigation.SelectEntityByName("dropTable", EntityType.Query); - dataSources.RunQuery(); - dataSources.ReadQueryTableResponse(0).then(($cellData) => { - expect($cellData).to.eq("0"); //Success response for dropped table! + + it("16. Verify Deletion of datasource", () => { + deployMode.DeployApp(); + deployMode.NavigateBacktoEditor(); + dataSources.DeleteDatasourceFromWithinDS(dsName, 200); }); - dataSources.AssertTableInVirtuosoList(dsName, "public.uuidtype", false); - }); - - it("15. Verify Deletion of all created queries", () => { - dataSources.DeleteDatasourceFromWithinDS(dsName, 409); //Since all queries exists - entityExplorer.DeleteAllQueriesForDB(dsName); - }); - - it("16. Verify Deletion of datasource", () => { - deployMode.DeployApp(); - deployMode.NavigateBacktoEditor(); - dataSources.DeleteDatasourceFromWithinDS(dsName, 200); - }); -}); + }, +); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidgetTableAndBind_spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidgetTableAndBind_spec.js index cd7fc2c7408..ff85dae304f 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidgetTableAndBind_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidgetTableAndBind_spec.js @@ -16,7 +16,7 @@ import { Widgets } from "../../../../support/Pages/DataSources"; describe( "Addwidget from Query and bind with other widgets", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { before(() => { agHelper.AddDsl("inputdsl"); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidget_spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidget_spec.js index 5fae39d4fe6..94870a8fe23 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidget_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/AddWidget_spec.js @@ -8,7 +8,7 @@ let datasourceName; describe( "Add widget - Postgress DataSource", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { beforeEach(() => { dataSources.StartDataSourceRoutes(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/DSDocs_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/DSDocs_Spec.ts index 35f56c3530b..96ea6018a64 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/DSDocs_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/DSDocs_Spec.ts @@ -12,7 +12,7 @@ let dsName: any; describe( "Check datasource doc links", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("1. Verify Postgres documentation opens", function () { CreateDummyDSNSave(DataSourceKVP["Postgres"]); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EmptyDataSource_spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EmptyDataSource_spec.js index 5f24c8213b2..ae3dd19742b 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EmptyDataSource_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EmptyDataSource_spec.js @@ -6,7 +6,7 @@ import { describe( "Create a query with a empty datasource, run, save the query", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { beforeEach(() => { dataSources.StartDataSourceRoutes(); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EvaluatedValuePopUp_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EvaluatedValuePopUp_spec.ts index 34393e2e9ca..f81c3ca2e8f 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EvaluatedValuePopUp_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/EvaluatedValuePopUp_spec.ts @@ -3,7 +3,7 @@ import formControls from "../../../../locators/FormControl.json"; describe( "Ensures evaluated popup is viewable when dynamic bindings are present and draggable", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { it("shows evaluated pop up is visible and draggable", () => { _.dataSources.CreateDataSource("Mongo", true, true); diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts index 792f633cd86..0c81622a800 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/GoogleSheets_spec.ts @@ -11,7 +11,15 @@ import { describe( "Google Sheets datasource row objects placeholder", - { tags: ["@tag.GSheet", "@tag.Datasource", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.GSheet", + "@tag.Datasource", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, function () { let pluginName = "Google Sheets"; diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts index d6f16abe1e2..5ed89ec798d 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Mongo1_spec.ts @@ -21,7 +21,9 @@ let dsName: any; describe( "Validate Mongo Query Pane Validations", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, () => { before(() => { //dataSources.StartDataSourceRoutes(); //already started in index.js beforeeach diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_MySQL_Spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_MySQL_Spec.ts index bf1b9606359..248acdf30ad 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_MySQL_Spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_MySQL_Spec.ts @@ -14,7 +14,7 @@ import EditorNavigation, { describe( "Validate MySQL query UI flows - Bug 14054", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, () => { let dsName: any; diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_Postgres_Spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_Postgres_Spec.js index 04d1f567c37..f42ef152735 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_Postgres_Spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/QueryPane_Postgres_Spec.js @@ -20,7 +20,7 @@ let datasourceName; describe( "Validate CRUD queries for Postgres along with UI flow verifications", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { // afterEach(function() { // if (this.currentTest.state === "failed") { diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js index 8a5f313c449..b3764037d92 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/Querypane_Mongo_Spec.js @@ -22,7 +22,9 @@ let datasourceName; describe( "Validate Mongo query commands", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { // afterEach(function() { // if (this.currentTest.state === "failed") { diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js index f3a4aa0f194..339eb14bb81 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_1_spec.js @@ -16,7 +16,7 @@ let datasourceName; describe( "Validate CRUD queries for Amazon S3 along with UI flow verifications", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { let fileName; diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_2_spec.ts b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_2_spec.ts index 310b1cfdbc6..d93c201197b 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_2_spec.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/S3_2_spec.ts @@ -21,7 +21,7 @@ import EditorNavigation, { describe( "Validate CRUD queries for Amazon S3 along with UI flow verifications", - { tags: ["@tag.Datasource"] }, + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, function () { let bucketName = "assets-test--appsmith", uid: any, diff --git a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js index 1165a9b6f9a..90e058e2c56 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js +++ b/app/client/cypress/e2e/Regression/ServerSide/QueryPane/SwitchDatasource_spec.js @@ -1,44 +1,50 @@ import { dataSources, agHelper } from "../../../../support/Objects/ObjectsCore"; -describe("Switch datasource", { tags: ["@tag.Datasource"] }, function () { - let dsName_1, dsName_2, MongoDB; - beforeEach(() => { - dataSources.StartDataSourceRoutes(); - }); +describe( + "Switch datasource", + { tags: ["@tag.Datasource", "@tag.Git", "@tag.AccessControl"] }, + function () { + let dsName_1, dsName_2, MongoDB; + beforeEach(() => { + dataSources.StartDataSourceRoutes(); + }); - it("1. Create postgres datasource", function () { - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - dsName_1 = $dsName; + it("1. Create postgres datasource", function () { + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + dsName_1 = $dsName; + }); }); - }); - it("2. Create another postgres datasource", function () { - dataSources.CreateDataSource("Postgres"); - cy.get("@dsName").then(($dsName) => { - dsName_2 = $dsName; + it("2. Create another postgres datasource", function () { + dataSources.CreateDataSource("Postgres"); + cy.get("@dsName").then(($dsName) => { + dsName_2 = $dsName; + }); }); - }); - it("3. Create mongo datasource", function () { - dataSources.CreateDataSource("Mongo"); - cy.get("@dsName").then(($dsName) => { - MongoDB = $dsName; + it("3. Create mongo datasource", function () { + dataSources.CreateDataSource("Mongo"); + cy.get("@dsName").then(($dsName) => { + MongoDB = $dsName; + }); }); - }); - it("4. By switching datasources execute a query with both the datasources", function () { - dataSources.CreateQueryForDS(dsName_1); - agHelper.GetNClick(".rc-select-show-arrow"); - cy.contains(".rc-select-item-option-content", dsName_2).click().wait(1000); - cy.runQuery(); - // Confirm mongo datasource is not present in the switch datasources dropdown - agHelper.GetNClick(".rc-select-show-arrow"); - cy.get(".rc-select-item-option-content").should("not.have", MongoDB); - }); + it("4. By switching datasources execute a query with both the datasources", function () { + dataSources.CreateQueryForDS(dsName_1); + agHelper.GetNClick(".rc-select-show-arrow"); + cy.contains(".rc-select-item-option-content", dsName_2) + .click() + .wait(1000); + cy.runQuery(); + // Confirm mongo datasource is not present in the switch datasources dropdown + agHelper.GetNClick(".rc-select-show-arrow"); + cy.get(".rc-select-item-option-content").should("not.have", MongoDB); + }); - after(() => { - dataSources.DeleteQuery("Query1"); - cy.deleteDatasource(MongoDB); - cy.deleteDatasource(dsName_1); - cy.deleteDatasource(dsName_2); - }); -}); + after(() => { + dataSources.DeleteQuery("Query1"); + cy.deleteDatasource(MongoDB); + cy.deleteDatasource(dsName_1); + cy.deleteDatasource(dsName_2); + }); + }, +); diff --git a/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts index 189c7153eaa..534a68a8345 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/Airtable_Basic_Spec.ts @@ -17,7 +17,15 @@ import EditorNavigation, { let dsName: any, jsonSpecies: any, offset: any, insertedRecordId: any; describe( "Validate Airtable Ds", - { tags: ["@tag.Datasource", "@tag.Sanity", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + "@tag.Sanity", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, () => { before("Create a new Airtable DS", () => { dataSources.CreateDataSource("Airtable", true, false); diff --git a/app/client/cypress/e2e/Sanity/Datasources/ArangoDataSourceStub_spec.js b/app/client/cypress/e2e/Sanity/Datasources/ArangoDataSourceStub_spec.js index a87849fdd30..7dfa7ff1396 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/ArangoDataSourceStub_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/ArangoDataSourceStub_spec.js @@ -2,7 +2,9 @@ import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore"; describe( "Arango datasource test cases", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { it("1. Create, test, save then delete a Arango datasource", function () { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts index ffe98530a9a..cbf69cdf90b 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/Arango_Basic_Spec.ts @@ -22,7 +22,14 @@ import EditorNavigation, { if (CURRENT_REPO == REPO.CE) { describe( "Validate Arango & CURL Import Datasources", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: [ + "@tag.Datasource", + "@tag.Sanity", + "@tag.Git", + "@tag.AccessControl", + ], + }, () => { let dsName: any, collectionName = "countries_places_to_visit", diff --git a/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiDatasource_spec.js b/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiDatasource_spec.js index 5a1d9234244..40ab6eb3476 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiDatasource_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiDatasource_spec.js @@ -7,7 +7,9 @@ import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore"; describe( "Authenticated API Datasource", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { const URL = datasourceFormData["authenticatedApiUrl"]; const headers = "Headers"; diff --git a/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiWithOAuth_spec.ts b/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiWithOAuth_spec.ts index 9926565e0c1..390bf288991 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiWithOAuth_spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/AuthenticatedApiWithOAuth_spec.ts @@ -7,7 +7,9 @@ import { describe( "Authentiacted Api with OAuth 2.O authorization code test cases", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { it("1. Create & Save an Authenticated API with OAuth 2.O authorization code", function () { // Create OAuth client diff --git a/app/client/cypress/e2e/Sanity/Datasources/DSAutosaveImprovements_spec.ts b/app/client/cypress/e2e/Sanity/Datasources/DSAutosaveImprovements_spec.ts index fe4a189b30f..a1bb173a62b 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/DSAutosaveImprovements_spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/DSAutosaveImprovements_spec.ts @@ -11,7 +11,9 @@ let dsName: any; describe( "Datasource Autosave Improvements Tests", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { it("1. Test to verify that when datasource is discarded, no datasource can be seen in active list", () => { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/DatasourceForm_spec.js b/app/client/cypress/e2e/Sanity/Datasources/DatasourceForm_spec.js index 33265c28b32..706edb756f1 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/DatasourceForm_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/DatasourceForm_spec.js @@ -14,7 +14,9 @@ import { describe( "Datasource form related tests", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { it("1. Check whether the number of key value pairs is equal to number of delete buttons", function () { apiPage.CreateAndFillApi(testdata.baseUrl + testdata.methods); diff --git a/app/client/cypress/e2e/Sanity/Datasources/ElasticSearchDatasource_spec.js b/app/client/cypress/e2e/Sanity/Datasources/ElasticSearchDatasource_spec.js index 151311f9595..5177fa44788 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/ElasticSearchDatasource_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/ElasticSearchDatasource_spec.js @@ -6,7 +6,9 @@ let elasticSearchName; describe( "Elastic search datasource tests", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { beforeEach(() => { dataSources.StartDataSourceRoutes(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts b/app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts index 22f5f17454c..33dd9ba475a 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts @@ -48,7 +48,9 @@ const GRAPHQL_LIMIT_DATA = [ describe( "GraphQL Datasource Implementation", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { before(() => { agHelper.GenerateUUID(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts index 33f132d7aa9..b1cd5d459fc 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/MockDBs_Spec.ts @@ -17,7 +17,14 @@ import PageList from "../../../support/Pages/PageList"; describe( "Validate Mock Query Active Ds querying & count", - { tags: ["@tag.Datasource", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, () => { it("1. Create Query from Mock Postgres DB & verify active queries count", () => { PageList.AddNewPage(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/MongoDatasourceURI_spec.ts b/app/client/cypress/e2e/Sanity/Datasources/MongoDatasourceURI_spec.ts index 356d71264c6..cf583607705 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MongoDatasourceURI_spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/MongoDatasourceURI_spec.ts @@ -10,7 +10,9 @@ let dsName: any; // https://github.com/appsmithorg/TestEventDriver/issues/40 describe( "Create, test, save then delete a mongo datasource using URI", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { it("1. Create, test, save then delete a mongo datasource using URI without username and password - #24897 ", function () { dataSources.NavigateToDSCreateNew(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/MsSQLDataSourceStub_spec.js b/app/client/cypress/e2e/Sanity/Datasources/MsSQLDataSourceStub_spec.js index 6eb064d9e11..f67224b5ca9 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MsSQLDataSourceStub_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/MsSQLDataSourceStub_spec.js @@ -3,7 +3,9 @@ import { dataSources } from "../../../support/Objects/ObjectsCore"; describe( "MsSQL datasource test cases", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { let datasourceName; diff --git a/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts index ce08c00a4f2..1b595f35bb3 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/MsSQL_Basic_Spec.ts @@ -23,7 +23,9 @@ const oneClickBinding = new OneClickBinding(); describe( "Validate MsSQL connection & basic querying with UI flows", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, () => { let dsName: any, query: string, diff --git a/app/client/cypress/e2e/Sanity/Datasources/MySQLDataSourceStub_spec.js b/app/client/cypress/e2e/Sanity/Datasources/MySQLDataSourceStub_spec.js index ba90846b079..2db2c9c9628 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MySQLDataSourceStub_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/MySQLDataSourceStub_spec.js @@ -3,7 +3,9 @@ import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore"; describe( "MySQL datasource test cases", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { let datasourceName; it("1. Create, test, save then delete a MySQL datasource", function () { diff --git a/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js b/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js index ecbc34e0248..bd4acb0b9e5 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/MySQLNoiseTest_spec.js @@ -13,7 +13,9 @@ const commonlocators = require("../../../locators/commonlocators.json"); describe( "MySQL noise test", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { let datasourceName; diff --git a/app/client/cypress/e2e/Sanity/Datasources/MySQL_spec.js b/app/client/cypress/e2e/Sanity/Datasources/MySQL_spec.js index 97e59863018..ab266b339ea 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/MySQL_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/MySQL_spec.js @@ -5,7 +5,9 @@ let datasourceName; describe( "MySQL datasource test cases", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { beforeEach(() => { dataSources.StartDataSourceRoutes(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/Port_Number_Placeholder_Spec.ts b/app/client/cypress/e2e/Sanity/Datasources/Port_Number_Placeholder_Spec.ts index 5d996f35e8b..39bbc8d7b6c 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/Port_Number_Placeholder_Spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/Port_Number_Placeholder_Spec.ts @@ -2,7 +2,9 @@ import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore"; describe( "Test placeholder value for port number for all datasources - tests #24960", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, () => { it("1. Test datasource port number placeholder", () => { // MsSQL diff --git a/app/client/cypress/e2e/Sanity/Datasources/RedshiftDataSourceStub_spec.js b/app/client/cypress/e2e/Sanity/Datasources/RedshiftDataSourceStub_spec.js index 2febce52d1f..80cfcb996c0 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/RedshiftDataSourceStub_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/RedshiftDataSourceStub_spec.js @@ -5,7 +5,9 @@ import { ObjectsRegistry } from "../../../support/Objects/Registry"; describe( "Redshift datasource test cases", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { beforeEach(() => { dataSources.StartDataSourceRoutes(); diff --git a/app/client/cypress/e2e/Sanity/Datasources/RestApiDatasource_spec.js b/app/client/cypress/e2e/Sanity/Datasources/RestApiDatasource_spec.js index b91b22b6817..41224748eaa 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/RestApiDatasource_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/RestApiDatasource_spec.js @@ -7,7 +7,9 @@ import { describe( "Create a rest datasource", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { it("1. Create a rest datasource + Bug 14566", function () { apiPage.CreateAndFillApi(testdata.baseUrl + testdata.methods); diff --git a/app/client/cypress/e2e/Sanity/Datasources/RestApiOAuth2Validation_spec.ts b/app/client/cypress/e2e/Sanity/Datasources/RestApiOAuth2Validation_spec.ts index e9c83ab4b16..9b52a88bcf9 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/RestApiOAuth2Validation_spec.ts +++ b/app/client/cypress/e2e/Sanity/Datasources/RestApiOAuth2Validation_spec.ts @@ -10,7 +10,9 @@ import { describe( "Datasource form OAuth2 client credentials related tests", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { let clientId, clientSecret; diff --git a/app/client/cypress/e2e/Sanity/Datasources/SMTPDatasource_spec.js b/app/client/cypress/e2e/Sanity/Datasources/SMTPDatasource_spec.js index e6da42b6a93..4274883a09a 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/SMTPDatasource_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/SMTPDatasource_spec.js @@ -6,7 +6,9 @@ import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore"; describe( "SMTP datasource test cases using ted", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { let SMTPDatasourceName; beforeEach(() => { diff --git a/app/client/cypress/e2e/Sanity/Datasources/Styles_spec.js b/app/client/cypress/e2e/Sanity/Datasources/Styles_spec.js index 2f3dfa6649a..c98c1b3dc1f 100644 --- a/app/client/cypress/e2e/Sanity/Datasources/Styles_spec.js +++ b/app/client/cypress/e2e/Sanity/Datasources/Styles_spec.js @@ -3,7 +3,15 @@ import { agHelper, dataSources } from "../../../support/Objects/ObjectsCore"; let dsName; describe( "Validate Datasource Panel Styles", - { tags: ["@tag.Datasource", "@tag.Sanity", "@tag.excludeForAirgap"] }, + { + tags: [ + "@tag.Datasource", + "@tag.Sanity", + "@tag.excludeForAirgap", + "@tag.Git", + "@tag.AccessControl", + ], + }, function () { const backgroundColorGray700 = "rgb(76, 86, 100)"; const backgroundColorGray1 = "rgb(241, 245, 249)"; diff --git a/app/client/cypress/e2e/Smoke/Apps/ReconnectDatasource_spec.js b/app/client/cypress/e2e/Smoke/Apps/ReconnectDatasource_spec.js index eec5e901dbe..e8a3d6c0183 100644 --- a/app/client/cypress/e2e/Smoke/Apps/ReconnectDatasource_spec.js +++ b/app/client/cypress/e2e/Smoke/Apps/ReconnectDatasource_spec.js @@ -7,7 +7,9 @@ import { describe( "Reconnect Datasource Modal validation while importing application", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, function () { let workspaceId; let appid; diff --git a/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts b/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts index a361763aa9b..6385c02be79 100644 --- a/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts +++ b/app/client/cypress/e2e/Smoke/GenerateCRUD/Generate_Crud_New_Page_spec.ts @@ -3,7 +3,9 @@ import PageList from "../../../support/Pages/PageList"; describe( "Validate generate CRUD operation by creating a datasource from generate CRUD form", - { tags: ["@tag.Datasource", "@tag.Sanity"] }, + { + tags: ["@tag.Datasource", "@tag.Sanity", "@tag.Git", "@tag.AccessControl"], + }, () => { it( "1. Generated CRUD app should work when there are no entities in the page & when there are entities in the current page", From 9a315eabdc7d94a5518e24697d38d1a25706c054 Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Fri, 18 Oct 2024 19:07:50 +0530 Subject: [PATCH 5/6] chore: Updating plugin action name editor component to use ADS text component (#36960) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Updating plugin action name editor component to use ADS text component instead of EditableText from blueprint. Also, adding permission checks for editable tabs to not allow the name edits when the user doesn't have the permission. Fixes [#36793](https://github.com/appsmithorg/appsmith/issues/36793) ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 0b695e8837a4c510df51ff3e7fcb799ed50a3666 > Cypress dashboard. > Tags: `@tag.All` > Spec: >
    Fri, 18 Oct 2024 12:36:26 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Introduced conditional editing functionality in the FileTab component based on user permissions. - Enhanced the PluginActionNameEditor with real-time validation and improved user interaction. - Added user permissions information to entity items and selectors for better access control. - Integrated new functionality for saving entity names and managing editable tab permissions. - Expanded the EditorTabs component to include contextual entity information for each tab. - **Bug Fixes** - Simplified the ActionNameEditor by removing unnecessary feature flag checks. - **Documentation** - Updated interfaces and components to improve clarity and functionality. --- .../IDE/Components/FileTab/FileTab.test.tsx | 1 + .../src/IDE/Components/FileTab/FileTab.tsx | 5 +- .../components/PluginActionNameEditor.tsx | 198 ++++++++++++++---- app/client/src/ce/entities/IDE/constants.ts | 1 + app/client/src/ce/entities/IDE/utils.ts | 38 ++++ .../src/ce/selectors/entitiesSelector.ts | 27 ++- .../editorComponents/ActionNameEditor.tsx | 8 +- .../Editor/IDE/EditorTabs/EditableTab.tsx | 32 +-- .../src/pages/Editor/IDE/EditorTabs/index.tsx | 36 ++-- 9 files changed, 271 insertions(+), 75 deletions(-) diff --git a/app/client/src/IDE/Components/FileTab/FileTab.test.tsx b/app/client/src/IDE/Components/FileTab/FileTab.test.tsx index 38ff125fe0f..dc1cd307c77 100644 --- a/app/client/src/IDE/Components/FileTab/FileTab.test.tsx +++ b/app/client/src/IDE/Components/FileTab/FileTab.test.tsx @@ -37,6 +37,7 @@ describe("FileTab", () => { editorConfig={mockEditorConfig} icon={} isActive + isChangePermitted isLoading={isLoading} onClick={mockOnClick} onClose={mockOnClose} diff --git a/app/client/src/IDE/Components/FileTab/FileTab.tsx b/app/client/src/IDE/Components/FileTab/FileTab.tsx index 5de08640815..8198e27050d 100644 --- a/app/client/src/IDE/Components/FileTab/FileTab.tsx +++ b/app/client/src/IDE/Components/FileTab/FileTab.tsx @@ -13,6 +13,7 @@ import { DATA_TEST_ID } from "./constants"; export interface FileTabProps { isActive: boolean; + isChangePermitted?: boolean; isLoading?: boolean; title: string; onClick: () => void; @@ -32,6 +33,7 @@ export const FileTab = ({ editorConfig, icon, isActive, + isChangePermitted = false, isLoading = false, onClick, onClose, @@ -89,7 +91,8 @@ export const FileTab = ({ enterEditMode(); }); - const handleDoubleClick = editorConfig ? handleEnterEditMode : noop; + const handleDoubleClick = + editorConfig && isChangePermitted ? handleEnterEditMode : noop; const inputProps = useMemo( () => ({ diff --git a/app/client/src/PluginActionEditor/components/PluginActionNameEditor.tsx b/app/client/src/PluginActionEditor/components/PluginActionNameEditor.tsx index 55f32a5e4cd..7958facc607 100644 --- a/app/client/src/PluginActionEditor/components/PluginActionNameEditor.tsx +++ b/app/client/src/PluginActionEditor/components/PluginActionNameEditor.tsx @@ -1,16 +1,19 @@ -import React from "react"; +import React, { useEffect, useMemo, useRef, useState } from "react"; import { useSelector } from "react-redux"; -import ActionNameEditor from "components/editorComponents/ActionNameEditor"; import { usePluginActionContext } from "../PluginActionContext"; import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import { getHasManageActionPermission } from "ee/utils/BusinessFeatures/permissionPageHelpers"; import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; -import { PluginType } from "entities/Action"; import type { ReduxAction } from "ee/constants/ReduxActionConstants"; -import styled from "styled-components"; import { getSavingStatusForActionName } from "selectors/actionSelectors"; import { getAssetUrl } from "ee/utils/airgapHelpers"; import { ActionUrlIcon } from "pages/Editor/Explorer/ExplorerIcons"; +import { Spinner, Text as ADSText, Tooltip, Flex } from "@appsmith/ads"; +import { usePrevious } from "@mantine/hooks"; +import styled from "styled-components"; +import { useNameEditor } from "utils/hooks/useNameEditor"; +import { useBoolean, useEventCallback, useEventListener } from "usehooks-ts"; +import { noop } from "lodash"; export interface SaveActionNameParams { id: string; @@ -23,58 +26,177 @@ export interface PluginActionNameEditorProps { ) => ReduxAction; } -const ActionNameEditorWrapper = styled.div` - & .ads-v2-box { - gap: var(--ads-v2-spaces-2); - } - - && .t--action-name-edit-field { - font-size: 12px; - - .bp3-editable-text-content { - height: unset !important; - line-height: unset !important; - } - } +export const NameWrapper = styled(Flex)` + height: 100%; + position: relative; + font-size: 12px; + color: var(--ads-v2-colors-text-default); + cursor: pointer; + gap: var(--ads-v2-spaces-2); + align-items: center; + justify-content: center; + padding: var(--ads-v2-spaces-3); +`; - & .t--plugin-icon-box { - height: 12px; +export const IconContainer = styled.div` + height: 12px; + width: 12px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + img { width: 12px; - - img { - width: 12px; - height: auto; - } } `; +export const Text = styled(ADSText)` + min-width: 3ch; + padding: 0 var(--ads-v2-spaces-1); + font-weight: 500; +`; + const PluginActionNameEditor = (props: PluginActionNameEditorProps) => { const { action, plugin } = usePluginActionContext(); + const title = action.name; + const previousTitle = usePrevious(title); + const [editableTitle, setEditableTitle] = useState(title); + const [validationError, setValidationError] = useState(null); + const inputRef = useRef(null); + const isLoading = useSelector( + (state) => getSavingStatusForActionName(state, action?.id || "").isSaving, + ); + + const { handleNameSave, normalizeName, validateName } = useNameEditor({ + entityId: action.id, + entityName: title, + nameSaveAction: props.saveActionName, + }); + + const { + setFalse: exitEditMode, + setTrue: enterEditMode, + value: isEditing, + } = useBoolean(false); + const isFeatureEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled); const isChangePermitted = getHasManageActionPermission( isFeatureEnabled, action?.userPermissions, ); - const saveStatus = useSelector((state) => - getSavingStatusForActionName(state, action?.id || ""), - ); - + const currentTitle = + isEditing || isLoading || title !== editableTitle ? editableTitle : title; const iconUrl = getAssetUrl(plugin?.iconLocation) || ""; const icon = ActionUrlIcon(iconUrl); + const handleKeyUp = useEventCallback( + (e: React.KeyboardEvent) => { + if (e.key === "Enter") { + const nameError = validateName(editableTitle); + + if (nameError === null) { + exitEditMode(); + handleNameSave(editableTitle); + } else { + setValidationError(nameError); + } + } else if (e.key === "Escape") { + exitEditMode(); + setEditableTitle(title); + setValidationError(null); + } else { + setValidationError(null); + } + }, + ); + + const handleTitleChange = useEventCallback( + (e: React.ChangeEvent) => { + setEditableTitle(normalizeName(e.target.value)); + }, + ); + + const handleEnterEditMode = useEventCallback(() => { + setEditableTitle(title); + enterEditMode(); + }); + + const handleDoubleClick = isChangePermitted ? handleEnterEditMode : noop; + + const inputProps = useMemo( + () => ({ + onKeyUp: handleKeyUp, + onChange: handleTitleChange, + autoFocus: true, + style: { + paddingTop: 0, + paddingBottom: 0, + left: -1, + top: -1, + }, + }), + [handleKeyUp, handleTitleChange], + ); + + useEventListener( + "focusout", + function handleFocusOut() { + if (isEditing) { + const nameError = validateName(editableTitle); + + exitEditMode(); + + if (nameError === null) { + handleNameSave(editableTitle); + } else { + setEditableTitle(title); + setValidationError(null); + } + } + }, + inputRef, + ); + + useEffect( + function syncEditableTitle() { + if (!isEditing && previousTitle !== title) { + setEditableTitle(title); + } + }, + [title, previousTitle, isEditing], + ); + + useEffect( + function recaptureFocusInEventOfFocusRetention() { + const input = inputRef.current; + + if (isEditing && input) { + setTimeout(() => { + input.focus(); + }, 200); + } + }, + [isEditing], + ); + return ( - - - + + {icon && !isLoading ? {icon} : null} + {isLoading && } + + + + {currentTitle} + + + ); }; diff --git a/app/client/src/ce/entities/IDE/constants.ts b/app/client/src/ce/entities/IDE/constants.ts index 3f1425dce20..0b19c02f625 100644 --- a/app/client/src/ce/entities/IDE/constants.ts +++ b/app/client/src/ce/entities/IDE/constants.ts @@ -122,6 +122,7 @@ export interface EntityItem { key: string; icon?: ReactNode; group?: string; + userPermissions?: string[]; } export type UseRoutes = Array<{ diff --git a/app/client/src/ce/entities/IDE/utils.ts b/app/client/src/ce/entities/IDE/utils.ts index 9beb96cdf2c..d119cac8236 100644 --- a/app/client/src/ce/entities/IDE/utils.ts +++ b/app/client/src/ce/entities/IDE/utils.ts @@ -7,6 +7,19 @@ import { BUILDER_PATH, BUILDER_PATH_DEPRECATED, } from "ee/constants/routes/appRoutes"; +import { saveActionName } from "actions/pluginActionActions"; +import { saveJSObjectName } from "actions/jsActionActions"; +import { EditorEntityTab, type EntityItem } from "ee/entities/IDE/constants"; +import { getHasManageActionPermission } from "ee/utils/BusinessFeatures/permissionPageHelpers"; + +export interface SaveEntityName { + params: { + name: string; + id: string; + }; + segment: EditorEntityTab; + entity?: EntityItem; +} export const EDITOR_PATHS = [ BUILDER_CUSTOM_PATH, @@ -35,3 +48,28 @@ export function getIDETypeByUrl(path: string): IDEType { export function getBaseUrlsForIDEType(type: IDEType): string[] { return IDEBasePaths[type]; } + +export const saveEntityName = ({ params, segment }: SaveEntityName) => { + let saveNameAction = saveActionName(params); + + if (EditorEntityTab.JS === segment) { + saveNameAction = saveJSObjectName(params); + } + + return saveNameAction; +}; + +export interface EditableTabPermissions { + isFeatureEnabled: boolean; + entity?: EntityItem; +} + +export const getEditableTabPermissions = ({ + entity, + isFeatureEnabled, +}: EditableTabPermissions) => { + return getHasManageActionPermission( + isFeatureEnabled, + entity?.userPermissions || [], + ); +}; diff --git a/app/client/src/ce/selectors/entitiesSelector.ts b/app/client/src/ce/selectors/entitiesSelector.ts index 4f50d471cb0..03262d1b648 100644 --- a/app/client/src/ce/selectors/entitiesSelector.ts +++ b/app/client/src/ce/selectors/entitiesSelector.ts @@ -59,12 +59,16 @@ import { import { MAX_DATASOURCE_SUGGESTIONS } from "constants/DatasourceEditorConstants"; import type { CreateNewActionKeyInterface } from "ee/entities/Engine/actionHelpers"; import { getNextEntityName } from "utils/AppsmithUtils"; -import type { EntityItem } from "ee/entities/IDE/constants"; +import { EditorEntityTab, type EntityItem } from "ee/entities/IDE/constants"; import { ActionUrlIcon, JsFileIconV2, } from "pages/Editor/Explorer/ExplorerIcons"; import { getAssetUrl } from "ee/utils/airgapHelpers"; +import { + getIsSavingForApiName, + getIsSavingForJSObjectName, +} from "selectors/ui"; export enum GROUP_TYPES { API = "APIs", @@ -1650,6 +1654,7 @@ export const getQuerySegmentItems = createSelector( key: action.config.baseId, type: action.config.pluginType, group, + userPermissions: action.config.userPermissions, }; }); @@ -1664,6 +1669,7 @@ export const getJSSegmentItems = createSelector( title: js.config.name, key: js.config.baseId, type: PluginType.JS, + userPermissions: js.config.userPermissions, })); return items; @@ -1691,3 +1697,22 @@ export const getDatasourceUsageCountForApp = createSelector( return actionDsMap; }, ); + +export interface IsSavingEntityNameParams { + id: string; + segment: EditorEntityTab; + entity?: EntityItem; +} + +export const getIsSavingEntityName = ( + state: AppState, + { id, segment }: IsSavingEntityNameParams, +) => { + let isSavingEntityName = getIsSavingForApiName(state, id); + + if (EditorEntityTab.JS === segment) { + isSavingEntityName = getIsSavingForJSObjectName(state, id); + } + + return isSavingEntityName; +}; diff --git a/app/client/src/components/editorComponents/ActionNameEditor.tsx b/app/client/src/components/editorComponents/ActionNameEditor.tsx index 1d9bf01aa7c..7db94c26666 100644 --- a/app/client/src/components/editorComponents/ActionNameEditor.tsx +++ b/app/client/src/components/editorComponents/ActionNameEditor.tsx @@ -17,8 +17,6 @@ import { } from "ee/constants/messages"; import type { ReduxAction } from "ee/constants/ReduxActionConstants"; import type { SaveActionNameParams } from "PluginActionEditor"; -import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; -import { FEATURE_FLAG } from "ee/entities/FeatureFlag"; import type { Action } from "entities/Action"; import type { ModuleInstance } from "ee/constants/ModuleInstanceConstants"; @@ -49,10 +47,6 @@ function ActionNameEditor(props: ActionNameEditorProps) { saveStatus, } = props; - const isActionRedesignEnabled = useFeatureFlag( - FEATURE_FLAG.release_actions_redesign_enabled, - ); - return ( { id: string; onClose: (id: string) => void; + entity?: EntityItem; } export function EditableTab(props: EditableTabProps) { - const { icon, id, isActive, onClick, onClose, title } = props; + const { entity, icon, id, isActive, onClick, onClose, title } = props; const { segment } = useCurrentEditorState(); + const isFeatureEnabled = useFeatureFlag(FEATURE_FLAG.license_gac_enabled); + const isChangePermitted = getEditableTabPermissions({ + isFeatureEnabled, + entity, + }); + const { handleNameSave, normalizeName, validateName } = useNameEditor({ entityId: id, entityName: title, - nameSaveAction: - EditorEntityTab.JS === segment ? saveJSObjectName : saveActionName, + nameSaveAction: (params) => saveEntityName({ params, segment, entity }), }); const isLoading = useSelector((state) => - EditorEntityTab.JS === segment - ? getIsSavingForJSObjectName(state, id) - : getIsSavingForApiName(state, id), + getIsSavingEntityName(state, { id, segment, entity }), ); const editorConfig = useMemo( @@ -55,6 +60,7 @@ export function EditableTab(props: EditableTabProps) { editorConfig={editorConfig} icon={icon} isActive={isActive} + isChangePermitted={isChangePermitted} isLoading={isLoading} onClick={onClick} onClose={handleClose} diff --git a/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx b/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx index 09a923da070..eeea9f8e7eb 100644 --- a/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx +++ b/app/client/src/pages/Editor/IDE/EditorTabs/index.tsx @@ -35,6 +35,7 @@ const EditorTabs = () => { const { segment, segmentMode } = useCurrentEditorState(); const { closeClickHandler, tabClickHandler } = useIDETabClickHandlers(); const tabsConfig = TabSelectors[segment]; + const entities = useSelector(tabsConfig.listSelector, shallowEqual); const files = useSelector(tabsConfig.tabsSelector, shallowEqual); const isListViewActive = useSelector(getListViewActiveState); @@ -122,21 +123,26 @@ const EditorTabs = () => { gap="spaces-2" height="100%" > - {files.map((tab) => ( - - ))} + {files.map((tab) => { + const entity = entities.find((entity) => entity.key === tab.key); + + return ( + + ); + })} Date: Sun, 20 Oct 2024 09:16:25 +0530 Subject: [PATCH 6/6] chore: ce changes decoupled mixpannel chunk (#36979) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Decoupled mixpanel script it takes about 50Kb zipped, reduces main chunk by about 2.7%. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 7288e912d63f4eee0ee2532934ccf4ae51cc1fff > Cypress dashboard. > Tags: `@tag.All` > Spec: >
    Sat, 19 Oct 2024 17:20:19 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Enhanced user identification for analytics tracking, ensuring accurate data collection. - Updated user data handling in the HelpButton component to manage consent asynchronously. - **Bug Fixes** - Improved clarity and control flow in user identification logic for analytics. --- app/client/src/ce/sagas/userSagas.tsx | 23 +++++++++++++--------- app/client/src/pages/Editor/HelpButton.tsx | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/client/src/ce/sagas/userSagas.tsx b/app/client/src/ce/sagas/userSagas.tsx index 4e881be6fc5..76fdb329ccb 100644 --- a/app/client/src/ce/sagas/userSagas.tsx +++ b/app/client/src/ce/sagas/userSagas.tsx @@ -1,4 +1,4 @@ -import { call, put, race, select, take } from "redux-saga/effects"; +import { call, fork, put, race, select, take } from "redux-saga/effects"; import type { ReduxAction, ReduxActionWithPromise, @@ -190,18 +190,27 @@ export function* getCurrentUserSaga(action?: { } } +function* intializeSmartLook(currentUser: User) { + if (!currentUser.isAnonymous && currentUser.username !== ANONYMOUS_USERNAME) { + yield AnalyticsUtil.identifyUser(currentUser); + } +} + export function* runUserSideEffectsSaga() { const currentUser: User = yield select(getCurrentUser); const { enableTelemetry } = currentUser; const isAirgappedInstance = isAirgapped(); if (enableTelemetry) { - const promise = initializeAnalyticsAndTrackers(); + // parallelize sentry and smart look initialization - if (promise instanceof Promise) { - const result: boolean = yield promise; + yield fork(intializeSmartLook, currentUser); + const initializeSentry = initializeAnalyticsAndTrackers(); - if (result) { + if (initializeSentry instanceof Promise) { + const sentryInialized: boolean = yield initializeSentry; + + if (sentryInialized) { yield put(segmentInitSuccess()); } else { yield put(segmentInitUncertain()); @@ -209,10 +218,6 @@ export function* runUserSideEffectsSaga() { } } - if (!currentUser.isAnonymous && currentUser.username !== ANONYMOUS_USERNAME) { - enableTelemetry && AnalyticsUtil.identifyUser(currentUser); - } - const isFFFetched: boolean = yield select(getFeatureFlagsFetched); if (!isFFFetched) { diff --git a/app/client/src/pages/Editor/HelpButton.tsx b/app/client/src/pages/Editor/HelpButton.tsx index f0c656f875d..186f2a8bb12 100644 --- a/app/client/src/pages/Editor/HelpButton.tsx +++ b/app/client/src/pages/Editor/HelpButton.tsx @@ -102,7 +102,7 @@ export function IntercomConsent({ const instanceId = useSelector(getInstanceId); const dispatch = useDispatch(); - const sendUserDataToIntercom = () => { + const sendUserDataToIntercom = async () => { const { email } = user || {}; updateIntercomProperties(instanceId, user); @@ -115,7 +115,7 @@ export function IntercomConsent({ showIntercomConsent(false); if (user?.enableTelemetry) { - AnalyticsUtil.identifyUser(user, true); + await AnalyticsUtil.identifyUser(user, true); AnalyticsUtil.logEvent("SUPPORT_REQUEST_INITIATED", { email, });