test: Cypress | Flaky fix (#25179)

## Description
- This PR fixes the below flaky tests
     - BugTests/AllWidgets_Reset_Spec.ts
     - BugTests/InputTruncateCheck_Spec.ts
- BugTests/CatchBlock_Spec.ts (external api replace with TED
v1/mock-http-codes/404 api)
     - Datasources/Airtable_Basic_Spec.ts
     - Onboarding/FirstTimeUserOnboarding_spec.js
     - Autocomplete/JS_AC_spec.ts - split!
     - GenerateCRUD specs - added assertion
     - ci-test-limit - comit message update for workflow & comment run

#### 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:
Aishwarya-U-R 2023-07-07 23:28:16 +05:30 committed by GitHub
parent 9f59b59495
commit 7846907416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 247 additions and 257 deletions

View File

@ -269,7 +269,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=TestLimit run on PR# ${{ inputs.pr }} >> $GITHUB_ENV
echo COMMIT_INFO_MESSAGE=LimitedTests run on PR# ${{ inputs.pr }} >> $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
@ -292,8 +292,10 @@ jobs:
env:
EVENT_COMMITS: ${{ toJson(github.event.commits[0].message) }}
run: |
if [[ ${{ inputs.pr }} -ne 0 ]]; then
if [[ ${{ inputs.pr }} -ne 0 && ${{github.event_name}} == 'repository_dispatch' ]]; then
echo "COMMIT_INFO_MESSAGE=${{ env.COMMIT_INFO_MESSAGE }}" >> $GITHUB_ENV
elif [[ ${{ inputs.pr }} -ne 0 && ${{github.event_name}} == 'workflow_dispatch' ]]; then
echo "COMMIT_INFO_MESSAGE=Workflow run on PR# ${{ inputs.pr }}" >> $GITHUB_ENV
else
echo "COMMIT_INFO_MESSAGE=$(echo \"${{ env.EVENT_COMMITS }}\" | awk -F '\\\\n' '{print $1}' | sed 's/^\"//')" >> $GITHUB_ENV
fi

View File

@ -308,166 +308,4 @@ describe("Autocomplete tests", () => {
agHelper.TypeText(locators._codeMirrorTextArea, ".");
agHelper.GetNAssertElementText(locators._hints, "geolocation");
});
it("9. Bug #17059 Autocomplete does not suggest same function name that belongs to a different object", () => {
// create js object - JSObject1
jsEditor.CreateJSObject(jsObjectBody, {
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
});
// create js object - JSObject2
jsEditor.CreateJSObject(jsObjectBody, {
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
});
agHelper.GetNClick(jsEditor._lineinJsEditor(5));
agHelper.TypeText(locators._codeMirrorTextArea, "JSObject1.");
agHelper.GetNAssertElementText(
locators._hints,
"myFun1.data",
"have.text",
0,
);
agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4);
// Same check in JSObject1
entityExplorer.SelectEntityByName("JSObject1", "Queries/JS");
agHelper.GetNClick(jsEditor._lineinJsEditor(5));
agHelper.TypeText(locators._codeMirrorTextArea, "JSObject2");
agHelper.Sleep(500);
agHelper.TypeText(locators._codeMirrorTextArea, ".");
agHelper.GetNAssertElementText(
locators._hints,
"myFun1.data",
"have.text",
0,
);
agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4);
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "JSObject1",
action: "Delete",
entityType: entityItems.JSObject,
});
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "JSObject2",
action: "Delete",
entityType: entityItems.JSObject,
});
});
it("10. Bug #10115 Autocomplete needs to show async await keywords instead of showing 'no suggestions'", () => {
// create js object
jsEditor.CreateJSObject(jsObjectBody, {
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
});
agHelper.GetNClick(jsEditor._lineinJsEditor(5));
agHelper.TypeText(locators._codeMirrorTextArea, "aw");
agHelper.GetNAssertElementText(locators._hints, "await", "have.text", 0);
agHelper.RemoveCharsNType(locators._codeMirrorTextArea, 2, "as");
agHelper.GetNAssertElementText(locators._hints, "async", "have.text", 0);
cy.get("@jsObjName").then((jsObjName) => {
jsName = jsObjName;
entityExplorer.SelectEntityByName(jsName as string, "Queries/JS");
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: jsName as string,
action: "Delete",
entityType: entityItems.JSObject,
});
});
});
it("10. Bug #15429 Random keystrokes trigger autocomplete to show up", () => {
// create js object
jsEditor.CreateJSObject(
`export default
myFunc1() {
showAlert("Hello world");
}
}`,
{
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
},
);
//Paste the code and assert that the hints are not present
jsEditor.CreateJSObject(`const x = "Hello world;"`, {
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: false,
prettify: false,
});
agHelper.AssertElementAbsence(locators._hints);
//Paste the code and assert that the hints are not present
jsEditor.CreateJSObject(
`export default
myFunc1() {
showAlert("Hello world");
}
}`,
{
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: false,
prettify: false,
},
);
agHelper.AssertElementAbsence(locators._hints);
agHelper.GetElement(jsEditor._lineinJsEditor(4)).click();
//Assert that hints are not present inside the string
agHelper.TypeText(locators._codeMirrorTextArea, `const x = "`);
agHelper.AssertElementAbsence(locators._hints);
agHelper.SelectNRemoveLineText(jsEditor._lineinJsEditor(4));
//Assert that hints are not present when line is cleared with backspace
agHelper.AssertElementAbsence(locators._hints);
//Assert that hints are not present when token is a comment
agHelper.TypeText(locators._codeMirrorTextArea, "// showA'");
agHelper.AssertElementAbsence(locators._hints);
cy.get("@jsObjName").then((jsObjName) => {
jsName = jsObjName;
entityExplorer.SelectEntityByName(jsName as string, "Queries/JS");
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: jsName as string,
action: "Delete",
entityType: entityItems.JSObject,
});
});
});
});

View File

@ -0,0 +1,175 @@
import {
agHelper,
entityExplorer,
entityItems,
jsEditor,
locators,
} from "../../../../support/Objects/ObjectsCore";
let jsName: any;
const jsObjectBody = `export default {
myVar1: [],
myVar2: {},
myFun1(){
},
myFun2: async () => {
//use async-await or promises
}
}`;
describe("Autocomplete tests", () => {
it("1. Bug #17059 Autocomplete does not suggest same function name that belongs to a different object", () => {
// create js object - JSObject1
jsEditor.CreateJSObject(jsObjectBody, {
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
});
// create js object - JSObject2
jsEditor.CreateJSObject(jsObjectBody, {
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
});
agHelper.GetNClick(jsEditor._lineinJsEditor(5));
agHelper.TypeText(locators._codeMirrorTextArea, "JSObject1.");
agHelper.GetNAssertElementText(
locators._hints,
"myFun1.data",
"have.text",
0,
);
agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4);
// Same check in JSObject1
entityExplorer.SelectEntityByName("JSObject1", "Queries/JS");
agHelper.GetNClick(jsEditor._lineinJsEditor(5));
agHelper.TypeText(locators._codeMirrorTextArea, "JSObject2");
agHelper.Sleep(500);
agHelper.TypeText(locators._codeMirrorTextArea, ".");
agHelper.GetNAssertElementText(
locators._hints,
"myFun1.data",
"have.text",
0,
);
agHelper.GetNAssertElementText(locators._hints, "myFun1()", "have.text", 4);
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "JSObject1",
action: "Delete",
entityType: entityItems.JSObject,
});
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "JSObject2",
action: "Delete",
entityType: entityItems.JSObject,
});
});
it("2. Bug #10115 Autocomplete needs to show async await keywords instead of showing 'no suggestions'", () => {
// create js object
jsEditor.CreateJSObject(jsObjectBody, {
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
});
agHelper.GetNClick(jsEditor._lineinJsEditor(5));
agHelper.TypeText(locators._codeMirrorTextArea, "aw");
agHelper.GetNAssertElementText(locators._hints, "await", "have.text", 0);
agHelper.RemoveCharsNType(locators._codeMirrorTextArea, 2, "as");
agHelper.GetNAssertElementText(locators._hints, "async", "have.text", 0);
cy.get("@jsObjName").then((jsObjName) => {
jsName = jsObjName;
entityExplorer.SelectEntityByName(jsName as string, "Queries/JS");
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: jsName as string,
action: "Delete",
entityType: entityItems.JSObject,
});
});
});
it("3. Bug #15429 Random keystrokes trigger autocomplete to show up", () => {
// create js object & assert no hints just show up
jsEditor.CreateJSObject(
`export default
myFunc1() {
showAlert("Hello world");
}
}`,
{
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
prettify: false,
},
);
agHelper.AssertElementAbsence(locators._hints);
//Paste the code and assert that the hints are not present
jsEditor.CreateJSObject(
`export default
myFunc1() {
showAlert("Hello world");
}
}`,
{
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: false,
prettify: false,
},
);
agHelper.AssertElementAbsence(locators._hints);
agHelper.GetElement(jsEditor._lineinJsEditor(4)).click();
agHelper.WaitUntilAllToastsDisappear();
//Assert that hints are not present inside the string
agHelper.TypeText(locators._codeMirrorTextArea, `const x = "`);
agHelper.AssertElementAbsence(locators._hints);
agHelper.SelectNRemoveLineText(jsEditor._lineinJsEditor(4));
//Assert that hints are not present when line is cleared with backspace
agHelper.AssertElementAbsence(locators._hints);
//Assert that hints are not present when token is a comment
agHelper.TypeText(locators._codeMirrorTextArea, "// showA'");
agHelper.AssertElementAbsence(locators._hints);
cy.get("@jsObjName").then((jsObjName) => {
jsName = jsObjName;
entityExplorer.SelectEntityByName(jsName as string, "Queries/JS");
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: jsName as string,
action: "Delete",
entityType: entityItems.JSObject,
});
});
});
});

View File

@ -4,11 +4,12 @@ import {
apiPage,
entityExplorer,
entityItems,
hostPort,
} from "../../../../support/Objects/ObjectsCore";
describe("Bug #15372 Catch block was not triggering in Safari/firefox", () => {
it("1. Triggers the catch block when the API hits a 404", () => {
apiPage.CreateAndFillApi("https://swapi.dev/api/people/18261826");
apiPage.CreateAndFillApi(hostPort.mockHttpCodeUrl + "404");
jsEditor.CreateJSObject(
`export default {
fun: async () => {

View File

@ -2,10 +2,18 @@ import {
PROPERTY_SELECTOR,
getWidgetSelector,
} from "../../../../locators/WidgetLocators";
import * as _ from "../../../../support/Objects/ObjectsCore";
import {
agHelper,
locators,
entityExplorer,
propPane,
apiPage,
draggableWidgets,
fakerHelper,
} from "../../../../support/Objects/ObjectsCore";
const widgetsToTest = {
[_.draggableWidgets.INPUT_V2]: {
[draggableWidgets.INPUT_V2]: {
testCases: [
{ input: "test", charToClear: 0 },
{ input: "12", charToClear: 0 },
@ -20,14 +28,14 @@ const widgetsToTest = {
charToClear: 2,
},
{
input: _.fakerHelper.GetRandomText(),
input: fakerHelper.GetRandomText(),
charToClear: -1,
},
],
widgetName: "Input widget",
widgetPrefixName: "Input",
},
[_.draggableWidgets.PHONE_INPUT]: {
[draggableWidgets.PHONE_INPUT]: {
testCases: [
{
input: "9999999999",
@ -42,14 +50,14 @@ const widgetsToTest = {
charToClear: 2,
},
{
input: _.fakerHelper.GetUSPhoneNumber(),
input: fakerHelper.GetUSPhoneNumber(),
charToClear: -1,
},
],
widgetName: "Phone Input widget",
widgetPrefixName: "PhoneInput",
},
[_.draggableWidgets.CURRENCY_INPUT]: {
[draggableWidgets.CURRENCY_INPUT]: {
testCases: [
{ input: "1233", charToClear: 0 },
{
@ -61,7 +69,7 @@ const widgetsToTest = {
charToClear: 2,
},
{
input: _.fakerHelper.GetRandomNumber(),
input: fakerHelper.GetRandomNumber(),
charToClear: -1,
},
],
@ -72,9 +80,9 @@ const widgetsToTest = {
function configureApi() {
cy.fixture("datasources").then((datasourceFormData) => {
_.apiPage.CreateAndFillApi(datasourceFormData["mockApiUrl"], "FirstAPI");
apiPage.CreateAndFillApi(datasourceFormData["mockApiUrl"], "FirstAPI");
});
_.apiPage.EnterHeader("value", "{{this.params.value}}");
apiPage.EnterHeader("value", "{{this.params.value}}");
}
Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => {
@ -83,33 +91,29 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => {
if (index === 0) {
configureApi();
}
_.entityExplorer.PinUnpinEntityExplorer(false);
_.entityExplorer.DragDropWidgetNVerify(widgetSelector, 300, 200);
_.entityExplorer.DragDropWidgetNVerify(
_.draggableWidgets.BUTTON,
400,
400,
);
//_.entityExplorer.SelectEntityByName(_.draggableWidgets.BUTTONNAME("1"));
entityExplorer.PinUnpinEntityExplorer(false);
entityExplorer.DragDropWidgetNVerify(widgetSelector, 300, 200);
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON, 400, 400);
//entityExplorer.SelectEntityByName(draggableWidgets.BUTTONNAME("1"));
// Set onClick action, storing value
_.propPane.EnterJSContext(
propPane.EnterJSContext(
PROPERTY_SELECTOR.onClickFieldName,
`{{storeValue('textPayloadOnSubmit',${testConfig.widgetPrefixName}1.text); FirstAPI.run({ value: ${testConfig.widgetPrefixName}1.text })}}`,
);
_.entityExplorer.DragDropWidgetNVerify(_.draggableWidgets.TEXT, 500, 300);
//_.entityExplorer.SelectEntityByName(_.draggableWidgets.TEXTNAME("1"));
entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 500, 300);
//entityExplorer.SelectEntityByName(draggableWidgets.TEXTNAME("1"));
// Display the bound store value
_.propPane.UpdatePropertyFieldValue(
propPane.UpdatePropertyFieldValue(
PROPERTY_SELECTOR.TextFieldName,
`{{appsmith.store.textPayloadOnSubmit}}`,
);
_.entityExplorer.PinUnpinEntityExplorer(true);
entityExplorer.PinUnpinEntityExplorer(true);
});
it("2. StoreValue should have complete input value", () => {
// if default input widget type is changed from text to any other type then uncomment below code.
// if (widgetSelector === _.draggableWidgets.INPUT_V2) {
// if (widgetSelector === draggableWidgets.INPUT_V2) {
// cy.openPropertyPane(widgetSelector);
// cy.selectDropdownValue(".t--property-control-datatype", "Text");
// cy.get(".t--property-control-required label")
@ -119,7 +123,7 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => {
// }
const inputs = testConfig.testCases;
_.agHelper.ClearInputText("Label");
agHelper.ClearInputText("Label");
inputs.forEach(({ charToClear, input }) => {
// Input text and hit enter key
@ -131,19 +135,19 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => {
// cy.get(getWidgetInputSelector(widgetSelector)).type(`${input}`);
// }
_.agHelper.RemoveCharsNType(
_.locators._widgetInputSelector(widgetSelector),
agHelper.RemoveCharsNType(
locators._widgetInputSelector(widgetSelector),
charToClear,
input,
);
_.agHelper.GetNClick(getWidgetSelector(_.draggableWidgets.BUTTON));
agHelper.GetNClick(getWidgetSelector(draggableWidgets.BUTTON));
_.agHelper
.GetText(_.locators._widgetInputSelector(widgetSelector), "val")
agHelper
.GetText(locators._widgetInputSelector(widgetSelector), "val")
.then(($expected: any) => {
// Assert if the Currency widget has random number with trailing zero, then
// if (widgetSelector === _.draggableWidgets.CURRENCY_INPUT) {
// cy.get(getWidgetSelector(_.draggableWidgets.TEXT)).should(
// if (widgetSelector === draggableWidgets.CURRENCY_INPUT) {
// cy.get(getWidgetSelector(draggableWidgets.TEXT)).should(
// "have.text",
// expected == null
// ? input
@ -152,9 +156,9 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => {
// .replace(/(^,)|(,$)/g, "")//to remove start & end comma's if any
// : expected,
// );
_.agHelper
.GetText(getWidgetSelector(_.draggableWidgets.TEXT))
agHelper.Sleep(500); //Adding time for CI flakyness in reading Label value
agHelper
.GetText(getWidgetSelector(draggableWidgets.TEXT))
.then(($label) => {
expect($label).to.eq($expected);
});
@ -170,15 +174,15 @@ Object.entries(widgetsToTest).forEach(([widgetSelector, testConfig], index) => {
});
it("3. Delete all the widgets on canvas", () => {
_.agHelper.GetNClick(_.locators._widgetInputSelector(widgetSelector));
_.agHelper.PressDelete();
agHelper.GetNClick(locators._widgetInputSelector(widgetSelector));
agHelper.PressDelete();
_.agHelper.GetNClick(getWidgetSelector(_.draggableWidgets.BUTTON));
_.agHelper.AssertContains("is not defined"); //Since widget is removed & Button is still holding its reference
_.agHelper.PressDelete();
agHelper.GetNClick(getWidgetSelector(draggableWidgets.BUTTON));
agHelper.AssertContains("is not defined"); //Since widget is removed & Button is still holding its reference
agHelper.PressDelete();
_.agHelper.GetNClick(getWidgetSelector(_.draggableWidgets.TEXT)).click();
_.agHelper.GetNClick(_.propPane._deleteWidget);
agHelper.GetNClick(getWidgetSelector(draggableWidgets.TEXT)).click();
agHelper.GetNClick(propPane._deleteWidget);
});
});
});

View File

@ -42,10 +42,10 @@ describe("Fork application with multiple datasources", function () {
homePage.ForkApplication(appname, workspaceId);
});
// In the forked application, reconnect all datasources
dataSources.ReconnectDSbyName("MongoDBUri");
dataSources.ReconnectDSbyName("PostgreSQL");
dataSources.ReconnectDSbyName("MySQL");
dataSources.ReconnectDSbyName("S3");
dataSources.ReconnectDSbyType("MongoDBUri");
dataSources.ReconnectDSbyType("PostgreSQL");
dataSources.ReconnectDSbyType("MySQL");
dataSources.ReconnectDSbyType("S3");
// assert if the datasources are connected as expeced
homePage.AssertNCloseImport();

View File

@ -2,7 +2,6 @@ import * as _ from "../../../../../../support/Objects/ObjectsCore";
const publishPage = require("../../../../../../locators/publishWidgetspage.json");
const commonLocators = require("../../../../../../locators/commonlocators.json");
import widgetsJson from "../../../../../../locators/Widgets.json";
import * as _ from "../../../../../../support/Objects/ObjectsCore";
const tableData = `[
{

View File

@ -98,7 +98,7 @@ describe("Validate Mongo CRUD with JSON Form", () => {
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.GetNClick(dataSources._visibleTextSpan("Got it"));
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp();
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);

View File

@ -180,7 +180,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => {
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.GetNClick(dataSources._visibleTextSpan("Got it"));
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp();
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);

View File

@ -399,7 +399,7 @@ describe("Validate MySQL Generate CRUD with JSON Form", () => {
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.GetNClick(dataSources._visibleTextSpan("Got it"));
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp();
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
table.WaitUntilTableLoad();
//Validating loaded table

View File

@ -132,7 +132,7 @@ describe("Postgres Generate CRUD with JSON Form", () => {
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.GetNClick(dataSources._visibleTextSpan("Got it"));
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp();
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);

View File

@ -95,7 +95,7 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => {
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.GetNClick(dataSources._visibleTextSpan("Got it"));
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp();
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);
@ -652,45 +652,6 @@ describe("Validate Postgres Generate CRUD with JSON Form", () => {
dataSources.DeleteDatasouceFromWinthinDS(dsName, 200);
});
function GenerateCRUDNValidateDeployPage(
col1Text: string,
col2Text: string,
col3Text: string,
jsonFromHeader: string,
) {
agHelper.GetNClick(dataSources._generatePageBtn);
assertHelper.AssertNetworkStatus("@replaceLayoutWithCRUDPage", 201);
agHelper.AssertContains("Successfully generated a page");
//assertHelper.AssertNetworkStatus("@getActions", 200);//Since failing sometimes
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.GetNClick(dataSources._visibleTextSpan("Got it"));
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp();
//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);
table.ReadTableRowColumnData(0, 1, "v1", 4000).then(($cellData) => {
expect($cellData).to.eq(col1Text);
});
table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => {
expect($cellData).to.eq(col2Text);
});
table.ReadTableRowColumnData(0, 4, "v1", 200).then(($cellData) => {
expect($cellData).to.eq(col3Text);
});
//Validating loaded JSON form
cy.xpath(locators._spanButton("Update")).then((selector) => {
cy.wrap(selector)
.invoke("attr", "class")
.then((classes) => {
//cy.log("classes are:" + classes);
expect(classes).not.contain("bp3-disabled");
});
});
dataSources.AssertJSONFormHeader(0, 0, jsonFromHeader);
}
function generateCallsignInfo(rowIndex: number) {
//let callSign: string = "";
table

View File

@ -235,6 +235,8 @@ describe("excludeForAirgap", "Validate Airtable Ds", () => {
inputFieldName: "View",
});
dataSources.RunQuery({ toValidateResponse: false }); //For CI failure!
agHelper.Sleep();
dataSources.RunQuery();
cy.get("@postExecute").then((resObj: any) => {

View File

@ -1 +1,4 @@
# For running all specs - uncomment below:
cypress/e2e/**/**/*
# TO run only limited tests - give the spec names in below format:
#cypress/e2e/Regression/ServerSide/GenerateCRUD/Mongo_Spec.ts

View File

@ -83,6 +83,7 @@ export class DefaultHostPort {
mockApiUrl = "http://host.docker.internal:5001/v1/mock-api?records=10";
echoApiUrl = "http://host.docker.internal:5001/v1/mock-api/echo";
randomCatfactUrl = "http://host.docker.internal:5001/v1/catfact/random";
mockHttpCodeUrl = "http://host.docker.internal:5001/v1/mock-http-codes/";
firestore_database_url = "https://appsmith-22e8b.firebaseio.com";
firestore_projectID = "appsmith-22e8b";

View File

@ -853,7 +853,7 @@ export class DataSources {
this.agHelper.AssertElementVisible(this._testDs); //Making sure modal is fully loaded
}
public ReconnectDSbyName(
public ReconnectDSbyType(
dsName: "PostgreSQL" | "MySQL" | "MongoDB" | "S3" | "MongoDBUri",
) {
this.WaitForReconnectModalToAppear();

View File

@ -16,7 +16,11 @@ export class Onboarding {
.GetElement(OnboardingLocator.checklistConnectionBtn)
.realHover()
.should("have.css", "cursor", "not-allowed");
cy.get(OnboardingLocator.checklistDatasourceBtn).click();
this._aggregateHelper.GetHoverNClick(
OnboardingLocator.checklistDatasourceBtn,
0,
true,
);
this._aggregateHelper.AssertElementVisible(
OnboardingLocator.datasourcePage,
);