test: Cypress | SetWidget property validations + CI Stabilize (#28626)
## Description - This PR includes [Set widget property Scenarios](https://github.com/appsmithorg/TestSmith/issues/2409) script - entityExplorer.RenameEntityFromExplorer() improved - jsEditor.CreateJSObject() improved **Flaky fixes below spces:** - ClientSide/JSObject/JSObjectMutation_spec.ts - Widgets/Form/FormWidget_Select_TreeSelect_spec.js - ClientSide/BugTests/Bug27817_Spec.ts - ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts - ClientSide/SettingsPane/EmbedSettings_spec.ts - /Widgets/Sliders/CategorySlider_spec.ts - Widgets/Select/RTL_support.ts - Widgets/TableV2/Edge_case_spec.js - Git/GitSync/SwitchBranches_spec.js - Widgets/Modal/Modal_spec.ts - MySQL_Datatypes/Basic_Spec.ts - Binding/TableTextPagination_spec.js - /GitSync/DeleteBranch_spec.js - /Sliders/NumberSlider_spec.ts #### 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: - [X] Added `Test Plan Approved` label after Cypress tests were reviewed
This commit is contained in:
parent
7aa1c98efe
commit
015f5424f6
|
|
@ -10,12 +10,10 @@ describe("Datasource structure schema preview data", () => {
|
|||
featureFlagIntercept({ ab_gsheet_schema_enabled: true });
|
||||
dataSources.CreateDataSource("Postgres");
|
||||
});
|
||||
|
||||
it("1. Table selection should be enabled and add template button absent", () => {
|
||||
dataSources.selectTabOnDatasourcePage("View data");
|
||||
agHelper.TypeText(
|
||||
dataSources._datasourceStructureSearchInput,
|
||||
"public.users",
|
||||
);
|
||||
agHelper.TypeText(dataSources._datasourceStructureSearchInput, "users");
|
||||
agHelper.GetNClick(
|
||||
dataSources._dsPageTabContainerTableName("public.users"),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ describe("Delete branch flow", () => {
|
|||
});
|
||||
|
||||
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 });
|
||||
|
|
|
|||
|
|
@ -15,10 +15,8 @@ describe("List no functions on empty collection", () => {
|
|||
}
|
||||
}`,
|
||||
{
|
||||
paste: true,
|
||||
completeReplace: true,
|
||||
toRun: false,
|
||||
shouldCreateNewJSObj: true,
|
||||
prettify: false,
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ describe("JSObject testing", () => {
|
|||
_.jsEditor.RunJSObj();
|
||||
_.entityExplorer.SelectEntityByName("Text2", "Widgets");
|
||||
_.agHelper.AssertContains("id-1");
|
||||
cy.reload();
|
||||
_.agHelper.RefreshPage();
|
||||
_.agHelper.AssertContains("Not Set");
|
||||
_.entityExplorer.SelectEntityByName("JSObject1", "Queries/JS");
|
||||
_.jsEditor.SelectFunctionDropdown("myFun2");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,386 @@
|
|||
import {
|
||||
entityExplorer,
|
||||
jsEditor,
|
||||
agHelper,
|
||||
locators,
|
||||
propPane,
|
||||
draggableWidgets,
|
||||
deployMode,
|
||||
debuggerHelper,
|
||||
apiPage,
|
||||
dataManager,
|
||||
} from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Widget Property Setters - Part III - Tc #2409 - Validates SetOptions", () => {
|
||||
before(() => {
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.INPUT_V2, 300);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT, 300, 200);
|
||||
entityExplorer.SelectEntityByName("Input1");
|
||||
propPane.UpdatePropertyFieldValue("Default value", "{{Select1.options}}");
|
||||
});
|
||||
|
||||
it("1. Set Widget property to unaccepted values & verify debug error", () => {
|
||||
//SetOptions to not acceptable value - Boolean
|
||||
jsEditor.CreateJSObject(
|
||||
`export default {
|
||||
myFun1 () {
|
||||
Select1.setOptions(false);
|
||||
}
|
||||
}`,
|
||||
{
|
||||
completeReplace: true,
|
||||
},
|
||||
);
|
||||
jsEditor.RunJSObj();
|
||||
entityExplorer.SelectEntityByName("Page1");
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.eq("false");
|
||||
});
|
||||
debuggerHelper.AssertDebugError(
|
||||
"Default value is missing in options. Please update the value.",
|
||||
"",
|
||||
true,
|
||||
false,
|
||||
);
|
||||
|
||||
//SetOptions to not acceptable value - Numeric
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
myFun1 () {
|
||||
Select1.setOptions(1234);
|
||||
}
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
jsEditor.RunJSObj();
|
||||
entityExplorer.SelectEntityByName("Page1");
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.eq("1234");
|
||||
});
|
||||
debuggerHelper.AssertDebugError(
|
||||
"Default value is missing in options. Please update the value.",
|
||||
"",
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
//SetOptions to not acceptable value - String
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
myFun1 () {
|
||||
Select1.setOptions('fdfjhgf7');
|
||||
}
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
jsEditor.RunJSObj();
|
||||
entityExplorer.SelectEntityByName("Page1");
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.eq("fdfjhgf7");
|
||||
});
|
||||
debuggerHelper.AssertDebugError(
|
||||
"Default value is missing in options. Please update the value.",
|
||||
"",
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
//SetOptions to not acceptable value - undefined
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
myFun1 () {
|
||||
Select1.setOptions(undefined);
|
||||
}
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
jsEditor.RunJSObj();
|
||||
entityExplorer.SelectEntityByName("Page1");
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.eq("fdfjhgf7");
|
||||
});
|
||||
debuggerHelper.AssertDebugError(
|
||||
"Default value is missing in options. Please update the value.",
|
||||
"",
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
//SetOptions to not acceptable value - null
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
myFun1 () {
|
||||
Select1.setOptions(null);
|
||||
}
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
jsEditor.RunJSObj();
|
||||
entityExplorer.SelectEntityByName("Page1");
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.be.empty;
|
||||
});
|
||||
debuggerHelper.AssertDebugError(
|
||||
"Default value is missing in options. Please update the value.",
|
||||
"",
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
//unabel to set +ve value to setOptions:
|
||||
// {{JSObject1.myFun1.data.map((item)=>{return{
|
||||
// label: item.name,
|
||||
// value: item.email } })}}
|
||||
// deployMode.DeployApp();
|
||||
});
|
||||
|
||||
it("2. Update 'setOptions' property By JS function & By action selector", () => {
|
||||
entityExplorer.SelectEntityByName("Select1");
|
||||
propPane.EnterJSContext("Source Data", ""); // By JS function
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(`export default {
|
||||
myFun1 () {
|
||||
Select1.setOptions([{label: 'monday', value: 'weekday'}])
|
||||
}
|
||||
}`);
|
||||
jsEditor.RunJSObj();
|
||||
entityExplorer.SelectEntityByName("Page1");
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.include("monday").and.to.include("weekday");
|
||||
});
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 300);
|
||||
propPane.EnterJSContext("onClick", "{{JSObject1.myFun1()}}"); // By action selector
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(`export default {
|
||||
myFun1 () {
|
||||
Select1.setOptions([{label: 'monday', value: 'weekday', code: '1'}])
|
||||
}
|
||||
}`);
|
||||
deployMode.DeployApp();
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.eq("[]");
|
||||
});
|
||||
agHelper.ClickButton("Submit");
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val)
|
||||
.to.include("monday")
|
||||
.and.to.include("weekday")
|
||||
.and.to.include("1");
|
||||
});
|
||||
deployMode.NavigateBacktoEditor();
|
||||
});
|
||||
|
||||
it("3. Update 'setOptions' property - during onPage load", () => {
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true, false); //for on page load execution
|
||||
deployMode.DeployApp();
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val)
|
||||
.to.include("monday")
|
||||
.and.to.include("weekday")
|
||||
.and.to.include("1");
|
||||
});
|
||||
deployMode.NavigateBacktoEditor();
|
||||
});
|
||||
|
||||
it("4. Update 'setOptions' property - during onPage load - via Promise", () => {
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(`export default {
|
||||
myFun1 () {
|
||||
return new Promise((resolve,reject)=>{
|
||||
Select1.setOptions([{label: 'monday', value: 'weekday'}])
|
||||
})
|
||||
}
|
||||
}`);
|
||||
deployMode.DeployApp();
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val)
|
||||
.to.include("monday")
|
||||
.and.to.include("weekday")
|
||||
.and.not.to.include("1");
|
||||
});
|
||||
deployMode.NavigateBacktoEditor();
|
||||
});
|
||||
|
||||
it("5. Update 'setOptions' property - during onPage load - via CallBack", () => {
|
||||
apiPage.CreateAndFillApi(
|
||||
dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl,
|
||||
);
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(`export default {
|
||||
async myFunc1 () {
|
||||
await Api1.run(() => {Select1.setOptions([
|
||||
{
|
||||
"label": "Api callback",
|
||||
"value": "Api callback"
|
||||
}
|
||||
])}, () => {showAlert('unable to run API')});
|
||||
}
|
||||
}`);
|
||||
jsEditor.EnableDisableAsyncFuncSettings("myFunc1", true, false); //for on page load execution, since sync function is updated to async
|
||||
deployMode.DeployApp();
|
||||
agHelper.Sleep(2000); //for call to finish for CI runs
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.include("Api callback");
|
||||
});
|
||||
deployMode.NavigateBacktoEditor();
|
||||
});
|
||||
|
||||
it("6. Update 'setOptions' property - during onPage load - via contcat", () => {
|
||||
entityExplorer.SelectEntityByName("Select1");
|
||||
propPane.EnterJSContext(
|
||||
"Source Data",
|
||||
`[
|
||||
{
|
||||
"name": "monday",
|
||||
"code": "Weekday"
|
||||
}
|
||||
]`,
|
||||
); // By JS function
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT, 300, 400);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT, 300, 500);
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(`export default {
|
||||
myFunc1 () {
|
||||
Select3.setOptions(Select1.options.concat(Select2.options));
|
||||
}
|
||||
}`);
|
||||
jsEditor.EnableDisableAsyncFuncSettings("myFunc1", true, false); //for on page load execution, since sync function is updated to async
|
||||
entityExplorer.SelectEntityByName("Input1");
|
||||
propPane.UpdatePropertyFieldValue("Default value", "{{Select3.options}}");
|
||||
deployMode.DeployApp();
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val)
|
||||
.to.include("monday")
|
||||
.and.to.include("Blue")
|
||||
.and.to.include("Red")
|
||||
.and.to.include("Green");
|
||||
});
|
||||
deployMode.NavigateBacktoEditor();
|
||||
});
|
||||
|
||||
it("7. Update 'setOptions' property - via SetTimeout framework function", () => {
|
||||
entityExplorer.SelectEntityByName("Input1");
|
||||
propPane.UpdatePropertyFieldValue("Default value", "{{Select1.options}}");
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(`export default {
|
||||
myFun1() {
|
||||
let localValue = {"label": 'local label', "value": 'local value'};
|
||||
setTimeout(() => {Select1.setOptions(localValue)}, 1000);
|
||||
}
|
||||
}`);
|
||||
jsEditor.EnableDisableAsyncFuncSettings("myFun1", false, false); //for on page load execution
|
||||
deployMode.DeployApp();
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.contain("monday");
|
||||
});
|
||||
agHelper.ClickButton("Submit");
|
||||
agHelper.Sleep(); //settimeout timer!
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).to.include("local label").and.to.include("local value");
|
||||
});
|
||||
deployMode.NavigateBacktoEditor();
|
||||
});
|
||||
});
|
||||
|
|
@ -10,7 +10,7 @@ import {
|
|||
dataManager,
|
||||
} from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Widget Property Setters - Part II", () => {
|
||||
describe("Widget Property Setters - Part II - Tc #2409", () => {
|
||||
it("1. Bug 25287 - CurrencyInput does not update value when set using CurrencyInput.text", () => {
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.CURRENCY_INPUT);
|
||||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 300, 200);
|
||||
|
|
@ -43,7 +43,7 @@ describe("Widget Property Setters - Part II", () => {
|
|||
);
|
||||
});
|
||||
|
||||
it("2. Update Visible property via JS function", () => {
|
||||
it("2. Update Visible property via JS function - using appmsith store", () => {
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
|
|
@ -63,7 +63,7 @@ describe("Widget Property Setters - Part II", () => {
|
|||
);
|
||||
});
|
||||
|
||||
it("3. Update Input value via JS function", () => {
|
||||
it("3. Update Input value via JS function - using async await - Api call", () => {
|
||||
apiPage.CreateAndFillApi(
|
||||
dataManager.dsValues[dataManager.defaultEnviorment].mockApiUrl,
|
||||
);
|
||||
|
|
@ -108,7 +108,7 @@ describe("Widget Property Setters - Part II", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("4. Update Input value via JS function run", () => {
|
||||
it("4. Update Input value via JS Call back function - in Edit mode itself + OnPage load", () => {
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
|
|
@ -137,12 +137,106 @@ describe("Widget Property Setters - Part II", () => {
|
|||
.then((val) => {
|
||||
expect(val).contains("@");
|
||||
});
|
||||
deployMode.DeployApp();
|
||||
|
||||
entityExplorer.SelectEntityByName("Input1");
|
||||
propPane.UpdatePropertyFieldValue(
|
||||
"Default value",
|
||||
"{{appsmith.user.name}}",
|
||||
);
|
||||
deployMode.DeployApp(); //below validates the Page load
|
||||
agHelper
|
||||
.GetText(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2) +
|
||||
" " +
|
||||
locators._input,
|
||||
"val",
|
||||
)
|
||||
.then((val) => {
|
||||
expect(val).not.be.empty;
|
||||
});
|
||||
});
|
||||
|
||||
// it("5. Update Widget property value during OnPage load", () => {
|
||||
// //
|
||||
// });
|
||||
it("5. Update Widget property through framework function - Settimeout", () => {
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
async myFun1 () {
|
||||
setTimeout(()=>{Button1.isVisible ?Button1.setVisibility(false):Button1.setVisibility(true)},2000)
|
||||
}
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true, false);
|
||||
deployMode.DeployApp();
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.BUTTON), //Asserting before setTimeout JS function execution, button is visible
|
||||
);
|
||||
agHelper.Sleep(2000); //waiting for settimeout to execute
|
||||
agHelper.AssertElementAbsence(
|
||||
locators._widgetInDeployed(draggableWidgets.BUTTON),
|
||||
);
|
||||
});
|
||||
|
||||
it("6. Verify SetWidget for unsupported properties - setPlaying(Audio widget) property for Button, set property via try/catch block", () => {
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
myFun1 () {
|
||||
Button1.setPlaying(true);
|
||||
},
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
agHelper.AssertElementVisibility(locators._lintErrorElement);
|
||||
agHelper.HoverElement(locators._lintErrorElement);
|
||||
agHelper.AssertContains(`"setPlaying" doesn't exist in Button1`);
|
||||
|
||||
//try catch block
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
myFun1 () {
|
||||
try {
|
||||
Api1.run().then(()=>{ Button1.setVisibility(false)})
|
||||
}
|
||||
catch(e)
|
||||
{ showAlert(e.message) }
|
||||
},
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
deployMode.DeployApp();
|
||||
agHelper.AssertElementAbsence(
|
||||
locators._widgetInDeployed(draggableWidgets.BUTTON),
|
||||
);
|
||||
});
|
||||
|
||||
it("7.Update set property using mutative values", () => {
|
||||
entityExplorer.SelectEntityByName("Button1");
|
||||
propPane.TogglePropertyState("Visible", "Off"); //due to bug, element state is not altereed when set via settimeout
|
||||
propPane.TogglePropertyState("Visible", "On");
|
||||
entityExplorer.SelectEntityByName("JSObject1");
|
||||
jsEditor.EditJSObj(
|
||||
`export default {
|
||||
var1: [true,false,true,false],
|
||||
async myFun1() {
|
||||
for (let i =0; i<=this.var1.length;i++){
|
||||
Input1.setVisibility(this.var1[i]);
|
||||
}
|
||||
},
|
||||
}`,
|
||||
false,
|
||||
);
|
||||
jsEditor.EnableDisableAsyncFuncSettings("myFun1", false, false);
|
||||
deployMode.DeployApp();
|
||||
agHelper.AssertElementVisibility(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2), //Asserting before setTimeout JS function execution, Input is visible
|
||||
);
|
||||
agHelper.ClickButton("Submit");
|
||||
agHelper.AssertElementAbsence(
|
||||
locators._widgetInDeployed(draggableWidgets.INPUT_V2),
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
deployMode.NavigateBacktoEditor();
|
||||
|
|
|
|||
|
|
@ -1,16 +1,21 @@
|
|||
const widgetsPage = require("../../../../../locators/Widgets.json");
|
||||
const formWidgetsPage = require("../../../../../locators/FormWidgets.json");
|
||||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||
import { agHelper } from "../../../../../support/Objects/ObjectsCore";
|
||||
|
||||
describe("Form Widget Functionality", function () {
|
||||
before(() => {
|
||||
_.agHelper.AddDsl("formSelectTreeselectDsl");
|
||||
agHelper.AddDsl("formSelectTreeselectDsl");
|
||||
});
|
||||
|
||||
it("Validate Select and TreeSelect Widget", function () {
|
||||
cy.get(widgetsPage.formButtonWidget)
|
||||
.contains("Submit")
|
||||
.should("have.attr", "disabled");
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(1000) //for dropdown to load for CI runs
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput).click().type("Blue");
|
||||
cy.treeSelectDropdown("Blue");
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ describe("Modal Widget test cases", function () {
|
|||
entityExplorer.DragDropWidgetNVerify(draggableWidgets.MODAL, 300, 300);
|
||||
entityExplorer.SelectEntityByName("Button1");
|
||||
propPane.EnterJSContext("onClick", "{{showModal('Modal1');}}");
|
||||
agHelper.Sleep();
|
||||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON));
|
||||
agHelper.Sleep(2000); //Wait for widgets to settle
|
||||
|
||||
|
|
@ -48,9 +49,11 @@ describe("Modal Widget test cases", function () {
|
|||
entityExplorer.SelectEntityByName("Button1");
|
||||
propPane.ToggleJSMode("onClick", false);
|
||||
propPane.CreateModal("onClick");
|
||||
agHelper.Sleep(500);
|
||||
propPane.CreateModal("onClick");
|
||||
agHelper.Sleep(500);
|
||||
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.BUTTON));
|
||||
|
||||
agHelper.Sleep(2000); //Wait for widgets to settle & be visible
|
||||
agHelper.ClickButton("Submit");
|
||||
agHelper.AssertElementLength(locators._modal, 3);
|
||||
agHelper.AssertElementVisibility(locators._modal, true, 2);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,11 @@ describe("MultiSelectTree Widget Functionality", function () {
|
|||
// Check if isDirty is set to false
|
||||
cy.get(".t--widget-textwidget").should("contain", "false");
|
||||
// Interact with UI
|
||||
cy.get(formWidgetsPage.treeSelectInput).first().click({ force: true });
|
||||
cy.wait(1000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.treeMultiSelectDropdown("Red");
|
||||
// Check if isDirty is set to true
|
||||
cy.get(".t--widget-textwidget").should("contain", "true");
|
||||
|
|
@ -42,7 +46,11 @@ describe("MultiSelectTree Widget Functionality", function () {
|
|||
.first()
|
||||
.should("have.text", "Red");
|
||||
// Clear the selected value
|
||||
cy.get(formWidgetsPage.treeSelectInput).first().click({ force: true });
|
||||
cy.wait(1000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.treeMultiSelectDropdown("Red");
|
||||
});
|
||||
|
||||
|
|
@ -51,8 +59,11 @@ describe("MultiSelectTree Widget Functionality", function () {
|
|||
// search for option Red in the search input
|
||||
cy.openPropertyPane("multiselecttreewidget");
|
||||
cy.testJsontext("defaultselectedvalues", "");
|
||||
cy.wait(2000);
|
||||
cy.get(formWidgetsPage.treeSelectInput).first().click({ force: true });
|
||||
cy.wait(2000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(formWidgetsPage.multiTreeSelectFilterInput)
|
||||
.click({ force: true })
|
||||
.type("Green");
|
||||
|
|
@ -64,7 +75,11 @@ describe("MultiSelectTree Widget Functionality", function () {
|
|||
.first()
|
||||
.should("have.text", "Green");
|
||||
// Reopen the multi-tree select widget
|
||||
cy.get(formWidgetsPage.treeSelectInput).first().click({ force: true });
|
||||
cy.wait(1000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
// Assert if the search input is empty now
|
||||
cy.get(formWidgetsPage.multiTreeSelectFilterInput)
|
||||
.invoke("val")
|
||||
|
|
@ -74,7 +89,11 @@ describe("MultiSelectTree Widget Functionality", function () {
|
|||
});
|
||||
|
||||
it("4. To Validate Options", function () {
|
||||
cy.get(formWidgetsPage.treeSelectInput).first().click({ force: true });
|
||||
cy.wait(1000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(formWidgetsPage.multiTreeSelectFilterInput).click().type("light");
|
||||
cy.treeMultiSelectDropdown("Light Blue");
|
||||
});
|
||||
|
|
@ -99,7 +118,11 @@ describe("MultiSelectTree Widget Functionality", function () {
|
|||
});
|
||||
|
||||
it("7. To Check Option Not Found", function () {
|
||||
cy.get(formWidgetsPage.treeSelectInput).first().click({ force: true });
|
||||
cy.wait(1000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(formWidgetsPage.multiTreeSelectFilterInput).click().type("ABCD");
|
||||
cy.get(".tree-multiselect-dropdown .rc-tree-select-empty").contains(
|
||||
"No Results Found",
|
||||
|
|
|
|||
|
|
@ -15,15 +15,11 @@ describe("Select Widget", () => {
|
|||
featureFlagIntercept({
|
||||
license_widget_rtl_support_enabled: false,
|
||||
});
|
||||
|
||||
agHelper.AssertElementAbsence(".t--property-control-enablertl");
|
||||
|
||||
featureFlagIntercept({
|
||||
license_widget_rtl_support_enabled: true,
|
||||
});
|
||||
|
||||
agHelper.RefreshPage();
|
||||
|
||||
agHelper.Sleep(2000);
|
||||
|
||||
agHelper.AssertElementExist(".t--property-control-enablertl");
|
||||
|
|
|
|||
|
|
@ -169,8 +169,10 @@ describe("Category Slider spec", () => {
|
|||
agHelper.RemoveCharsNType(propPane._placeholderValue, -1, "xxl", 5);
|
||||
// Verify option added
|
||||
agHelper.AssertElementLength(propPane._placeholderName, len + 1);
|
||||
agHelper.Sleep(); // Wait for the element to settle to delete it
|
||||
// Delete option
|
||||
agHelper.GetNClick(propPane._optionsDeleteButton, 5);
|
||||
agHelper.GetNClick(propPane._optionsDeleteButton, 5, true);
|
||||
agHelper.Sleep(); // Wait for the element to be deleted
|
||||
// Verify option deleted
|
||||
agHelper.AssertElementLength(propPane._placeholderName, len);
|
||||
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ describe("Number Slider spec", () => {
|
|||
.type("{rightArrow}")
|
||||
.type("{upArrow}");
|
||||
|
||||
agHelper.Sleep(200);
|
||||
agHelper.Sleep();
|
||||
|
||||
agHelper
|
||||
.GetText(getWidgetSelector(draggableWidgets.TEXT))
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ describe("Table widget v2 edge case scenario testing", function () {
|
|||
|
||||
//Check the value present in the textfield which is selectedRowIndices is []
|
||||
cy.get(`${widgetsPage.textWidget} .bp3-ui-text`).should("have.text", "[]");
|
||||
cy.wait(1000);
|
||||
|
||||
//Select the 1st, 2nd and 3rd row
|
||||
table.SelectTableRow(0, 0, true, "v2");
|
||||
|
|
|
|||
|
|
@ -5,13 +5,19 @@ describe("MultiSelect, Tree Select and Multi Tree Select Widget Empty Options Fu
|
|||
_.agHelper.AddDsl("SelectDslWithEmptyOptions");
|
||||
});
|
||||
it("1. To Check empty options for Multi Select Tree Widget", () => {
|
||||
cy.get(formWidgetsPage.treeSelectInput).first().click({ force: true });
|
||||
cy.wait(1000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(".rc-tree-select-empty").should("have.text", "No Results Found");
|
||||
|
||||
//To Check empty options for Single Select Tree Widget"
|
||||
cy.get(formWidgetsPage.treeSelectInput)
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500)
|
||||
.get(".single-tree-select-dropdown .rc-tree-select-empty")
|
||||
.should("have.text", "No Results Found");
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,11 @@ describe("Single Select Widget Functionality", function () {
|
|||
// Check if isDirty is reset to false
|
||||
cy.get(".t--widget-textwidget").should("contain", "false");
|
||||
// Interact with UI
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(1000)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput).click().type("light");
|
||||
cy.treeSelectDropdown("Light Blue");
|
||||
// Check if isDirty is set to true
|
||||
|
|
@ -50,14 +54,22 @@ describe("Single Select Widget Functionality", function () {
|
|||
});
|
||||
|
||||
it("3. To Validate Options", function () {
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput).click().type("light");
|
||||
cy.treeSelectDropdown("Light Blue");
|
||||
});
|
||||
|
||||
it("4. Clears the search field when widget is closed", () => {
|
||||
// Open the widget
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
// Search for Green option in the search input
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput).click().type("Green");
|
||||
// Select the Green Option
|
||||
|
|
@ -68,7 +80,11 @@ describe("Single Select Widget Functionality", function () {
|
|||
.first()
|
||||
.should("have.text", "Green");
|
||||
// Reopen the widget
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
// Assert the search input is cleared
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput)
|
||||
.invoke("val")
|
||||
|
|
@ -95,7 +111,11 @@ describe("Single Select Widget Functionality", function () {
|
|||
});
|
||||
|
||||
it("7. To Check Option Not Found", function () {
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput).click().type("ABCD");
|
||||
cy.get(".tree-select-dropdown .rc-tree-select-empty").contains(
|
||||
"No Results Found",
|
||||
|
|
@ -137,7 +157,11 @@ describe("Single Select Widget Functionality", function () {
|
|||
// Add a message to alert event in onOptionChange
|
||||
cy.testJsontext("onoptionchange", `{{showAlert('Option Changed')}}`);
|
||||
// Open the widget
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
// Search for Green option in the search input
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput).click().type("Green");
|
||||
// Select the Green Option
|
||||
|
|
@ -147,7 +171,11 @@ describe("Single Select Widget Functionality", function () {
|
|||
// Validate the toast message
|
||||
cy.validateToastMessage("Option Changed");
|
||||
// Open the widget
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
// Search for Green option (selecting same option) in the search input
|
||||
cy.get(formWidgetsPage.treeSelectFilterInput).click().type("Green");
|
||||
// Select the Green Option
|
||||
|
|
|
|||
|
|
@ -32,7 +32,11 @@ describe("Tree Select Widget", function () {
|
|||
.invoke("val")
|
||||
.should("be.empty");
|
||||
// click on the widget
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
// select Green option
|
||||
cy.treeSelectDropdown("Green");
|
||||
// again click on cancel icon in the widget
|
||||
|
|
@ -56,7 +60,11 @@ describe("Tree Select Widget", function () {
|
|||
.find(".rc-tree-select-clear")
|
||||
.should("not.exist");
|
||||
// click on the widget again
|
||||
cy.get(formWidgetsPage.treeSelectInput).last().click({ force: true });
|
||||
cy.wait(500)
|
||||
.get(formWidgetsPage.treeSelectInput)
|
||||
.last()
|
||||
.click({ force: true })
|
||||
.wait(500);
|
||||
// select Green option
|
||||
cy.treeSelectDropdown("Green");
|
||||
// assert if the widget input value is Green
|
||||
|
|
|
|||
|
|
@ -407,6 +407,7 @@ describe("JS Function Execution", function () {
|
|||
assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA);
|
||||
|
||||
agHelper.RefreshPage();
|
||||
agHelper.Sleep(2000); //for confirmatiom modal to appear before clicking on "Yes" button for CI runs
|
||||
// click "Yes" button for all onPageload && ConfirmExecute functions
|
||||
for (let i = 0; i <= onPageLoadAndConfirmExecuteFunctionsLength - 1; i++) {
|
||||
//agHelper.AssertElementPresence(jsEditor._dialog("Confirmation Dialog")); // Not working in edit mode
|
||||
|
|
|
|||
|
|
@ -76,10 +76,11 @@ describe("MySQL Datatype tests", function () {
|
|||
});
|
||||
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(2000);
|
||||
agHelper.Sleep(3000);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@ export const featureFlagIntercept = (
|
|||
cy.intercept("GET", "/api/v1/users/features", response);
|
||||
if (reload) {
|
||||
cy.reload();
|
||||
cy.wait(2000); //for the page to re-load finish for CI runs
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1089,6 +1089,9 @@ export class AggregateHelper extends ReusableHelper {
|
|||
win.location.href = url;
|
||||
});
|
||||
});
|
||||
this.AssertElementAbsence(
|
||||
this.locator._specificToast("Cannot read properties of undefined"),
|
||||
);
|
||||
this.assertHelper.AssertDocumentReady();
|
||||
this.Sleep(4000); //for page to load for CI runs
|
||||
networkCallAlias &&
|
||||
|
|
|
|||
|
|
@ -455,9 +455,11 @@ export class EntityExplorer {
|
|||
action: "Edit name",
|
||||
});
|
||||
else cy.xpath(this._entityNameInExplorer(entityName)).dblclick();
|
||||
cy.xpath(this.locator._entityNameEditing(entityName)).type(
|
||||
renameVal + "{enter}",
|
||||
);
|
||||
cy.xpath(this.locator._entityNameEditing(entityName))
|
||||
.type(renameVal)
|
||||
.wait(500)
|
||||
.type("{enter}")
|
||||
.wait(300);
|
||||
this.AssertEntityPresenceInExplorer(renameVal);
|
||||
this.agHelper.Sleep(); //allowing time for name change to reflect in EntityExplorer
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ export class InviteModal {
|
|||
private embedSettings = ObjectsRegistry.EmbedSettings;
|
||||
private deployMode = ObjectsRegistry.DeployMode;
|
||||
private commonLocators = ObjectsRegistry.CommonLocators;
|
||||
private assertHelper = ObjectsRegistry.AssertHelper;
|
||||
|
||||
public locators = {
|
||||
_inviteTab: "[data-testid='t--tab-INVITE']",
|
||||
|
|
@ -85,7 +86,11 @@ export class InviteModal {
|
|||
toggle,
|
||||
toggle == "On" ? false : true,
|
||||
);
|
||||
cy.get(this.locators._previewEmbed).invoke("removeAttr", "target").click();
|
||||
cy.get(this.locators._previewEmbed)
|
||||
.invoke("removeAttr", "target")
|
||||
.click()
|
||||
.wait(2000);
|
||||
this.assertHelper.AssertDocumentReady();
|
||||
this.agHelper.Sleep(3000); //for page to load
|
||||
if (toggle == "On") {
|
||||
this.deployMode.NavigateBacktoEditor(); //Also verifies that navigation bar is present
|
||||
|
|
|
|||
|
|
@ -148,16 +148,16 @@ export class JSEditor {
|
|||
|
||||
public CreateJSObject(
|
||||
JSCode: string,
|
||||
options: ICreateJSObjectOptions = DEFAULT_CREATE_JS_OBJECT_OPTIONS,
|
||||
options: Partial<ICreateJSObjectOptions> = {},
|
||||
) {
|
||||
const {
|
||||
completeReplace,
|
||||
lineNumber = 4,
|
||||
lineNumber,
|
||||
paste,
|
||||
prettify = true,
|
||||
prettify,
|
||||
shouldCreateNewJSObj,
|
||||
toRun,
|
||||
} = options;
|
||||
} = { ...DEFAULT_CREATE_JS_OBJECT_OPTIONS, ...options };
|
||||
|
||||
shouldCreateNewJSObj && this.NavigateToNewJSEditor();
|
||||
if (!completeReplace) {
|
||||
|
|
|
|||
|
|
@ -1309,7 +1309,7 @@ Cypress.Commands.add("ValidatePaginateResponseUrlData", (runTestCss) => {
|
|||
cy.isSelectRow(0);
|
||||
cy.readTabledata("0", "5").then((tabData) => {
|
||||
const tableData = tabData;
|
||||
expect(tableData).to.equal(valueToTest);
|
||||
expect(valueToTest).contains(tableData);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user