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

test: new test cases framework functions and Action selector #37566

Merged
merged 59 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a88888a
new test cases fof action
sagar-qa007 Nov 19, 2024
4790898
Update for flaky
sagar-qa007 Nov 20, 2024
cc8200d
Alert messsage code done
sagar-qa007 Nov 21, 2024
ba6a61d
update for test
sagar-qa007 Nov 21, 2024
59e9362
Modal related cases done
sagar-qa007 Nov 21, 2024
6b0d5dc
local storage related test cases
sagar-qa007 Nov 25, 2024
9906ca7
Run setup
sagar-qa007 Nov 25, 2024
1203bf5
update only
sagar-qa007 Nov 26, 2024
25a3d63
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 26, 2024
9ce0a1b
Saved changes for download
sagar-qa007 Nov 26, 2024
41ffc6f
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 26, 2024
0b7f0de
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 26, 2024
056527a
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 26, 2024
405a351
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 26, 2024
ba3a393
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 26, 2024
af97ce4
Minor update
sagar-qa007 Nov 27, 2024
68f0553
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 27, 2024
390638a
Merge remote-tracking branch 'origin/release' into test/frameworkfunc…
sagar-qa007 Nov 27, 2024
9038912
reverted only
sagar-qa007 Nov 28, 2024
359b47b
Download fun test cases
sagar-qa007 Nov 28, 2024
62fa7f0
Reverted only
sagar-qa007 Nov 28, 2024
4e0c35b
Completed download file
sagar-qa007 Nov 28, 2024
ceef715
Minor optimisations
sagar-qa007 Nov 29, 2024
683cf24
Optimisation for jsobject
sagar-qa007 Nov 29, 2024
dc24c4b
Copy to clipboard cases done
sagar-qa007 Nov 29, 2024
93575cc
Reset widget test cases
sagar-qa007 Nov 30, 2024
ae8b90a
Completed basic code for setInterval
sagar-qa007 Dec 1, 2024
ab2cf12
Data added
sagar-qa007 Dec 1, 2024
92fc503
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 Dec 3, 2024
f6251eb
Small update for code
sagar-qa007 Dec 3, 2024
704c5c0
Merge remote-tracking branch 'origin' into test/frameworkfunctions
sagar-qa007 Dec 3, 2024
42f5163
Merge remote-tracking branch 'origin' into test/frameworkfunctions
sagar-qa007 Dec 3, 2024
cbf2217
Updated interval tc
sagar-qa007 Dec 3, 2024
bff309f
Watch geo location cases
sagar-qa007 Dec 3, 2024
d0fc084
some work progress
sagar-qa007 Dec 4, 2024
339795e
Merge branch 'release' into test/frameworkfunctions
yatinappsmith Dec 4, 2024
7359fe9
Update with postmessage
sagar-qa007 Dec 5, 2024
de199ee
Update for postwindow
sagar-qa007 Dec 6, 2024
b2c711b
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 Dec 9, 2024
f65f265
Basic setup
sagar-qa007 Dec 9, 2024
5878c38
Some steps written
sagar-qa007 Dec 9, 2024
dba856b
Progress saved
sagar-qa007 Dec 10, 2024
eb7bf2a
remove only
sagar-qa007 Dec 10, 2024
6dc9327
Fix local store and actionselector done
sagar-qa007 Dec 10, 2024
9756ce8
Fix for download file
sagar-qa007 Dec 10, 2024
4ea1a3b
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 Dec 10, 2024
98300a1
Modal and stop location fixes
sagar-qa007 Dec 10, 2024
b8e53e2
Postwindownew cases
sagar-qa007 Dec 10, 2024
46ff2ce
Updated name
sagar-qa007 Dec 10, 2024
6dae3c9
Deleted unused file
sagar-qa007 Dec 10, 2024
c14d734
Minor update
sagar-qa007 Dec 10, 2024
9cda459
Prettier error resolve
sagar-qa007 Dec 10, 2024
09176be
Homepage revert
sagar-qa007 Dec 10, 2024
6560706
HomepageTs revert
sagar-qa007 Dec 10, 2024
e6768cb
Update for test fix
sagar-qa007 Dec 11, 2024
c6250d0
Update
sagar-qa007 Dec 11, 2024
fd8d5e2
Merge branch 'release' into test/frameworkfunctions
sagar-qa007 Dec 11, 2024
d89d870
Fix cases
sagar-qa007 Dec 12, 2024
56f7a2e
Merge remote-tracking branch 'origin' into test/frameworkfunctions
sagar-qa007 Dec 12, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
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(
"To verify action selector navigate to functions",
{ tags: ["@tag.JS"] },
() => {
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,
);
sagar-qa007 marked this conversation as resolved.
Show resolved Hide resolved
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,
prettify: 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,
prettify: 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.
Show resolved Hide resolved
agHelper.VisitNAssert(pageTwoUrl);
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);

deployMode.DeployApp();
agHelper.AssertElementVisibility(appSettings.locators._header);
agHelper.ClickButton("Submit");
agHelper.AssertURL(thirdPartyUrl);
agHelper.VisitNAssert(pageTwoUrl);
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);

const jsObjectBody = `export default {
myFun1 () {
{{navigateTo('${thirdPartyUrl}', {}, 'SAME_WINDOW');}}
},
}`;

jsEditor.CreateJSObject(jsObjectBody, {
paste: true,
completeReplace: true,
toRun: false,
prettify: 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.VisitNAssert(pageTwoUrl);
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);

deployMode.DeployApp();
agHelper.AssertElementVisibility(appSettings.locators._header);
agHelper.ClickButton("Submit");
agHelper.AssertURL(thirdPartyUrl);
agHelper.VisitNAssert(pageTwoUrl);
EditorNavigation.SelectEntityByName("Page1", EntityType.Page);
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
});

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);
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,
prettify: 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);
});
},
);
Loading
Loading