-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Changes from 12 commits
bb66e9b
80c129a
7c12f3c
d6d98e4
fd0f077
83a6965
926a951
870de4b
9bb8064
cff6304
5ef38fd
fe6715f
04bd623
1d1a836
665eeb4
f13e683
5f38a74
7fd42ec
3950053
ebf037c
173479c
7bf8c53
829dd77
597f7e4
8fbc025
98da06d
3deca4c
2433f0f
2cb0438
4794d69
ba1bf6b
6ea0d15
ab55a02
73aa79f
99e61d3
9bdaf3f
f290fce
021e2d6
80ba37b
0c700a1
ced13ac
268dc3a
ec51150
e1f142b
761445d
d55d23b
129a988
bb89fb7
e2ce9ce
8cf58d1
5df1a96
bbf5e77
7d0fd07
c85eff5
2c0be98
7380053
f3ef4d4
a5b2f86
ac9d4b9
a63fb46
ca09d6e
6a09d77
5ff81bb
a492f6a
f0c7176
9d44e45
bae5e7d
d385796
19aa481
db715e7
b6a87f6
2e35b2a
aaf8a11
e084346
87ba494
bb3e617
f2af870
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove explicit sleep calls. Replace -_.dataSources.SaveDatasource();
-_.agHelper.Sleep();
+_.dataSources.SaveDatasource();
+_.agHelper.WaitUntilToastDisappear();
|
||
|
@@ -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(); | ||
|
@@ -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(); | ||
|
@@ -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(); | ||
|
@@ -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(); | ||
|
@@ -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(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,7 +400,7 @@ describe( | |
jsObj = jsObjName; | ||
}); | ||
// Switch to settings tab | ||
agHelper.GetNClick(jsEditor._settingsTab); | ||
jsEditor.toolbar.toggleSettings(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace Sleep() calls with proper Cypress wait conditions The code uses 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) => { | ||
|
@@ -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); | ||
}); | ||
|
||
|
@@ -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", | ||
|
@@ -500,7 +500,7 @@ return "yes";`; | |
}); | ||
|
||
// Switch to settings tab | ||
agHelper.GetNClick(jsEditor._settingsTab); | ||
jsEditor.toolbar.toggleSettings(); | ||
// Enable all settings | ||
jsEditor.EnableDisableAsyncFuncSettings("asyncToSync", true); | ||
|
||
|
There was a problem hiding this comment.
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.
Also applies to: 56-57