-
Notifications
You must be signed in to change notification settings - Fork 4.6k
test: new test cases framework functions and Action selector #37566
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
a88888a
new test cases fof action
sagar-qa007 4790898
Update for flaky
sagar-qa007 cc8200d
Alert messsage code done
sagar-qa007 ba6a61d
update for test
sagar-qa007 59e9362
Modal related cases done
sagar-qa007 6b0d5dc
local storage related test cases
sagar-qa007 9906ca7
Run setup
sagar-qa007 1203bf5
update only
sagar-qa007 25a3d63
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 9ce0a1b
Saved changes for download
sagar-qa007 41ffc6f
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 0b7f0de
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 056527a
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 405a351
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 ba3a393
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 af97ce4
Minor update
sagar-qa007 68f0553
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 390638a
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 9038912
reverted only
sagar-qa007 359b47b
Download fun test cases
sagar-qa007 62fa7f0
Reverted only
sagar-qa007 4e0c35b
Completed download file
sagar-qa007 ceef715
Minor optimisations
sagar-qa007 683cf24
Optimisation for jsobject
sagar-qa007 dc24c4b
Copy to clipboard cases done
sagar-qa007 93575cc
Reset widget test cases
sagar-qa007 ae8b90a
Completed basic code for setInterval
sagar-qa007 ab2cf12
Data added
sagar-qa007 92fc503
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 f6251eb
Small update for code
sagar-qa007 704c5c0
Merge remote-tracking branch 'origin' into test/frameworkfunctions
sagar-qa007 42f5163
Merge remote-tracking branch 'origin' into test/frameworkfunctions
sagar-qa007 cbf2217
Updated interval tc
sagar-qa007 bff309f
Watch geo location cases
sagar-qa007 d0fc084
some work progress
sagar-qa007 339795e
Merge branch 'release' into test/frameworkfunctions
yatinappsmith 7359fe9
Update with postmessage
sagar-qa007 de199ee
Update for postwindow
sagar-qa007 b2c711b
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 f65f265
Basic setup
sagar-qa007 5878c38
Some steps written
sagar-qa007 dba856b
Progress saved
sagar-qa007 eb7bf2a
remove only
sagar-qa007 6dc9327
Fix local store and actionselector done
sagar-qa007 9756ce8
Fix for download file
sagar-qa007 4ea1a3b
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 98300a1
Modal and stop location fixes
sagar-qa007 b8e53e2
Postwindownew cases
sagar-qa007 46ff2ce
Updated name
sagar-qa007 6dae3c9
Deleted unused file
sagar-qa007 c14d734
Minor update
sagar-qa007 9cda459
Prettier error resolve
sagar-qa007 09176be
Homepage revert
sagar-qa007 6560706
HomepageTs revert
sagar-qa007 e6768cb
Update for test fix
sagar-qa007 c6250d0
Update
sagar-qa007 fd8d5e2
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 d89d870
Fix cases
sagar-qa007 56f7a2e
Merge remote-tracking branch 'origin' into test/frameworkfunctions
sagar-qa007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
274 changes: 274 additions & 0 deletions
274
...ress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_NavigateToFunctions_spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,274 @@ | ||
| import { | ||
| agHelper, | ||
| appSettings, | ||
| dataSources, | ||
| deployMode, | ||
| draggableWidgets, | ||
| entityExplorer, | ||
| jsEditor, | ||
| propPane, | ||
| } from "../../../../support/Objects/ObjectsCore"; | ||
| import { EntityItems } from "../../../../support/Pages/AssertHelper"; | ||
| import EditorNavigation, { | ||
| EntityType, | ||
| } from "../../../../support/Pages/EditorNavigation"; | ||
| import PageList from "../../../../support/Pages/PageList"; | ||
|
|
||
| describe( | ||
| "JS to non-JS mode in Action Selector", | ||
| { tags: ["@tag.JS", "@tag.Binding"] }, | ||
| () => { | ||
| let pageTwoUrl: string = ""; | ||
| before(() => { | ||
| entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON); | ||
| PageList.AddNewPage(); | ||
| cy.url().then((url) => { | ||
| pageTwoUrl = url; | ||
| }); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| }); | ||
|
|
||
| it("1. To verify trigger the action without editing any field - error should be for missing navigation path and not something arbitrary like unexpected token", () => { | ||
| propPane.EnterJSContext("onClick", "{{navigateTo()}}", true, false); | ||
| propPane.ToggleJSMode("onClick", false); | ||
|
|
||
| agHelper.GetNAssertElementText( | ||
| propPane._actionCard, | ||
| "Navigate toSelect page", | ||
| "have.text", | ||
| 0, | ||
| ); | ||
| agHelper.GetNClick(propPane._actionCard, 0); | ||
|
|
||
| agHelper.AssertElementVisibility(propPane._navigateToType("Page name")); | ||
|
|
||
| dataSources.ValidateNSelectDropdown( | ||
| "Choose page", | ||
| "Select page", | ||
| "Page2", | ||
| ); | ||
|
|
||
| agHelper.GetNAssertElementText( | ||
| propPane._actionPopupTextLabel, | ||
| "Query params", | ||
| "have.text", | ||
| 0, | ||
| ); | ||
|
|
||
| agHelper.GetNClick(propPane._actionCollapsibleHeader("Query params")); | ||
| propPane.UpdatePropertyFieldValue( | ||
| "Query params", | ||
| `{{ | ||
| { | ||
|
|
||
| } | ||
| }}`, | ||
| ); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| deployMode.NavigateBacktoEditor(); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| const jsObjectBody = `export default { | ||
| myFun1 () { | ||
| {{navigateTo('Page2', { | ||
|
|
||
| }, 'SAME_WINDOW');}} | ||
| }, | ||
| }`; | ||
|
|
||
| jsEditor.CreateJSObject(jsObjectBody, { | ||
| paste: true, | ||
| completeReplace: true, | ||
| toRun: false, | ||
| shouldCreateNewJSObj: true, | ||
| }); | ||
|
|
||
| EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); | ||
| propPane.ToggleJSMode("onClick", true); | ||
| propPane.EnterJSContext("onClick", "{{JSObject1.myFun1()}}", true, false); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| deployMode.NavigateBacktoEditor(); | ||
| }); | ||
|
|
||
| it("2. To verify add a widget navigation using URL containing widgetID", () => { | ||
| EditorNavigation.SelectEntityByName("Page2", EntityType.Page); | ||
| entityExplorer.DragDropWidgetNVerify(draggableWidgets.TEXT, 200, 600); | ||
| cy.url().then((url) => { | ||
| pageTwoUrl = url; | ||
| }); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); | ||
| propPane.ToggleJSMode("onClick", false); | ||
| propPane.SelectPlatformFunction("onClick", "Navigate to"); | ||
| propPane.SelectActionByTitleAndValue("Navigate to", "Select page"); | ||
| agHelper.GetNClick(propPane._navigateToType("URL")); | ||
| agHelper.TypeText( | ||
| propPane._actionSelectorFieldByLabel("Enter URL"), | ||
| pageTwoUrl, | ||
| ); | ||
| agHelper.GetNClick(propPane._actionSelectorPopupClose); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| const jsObjectBody = `export default { | ||
| myFun1 () { | ||
| {{navigateTo('${pageTwoUrl}', {}, 'SAME_WINDOW');}} | ||
| }, | ||
| }`; | ||
|
|
||
| jsEditor.CreateJSObject(jsObjectBody, { | ||
| paste: true, | ||
| completeReplace: true, | ||
| toRun: false, | ||
| shouldCreateNewJSObj: true, | ||
| }); | ||
|
|
||
| EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); | ||
| propPane.ToggleJSMode("onClick", true); | ||
| propPane.EnterJSContext("onClick", "{{JSObject2.myFun1()}}", true, false); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| }); | ||
|
|
||
| it("3. To verify add a navigation using URL containing links to third party websites", () => { | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); | ||
| propPane.ToggleJSMode("onClick", false); | ||
| const thirdPartyUrl = "https://www.google.com/"; | ||
| propPane.SelectPlatformFunction("onClick", "Navigate to"); | ||
| propPane.SelectActionByTitleAndValue("Navigate to", "Select page"); | ||
| agHelper.GetNClick(propPane._navigateToType("URL")); | ||
| agHelper.TypeText( | ||
| propPane._actionSelectorFieldByLabel("Enter URL"), | ||
| thirdPartyUrl, | ||
| ); | ||
| agHelper.GetNClick(propPane._actionSelectorPopupClose); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(thirdPartyUrl); | ||
|
sagar-qa007 marked this conversation as resolved.
|
||
| agHelper.BrowserNavigation(-1); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(thirdPartyUrl); | ||
| agHelper.BrowserNavigation(-1); | ||
| agHelper.RefreshPage(); | ||
| deployMode.NavigateBacktoEditor(); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| const jsObjectBody = `export default { | ||
| myFun1 () { | ||
| {{navigateTo('${thirdPartyUrl}', {}, 'SAME_WINDOW');}} | ||
| }, | ||
| }`; | ||
|
|
||
| jsEditor.CreateJSObject(jsObjectBody, { | ||
| paste: true, | ||
| completeReplace: true, | ||
| toRun: false, | ||
| shouldCreateNewJSObj: true, | ||
| }); | ||
|
|
||
| EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); | ||
| propPane.ToggleJSMode("onClick", true); | ||
| propPane.EnterJSContext("onClick", "{{JSObject3.myFun1()}}", true, false); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(thirdPartyUrl); | ||
| agHelper.BrowserNavigation(-1); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(thirdPartyUrl); | ||
| agHelper.BrowserNavigation(-1); | ||
| agHelper.RefreshPage(); | ||
| deployMode.NavigateBacktoEditor(); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| }); | ||
|
|
||
| it("4. To verify navigation to a hidden page in same as well a new window", () => { | ||
| PageList.AddNewPage(); | ||
| entityExplorer.ActionContextMenuByEntityName({ | ||
| entityNameinLeftSidebar: "Page3", | ||
| action: "Hide", | ||
| entityType: EntityItems.Page, | ||
| }); | ||
| EditorNavigation.SelectEntityByName("Page3", EntityType.Page); | ||
| cy.url().then((url) => { | ||
| pageTwoUrl = url; | ||
| }); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| propPane.ToggleJSMode("onClick", false); | ||
| propPane.SelectPlatformFunction("onClick", "Navigate to"); | ||
| propPane.SelectActionByTitleAndValue("Navigate to", "Select page"); | ||
| agHelper.GetNClick(propPane._navigateToType("URL")); | ||
| agHelper.TypeText( | ||
| propPane._actionSelectorFieldByLabel("Enter URL"), | ||
| pageTwoUrl, | ||
| ); | ||
| agHelper.GetNClick(propPane._actionSelectorPopupClose); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| const jsObjectBody = `export default { | ||
| myFun1 () { | ||
| {{navigateTo('${pageTwoUrl}', {}, 'SAME_WINDOW');}} | ||
| }, | ||
| }`; | ||
|
|
||
| jsEditor.CreateJSObject(jsObjectBody, { | ||
| paste: true, | ||
| completeReplace: true, | ||
| toRun: false, | ||
| shouldCreateNewJSObj: true, | ||
| }); | ||
|
|
||
| EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); | ||
| propPane.ToggleJSMode("onClick", true); | ||
| propPane.EnterJSContext("onClick", "{{JSObject4.myFun1()}}", true, false); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
|
|
||
| deployMode.DeployApp(); | ||
| agHelper.AssertElementVisibility(appSettings.locators._header); | ||
| agHelper.ClickButton("Submit"); | ||
| agHelper.AssertURL(pageTwoUrl); | ||
| EditorNavigation.SelectEntityByName("Page1", EntityType.Page); | ||
| }); | ||
|
sagar-qa007 marked this conversation as resolved.
|
||
| }, | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.