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: Enable new toolbar for cypress #37148

Merged
merged 77 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
bb66e9b
feat: Enable new toolbar for cypress
albinAppsmith Oct 31, 2024
80c129a
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Oct 31, 2024
7c12f3c
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Oct 31, 2024
d6d98e4
fix: query rename and run button
albinAppsmith Oct 31, 2024
fd0f077
fix: more action trigger test id added
albinAppsmith Nov 1, 2024
83a6965
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 1, 2024
926a951
fix: locators fix
albinAppsmith Nov 1, 2024
870de4b
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 1, 2024
9bb8064
fix: setting tab selector fix
albinAppsmith Nov 4, 2024
cff6304
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 4, 2024
5ef38fd
fix: failures
albinAppsmith Nov 5, 2024
fe6715f
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 5, 2024
04bd623
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 5, 2024
1d1a836
fix: rename locator fixes
albinAppsmith Nov 5, 2024
665eeb4
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 5, 2024
f13e683
fix: js menu locators
albinAppsmith Nov 6, 2024
5f38a74
fix api locators
albinAppsmith Nov 6, 2024
7fd42ec
fix: Removed unused locators
albinAppsmith Nov 6, 2024
3950053
fix: setting popover selectors
albinAppsmith Nov 6, 2024
ebf037c
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 6, 2024
173479c
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 6, 2024
7bf8c53
fix: jsobject tests
albinAppsmith Nov 6, 2024
829dd77
fix: api url selectoir fix
albinAppsmith Nov 7, 2024
597f7e4
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 7, 2024
8fbc025
fix: locators
albinAppsmith Nov 7, 2024
98da06d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 7, 2024
3deca4c
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 8, 2024
2433f0f
docs locator fix
albinAppsmith Nov 8, 2024
2cb0438
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 11, 2024
4794d69
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 11, 2024
ba1bf6b
fix settings locators replaced with plugin form function
albinAppsmith Nov 11, 2024
6ea0d15
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 12, 2024
ab55a02
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 12, 2024
73aa79f
fix eslint in cypress
albinAppsmith Nov 12, 2024
99e61d3
commented code reverted
albinAppsmith Nov 12, 2024
9bdaf3f
fix: removed trailing comma which caused cypress failure
albinAppsmith Nov 12, 2024
f290fce
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 12, 2024
021e2d6
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 13, 2024
80ba37b
fix: Added response pane class for cypress
albinAppsmith Nov 13, 2024
0c700a1
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 13, 2024
ced13ac
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 13, 2024
268dc3a
fix: cypress datasource failures
albinAppsmith Nov 13, 2024
ec51150
fix: Logs2_spec.js
albinAppsmith Nov 14, 2024
e1f142b
fix: JSEditorIndent_spec
albinAppsmith Nov 14, 2024
761445d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 14, 2024
d55d23b
fix: Logs2_spec
albinAppsmith Nov 14, 2024
129a988
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 15, 2024
bb89fb7
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 15, 2024
e2ce9ce
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 21, 2024
8cf58d1
fix: folder name change
albinAppsmith Nov 21, 2024
5df1a96
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 22, 2024
bbf5e77
fix: import fix
albinAppsmith Nov 22, 2024
7d0fd07
feat: uupdated JSEditorComment_spec.js visual tests
albinAppsmith Nov 22, 2024
c85eff5
feat: Updated visual test for JSEditorIndent_spec.js
albinAppsmith Nov 22, 2024
2c0be98
feat: updated JSEditorSaveAndAutoIndent_spec.js visual test
albinAppsmith Nov 22, 2024
7380053
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 22, 2024
f3ef4d4
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 22, 2024
a5b2f86
fix: cypress failures on mongo template menu
albinAppsmith Nov 22, 2024
ac9d4b9
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 23, 2024
a63fb46
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 24, 2024
ca09d6e
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 25, 2024
6a09d77
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 25, 2024
5ff81bb
feat: Added data test id for plugin editor forms
albinAppsmith Nov 25, 2024
a492f6a
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 25, 2024
f0c7176
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 25, 2024
9d44e45
feat: added test ids and package check
albinAppsmith Nov 26, 2024
bae5e7d
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 26, 2024
d385796
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 26, 2024
19aa481
fix: Added empty message in js settings
albinAppsmith Nov 26, 2024
db715e7
fix: Added callback for rename in cypress datasource
albinAppsmith Nov 27, 2024
b6a87f6
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 27, 2024
2e35b2a
fix: try removing useInitFormEvaluation
albinAppsmith Nov 27, 2024
aaf8a11
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 27, 2024
e084346
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 28, 2024
87ba494
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Nov 28, 2024
bb3e617
fix: removed editor config check
albinAppsmith Nov 28, 2024
f2af870
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
albinAppsmith Dec 2, 2024
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
2 changes: 1 addition & 1 deletion app/client/cypress/e2e/GSheet/AllAccess_Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe.skip(

it("1. Add and verify fetch details query", () => {
entityExplorer.CreateNewDsQuery(dataSourceName);
agHelper.RenameWithInPane("Fetch_Details");
agHelper.RenameQuery("Fetch_Details");
dataSources.ValidateNSelectDropdown(
"Operation",
"Fetch Many",
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/e2e/GSheet/GsheetMisc_Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe.skip(
it("1. Add query from active ds tab and verify", () => {
dataSources.CreateQueryForDS(dataSourceName);
// entityExplorer.CreateNewDsQuery(dataSourceName);
agHelper.RenameWithInPane("Fetch_Details");
agHelper.RenameQuery("Fetch_Details");
dataSources.ValidateNSelectDropdown(
"Operation",
"Fetch Many",
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/e2e/GSheet/ReadNWrite_Access_Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe.skip(

it("1. Add and verify fetch details query", () => {
entityExplorer.CreateNewDsQuery(dataSourceName.readNWrite);
agHelper.RenameWithInPane("Fetch_Details");
agHelper.RenameQuery("Fetch_Details");
dataSources.ValidateNSelectDropdown(
"Operation",
Comment on lines 54 to 55
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

Consider using data-cy attributes for dropdown selections

Replace string selectors with data-cy attributes for better maintainability.

-      dataSources.ValidateNSelectDropdown(
-        "Operation",
+      dataSources.ValidateNSelectDropdown(
+        "[data-cy=operation-dropdown]",

Also applies to: 56-57

"Fetch Many",
Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/e2e/GSheet/ReadOnly_Access_Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe.skip(

it("1. Add and verify fetch details query", () => {
entityExplorer.CreateNewDsQuery(dataSourceName.readOnly);
agHelper.RenameWithInPane("Fetch_Details");
agHelper.RenameQuery("Fetch_Details");
dataSources.ValidateNSelectDropdown(
"Operation",
"Fetch Many",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe(

it("1. Add and verify fetch details query", () => {
entityExplorer.CreateNewDsQuery(dataSourceName);
agHelper.RenameWithInPane("Fetch_Details");
agHelper.RenameQuery("Fetch_Details");
dataSources.ValidateNSelectDropdown(
"Operation",
"Fetch Many",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(
// because I do not need to fill the datasource form and use the same default data
_.dataSources.CreatePlugIn("PostgreSQL");
dsName = "Postgres" + uid;
_.agHelper.RenameWithInPane(dsName, false);
_.agHelper.RenameDatasource(dsName);
_.dataSources.SaveDatasource();
_.agHelper.Sleep();
_.dataSources.EditDatasource();
Comment on lines 25 to 26
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove explicit sleep calls.

Replace _.agHelper.Sleep() with proper Cypress commands that wait for specific conditions. Cypress has built-in retry-ability and automatic waiting.

-_.dataSources.SaveDatasource();
-_.agHelper.Sleep();
+_.dataSources.SaveDatasource();
+_.agHelper.WaitUntilToastDisappear();

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

Expand All @@ -39,7 +39,7 @@ describe(
// because I do not need to fill the datasource form and use the same default data
_.dataSources.CreatePlugIn("Authenticated API");
dsName = "AuthDS" + uid;
_.agHelper.RenameWithInPane(dsName, false);
_.agHelper.RenameDatasource(dsName);
_.dataSources.FillAuthAPIUrl();
_.dataSources.SaveDatasource();
_.agHelper.Sleep();
Expand All @@ -62,7 +62,7 @@ describe(
// because I do not need to fill the datasource form and use the same default data
_.dataSources.CreatePlugIn("MongoDB");
dsName = "Mongo" + uid;
_.agHelper.RenameWithInPane(dsName, false);
_.agHelper.RenameDatasource(dsName);
_.dataSources.FillMongoDSForm();
_.dataSources.SaveDatasource();
_.agHelper.Sleep();
Expand All @@ -86,7 +86,7 @@ describe(
// because I do not need to fill the datasource form and use the same default data
_.dataSources.CreatePlugIn("MongoDB");
dsName = "Mongo" + uid;
_.agHelper.RenameWithInPane(dsName, false);
_.agHelper.RenameDatasource(dsName);
_.dataSources.FillMongoDSForm();
_.dataSources.SaveDatasource();
_.agHelper.Sleep();
Expand All @@ -110,7 +110,7 @@ describe(
// because I do not need to fill the datasource form and use the same default data
_.dataSources.CreatePlugIn("MongoDB");
dsName = "Mongo" + uid;
_.agHelper.RenameWithInPane(dsName, false);
_.agHelper.RenameDatasource(dsName);
_.dataSources.FillMongoDSForm();
_.dataSources.SaveDatasource();
_.agHelper.Sleep();
Expand All @@ -133,7 +133,7 @@ describe(
// because I do not need to fill the datasource form and use the same default data
_.dataSources.CreatePlugIn("MongoDB");
dsName = "Mongo" + uid;
_.agHelper.RenameWithInPane(dsName, false);
_.agHelper.RenameDatasource(dsName);
_.dataSources.FillMongoDSForm();
_.dataSources.SaveDatasource();
_.agHelper.Sleep();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe(
cy.get("@guid").then((uid) => {
dsName = "AuthAPI " + uid;
_.dataSources.CreatePlugIn("Authenticated API");
_.agHelper.RenameWithInPane(dsName, false);
_.agHelper.RenameDatasource(dsName);
_.dataSources.FillAuthAPIUrl();
_.dataSources.AssertCursorPositionForTextInput(
_.dataSources._urlInputControl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe(
cy.get("@guid").then((uid) => {
dsName = "AuthAPI " + uid;
dataSources.CreatePlugIn("Authenticated API");
agHelper.RenameWithInPane(dsName, false);
agHelper.RenameDatasource(dsName);
dataSources.FillAuthAPIUrl();
dataSources.SaveDatasource();
apiPage.CreateApi("API" + uid, "GET", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe(
dataSourceName = "Postgres " + guid;
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("PostgreSQL");
agHelper.RenameWithInPane(dataSourceName, false);
agHelper.RenameDatasource(dataSourceName);
dataSources.FillPostgresDSForm(
"Production",
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe(
dataSources.EnterQuery("select * from users");

cy.EvaluateCurrentValue("select * from users");
cy.get(".t--action-name-edit-field").click({ force: true });

cy.get("@saveDatasource").then((httpResponse) => {
datasourceName = httpResponse.response.body.data.name;
PageLeftPane.switchSegment(PagePaneSegment.Queries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ describe(
datasourceName,
EntityType.Datasource,
);
agHelper.RenameWithInPane(`${datasourceName}new`, false);
agHelper.RenameDatasource(`${datasourceName}new`);
cy.contains(dataSources._datasourceCard, `${datasourceName}new`);

// reverting the name
agHelper.RenameWithInPane(datasourceName, false);
agHelper.RenameDatasource(datasourceName);

// going to the query create page
EditorNavigation.SelectEntityByName("Query1", EntityType.Query);
Expand All @@ -81,7 +81,7 @@ describe(
dataSources.EnterQuery("select * from users");

cy.EvaluateCurrentValue("select * from users");
cy.get(".t--action-name-edit-field").click({ force: true });

entityExplorer.ActionContextMenuByEntityName({
entityNameinLeftSidebar: "Query1",
action: "Show bindings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ describe("Linting", { tags: ["@tag.JS", "@tag.Binding"] }, () => {

it("2. TC 1927 Cont'd - Doesn't show lint errors when Api is renamed", () => {
EditorNavigation.SelectEntityByName("Api1", EntityType.Api);
agHelper.RenameWithInPane("Api2");
agHelper.RenameQuery("Api2");

clickButtonAndAssertLintError(false);

EditorNavigation.SelectEntityByName("Api2", EntityType.Api);
agHelper.RenameWithInPane("Api1");
agHelper.RenameQuery("Api1");

clickButtonAndAssertLintError(false);
});
Expand Down Expand Up @@ -237,13 +237,13 @@ describe("Linting", { tags: ["@tag.JS", "@tag.Binding"] }, () => {

it("6. TC 1928 Cont'd - Shows correct lint error when Query is renamed", () => {
EditorNavigation.SelectEntityByName("Query1", EntityType.Query);
agHelper.RenameWithInPane("Query2");
agHelper.RenameQuery("Query2");

// Assert Absence of lint error
clickButtonAndAssertLintError(false);

EditorNavigation.SelectEntityByName("Query2", EntityType.Query);
agHelper.RenameWithInPane("Query1");
agHelper.RenameQuery("Query1");

// Assert Absence of lint error
clickButtonAndAssertLintError(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe(
});
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("Mongo");
agHelper.RenameWithInPane("myinvalidds", false);
agHelper.RenameDatasource("myinvalidds");

agHelper.ClearNType(dataSources._host(), "127.0.0.1");
agHelper.ClearNType(dataSources._port, "8000");
Expand All @@ -136,7 +136,7 @@ describe(
[1, 2].forEach((I) => {
dataSources.NavigateToDSCreateNew();
dataSources.CreatePlugIn("Mongo");
agHelper.RenameWithInPane(`dummy${I}`, false);
agHelper.RenameDatasource(`dummy${I}`);

agHelper.ClearNType(dataSources._host(), "127.0.0.1");
agHelper.ClearNType(dataSources._port, "8000");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("Omnibar functionality test cases", () => {
assertHelper.AssertNetworkStatus("@createNewApi", 201);
EditorNavigation.SelectEntityByName("Api1", EntityType.Api);
agHelper.AssertURL("/api");
agHelper.RenameWithInPane(apiName);
agHelper.RenameQuery(apiName);

agHelper.GetNClick(omnibar.globalSearch, 0, true);
agHelper.GetNClickByContains(omnibar.categoryTitle, "Create new");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,7 @@ describe(
_.dataSources.CreateDataSource("Postgres");
_.dataSources.CreateQueryAfterDSSaved();

// Click the editing field
cy.get(".t--action-name-edit-field").click({ force: true });

// Click the editing field
cy.get(queryLocators.queryNameField).type("Query1");
_.agHelper.RenameQuery("Query1");

// switching off Use Prepared Statement toggle
_.dataSources.ToggleUsePreparedStatement(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,8 @@ describe(
_.dataSources.CreateDataSource("Postgres");
cy.wait(1000);
_.dataSources.CreateQueryAfterDSSaved();
// Click the editing field
cy.get(".t--action-name-edit-field").click({
force: true,
});

// Click the editing field
cy.get(queryLocators.queryNameField).type("Query2");
_.agHelper.RenameQuery("Query2");

// switching off Use Prepared Statement toggle
_.dataSources.ToggleUsePreparedStatement(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ describe(
);
_.dataSources.ToggleUsePreparedStatement(false);
cy.wait("@saveAction");
cy.get(".t--run-query").click();
cy.get(_.dataSources._runQueryBtn).click();
cy.wait("@postExecute");
PageLeftPane.switchSegment(PagePaneSegment.UI);
cy.openPropertyPane("tablewidgetv2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe(
cy.get("@guid").then((uid) => {
dataSources.CreatePlugIn("PostgreSQL");
dataSourceName = "PostgreSQL" + " " + uid;
agHelper.RenameWithInPane(dataSourceName, false);
agHelper.RenameDatasource(dataSourceName);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Missing username for authentication.");
Expand Down Expand Up @@ -81,7 +81,7 @@ describe(
cy.get("@guid").then((uid) => {
dataSources.CreatePlugIn("MySQL");
dataSourceName = "MySQL" + " " + uid;
agHelper.RenameWithInPane(dataSourceName, false);
agHelper.RenameDatasource(dataSourceName);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage("Host value cannot be empty");
Expand Down Expand Up @@ -133,7 +133,7 @@ describe(
cy.get("@guid").then((uid) => {
dataSources.CreatePlugIn("MongoDB");
dataSourceName = "MongoDB" + " " + uid;
agHelper.RenameWithInPane(dataSourceName, false);
agHelper.RenameDatasource(dataSourceName);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage(
Expand Down Expand Up @@ -234,7 +234,7 @@ describe(
cy.get("@guid").then((uid) => {
dataSources.CreatePlugIn("Redis");
dataSourceName = "Redis" + " " + uid;
agHelper.RenameWithInPane(dataSourceName, false);
agHelper.RenameDatasource(dataSourceName);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage(
Expand All @@ -255,7 +255,7 @@ describe(
cy.get("@guid").then((uid) => {
dataSources.CreatePlugIn("S3");
dataSourceName = "S3" + " " + uid;
agHelper.RenameWithInPane(dataSourceName, false);
agHelper.RenameDatasource(dataSourceName);

dataSources.TestDatasource(false);
agHelper.ValidateToastMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe(
cy.get("@guid").then((uid) => {
dataSources.CreatePlugIn("MongoDB");
dsName = "Mongo" + uid;
agHelper.RenameWithInPane(dsName, false);
agHelper.RenameDatasource(dsName);
dataSources.FillMongoDatasourceFormWithURI();
dataSources.TestSaveDatasource();
AppSidebar.navigate(AppSidebarButton.Editor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ describe(
jsObj = jsObjName;
});
// Switch to settings tab
agHelper.GetNClick(jsEditor._settingsTab);
jsEditor.toolbar.toggleSettings();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Replace Sleep() calls with proper Cypress wait conditions

The code uses agHelper.Sleep() in multiple places which is against the coding guidelines. Instead, wait for specific elements or conditions.

Consider replacing with proper wait conditions:

- agHelper.Sleep(2000);
+ cy.get(jsEditor._asyncJSFunctionSettings).should('be.visible');

Similar replacements should be made for other Sleep() calls.

Also applies to: 414-414, 421-421, 466-466, 473-473, 503-503

// Add settings for each function (according to data)
Object.values(FUNCTIONS_SETTINGS_DEFAULT_DATA).forEach(
(functionSetting) => {
Expand All @@ -411,14 +411,14 @@ describe(
},
);
// Switch to settings tab
agHelper.GetNClick(jsEditor._settingsTab);
jsEditor.toolbar.toggleSettings();
//After JSObj is created - check methods are in alphabetical order
assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA);

agHelper.RefreshPage();
agHelper.Sleep(2000); //for confirmatiom modal to appear before clicking on "Yes" button for CI runs
// Switch to settings tab and assert order
agHelper.GetNClick(jsEditor._settingsTab);
jsEditor.toolbar.toggleSettings();
assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA);
});

Expand Down Expand Up @@ -463,14 +463,14 @@ describe(
agHelper.Sleep();

EditorNavigation.SelectEntityByName(jsObj, EntityType.JSObject);
agHelper.GetNClick(jsEditor._settingsTab);
jsEditor.toolbar.toggleSettings();
assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_DEFAULT_DATA);

// rename functions and assert order
agHelper.GetNClick(jsEditor._codeTab);
jsEditor.EditJSObj(getJSObject(FUNCTIONS_SETTINGS_RENAMED_DATA), false);
agHelper.Sleep(3000);
agHelper.GetNClick(jsEditor._settingsTab);
jsEditor.toolbar.toggleSettings();
assertAsyncFunctionsOrder(FUNCTIONS_SETTINGS_RENAMED_DATA);
agHelper.ActionContextMenuWithInPane({
action: "Delete",
Expand Down Expand Up @@ -500,7 +500,7 @@ return "yes";`;
});

// Switch to settings tab
agHelper.GetNClick(jsEditor._settingsTab);
jsEditor.toolbar.toggleSettings();
// Enable all settings
jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe(
inputData.tableName,
"Insert",
);
agHelper.RenameWithInPane("insertRecord");
agHelper.RenameQuery("insertRecord");
dataSources.EnterQuery(query);

query = inputData.query.dropTable;
Expand All @@ -59,7 +59,7 @@ describe(
inputData.tableName,
"Delete",
);
agHelper.RenameWithInPane("dropTable");
agHelper.RenameQuery("dropTable");
dataSources.EnterQuery(query);

//Creating SELECT query
Expand All @@ -68,7 +68,7 @@ describe(
inputData.tableName,
"Select",
);
agHelper.RenameWithInPane("selectRecords");
agHelper.RenameQuery("selectRecords");
dataSources.RunQuery();
agHelper
.GetText(dataSources._noRecordFound)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe(
inputData.tableName,
"Insert",
);
agHelper.RenameWithInPane("falseCases");
agHelper.RenameQuery("falseCases");
inputData.falseResult.forEach((res_array, i) => {
res_array.forEach((value) => {
query =
Expand Down
Loading
Loading