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

feat: remove generate new page button from datasource preview pages #38182

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cd049dd
feat: remove generate page button from datasource view mode schema
jacquesikot Dec 16, 2024
39e8ec5
feat: remove generatePageButton from DSFormHeader
jacquesikot Dec 16, 2024
2aa42e7
feat: remove releaseDragDropBuildingBlocks from dependant of shouldSh…
jacquesikot Dec 16, 2024
c0cd8f3
feat: remove generatePage folder
jacquesikot Dec 17, 2024
9cd7130
Revert "feat: remove generatePage folder"
jacquesikot Dec 17, 2024
5babacb
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Dec 17, 2024
9c9a0b1
feat: remove generate CRUD from active DS for mongo
jacquesikot Dec 17, 2024
30c7d42
feat: remove generate new page tests for mysql test
jacquesikot Dec 17, 2024
11a3c0c
feat: remove mysql generate page crud tests from mysql2
jacquesikot Dec 17, 2024
dfd5503
feat: remove redundant test cases from Postgres1_Spec
jacquesikot Dec 17, 2024
2fb70d7
feat: remove redundant test cases from Postgres2_Spec
jacquesikot Dec 17, 2024
4534f65
feat: remove redundant cypress tests from S3_Spec
jacquesikot Dec 17, 2024
137db4c
feat: remove redundant cypress test from Mongo1_spec
jacquesikot Dec 17, 2024
6c82643
feat: remove redundant cypress tests from S3_1_spec
jacquesikot Dec 17, 2024
b62f6f4
feat: remove redundant imports
jacquesikot Dec 17, 2024
4c44b14
feat: remove redundant cypress tests from S3_2_spec.ts
jacquesikot Dec 17, 2024
39f5d1f
feat: remove redundant cypress tests from QueryPane_Postgres_Spec.js
jacquesikot Dec 17, 2024
645de9f
feat: remove redundant cypress tests from Querypane_Mongo_Spec.js
jacquesikot Dec 17, 2024
0e823ab
feat: remove redundant import
jacquesikot Dec 17, 2024
d81112d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Dec 18, 2024
0c81fa8
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Dec 19, 2024
40b2557
feat: fix delete datasource in S3_2_spec.ts
jacquesikot Dec 19, 2024
d1aeda9
feat: remove redundant unit test for GeneratePageButton
jacquesikot Dec 20, 2024
1842e76
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Dec 31, 2024
fdd745d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 3, 2025
d9c5dcf
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 6, 2025
7be89cc
feat: remove redundant verify queries test from JSObject_Tests_spec
jacquesikot Jan 7, 2025
03a012b
feat: comment out test not remove
jacquesikot Jan 8, 2025
cc4bac6
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 8, 2025
22ef934
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 9, 2025
c13934c
feat: remove server side generate CRUD tests
jacquesikot Jan 9, 2025
efe8168
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 9, 2025
c429bda
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 10, 2025
a2f03a3
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 11, 2025
9e4cfaf
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
jacquesikot Jan 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -236,45 +236,46 @@ describe("Validate JSObj", {}, () => {
debuggerHelper.DoesConsoleLogExist("Operation was successful!");
});

it("8. Verify Queries", () => {
dataSources.CreateDataSource("Postgres");
dataSources.CreateQueryAfterDSSaved(" ");
agHelper.TypeIntoTextArea(locators._codeEditorTarget, "/");
agHelper.GetNAssertContains(locators._hints, "Coalescing");
agHelper.GetNAssertContains(locators._hints, "Typecasting");
agHelper.GetNAssertContains(locators._hints, "Pr");
agHelper.GetNAssertContains(locators._hints, "JSObject1");
agHelper.GetNAssertContains(locators._hints, "MainContainer");
// it("8. Verify Queries", () => {
// dataSources.CreateDataSource("Postgres");
// dataSources.CreateQueryAfterDSSaved(" ");
// agHelper.TypeIntoTextArea(locators._codeEditorTarget, "/");
// agHelper.GetNAssertContains(locators._hints, "Coalescing");
// agHelper.GetNAssertContains(locators._hints, "Typecasting");
// agHelper.GetNAssertContains(locators._hints, "Pr");
// agHelper.GetNAssertContains(locators._hints, "JSObject1");
// agHelper.GetNAssertContains(locators._hints, "MainContainer");

cy.get("@guid").then((uid) => {
dataSources.GeneratePageForDS(`Postgres ${uid}`);
});
assertHelper.AssertNetworkStatus("@postExecute", 200);
agHelper.ClickButton("Got it");
assertHelper.AssertNetworkStatus("@updateLayout", 200);
agHelper.Sleep(2000);
table.WaitUntilTableLoad(0, 0, "v2");
EditorNavigation.SelectEntityByName("SelectQuery", EntityType.Query);
agHelper.GetNClick(locators._codeEditorTarget);
agHelper.AssertElementVisibility(locators._evaluatedValue);
// cy.get("@guid").then((uid) => {
// dataSources.GeneratePageForDS(`Postgres ${uid}`);
// });
// assertHelper.AssertNetworkStatus("@postExecute", 200);
// agHelper.ClickButton("Got it");
// assertHelper.AssertNetworkStatus("@updateLayout", 200);
// agHelper.Sleep(2000);
// table.WaitUntilTableLoad(0, 0, "v2");
// EditorNavigation.SelectEntityByName("SelectQuery", EntityType.Query);
// agHelper.GetNClick(locators._codeEditorTarget);
// agHelper.AssertElementVisibility(locators._evaluatedValue);

// cy.get(`${locators._codeMirrorCode} pre`).then(($elements) => {
// const text = [...$elements].map((el) => el.innerText).join("");
// agHelper.GetText(locators._evaluatedValue).then((evalText: any) => {
// expect(evalText.replace(/\n/g, "")).to.eq(text);
// });
// });
// });

cy.get(`${locators._codeMirrorCode} pre`).then(($elements) => {
const text = [...$elements].map((el) => el.innerText).join("");
agHelper.GetText(locators._evaluatedValue).then((evalText: any) => {
expect(evalText.replace(/\n/g, "")).to.eq(text);
});
});
});
//Bug: https://github.com/appsmithorg/appsmith/issues/35385
it.skip("9. Verify JSObject with identical name should not exist Bug: #35385", () => {
it.skip("8. Verify JSObject with identical name should not exist Bug: #35385", () => {
for (let i = 0; i < 10; i++) {
agHelper.GetNClick(locators._createNew, 0, true, 0);
}
agHelper.AssertElementAbsence(locators._toastMsg);
});
Comment on lines +270 to 275
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Replace hardcoded sleep with proper assertions

The test uses a loop to create objects but lacks proper assertions between actions. Consider:

  1. Using cy.intercept() to wait for network requests
  2. Adding assertions to verify each object creation
 it.skip("8. Verify JSObject with identical name should not exist Bug: #35385", () => {
+  cy.intercept('POST', '/api/v1/collections/actions').as('createJSObject');
   for (let i = 0; i < 10; i++) {
     agHelper.GetNClick(locators._createNew, 0, true, 0);
+    cy.wait('@createJSObject');
+    agHelper.AssertElementExist(`${locators._entityName}:contains("JSObject${i + 1}")`);
   }
   agHelper.AssertElementAbsence(locators._toastMsg);
 });

Committable suggestion skipped: line range outside the PR's diff.


//Bug: https://github.com/appsmithorg/appsmith/issues/38216
it.skip("10. Verify selecting JSObject does not change the page", () => {
it.skip("9. Verify selecting JSObject does not change the page", () => {
PageList.AddNewPage("New blank page");
PageLeftPane.switchSegment(PagePaneSegment.JS);
agHelper.GetNClick(locators._createNew);
Expand Down

This file was deleted.

Loading
Loading