test: Cypress | Flaky fixes (#24508)
## Description - This PR improves the sign up method to work even if telemetry related details are not asked at start - Also alters the Commit message based on the repository/workflow or push runs - Improves DragDropWidgetNVerify() - Fixes flaky TableV2/Inline_editing_spec.js spec with TS methods - Improved EditTableCell() - Skipping deleting apps during local runs for debugging purpose - Fixes PropertyPane_Search_spec.ts - Fixed ever flaky AppNavigationWithMultiplePages_spec, AppNavigationWithAutoLayout_spec #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? - [X] Cypress CI runs > > ## Checklist: #### QA activity: - [ ] Added `Test Plan Approved` label after changes were reviewed
This commit is contained in:
parent
74dd62a901
commit
959fdce6ac
6
.github/workflows/ci-test-limited.yml
vendored
6
.github/workflows/ci-test-limited.yml
vendored
|
|
@ -256,7 +256,7 @@ jobs:
|
|||
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#environment-files
|
||||
run: |
|
||||
echo COMMIT_INFO_BRANCH=$(git rev-parse --abbrev-ref HEAD) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_MESSAGE=Run from $(git rev-parse --abbrev-ref HEAD) on commit $(git show -s --pretty=%H | cut -c 1-7)>> $GITHUB_ENV
|
||||
echo COMMIT_INFO_MESSAGE=Run from $(git rev-parse --abbrev-ref HEAD) on commit $(git show -s --pretty=%H | cut -c 1-7) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_EMAIL=$(git show -s --pretty=%ae) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_AUTHOR=$(git show -s --pretty=%an) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_SHA=$(git show -s --pretty=%H) >> $GITHUB_ENV
|
||||
|
|
@ -320,7 +320,7 @@ jobs:
|
|||
CYPRESS_AIRGAPPED: false
|
||||
APPSMITH_DISABLE_TELEMETRY: true
|
||||
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE || github.event.pull_request.title }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE }}
|
||||
CYPRESS_VERIFY_TIMEOUT: 100000
|
||||
with:
|
||||
browser: ${{ env.BROWSER_PATH }}
|
||||
|
|
@ -382,7 +382,7 @@ jobs:
|
|||
CYPRESS_AIRGAPPED: false
|
||||
APPSMITH_DISABLE_TELEMETRY: true
|
||||
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE || github.event.pull_request.title }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE }}
|
||||
CYPRESS_VERIFY_TIMEOUT: 100000
|
||||
with:
|
||||
browser: ${{ env.BROWSER_PATH }}
|
||||
|
|
|
|||
14
.github/workflows/ci-test.yml
vendored
14
.github/workflows/ci-test.yml
vendored
|
|
@ -254,7 +254,7 @@ jobs:
|
|||
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#environment-files
|
||||
run: |
|
||||
echo COMMIT_INFO_BRANCH=$(git rev-parse --abbrev-ref HEAD) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_MESSAGE=Run from $(git rev-parse --abbrev-ref HEAD) on commit $(git show -s --pretty=%H | cut -c 1-7)>> $GITHUB_ENV
|
||||
echo COMMIT_INFO_MESSAGE=Run from PR# ${{ inputs.pr }} on commit $(git show -s --pretty=%H | cut -c 1-7) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_EMAIL=$(git show -s --pretty=%ae) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_AUTHOR=$(git show -s --pretty=%an) >> $GITHUB_ENV
|
||||
echo COMMIT_INFO_SHA=$(git show -s --pretty=%H) >> $GITHUB_ENV
|
||||
|
|
@ -273,6 +273,14 @@ jobs:
|
|||
echo Timestamp $COMMIT_INFO_TIMESTAMP
|
||||
echo Remote $COMMIT_INFO_REMOTE
|
||||
|
||||
- name: Set Commit Message
|
||||
run: |
|
||||
if [[ ${{ inputs.pr }} -ne 0 ]]; then
|
||||
echo COMMIT_INFO_MESSAGE=Run from PR# ${{ inputs.pr }} on commit $(git show -s --pretty=%H | cut -c 1-7) >> $GITHUB_ENV
|
||||
else
|
||||
echo COMMIT_INFO_MESSAGE= ${{ github.event.pull_request.title }} >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Run the cypress test
|
||||
if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
|
||||
uses: cypress-io/github-action@v2
|
||||
|
|
@ -318,7 +326,7 @@ jobs:
|
|||
CYPRESS_AIRGAPPED: false
|
||||
APPSMITH_DISABLE_TELEMETRY: true
|
||||
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE || github.event.pull_request.title }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE }}
|
||||
CYPRESS_VERIFY_TIMEOUT: 100000
|
||||
with:
|
||||
browser: ${{ env.BROWSER_PATH }}
|
||||
|
|
@ -380,7 +388,7 @@ jobs:
|
|||
CYPRESS_AIRGAPPED: false
|
||||
APPSMITH_DISABLE_TELEMETRY: true
|
||||
APPSMITH_GOOGLE_MAPS_API_KEY: ${{ secrets.APPSMITH_GOOGLE_MAPS_API_KEY }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE || github.event.pull_request.title }}
|
||||
COMMIT_INFO_MESSAGE: ${{ env.COMMIT_INFO_MESSAGE }}
|
||||
with:
|
||||
browser: ${{ env.BROWSER_PATH }}
|
||||
headless: true
|
||||
|
|
|
|||
|
|
@ -24,12 +24,8 @@ describe("Validating multiple widgets in auto layout mode with App navigation se
|
|||
agHelper.GetNClick(
|
||||
appSettings.locators._navigationSettings._orientationOptions._side,
|
||||
);
|
||||
agHelper.GetNClickByContains(
|
||||
appSettings.locators._navigationMenuItem,
|
||||
"Page1",
|
||||
);
|
||||
agHelper.Sleep(3000); //wait a bit before proceeding, for CI!
|
||||
agHelper.AssertNetworkStatus("@getWorkspace");
|
||||
agHelper.AssertElementExist(appSettings.locators._sideNavbar);
|
||||
agHelper.GetNClick(locators._canvas);
|
||||
agHelper.AssertElementExist(locators._widgetInCanvas("inputwidgetv2"));
|
||||
agHelper.AssertElementExist(locators._widgetInCanvas("inputwidgetv2"), 1);
|
||||
agHelper.AssertElementExist(locators._fixedLayout);
|
||||
|
|
|
|||
|
|
@ -17,12 +17,8 @@ describe("Page orientation and navigation related usecases ", function () {
|
|||
agHelper.GetNClick(
|
||||
appSettings.locators._navigationSettings._orientationOptions._side,
|
||||
);
|
||||
agHelper.GetNClickByContains(
|
||||
appSettings.locators._navigationMenuItem,
|
||||
"Page1",
|
||||
);
|
||||
agHelper.Sleep(3000); //wait a bit before proceeding, for CI!
|
||||
agHelper.AssertNetworkStatus("@getWorkspace");
|
||||
agHelper.AssertElementExist(appSettings.locators._sideNavbar);
|
||||
agHelper.GetNClick(locators._canvas);
|
||||
});
|
||||
|
||||
it("2. Validate change with height width for fill widget - Input widget", function () {
|
||||
|
|
|
|||
|
|
@ -11,18 +11,16 @@ describe("Dynamic Height Width validation for text widget", function () {
|
|||
//changing the Text and verifying
|
||||
_.propPane.AssertPropertiesDropDownCurrentValue("Height", "Auto Height");
|
||||
|
||||
_.agHelper.GetWidgetHeight(
|
||||
_.locators._widgetInDeployed(_.draggableWidgets.TEXT),
|
||||
);
|
||||
cy.get("@widgetHeight").then(($initalHeight) => {
|
||||
_.agHelper.GetHeight(_.locators._widgetInDeployed(_.draggableWidgets.TEXT));
|
||||
cy.get("@eleHeight").then(($initalHeight) => {
|
||||
_.propPane.UpdatePropertyFieldValue("Text", textMsg);
|
||||
_.propPane.MoveToTab("Style");
|
||||
_.propPane.SelectPropertiesDropDown("Font size", "L");
|
||||
_.agHelper.AssertNetworkStatus("@updateLayout"); //for textMsg update
|
||||
_.agHelper.GetWidgetHeight(
|
||||
_.agHelper.GetHeight(
|
||||
_.locators._widgetInDeployed(_.draggableWidgets.TEXT),
|
||||
);
|
||||
cy.get("@widgetHeight").then(($addedtextHeight) => {
|
||||
cy.get("@eleHeight").then(($addedtextHeight) => {
|
||||
expect($addedtextHeight).to.not.equal($initalHeight);
|
||||
_.deployMode.DeployApp(_.locators._textWidgetInDeployed);
|
||||
_.agHelper
|
||||
|
|
@ -37,10 +35,10 @@ describe("Dynamic Height Width validation for text widget", function () {
|
|||
"1.25rem", //for Font size 'L'
|
||||
);
|
||||
|
||||
_.agHelper.GetWidgetHeight(
|
||||
_.agHelper.GetHeight(
|
||||
_.locators._widgetInDeployed(_.draggableWidgets.TEXT),
|
||||
);
|
||||
cy.get("@widgetHeight").then(($deployedAutoHeight) => {
|
||||
cy.get("@eleHeight").then(($deployedAutoHeight) => {
|
||||
expect($deployedAutoHeight).not.eq($initalHeight);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ describe("Lint error reporting", () => {
|
|||
|
||||
//Test in Table for no error when using {{currentRow}}
|
||||
entityExplorer.SelectEntityByName("Table1", "Widgets");
|
||||
agHelper.GetNClick(table._columnSettings("step"));
|
||||
agHelper.GetNClick(table._columnSettings("step", "Edit"));
|
||||
agHelper.AssertElementAbsence(locators._lintErrorElement);
|
||||
|
||||
propPane.UpdatePropertyFieldValue("Computed value", "{{currentRow}}");
|
||||
|
|
|
|||
|
|
@ -1,87 +1,70 @@
|
|||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
import {
|
||||
agHelper,
|
||||
locators,
|
||||
entityExplorer,
|
||||
autoLayout,
|
||||
draggableWidgets,
|
||||
} from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Validating use cases for Auto Dimension", () => {
|
||||
before(() => {
|
||||
_.autoLayout.ConvertToAutoLayoutAndVerify(false);
|
||||
autoLayout.ConvertToAutoLayoutAndVerify(false);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// Cleanup the canvas before each test
|
||||
_.agHelper.SelectAllWidgets();
|
||||
_.agHelper.PressDelete();
|
||||
_.agHelper.SetCanvasViewportWidth(808);
|
||||
agHelper.SelectAllWidgets();
|
||||
agHelper.PressDelete();
|
||||
agHelper.SetCanvasViewportWidth(808);
|
||||
});
|
||||
|
||||
["DESKTOP", "MOBILE"].forEach((viewport) => {
|
||||
it(`1. [${viewport}] Verify if Auto dimension works for widgets in the MainCanvas`, () => {
|
||||
if (viewport === "MOBILE") {
|
||||
_.agHelper.SetCanvasViewportWidth(375);
|
||||
agHelper.SetCanvasViewportWidth(375);
|
||||
}
|
||||
_.autoLayout.DropButtonAndTestForAutoDimension(100, 100);
|
||||
_.autoLayout.DropTextAndTestForAutoDimension(100, 200);
|
||||
autoLayout.DropButtonAndTestForAutoDimension(100, 100);
|
||||
autoLayout.DropTextAndTestForAutoDimension(100, 200);
|
||||
});
|
||||
|
||||
it(`2. [${viewport}] Verify if Auto dimension works for widgets in a Container`, () => {
|
||||
if (viewport === "MOBILE") {
|
||||
_.agHelper.SetCanvasViewportWidth(375);
|
||||
agHelper.SetCanvasViewportWidth(375);
|
||||
}
|
||||
_.entityExplorer.DragDropWidgetNVerify(
|
||||
_.draggableWidgets.CONTAINER,
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.CONTAINER, 100, 30);
|
||||
autoLayout.DropButtonAndTestForAutoDimension(
|
||||
100,
|
||||
30,
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
// y = main canvas padding (8) + button widget height (40)
|
||||
autoLayout.DropTextAndTestForAutoDimension(
|
||||
100,
|
||||
48,
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
|
||||
_.agHelper
|
||||
.GetWidgetByName("Container1")
|
||||
.invoke("attr", "id")
|
||||
.then((id) => {
|
||||
const dropTargetClass = `.drop-target-${id?.split("_")[1]}`;
|
||||
// dropButtonAndTest(100, 25, dropTargetClass);
|
||||
_.autoLayout.DropButtonAndTestForAutoDimension(
|
||||
100,
|
||||
30,
|
||||
dropTargetClass,
|
||||
);
|
||||
// y = main canvas padding (8) + button widget height (40)
|
||||
_.autoLayout.DropTextAndTestForAutoDimension(
|
||||
100,
|
||||
48,
|
||||
dropTargetClass,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it(`3. [${viewport}] Verify if Auto dimension works for widgets in a List`, () => {
|
||||
if (viewport === "MOBILE") {
|
||||
_.agHelper.SetCanvasViewportWidth(375);
|
||||
agHelper.SetCanvasViewportWidth(375);
|
||||
}
|
||||
_.entityExplorer.DragDropWidgetNVerify(
|
||||
_.draggableWidgets.LIST_V2,
|
||||
100,
|
||||
30,
|
||||
);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.LIST_V2, 100, 30);
|
||||
|
||||
// Delete existing widgets within list
|
||||
_.agHelper.SelectAllWidgets(_.locators._widgetByName("Container1"));
|
||||
_.agHelper.PressDelete();
|
||||
|
||||
_.agHelper
|
||||
.GetWidgetByName("Container1")
|
||||
.invoke("attr", "id")
|
||||
.then((id) => {
|
||||
const dropTargetClass = `.drop-target-${id?.split("_")[1]}`;
|
||||
_.autoLayout.DropButtonAndTestForAutoDimension(
|
||||
100,
|
||||
25,
|
||||
dropTargetClass,
|
||||
);
|
||||
// y = main canvas padding (8) + button widget height (40)
|
||||
_.autoLayout.DropTextAndTestForAutoDimension(
|
||||
100,
|
||||
48,
|
||||
dropTargetClass,
|
||||
);
|
||||
});
|
||||
agHelper.SelectAllWidgets(locators._widgetByName("Container1"));
|
||||
agHelper.PressDelete();
|
||||
autoLayout.DropButtonAndTestForAutoDimension(
|
||||
100,
|
||||
25,
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
// y = main canvas padding (8) + button widget height (40)
|
||||
autoLayout.DropTextAndTestForAutoDimension(
|
||||
100,
|
||||
48,
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,52 +1,52 @@
|
|||
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||
import {
|
||||
agHelper,
|
||||
entityExplorer,
|
||||
propPane,
|
||||
autoLayout,
|
||||
draggableWidgets,
|
||||
} from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Validating use cases for Auto Dimension", () => {
|
||||
before(() => {
|
||||
_.autoLayout.ConvertToAutoLayoutAndVerify(false);
|
||||
autoLayout.ConvertToAutoLayoutAndVerify(false);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// Cleanup the canvas before each test
|
||||
_.agHelper.SelectAllWidgets();
|
||||
_.agHelper.PressDelete();
|
||||
_.agHelper.SetCanvasViewportWidth(808);
|
||||
agHelper.SelectAllWidgets();
|
||||
agHelper.PressDelete();
|
||||
agHelper.SetCanvasViewportWidth(808);
|
||||
});
|
||||
|
||||
["DESKTOP", "MOBILE"].forEach((viewport) => {
|
||||
it(`1. [${viewport}] Check if widget's auto height updation updates container's height`, () => {
|
||||
if (viewport === "MOBILE") {
|
||||
_.agHelper.SetCanvasViewportWidth(375);
|
||||
agHelper.SetCanvasViewportWidth(375);
|
||||
}
|
||||
_.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.CONTAINER);
|
||||
_.agHelper
|
||||
.GetWidgetByName("Container1")
|
||||
.invoke("attr", "id")
|
||||
.then((id) => {
|
||||
const dropTargetClass = `.drop-target-${id?.split("_")[1]}`;
|
||||
_.entityExplorer.DragDropWidgetNVerify(
|
||||
"textwidget",
|
||||
50,
|
||||
20,
|
||||
dropTargetClass,
|
||||
);
|
||||
});
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.CONTAINER);
|
||||
entityExplorer.DragDropWidgetNVerify(
|
||||
"textwidget",
|
||||
50,
|
||||
20,
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
|
||||
// Add multi-line text & verify if the container's height increases
|
||||
|
||||
_.agHelper.GetWidgetHeight(_.autoLayout._containerWidgetSelector);
|
||||
cy.get("@widgetHeight").then(($initialHeight) => {
|
||||
_.propPane.UpdatePropertyFieldValue(
|
||||
agHelper.GetHeight(autoLayout._containerWidgetSelector);
|
||||
cy.get("@eleHeight").then(($initialHeight) => {
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
"Text",
|
||||
"hello\nWorld\nThis\nis\na\nMulti-line\nTexthello\nWorld\nThis\nis\na\nMulti-line\nText",
|
||||
);
|
||||
_.agHelper.GetWidgetHeight(_.autoLayout._containerWidgetSelector);
|
||||
cy.get("@widgetHeight").then(($longTextheight: any) => {
|
||||
agHelper.GetHeight(autoLayout._containerWidgetSelector);
|
||||
cy.get("@eleHeight").then(($longTextheight: any) => {
|
||||
expect($longTextheight).to.be.greaterThan(Number($initialHeight));
|
||||
|
||||
// Remove some lines & verify if the container's height decreases
|
||||
_.propPane.UpdatePropertyFieldValue("Text", "hello");
|
||||
_.agHelper.GetWidgetHeight(_.autoLayout._containerWidgetSelector);
|
||||
cy.get("@widgetHeight").then((height: any) => {
|
||||
propPane.UpdatePropertyFieldValue("Text", "hello");
|
||||
agHelper.GetHeight(autoLayout._containerWidgetSelector);
|
||||
cy.get("@eleHeight").then((height: any) => {
|
||||
expect(height).to.be.lessThan(Number($longTextheight));
|
||||
});
|
||||
});
|
||||
|
|
@ -54,86 +54,78 @@ describe("Validating use cases for Auto Dimension", () => {
|
|||
});
|
||||
|
||||
it("2. Check if widget's bounding box fits on widget shrink", () => {
|
||||
_.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 100, 30);
|
||||
_.propPane.UpdatePropertyFieldValue(
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 100, 30);
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
"Text",
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
|
||||
);
|
||||
// Check if bounding box fits perfectly to the Text Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._textWidgetSelector,
|
||||
_.autoLayout._textComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._textWidgetSelector,
|
||||
autoLayout._textComponentSelector,
|
||||
);
|
||||
|
||||
// Drop another widget next to text widget so that it shrinks
|
||||
_.entityExplorer.DragDropWidgetNVerify(
|
||||
_.draggableWidgets.CONTAINER,
|
||||
10,
|
||||
30,
|
||||
);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.CONTAINER, 10, 30);
|
||||
|
||||
// Check if bounding box fits perfectly to the Text Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._textWidgetSelector,
|
||||
_.autoLayout._textComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._textWidgetSelector,
|
||||
autoLayout._textComponentSelector,
|
||||
);
|
||||
});
|
||||
|
||||
it("3. Check if widgets bounding box fits on canvas resizing", () => {
|
||||
_.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 100, 30);
|
||||
_.propPane.UpdatePropertyFieldValue(
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 100, 30);
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
"Text",
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
|
||||
);
|
||||
_.entityExplorer.DragDropWidgetNVerify(
|
||||
_.draggableWidgets.BUTTON,
|
||||
100,
|
||||
200,
|
||||
);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 100, 200);
|
||||
|
||||
// reduce canvas size
|
||||
_.agHelper.SetCanvasViewportWidth(500);
|
||||
agHelper.SetCanvasViewportWidth(500);
|
||||
|
||||
// Check if bounding box fits perfectly to the Text Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._textWidgetSelector,
|
||||
_.autoLayout._textComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._textWidgetSelector,
|
||||
autoLayout._textComponentSelector,
|
||||
);
|
||||
|
||||
// Check if bounding box fits perfectly to the Button Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._buttonWidgetSelector,
|
||||
_.autoLayout._buttonComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._buttonWidgetSelector,
|
||||
autoLayout._buttonComponentSelector,
|
||||
);
|
||||
|
||||
// increase canvas size
|
||||
_.agHelper.SetCanvasViewportWidth(700);
|
||||
agHelper.SetCanvasViewportWidth(700);
|
||||
|
||||
// Check if bounding box fits perfectly to the Text Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._textWidgetSelector,
|
||||
_.autoLayout._textComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._textWidgetSelector,
|
||||
autoLayout._textComponentSelector,
|
||||
);
|
||||
|
||||
// Check if bounding box fits perfectly to the Button Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._buttonWidgetSelector,
|
||||
_.autoLayout._buttonComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._buttonWidgetSelector,
|
||||
autoLayout._buttonComponentSelector,
|
||||
);
|
||||
|
||||
// reduce canvas size less than mobile breakpoint
|
||||
_.agHelper.SetCanvasViewportWidth(300);
|
||||
agHelper.SetCanvasViewportWidth(300);
|
||||
|
||||
// Check if bounding box fits perfectly to the Text Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._textWidgetSelector,
|
||||
_.autoLayout._textComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._textWidgetSelector,
|
||||
autoLayout._textComponentSelector,
|
||||
);
|
||||
|
||||
// Check if bounding box fits perfectly to the Button Widget
|
||||
_.autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
_.autoLayout._buttonWidgetSelector,
|
||||
_.autoLayout._buttonComponentSelector,
|
||||
autoLayout.EnsureBoundingBoxFitsComponent(
|
||||
autoLayout._buttonWidgetSelector,
|
||||
autoLayout._buttonComponentSelector,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
let appId;
|
||||
import { agHelper } from "../../../../support/Objects/ObjectsCore";
|
||||
import { agHelper, homePage } from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe(
|
||||
"excludeForAirgap",
|
||||
"Checks for analytics for enableTelemtry",
|
||||
function () {
|
||||
before(() => {
|
||||
agHelper.VisitNAssert("/applications", "getReleaseItems");
|
||||
homePage.NavigateToHome();
|
||||
cy.get(".admin-settings-menu-option").click();
|
||||
cy.get("[data-testid='APPSMITH_DISABLE_TELEMETRY']").should("be.checked"); //Bug 21191
|
||||
cy.get("[data-testid='APPSMITH_DISABLE_TELEMETRY']").uncheck({
|
||||
|
|
|
|||
|
|
@ -69,8 +69,7 @@ describe("Property Pane Search", function () {
|
|||
propPane.Search("text formaTTing");
|
||||
propPane.AssertIfPropertyOrSectionExists("textformatting", "STYLE");
|
||||
|
||||
// Clear the search input for the next test
|
||||
propPane.Search("");
|
||||
agHelper.ClearTextField(propPane._propertyPaneSearchInput);
|
||||
});
|
||||
|
||||
it("4. Search for Properties inside a panel", function () {
|
||||
|
|
@ -140,7 +139,7 @@ describe("Property Pane Search", function () {
|
|||
propPane.AssertIfPropertyOrSectionExists("events", "CONTENT");
|
||||
|
||||
propPane.Search("visible");
|
||||
propPane.AssertIfPropertyOrSectionExists("events", "CONTENT", "visible");
|
||||
propPane.AssertIfPropertyOrSectionExists("general", "CONTENT", "visible");
|
||||
|
||||
propPane.Search("color");
|
||||
propPane.AssertIfPropertyOrSectionExists("color", "STYLE");
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ describe("List widget v2 onItemClick", () => {
|
|||
draggableWidgets.INPUT_V2,
|
||||
250,
|
||||
50,
|
||||
".t--draggable-containerwidget",
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
|
||||
cy.get(`${widgetSelector("Input1")} input`)
|
||||
|
|
@ -107,7 +107,7 @@ describe("List widget v2 onItemClick", () => {
|
|||
draggableWidgets.SELECT,
|
||||
250,
|
||||
50,
|
||||
".t--draggable-containerwidget",
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
|
||||
cy.get(`${widgetSelector("Select1")} button`)
|
||||
|
|
@ -121,7 +121,7 @@ describe("List widget v2 onItemClick", () => {
|
|||
draggableWidgets.BUTTON,
|
||||
250,
|
||||
50,
|
||||
".t--draggable-containerwidget",
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
|
||||
cy.get(`${widgetSelector("Button1")} button`)
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ describe("Migration Validate", function () {
|
|||
|
||||
// cy.wait(4000);
|
||||
// cy.get("div.tableWrap").should("be.visible"); //wait for page load!
|
||||
cy.wait("@getWorkspace");
|
||||
|
||||
cy.waitUntil(() => cy.get("div.tableWrap").should("be.visible"), {
|
||||
errorMsg: "Page is not loaded evn after 10 secs",
|
||||
|
|
|
|||
|
|
@ -1,21 +1,27 @@
|
|||
const explorer = require("../../../../../locators/explorerlocators.json");
|
||||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||
import {
|
||||
agHelper,
|
||||
draggableWidgets,
|
||||
entityExplorer,
|
||||
} from "../../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Statbox Widget Functionality", function () {
|
||||
before(() => {
|
||||
cy.fixture("dynamicHeightStatboxdsl").then((val) => {
|
||||
_.agHelper.AddDsl(val);
|
||||
agHelper.AddDsl(val);
|
||||
});
|
||||
});
|
||||
|
||||
it("1. Verify Statbox can be placed inside another widget", () => {
|
||||
cy.get(explorer.addWidget).click();
|
||||
// placing statbox widget inside container widget
|
||||
cy.dragAndDropToWidget("statboxwidget", "containerwidget", {
|
||||
x: 100,
|
||||
y: 100,
|
||||
});
|
||||
cy.openPropertyPaneWithIndex("statboxwidget", 1);
|
||||
cy.openPropertyPaneWithIndex("statboxwidget", 0);
|
||||
entityExplorer.DragDropWidgetNVerify(
|
||||
draggableWidgets.STATBOX,
|
||||
300,
|
||||
100,
|
||||
draggableWidgets.CONTAINER,
|
||||
);
|
||||
entityExplorer.NavigateToSwitcher("Explorer");
|
||||
entityExplorer.AssertEntityPresenceInExplorer("Statbox1");
|
||||
entityExplorer.ExpandCollapseEntity("Container1");
|
||||
entityExplorer.AssertEntityPresenceInExplorer("Statbox2");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ describe("Verify various Table property bugs", function () {
|
|||
|
||||
it("2. Bug 13299 - Verify Display Text does not contain garbage value for URL column type when null", function () {
|
||||
_.entityExplorer.SelectEntityByName("Table1", "Widgets");
|
||||
_.agHelper.GetNClick(_.table._columnSettings("image"));
|
||||
_.agHelper.GetNClick(_.table._columnSettings("image", "Edit"));
|
||||
|
||||
_.propPane.UpdatePropertyFieldValue(
|
||||
"Display text",
|
||||
|
|
@ -100,7 +100,7 @@ describe("Verify various Table property bugs", function () {
|
|||
|
||||
it("3. Bug 13299 - Verify Display Text does not contain garbage value for URL column type when undefined", function () {
|
||||
_.entityExplorer.SelectEntityByName("Table1", "Widgets");
|
||||
_.agHelper.GetNClick(_.table._columnSettings("image"));
|
||||
_.agHelper.GetNClick(_.table._columnSettings("image", "Edit"));
|
||||
|
||||
_.propPane.UpdatePropertyFieldValue(
|
||||
"Display text",
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
const commonlocators = require("../../../../../locators/commonlocators.json");
|
||||
const widgetsPage = require("../../../../../locators/Widgets.json");
|
||||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||
import {
|
||||
agHelper,
|
||||
entityExplorer,
|
||||
propPane,
|
||||
table,
|
||||
draggableWidgets,
|
||||
} from "../../../../../support/Objects/ObjectsCore";
|
||||
import { PROPERTY_SELECTOR } from "../../../../../locators/WidgetLocators";
|
||||
|
||||
describe("Table widget inline editing functionality", () => {
|
||||
afterEach(() => {
|
||||
_.agHelper.SaveLocalStorageCache();
|
||||
agHelper.SaveLocalStorageCache();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
_.agHelper.RestoreLocalStorageCache();
|
||||
agHelper.RestoreLocalStorageCache();
|
||||
cy.fixture("Table/InlineEditingDSL").then((val) => {
|
||||
_.agHelper.AddDsl(val);
|
||||
agHelper.AddDsl(val);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -637,7 +643,7 @@ describe("Table widget inline editing functionality", () => {
|
|||
|
||||
it("22. should check that inline editing works with text wrapping disabled", () => {
|
||||
cy.fixture("Table/InlineEditingDSL").then((val) => {
|
||||
_.agHelper.AddDsl(val);
|
||||
agHelper.AddDsl(val);
|
||||
});
|
||||
cy.openPropertyPane("tablewidgetv2");
|
||||
cy.makeColumnEditable("step");
|
||||
|
|
@ -661,33 +667,40 @@ describe("Table widget inline editing functionality", () => {
|
|||
});
|
||||
|
||||
it("24. should check that doesn't grow taller when text wrapping is disabled", () => {
|
||||
cy.openPropertyPane("tablewidgetv2");
|
||||
cy.makeColumnEditable("step");
|
||||
cy.editTableCell(0, 0);
|
||||
cy.get(
|
||||
"[data-colindex='0'][data-rowindex='0'] .t--inlined-cell-editor",
|
||||
).should("have.css", "height", "32px");
|
||||
cy.enterTableCellValue(0, 0, "this is a very long cell value");
|
||||
cy.get(
|
||||
"[data-colindex='0'][data-rowindex='0'] .t--inlined-cell-editor",
|
||||
).should("have.css", "height", "32px");
|
||||
entityExplorer.SelectEntityByName("Table1");
|
||||
table.EnableEditableOfColumn("step");
|
||||
table.EditTableCell(0, 0, "", false);
|
||||
agHelper.GetHeight(table._editCellEditor);
|
||||
cy.get("@eleHeight").then(($initiaHeight) => {
|
||||
expect(Number($initiaHeight)).to.eq(28);
|
||||
table.EditTableCell(
|
||||
1,
|
||||
0,
|
||||
"this is a very long cell value to check the height of the cell is growing accordingly",
|
||||
false,
|
||||
);
|
||||
agHelper.GetHeight(table._editCellEditor);
|
||||
cy.get("@eleHeight").then(($newHeight) => {
|
||||
expect(Number($newHeight)).to.eq(Number($initiaHeight));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it("25. should check that grows taller when text wrapping is enabled", () => {
|
||||
cy.openPropertyPane("tablewidgetv2");
|
||||
cy.makeColumnEditable("step");
|
||||
cy.editColumn("step");
|
||||
cy.get(".t--property-control-cellwrapping .ads-v2-switch").click({
|
||||
force: true,
|
||||
entityExplorer.SelectEntityByName("Table1");
|
||||
table.EnableEditableOfColumn("step");
|
||||
table.EditColumn("step");
|
||||
propPane.TogglePropertyState("Cell Wrapping", "On");
|
||||
table.EditTableCell(
|
||||
0,
|
||||
0,
|
||||
"this is a very long cell value to check the height of the cell is growing accordingly",
|
||||
false,
|
||||
);
|
||||
agHelper.GetHeight(table._editCellEditor);
|
||||
cy.get("@eleHeight").then(($newHeight) => {
|
||||
expect(Number($newHeight)).to.be.greaterThan(34);
|
||||
});
|
||||
cy.editTableCell(0, 0);
|
||||
cy.get(
|
||||
"[data-colindex='0'][data-rowindex='0'] .t--inlined-cell-editor",
|
||||
).should("have.css", "height", "34px");
|
||||
cy.enterTableCellValue(0, 0, "this is a very long cell value");
|
||||
cy.get(
|
||||
"[data-colindex='0'][data-rowindex='0'] .t--inlined-cell-editor",
|
||||
).should("not.have.css", "height", "34px");
|
||||
});
|
||||
|
||||
it("26. should check if updatedRowIndex is getting updated for single row update mode", () => {
|
||||
|
|
@ -741,13 +754,13 @@ describe("Table widget inline editing functionality", () => {
|
|||
});
|
||||
|
||||
it("27. should check if updatedRowIndex is getting updated for multi row update mode", () => {
|
||||
_.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 400, 400);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 400, 400);
|
||||
cy.get(".t--widget-textwidget").should("exist");
|
||||
cy.updateCodeInput(
|
||||
".t--property-control-text",
|
||||
`{{Table1.updatedRowIndex}}`,
|
||||
);
|
||||
_.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.BUTTON, 300, 300);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300);
|
||||
cy.get(".t--widget-buttonwidget").should("exist");
|
||||
cy.get(PROPERTY_SELECTOR.onClick).find(".t--js-toggle").click();
|
||||
cy.updateCodeInput(".t--property-control-label", "Reset");
|
||||
|
|
@ -756,30 +769,25 @@ describe("Table widget inline editing functionality", () => {
|
|||
`{{resetWidget("Table1",true)}}`,
|
||||
);
|
||||
|
||||
cy.openPropertyPane("tablewidgetv2");
|
||||
|
||||
cy.makeColumnEditable("step");
|
||||
cy.get(".ads-v2-segmented-control-value-CUSTOM").click({ force: true });
|
||||
cy.wait(1000);
|
||||
entityExplorer.NavigateToSwitcher("Explorer");
|
||||
entityExplorer.SelectEntityByName("Table1");
|
||||
table.EnableEditableOfColumn("step");
|
||||
agHelper.GetNClick(table._updateMode("Multi"));
|
||||
|
||||
// case 1: check if updatedRowIndex is 0, when cell at row 0 is updated.
|
||||
//_.table.EditTableCell(0, 0, "#12");
|
||||
cy.editTableCell(0, 0);
|
||||
cy.enterTableCellValue(0, 0, "#12").type("{enter}");
|
||||
table.EditTableCell(0, 0, "#12");
|
||||
cy.get(commonlocators.textWidgetContainer).should("contain.text", 0);
|
||||
|
||||
// case 2: check if the updateRowIndex is -1 when widget is reset
|
||||
//_.table.EditTableCell(0, 1, "#13");//Method to be improve!
|
||||
cy.editTableCell(0, 1);
|
||||
cy.enterTableCellValue(0, 1, "#13").type("{enter}");
|
||||
table.EditTableCell(1, 0, "#13");
|
||||
cy.get(commonlocators.textWidgetContainer).should("contain.text", 1);
|
||||
|
||||
cy.contains("Reset").click({ force: true });
|
||||
cy.get(commonlocators.textWidgetContainer).should("contain.text", -1);
|
||||
|
||||
// case 3: check if the updatedRowIndex changes to -1 when the table data changes.
|
||||
cy.wait(1000);
|
||||
cy.editTableCell(0, 2);
|
||||
cy.enterTableCellValue(0, 2, "#14").type("{enter}");
|
||||
table.EditTableCell(2, 0, "#14");
|
||||
cy.get(commonlocators.textWidgetContainer).should("contain.text", 2);
|
||||
cy.openPropertyPane("tablewidgetv2");
|
||||
cy.get(widgetsPage.tabedataField).type("{backspace}");
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ describe("Validate CRUD queries for Amazon S3 along with UI flow verifications",
|
|||
cy.ClickGotIt();
|
||||
|
||||
//Verifying Searching File from UI
|
||||
cy.xpath(queryLocators.searchFilefield).type("S3Crud_").wait(7000); //for search to finish
|
||||
cy.xpath(queryLocators.searchFilefield).type("S3Crud_").wait(10000); //for search to finish
|
||||
|
||||
cy.get(".t--widget-textwidget span:contains('" + fileName + "')")
|
||||
.should("have.length", 1)
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@
|
|||
"version":59,
|
||||
"minHeight":1292,
|
||||
"dynamicTriggerPathList":[
|
||||
|
||||
|
||||
],
|
||||
"parentColumnSpace":1,
|
||||
"dynamicBindingPathList":[
|
||||
|
||||
|
||||
],
|
||||
"leftColumn":0,
|
||||
"children":[
|
||||
|
|
@ -220,10 +220,11 @@
|
|||
"action":""
|
||||
}
|
||||
],
|
||||
"columnWidthMap":{
|
||||
"task":245,
|
||||
"step":62,
|
||||
"status":75
|
||||
"bottomRow": 22,
|
||||
"columnWidthMap": {
|
||||
"task": 313,
|
||||
"step": 222,
|
||||
"status": 140
|
||||
},
|
||||
"columnOrder":[
|
||||
"step",
|
||||
|
|
@ -279,9 +280,8 @@
|
|||
"leftColumn":0,
|
||||
"rightColumn":64,
|
||||
"topRow":2,
|
||||
"bottomRow":24,
|
||||
"parentId":"0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ export const WIDGET = {
|
|||
FORM: "formwidget",
|
||||
ICONBUTTON: "iconbuttonwidget",
|
||||
IMAGE: "imagewidget",
|
||||
STATBOX: "statboxwidget",
|
||||
} as const;
|
||||
|
||||
// property pane element selector are maintained here
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { v4 as uuidv4 } from "uuid";
|
|||
import { ObjectsRegistry } from "../Objects/Registry";
|
||||
import type CodeMirror from "codemirror";
|
||||
import { ReusableHelper } from "../Objects/ReusableHelper";
|
||||
import type { EntityItemsType } from "./AssertHelper";
|
||||
import { EntityItems } from "./AssertHelper";
|
||||
|
||||
type ElementType = string | JQuery<HTMLElement>;
|
||||
|
|
@ -10,7 +11,7 @@ type ElementType = string | JQuery<HTMLElement>;
|
|||
interface DeleteParams {
|
||||
action: "Copy to page" | "Move to page" | "Delete" | "Prettify code";
|
||||
subAction?: string;
|
||||
entityType?: EntityItems;
|
||||
entityType?: EntityItemsType;
|
||||
toastToValidate?: string;
|
||||
}
|
||||
interface SubActionParams {
|
||||
|
|
@ -645,11 +646,15 @@ export class AggregateHelper extends ReusableHelper {
|
|||
|
||||
public HoverElement(selector: string, index = 0, waitTimeInterval = 100) {
|
||||
//this.ScrollTo(this.GetElement(selector))
|
||||
return this.GetElement(selector)
|
||||
.eq(index)
|
||||
.scrollIntoView()
|
||||
.realHover()
|
||||
.wait(waitTimeInterval);
|
||||
return (
|
||||
this.GetElement(selector)
|
||||
.eq(index)
|
||||
.scrollIntoView()
|
||||
.realTouch({ position: "center" })
|
||||
.realHover({ pointer: "mouse" })
|
||||
//.trigger("mousemove", { eventConstructor: "MouseEvent" })
|
||||
.wait(waitTimeInterval)
|
||||
);
|
||||
}
|
||||
|
||||
public GetSiblingNClick(
|
||||
|
|
@ -885,7 +890,10 @@ export class AggregateHelper extends ReusableHelper {
|
|||
}
|
||||
}
|
||||
|
||||
public DeleteEntityNAssert(entityType: EntityItems, toAssertAction = true) {
|
||||
public DeleteEntityNAssert(
|
||||
entityType: EntityItemsType,
|
||||
toAssertAction = true,
|
||||
) {
|
||||
if (entityType != EntityItems.Widget)
|
||||
this.GetNClick(this.locator._contextMenuItem("Are you sure?"));
|
||||
toAssertAction && this.assertHelper.AssertDelete(entityType);
|
||||
|
|
@ -1316,15 +1324,15 @@ export class AggregateHelper extends ReusableHelper {
|
|||
return this.GetElement(selector).scrollTo(position).wait(2000);
|
||||
}
|
||||
|
||||
public GetWidgetWidth(widgetSelector: string) {
|
||||
public GetWidth(widgetSelector: string) {
|
||||
this.GetElement(widgetSelector).then(($element) => {
|
||||
cy.wrap(Number($element.width())).as("widgetWidth");
|
||||
cy.wrap(Number($element.width())).as("eleWidth");
|
||||
});
|
||||
}
|
||||
|
||||
public GetWidgetHeight(widgetSelector: string) {
|
||||
public GetHeight(widgetSelector: string) {
|
||||
this.GetElement(widgetSelector).then(($element) => {
|
||||
cy.wrap(Number($element.height())).as("widgetHeight");
|
||||
cy.wrap(Number($element.height())).as("eleHeight");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1394,7 +1402,7 @@ export class AggregateHelper extends ReusableHelper {
|
|||
}
|
||||
|
||||
public VisitNAssert(url: string, apiToValidate = "") {
|
||||
cy.visit(url);
|
||||
cy.visit(url, { timeout: 60000 });
|
||||
if (apiToValidate.includes("getReleaseItems") && Cypress.env("AIRGAPPED")) {
|
||||
this.Sleep(2000);
|
||||
} else apiToValidate && this.AssertNetworkStatus(apiToValidate);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ export class AppSettings {
|
|||
},
|
||||
},
|
||||
_navigationMenuItem: ".t--page-switch-tab",
|
||||
_sideNavbar: ".t--app-viewer-navigation-sidebar",
|
||||
_getPageSettingsHeader: (pageName: string) =>
|
||||
`#t--page-settings-${pageName}`,
|
||||
_updateStatus: ".ads-v2-icon.rotate",
|
||||
|
|
|
|||
|
|
@ -2,14 +2,17 @@ import "cypress-wait-until";
|
|||
import { ObjectsRegistry } from "../Objects/Registry";
|
||||
import { ReusableHelper } from "../Objects/ReusableHelper";
|
||||
|
||||
export enum EntityItems {
|
||||
Page,
|
||||
Query,
|
||||
Api,
|
||||
JSObject,
|
||||
Widget,
|
||||
Datasource,
|
||||
}
|
||||
export const EntityItems = {
|
||||
Page: 0,
|
||||
Query: 1,
|
||||
Api: 2,
|
||||
JSObject: 3,
|
||||
Widget: 4,
|
||||
Datasource: 5,
|
||||
} as const;
|
||||
|
||||
export type EntityItemsType = (typeof EntityItems)[keyof typeof EntityItems];
|
||||
|
||||
export class AssertHelper extends ReusableHelper {
|
||||
private locator = ObjectsRegistry.CommonLocators;
|
||||
public _modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl";
|
||||
|
|
@ -30,7 +33,7 @@ export class AssertHelper extends ReusableHelper {
|
|||
cy.window().should("have.property", "onload");
|
||||
}
|
||||
|
||||
public AssertDelete(entityType: EntityItems) {
|
||||
public AssertDelete(entityType: EntityItemsType) {
|
||||
let networkCall = "";
|
||||
switch (entityType) {
|
||||
case EntityItems.Api:
|
||||
|
|
|
|||
|
|
@ -182,12 +182,12 @@ export class AutoLayout {
|
|||
);
|
||||
|
||||
// Increase the length of button label & verify if the component expands
|
||||
this.agHelper.GetWidgetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@widgetWidth").then(($initialWidth) => {
|
||||
this.agHelper.GetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@eleWidth").then(($initialWidth) => {
|
||||
this.propPane.UpdatePropertyFieldValue("Label", "Lengthy Button Label");
|
||||
this.agHelper.Sleep(); //to allow time for widget to resize itself before checking width again!
|
||||
this.agHelper.GetWidgetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@widgetWidth").then((width: any) => {
|
||||
this.agHelper.GetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@eleWidth").then((width: any) => {
|
||||
//cy.get<number>("@initialWidth").then((initialWidth) => {
|
||||
expect(width).to.be.greaterThan(Number($initialWidth));
|
||||
//});
|
||||
|
|
@ -201,12 +201,12 @@ export class AutoLayout {
|
|||
);
|
||||
|
||||
// Decrease the length of button label & verify if the component shrinks
|
||||
this.agHelper.GetWidgetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@widgetWidth").then(($initialWidth) => {
|
||||
this.agHelper.GetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@eleWidth").then(($initialWidth) => {
|
||||
this.propPane.UpdatePropertyFieldValue("Label", "Label");
|
||||
this.agHelper.Sleep(); //to allow time for widget to resize itself before checking width again!
|
||||
this.agHelper.GetWidgetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@widgetWidth").then((width: any) => {
|
||||
this.agHelper.GetWidth(this._buttonWidgetSelector);
|
||||
cy.get("@eleWidth").then((width: any) => {
|
||||
expect(width).to.be.lessThan(Number($initialWidth));
|
||||
});
|
||||
});
|
||||
|
|
@ -241,15 +241,15 @@ export class AutoLayout {
|
|||
|
||||
// Add multi-line text & verify if the component's height increases
|
||||
|
||||
this.agHelper.GetWidgetHeight(this._textWidgetSelector);
|
||||
cy.get("@widgetHeight").then(($initialHeight) => {
|
||||
this.agHelper.GetHeight(this._textWidgetSelector);
|
||||
cy.get("@eleHeight").then(($initialHeight) => {
|
||||
this.propPane.UpdatePropertyFieldValue(
|
||||
"Text",
|
||||
"hello\nWorld\nThis\nis\na\nMulti-line\nText",
|
||||
);
|
||||
this.agHelper.Sleep(); //to allow time for widget to resize itself before checking height again!
|
||||
this.agHelper.GetWidgetHeight(this._textWidgetSelector);
|
||||
cy.get("@widgetHeight").then((height: any) => {
|
||||
this.agHelper.GetHeight(this._textWidgetSelector);
|
||||
cy.get("@eleHeight").then((height: any) => {
|
||||
expect(height).to.be.greaterThan(Number($initialHeight));
|
||||
});
|
||||
});
|
||||
|
|
@ -262,12 +262,12 @@ export class AutoLayout {
|
|||
|
||||
// Remove some lines & verify if the component's height decreases
|
||||
|
||||
this.agHelper.GetWidgetHeight(this._textWidgetSelector);
|
||||
cy.get("@widgetHeight").then(($initialHeight) => {
|
||||
this.agHelper.GetHeight(this._textWidgetSelector);
|
||||
cy.get("@eleHeight").then(($initialHeight) => {
|
||||
this.propPane.UpdatePropertyFieldValue("Text", "hello\nWorld\nblabla");
|
||||
this.agHelper.Sleep(); //to allow time for widget to resize itself before checking width again!
|
||||
this.agHelper.GetWidgetHeight(this._textWidgetSelector);
|
||||
cy.get("@widgetHeight").then((height: any) => {
|
||||
this.agHelper.GetHeight(this._textWidgetSelector);
|
||||
cy.get("@eleHeight").then((height: any) => {
|
||||
expect(height).to.be.lessThan(Number($initialHeight));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ export class DeployMode {
|
|||
|
||||
public NavigateBacktoEditor() {
|
||||
this.assertHelper.AssertDocumentReady();
|
||||
cy.get(this.locator._backToEditor).click({ force: true });
|
||||
this.agHelper.GetNClick(this.locator._backToEditor, 0, true);
|
||||
this.agHelper.Sleep(2000);
|
||||
localStorage.setItem("inDeployedMode", "false");
|
||||
this.assertHelper.AssertDocumentReady();
|
||||
|
|
|
|||
|
|
@ -150,8 +150,8 @@ export class EntityExplorer {
|
|||
}
|
||||
|
||||
public AssertEntityPresenceInExplorer(entityNameinLeftSidebar: string) {
|
||||
cy.xpath(this._entityNameInExplorer(entityNameinLeftSidebar)).should(
|
||||
"have.length",
|
||||
this.agHelper.AssertElementLength(
|
||||
this._entityNameInExplorer(entityNameinLeftSidebar),
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
|
@ -318,12 +318,24 @@ export class EntityExplorer {
|
|||
.first()
|
||||
.trigger("dragstart", { force: true })
|
||||
.trigger("mousemove", x, y, { force: true });
|
||||
cy.get(dropTargetId ? dropTargetId : this.locator._dropHere)
|
||||
cy.get(
|
||||
dropTargetId
|
||||
? this.locator._widgetInCanvas(dropTargetId) +
|
||||
" " +
|
||||
this.locator._dropHere
|
||||
: this.locator._dropHere,
|
||||
)
|
||||
.first()
|
||||
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" })
|
||||
.trigger("mousemove", x, y, { eventConstructor: "MouseEvent" });
|
||||
this.agHelper.Sleep(200);
|
||||
cy.get(dropTargetId ? dropTargetId : this.locator._dropHere)
|
||||
cy.get(
|
||||
dropTargetId
|
||||
? this.locator._widgetInCanvas(dropTargetId) +
|
||||
" " +
|
||||
this.locator._dropHere
|
||||
: this.locator._dropHere,
|
||||
)
|
||||
.first()
|
||||
.trigger("mouseup", x, y, { eventConstructor: "MouseEvent" });
|
||||
this.agHelper.AssertAutoSave(); //settling time for widget on canvas!
|
||||
|
|
@ -331,11 +343,15 @@ export class EntityExplorer {
|
|||
cy.get(".t--modal-widget").should("exist");
|
||||
} else {
|
||||
if (dropTargetId) {
|
||||
cy.get(
|
||||
`${dropTargetId} ${this.locator._widgetInCanvas(widgetType)}`,
|
||||
).should("exist");
|
||||
this.agHelper.AssertElementExist(
|
||||
`${this.locator._widgetInCanvas(
|
||||
dropTargetId,
|
||||
)} ${this.locator._widgetInCanvas(widgetType)}`,
|
||||
);
|
||||
} else {
|
||||
cy.get(this.locator._widgetInCanvas(widgetType)).should("exist");
|
||||
this.agHelper.AssertElementExist(
|
||||
this.locator._widgetInCanvas(widgetType),
|
||||
);
|
||||
}
|
||||
}
|
||||
this.agHelper.Sleep(200); //waiting a bit for widget properties to open
|
||||
|
|
|
|||
|
|
@ -429,12 +429,9 @@ export class PropertyPane {
|
|||
}
|
||||
|
||||
public Search(query: string) {
|
||||
cy.get(this._propertyPaneSearchInput)
|
||||
.first()
|
||||
.then((el: any) => {
|
||||
cy.get(el).clear();
|
||||
if (query) cy.get(el).type(query, { force: true });
|
||||
});
|
||||
this.agHelper.ClearTextField(this._propertyPaneSearchInput);
|
||||
this.agHelper.TypeText(this._propertyPaneSearchInput, query);
|
||||
this.agHelper.Sleep();
|
||||
}
|
||||
|
||||
public ToggleSection(section: string) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ export class Table {
|
|||
this._tableWidgetVersion(version) +
|
||||
` .tbody .td[data-rowindex=${rowNum}][data-colindex=${colNum}]`;
|
||||
_editCellIconDiv = ".t--editable-cell-icon";
|
||||
_editCellEditorInput = ".t--inlined-cell-editor input";
|
||||
_editCellEditor = ".t--inlined-cell-editor";
|
||||
_editCellEditorInput = this._editCellEditor + " input";
|
||||
_tableRowColumnDataVersion = (version: "v1" | "v2") =>
|
||||
`${version == "v1" ? " div div" : " .cell-wrapper"}`;
|
||||
_tableRowColumnData = (
|
||||
|
|
@ -111,12 +112,30 @@ export class Table {
|
|||
_filterOperatorDropdown = ".t--table-filter-operators-dropdown";
|
||||
private _downloadBtn = ".t--table-download-btn";
|
||||
private _downloadOption = ".t--table-download-data-option";
|
||||
_columnSettings = (columnName: string) =>
|
||||
"//input[@placeholder='Column title'][@value='" +
|
||||
columnName +
|
||||
"']/parent::div/parent::div/parent::div/parent::div/following-sibling::div/button[contains(@class, 't--edit-column-btn')]";
|
||||
_columnSettingsV2 = (columnName: string) =>
|
||||
`.t--property-pane-view .tablewidgetv2-primarycolumn-list div[data-rbd-draggable-id=${columnName}] .t--edit-column-btn`;
|
||||
_columnSettings = (
|
||||
columnName: string,
|
||||
type: "Edit" | "Visibility" | "Editable",
|
||||
) => {
|
||||
const classMap = {
|
||||
Edit: "t--edit-column-btn",
|
||||
Visibility: "t--show-column-btn",
|
||||
Editable: "t--card-checkbox",
|
||||
};
|
||||
const classToCheck = classMap[type];
|
||||
return `//input[@placeholder='Column title'][@value='${columnName}']/parent::div/parent::div/parent::div/parent::div/following-sibling::div/*[contains(@class, '${classToCheck}')]`;
|
||||
};
|
||||
_columnSettingsV2 = (
|
||||
columnName: string,
|
||||
type: "Edit" | "Visibility" | "Editable",
|
||||
) => {
|
||||
const classMap = {
|
||||
Edit: ".t--edit-column-btn",
|
||||
Visibility: ".t--show-column-btn",
|
||||
Editable: ".t--card-checkbox",
|
||||
};
|
||||
const classToCheck = classMap[type];
|
||||
return `.t--property-pane-view .tablewidgetv2-primarycolumn-list div[data-rbd-draggable-id=${columnName}] ${classToCheck}`;
|
||||
};
|
||||
_showPageItemsCount = "div.show-page-items";
|
||||
_filtersCount = this._filterBtn + " span.action-title";
|
||||
_headerCell = (column: string) =>
|
||||
|
|
@ -129,6 +148,8 @@ export class Table {
|
|||
_newRow = ".new-row";
|
||||
_connectDataHeader = ".t--cypress-table-overlay-header";
|
||||
_connectDataButton = ".t--cypress-table-overlay-connectdata";
|
||||
_updateMode = (mode: "Single" | "Multi") =>
|
||||
"//span[text()='" + mode + " Row']/ancestor::div";
|
||||
|
||||
public WaitUntilTableLoad(
|
||||
rowIndex = 0,
|
||||
|
|
@ -525,13 +546,36 @@ export class Table {
|
|||
public EditColumn(columnName: string, tableVersion: "v1" | "v2") {
|
||||
const colSettings =
|
||||
tableVersion == "v1"
|
||||
? this._columnSettings(columnName)
|
||||
: this._columnSettingsV2(columnName);
|
||||
? this._columnSettings(columnName, "Edit")
|
||||
: this._columnSettingsV2(columnName, "Edit");
|
||||
this.agHelper.GetNClick(colSettings);
|
||||
}
|
||||
|
||||
//Method to be improved!
|
||||
public EditTableCell(rowIndex: number, colIndex: number, newValue: string) {
|
||||
public EnableVisibilityOfColumn(
|
||||
columnName: string,
|
||||
tableVersion: "v1" | "v2",
|
||||
) {
|
||||
const colSettings =
|
||||
tableVersion == "v1"
|
||||
? this._columnSettings(columnName, "Visibility")
|
||||
: this._columnSettingsV2(columnName, "Visibility");
|
||||
this.agHelper.GetNClick(colSettings);
|
||||
}
|
||||
|
||||
public EnableEditableOfColumn(columnName: string, tableVersion: "v1" | "v2") {
|
||||
const colSettings =
|
||||
tableVersion == "v1"
|
||||
? this._columnSettings(columnName, "Editable")
|
||||
: this._columnSettingsV2(columnName, "Editable");
|
||||
this.agHelper.GetNClick(colSettings);
|
||||
}
|
||||
|
||||
public EditTableCell(
|
||||
rowIndex: number,
|
||||
colIndex: number,
|
||||
newValue = "",
|
||||
toSaveNewValue = true,
|
||||
) {
|
||||
this.agHelper.HoverElement(this._tableRow(rowIndex, colIndex, "v2"));
|
||||
this.agHelper.GetNClick(
|
||||
this._tableRow(rowIndex, colIndex, "v2") + " " + this._editCellIconDiv,
|
||||
|
|
@ -541,13 +585,16 @@ export class Table {
|
|||
" " +
|
||||
this._editCellEditorInput,
|
||||
);
|
||||
this.agHelper.UpdateInputValue(
|
||||
this._tableRow(rowIndex, colIndex, "v2") +
|
||||
" " +
|
||||
this._editCellEditorInput,
|
||||
newValue,
|
||||
);
|
||||
this.agHelper.PressEnter();
|
||||
if (newValue) {
|
||||
this.agHelper.UpdateInputValue(
|
||||
this._tableRow(rowIndex, colIndex, "v2") +
|
||||
" " +
|
||||
this._editCellEditorInput,
|
||||
newValue,
|
||||
);
|
||||
}
|
||||
toSaveNewValue &&
|
||||
this.agHelper.TypeText(this._editCellEditorInput, "{enter}", 0, true);
|
||||
}
|
||||
|
||||
public DeleteColumn(colId: string) {
|
||||
|
|
|
|||
|
|
@ -271,12 +271,15 @@ Cypress.Commands.add("Signup", (uname, pword) => {
|
|||
cy.get(signupPage.password).type(pword);
|
||||
cy.get(signupPage.submitBtn).click();
|
||||
cy.wait(1000);
|
||||
cy.get(signupPage.roleDropdown).click();
|
||||
cy.get(signupPage.dropdownOption).click();
|
||||
cy.get(signupPage.useCaseDropdown).click();
|
||||
cy.get(signupPage.dropdownOption).click();
|
||||
cy.get(signupPage.roleUsecaseSubmit).click({ force: true });
|
||||
|
||||
cy.get("body").then(($body) => {
|
||||
if ($body.find(signupPage.roleDropdown).length > 0) {
|
||||
cy.get(signupPage.roleDropdown).click();
|
||||
cy.get(signupPage.dropdownOption).click();
|
||||
cy.get(signupPage.useCaseDropdown).click();
|
||||
cy.get(signupPage.dropdownOption).click();
|
||||
cy.get(signupPage.roleUsecaseSubmit).click({ force: true });
|
||||
}
|
||||
});
|
||||
cy.wait("@getMe");
|
||||
cy.wait(3000);
|
||||
initLocalstorage();
|
||||
|
|
|
|||
|
|
@ -169,11 +169,14 @@ after(function () {
|
|||
if (RapidMode.config.enabled) {
|
||||
return;
|
||||
}
|
||||
//-- Deleting the application by Api---//
|
||||
cy.DeleteAppByApi();
|
||||
//-- LogOut Application---//
|
||||
cy.LogOut();
|
||||
|
||||
if (Cypress.env("CYPRESS_CI") === "1") {
|
||||
//-- Deleting the application by Api---//
|
||||
cy.DeleteAppByApi();
|
||||
//-- LogOut Application---//
|
||||
cy.LogOut();
|
||||
} else {
|
||||
cy.log("Running locally, hence skipping app delete!");
|
||||
}
|
||||
// Commenting until Upgrade Appsmith cases are fixed
|
||||
// const tedUrl = "http://localhost:5001/v1/parent/cmd";
|
||||
// cy.log("Start the appsmith container");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user