Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: table version changed for crud #29457

Merged
merged 37 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8ffbe1b
fix: table version changed for crud
AmanAgarwal041 Dec 8, 2023
1cf36c6
fix: updated test cases to use table v2
AmanAgarwal041 Dec 11, 2023
06cc0c8
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/cr…
AmanAgarwal041 Dec 11, 2023
d176488
fix: merge from release and resolved conflicts
AmanAgarwal041 Dec 12, 2023
b03a110
fix: changed the default version of table
AmanAgarwal041 Dec 12, 2023
50ef2e5
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/cr…
AmanAgarwal041 Dec 13, 2023
a2a1c6d
fix: updated cypress to match table v2 for generate crud
Dec 19, 2023
d7a2c73
Merge branch 'release' into fix/crud-table-version
Dec 19, 2023
8a91736
fix: selected row and delete label issues fixed
Dec 20, 2023
5e10141
fix: formatting removed
Dec 20, 2023
f72c6b0
Merge branch 'release' into fix/crud-table-version
Dec 20, 2023
5cbb108
fix: failing test cases fixed
Dec 20, 2023
5a71982
temp fix to check cypress tests
Dec 25, 2023
58596c6
fix: cypress test fixes
Dec 26, 2023
b93dd07
fix: cypress fixes
Dec 26, 2023
d9d9e71
fix: delete column order fixed
Dec 26, 2023
456926a
Merge branch 'release' into fix/crud-table-version
Dec 26, 2023
1a01f39
fix: cypress fixes
Dec 26, 2023
2866789
fix: postgres2 spec fixed
Dec 27, 2023
e208b6b
Merge branch 'release' into fix/crud-table-version
Dec 27, 2023
121c7c1
fix: button click added support for invoke
AmanAgarwal041 Dec 27, 2023
a5416ce
Merge branch 'fix/crud-table-version' of github.com:appsmithorg/appsm…
AmanAgarwal041 Dec 27, 2023
4e4440d
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/cr…
AmanAgarwal041 Dec 27, 2023
c10d49c
mongo_uri and postgres2 fixed
Dec 27, 2023
e824a15
fix: updated click to invoke for table v2
AmanAgarwal041 Dec 27, 2023
03dbf24
Merge branch 'fix/crud-table-version' of github.com:appsmithorg/appsm…
AmanAgarwal041 Dec 27, 2023
b161f65
fix: updated invoke back to click, select row on next page
AmanAgarwal041 Dec 28, 2023
4b42f0f
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/cr…
AmanAgarwal041 Dec 28, 2023
1ac32b0
fix: updated cypress test case
AmanAgarwal041 Dec 28, 2023
f1c41de
fix: updated cypress test case
AmanAgarwal041 Dec 28, 2023
8868f13
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/cr…
AmanAgarwal041 Dec 28, 2023
499ce8e
fix: commented the failing test case for table v2
AmanAgarwal041 Dec 28, 2023
045724d
fix: skipped the failing test case for table v2
AmanAgarwal041 Dec 29, 2023
aafbd9a
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/cr…
AmanAgarwal041 Dec 29, 2023
caf7406
fix: updated cypress test case
AmanAgarwal041 Dec 29, 2023
be295d2
fix: lint
AmanAgarwal041 Dec 29, 2023
031c59d
Merge branch 'release' of github.com:appsmithorg/appsmith into fix/cr…
AmanAgarwal041 Dec 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions app/client/cypress/e2e/GSheet/Misc_Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,21 @@ describe(
assertHelper.AssertNetworkStatus("@updateLayout", 200);

//deploy the app and verify the table data
deployMode.DeployApp(
locators._widgetInDeployed(draggableWidgets.TABLE_V1),
);
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE));
const data = GSHEET_DATA.filter((item) => item.rowIndex === "0")[0];
table.ReadTableRowColumnData(0, 0, "v1").then((cellData) => {
table.ReadTableRowColumnData(0, 0, "v2").then((cellData) => {
expect(cellData).to.eq(data.uniq_id);
});
table.ReadTableRowColumnData(0, 1, "v1").then((cellData) => {
table.ReadTableRowColumnData(0, 1, "v2").then((cellData) => {
expect(cellData).to.eq(data.japanese_name);
});
table.ReadTableRowColumnData(0, 2, "v1").then((cellData) => {
table.ReadTableRowColumnData(0, 2, "v2").then((cellData) => {
expect(cellData).to.eq(data.currencies);
});
table.ReadTableRowColumnData(0, 3, "v1").then((cellData) => {
table.ReadTableRowColumnData(0, 3, "v2").then((cellData) => {
expect(cellData).to.eq(data.specialChars);
});
table.ReadTableRowColumnData(0, 4, "v1").then((cellData) => {
table.ReadTableRowColumnData(0, 4, "v2").then((cellData) => {
expect(cellData).to.eq(data.product_name);
});

Expand Down Expand Up @@ -203,23 +201,21 @@ describe(
assertHelper.AssertNetworkStatus("@updateLayout", 200);

//deploy the app and verify the table data
deployMode.DeployApp(
locators._widgetInDeployed(draggableWidgets.TABLE_V1),
);
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE));
const data = GSHEET_DATA.filter((item) => item.rowIndex === "1")[0];
table.ReadTableRowColumnData(1, 0, "v1").then((cellData) => {
table.ReadTableRowColumnData(1, 0, "v2").then((cellData) => {
expect(cellData).to.eq(data.uniq_id);
});
table.ReadTableRowColumnData(1, 1, "v1").then((cellData) => {
table.ReadTableRowColumnData(1, 1, "v2").then((cellData) => {
expect(cellData).to.eq(data.japanese_name);
});
table.ReadTableRowColumnData(1, 2, "v1").then((cellData) => {
table.ReadTableRowColumnData(1, 2, "v2").then((cellData) => {
expect(cellData).to.eq(data.currencies);
});
table.ReadTableRowColumnData(1, 3, "v1").then((cellData) => {
table.ReadTableRowColumnData(1, 3, "v2").then((cellData) => {
expect(cellData).to.eq(data.specialChars);
});
table.ReadTableRowColumnData(1, 5, "v1").then((cellData) => {
table.ReadTableRowColumnData(1, 5, "v2").then((cellData) => {
expect(cellData).to.eq(data.manufacturer);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe(
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.ClickButton("Got it");
assertHelper.AssertNetworkStatus("@updateLayout", 200);
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WaitUntilTableLoad function has been updated to include parameters for coordinates and version. Ensure that the new parameters are being used correctly throughout the test suite and that all instances of this function call have been updated accordingly.


//CRUD page 3
PageList.AddNewPage();
Expand All @@ -63,7 +63,7 @@ describe(
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.ClickButton("Got it");
assertHelper.AssertNetworkStatus("@updateLayout", 200);
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
});

it("2. Navigate & Assert toast", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe(
"listingAndReviews Data",
);
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
table.WaitUntilTableLoad(0, 0, "v1");
table.WaitUntilTableLoad(0, 0, "v2");

//Filter & validate table data
table.OpenNFilterTable("_id", "is exactly", "15665837");
Expand All @@ -131,7 +131,7 @@ describe(
"countryFlags Data",
);
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
table.WaitUntilTableLoad(0, 0, "v1");
table.WaitUntilTableLoad(0, 0, "v2");

//Filter & validate table data
table.OpenNFilterTable("Country", "starts with", "Ba");
Expand All @@ -152,7 +152,7 @@ describe(
"public_astronauts Data",
);
agHelper.AssertElementVisibility(locators._widgetByName("data_table"));
table.WaitUntilTableLoad(0, 0, "v1");
table.WaitUntilTableLoad(0, 0, "v2");

//Filter & validate table data
table.OpenNFilterTable("id", "is exactly", "196");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe(
);

deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
//Should not be able to delete ds until app is published again
//coz if app is published & shared then deleting ds may cause issue, So!
dataSources.DeleteDatasourceFromWithinDS(dsName as string, 409);
Expand All @@ -62,34 +62,32 @@ describe(
directInput: false,
inputFieldName: "Query",
});
deployMode.DeployApp(
locators._widgetInDeployed(draggableWidgets.TABLE_V1),
);
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE));
agHelper.GetNAssertElementText(
locators._textWidgetInDeployed,
"mongomart Data",
);
//Validating loaded table
table.SelectTableRow(2);
table.SelectTableRow(2, 0, true, "v2");
agHelper.AssertElementExist(dataSources._selectedRow);
table.ReadTableRowColumnData(2, 0, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(2, 0, "v2", 200).then(($cellData) => {
expect($cellData).to.be.empty;
});
table.ReadTableRowColumnData(2, 6, "v1", 2000).then(($cellData) => {
table.ReadTableRowColumnData(2, 6, "v2", 2000).then(($cellData) => {
expect($cellData).to.eq("WiredTiger T-shirt");
});
table.ReadTableRowColumnData(2, 7, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(2, 7, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Apparel");
});

table.SelectTableRow(8);
table.SelectTableRow(8, 0, true, "v2");
deployMode.ClearJSONFieldValue("Slogan");
deployMode.ClearJSONFieldValue("Category");

agHelper.ClickButton("Update");
agHelper.AssertElementAbsence(locators._toastMsg); //Validating fix for Bug 14063
for (let i = 7; i <= 8; i++) {
table.ReadTableRowColumnData(8, i, "v1").then(($cellData) => {
table.ReadTableRowColumnData(8, i, "v2").then(($cellData) => {
expect($cellData).to.be.empty;
});
}
Expand All @@ -103,12 +101,12 @@ describe(

agHelper.ClickButton("Update");
agHelper.AssertElementAbsence(locators._toastMsg); //Validating fix for Bug 14063
table.ReadTableRowColumnData(8, 8, "v1", 2000).then(($cellData) => {
table.ReadTableRowColumnData(8, 8, "v2", 2000).then(($cellData) => {
expect($cellData).to.eq(
"Write Your Story with Elegance: The Pen of Choice!",
);
});
table.ReadTableRowColumnData(8, 5, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(8, 5, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("3");
});
});
Expand All @@ -128,7 +126,7 @@ describe(
);
agHelper.ClickButton("Submit");
for (let i = 0; i <= 1; i++) {
table.ReadTableRowColumnData(i, 6, "v1").then(($cellData) => {
table.ReadTableRowColumnData(i, 6, "v2").then(($cellData) => {
expect($cellData).contains("Coffee Mug");
});
}
Expand All @@ -145,10 +143,10 @@ describe(
agHelper.ClickButton("Confirm");
assertHelper.AssertNetworkStatus("@postExecute", 200);
assertHelper.AssertNetworkStatus("@postExecute", 200);
table.ReadTableRowColumnData(0, 6, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(0, 6, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Coffee Mug");
});
table.ReadTableRowColumnData(1, 6, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(1, 6, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Track Jacket");
});
});
Expand All @@ -157,15 +155,15 @@ describe(
table.SearchTable("Swag");
agHelper.Sleep(2500); //for search to load
for (let i = 0; i <= 1; i++) {
table.ReadTableRowColumnData(i, 6, "v1").then(($cellData) => {
table.ReadTableRowColumnData(i, 6, "v2").then(($cellData) => {
expect($cellData).to.eq("Swag");
});
}
table.ResetSearch();

table.OpenNFilterTable("title", "contains", "USB");
for (let i = 0; i < 3; i++) {
table.ReadTableRowColumnData(i, 6, "v1").then(($cellData) => {
table.ReadTableRowColumnData(i, 5, "v2").then(($cellData) => {
expect($cellData).contains("USB");
});
}
Expand All @@ -184,7 +182,7 @@ describe(
});

it("6. Suggested Widget - Table", () => {
table.SelectTableRow(8);
table.SelectTableRow(8, 0, true, "v2");
agHelper.GetNClick(
deployMode._jsonFormNumberFieldByName("Stars", "down"),
); //2
Expand All @@ -197,7 +195,7 @@ describe(
agHelper.ClickButton("Update");

deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
PageList.AddNewPage();
dataSources.CreateQueryForDS(dsName);
dataSources.ValidateNSelectDropdown("Collection", "", "mongomart");
Expand All @@ -224,17 +222,17 @@ function GenerateCRUDNValidateDeployPage(
agHelper.ClickButton("Got it");
assertHelper.AssertNetworkStatus("@updateLayout", 200);
appSettings.OpenPaneAndChangeTheme("Pacific");
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE));

//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);
table.ReadTableRowColumnData(0, 1, "v1", 2000).then(($cellData) => {
table.ReadTableRowColumnData(0, 1, "v2", 2000).then(($cellData) => {
expect($cellData).to.eq(col1Text);
});
table.ReadTableRowColumnData(0, 6, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(0, 6, "v2", 200).then(($cellData) => {
expect($cellData).to.eq(col6Text);
});
table.ReadTableRowColumnData(0, 7, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(0, 7, "v2", 200).then(($cellData) => {
expect($cellData).to.eq(col7Text);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
assertHelper,
dataSources,
deployMode,
draggableWidgets,
entityExplorer,
entityItems,
locators,
Expand Down Expand Up @@ -49,7 +50,7 @@ describe(
);

deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WaitUntilTableLoad function call has been updated to include the "v2" parameter. Confirm that this change is consistent with the new table widget versioning and that all relevant test cases have been updated.


//Delete the test data
entityExplorer.ActionContextMenuByEntityName({
Expand All @@ -75,7 +76,7 @@ describe(
agHelper.GetNClickByContains(dataSources._dropdownOption, "coffeeCafe");
GenerateCRUDNValidateDeployPage("", "", "Washington, US", 11);
deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad(1, 0);
table.WaitUntilTableLoad(1, 0, "v2");
//Delete the test data
PageLeftPane.expandCollapseItem("Pages");
entityExplorer.ActionContextMenuByEntityName({
Expand Down Expand Up @@ -103,17 +104,17 @@ describe(
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.ClickButton("Got it");
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE));

//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);
table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
table.ReadTableRowColumnData(0, 0, "v2", 2000).then(($cellData) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ReadTableRowColumnData function call has been updated to use "v2" as the version parameter. Confirm that this change is consistent with the new table widget versioning and that all relevant test cases have been updated.

expect($cellData).to.eq(col1Text);
});
table.ReadTableRowColumnData(0, 3, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(0, 3, "v2", 200).then(($cellData) => {
expect($cellData).to.eq(col2Text);
});
table.ReadTableRowColumnData(0, 6, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(0, 6, "v2", 200).then(($cellData) => {
expect($cellData).to.eq(col3Text);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
assertHelper,
dataSources,
deployMode,
draggableWidgets,
entityExplorer,
entityItems,
homePage,
Comment on lines 3 to 9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [111-111]

The ReadTableRowColumnData function call has been updated to use "v2" as the version parameter. Confirm that this change is consistent with the new table widget versioning and that all relevant test cases have been updated.

Expand Down Expand Up @@ -58,7 +59,7 @@ describe(
GenerateCRUDNValidateDeployPage("ABW", "Aruba", "North America", "Code");

deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WaitUntilTableLoad function call has been updated to include the "v2" parameter. Confirm that this change is consistent with the new table widget versioning and that all relevant test cases have been updated.

//Delete the test data
PageLeftPane.expandCollapseItem("Pages");
entityExplorer.ActionContextMenuByEntityName({
Expand Down Expand Up @@ -127,7 +128,7 @@ describe(
);

deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
//Delete the test data
PageLeftPane.expandCollapseItem("Pages");
entityExplorer.ActionContextMenuByEntityName({
Expand Down Expand Up @@ -191,29 +192,29 @@ describe(
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.ClickButton("Got it");
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE));

//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);
table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
table.ReadTableRowColumnData(0, 0, "v2", 2000).then(($cellData) => {
expect($cellData).to.eq("Classic Cars");
});
table.ReadTableRowColumnData(1, 0, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(1, 0, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Motorcycles");
});
table.ReadTableRowColumnData(2, 0, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(2, 0, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Planes");
});
table.ReadTableRowColumnData(3, 0, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(3, 0, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Ships");
});
table.ReadTableRowColumnData(4, 0, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(4, 0, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Trains");
});
table.ReadTableRowColumnData(5, 0, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(5, 0, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Trucks and Buses");
});
table.ReadTableRowColumnData(6, 0, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(6, 0, "v2", 200).then(($cellData) => {
expect($cellData).to.eq("Vintage Cars");
});
//Validating loaded JSON form
Expand Down Expand Up @@ -273,7 +274,7 @@ describe(

it("8. Validate Deletion of the Newly Created Page - Productlines", () => {
deployMode.NavigateBacktoEditor();
table.WaitUntilTableLoad();
table.WaitUntilTableLoad(0, 0, "v2");
//Delete the test data
entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "Productlines",
Expand Down Expand Up @@ -327,18 +328,18 @@ describe(
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.ClickButton("Got it");
assertHelper.AssertNetworkStatus("@updateLayout", 200);
deployMode.DeployApp(locators._widgetInDeployed("tablewidget"));
table.WaitUntilTableLoad();
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.TABLE));
table.WaitUntilTableLoad(0, 0, "v2");

//Validating loaded table
agHelper.AssertElementExist(dataSources._selectedRow);
table.ReadTableRowColumnData(0, 0, "v1", 2000).then(($cellData) => {
table.ReadTableRowColumnData(0, 0, "v2", 2000).then(($cellData) => {
expect($cellData).to.eq(col1Text);
});
table.ReadTableRowColumnData(0, 1, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(0, 1, "v2", 200).then(($cellData) => {
expect($cellData).to.eq(col2Text);
});
table.ReadTableRowColumnData(0, 2, "v1", 200).then(($cellData) => {
table.ReadTableRowColumnData(0, 2, "v2", 200).then(($cellData) => {
expect($cellData).to.eq(col3Text);
});

Expand Down
Loading
Loading