Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(
cy.url().then((url) => {
const forkableAppUrl = url;
cy.LogOut();
cy.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe(
{ tags: ["@tag.Fork"] },
function () {
it("1. Mark application as forkable", () => {
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
if (CURRENT_REPO === REPO.EE) adminSettings.EnableGAC(false, true);

homePage.CreateNewApplication();
Expand All @@ -50,7 +50,7 @@ describe(
cy.url().then((url) => {
forkableAppUrl = url;
cy.LogOut();
homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
);
Expand All @@ -60,7 +60,7 @@ describe(
});

it("2. Check if the forked application has the same dsl as the original", function () {
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
const workspaceName = fakerHelper.GetRandomNumber() + "workspace";

homePage.CreateNewWorkspace(workspaceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe(
function () {
it("1. Go to admin settings and enable Github with not all mandatory fields filled", function () {
homePage.Signout();
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
adminSettings.NavigateToAdminSettings();
// click authentication tab
agHelper.GetNClick(adminSettingsLocators.authenticationTab);
Expand All @@ -35,7 +35,7 @@ describe(

it("2. Go to admin settings and enable Github", function () {
homePage.Signout();
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
adminSettings.NavigateToAdminSettings();
// click authentication tab
agHelper.GetNClick(adminSettingsLocators.authenticationTab);
Expand Down Expand Up @@ -71,7 +71,7 @@ describe(
});

it("3. Go to admin settings and disable Github", function () {
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
adminSettings.NavigateToAdminSettings();
// click authentication tab
agHelper.GetNClick(adminSettingsLocators.authenticationTab);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(
);
cy.LogOut();

cy.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
);
Expand All @@ -52,7 +52,7 @@ describe(
});

it("2. User with developer access,should not be able to export the app", function () {
cy.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
if (CURRENT_REPO === REPO.EE) adminSettings.EnableGAC(false, true);
agHelper.GenerateUUID();
cy.get("@guid").then((uid) => {
Expand All @@ -68,7 +68,7 @@ describe(

cy.LogOut();

cy.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
);
Expand All @@ -90,7 +90,7 @@ describe(
});

it("3. User with viewer access,should not be able to export the app", function () {
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
if (CURRENT_REPO === REPO.EE) adminSettings.EnableGAC(false, true);
agHelper.GenerateUUID();
cy.get("@guid").then((uid) => {
Expand All @@ -106,7 +106,7 @@ describe(
);
cy.LogOut();

cy.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("Private embed in-app ramp", { tags: ["@tag.Settings"] }, () => {
);
_.inviteModal.CloseModal();
_.homePage.Signout(false);
_.homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ describe(
false,
);
homePage.LogOutviaAPI();
homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
"App Viewer",
);
homePage.OpenWorkspaceOptions(newWorkspaceName);
agHelper.AssertContains(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ describe(
);
homePage.LogOutviaAPI();

homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
"App Viewer",
);
agHelper.AssertContains(newWorkspaceName);
homePage.SelectWorkspace(newWorkspaceName, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe(
});

it("2. Login as Administrator and search for users using search bar", () => {
_.homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
if (CURRENT_REPO === REPO.EE) _.adminSettings.EnableGAC(false, true);
_.homePage.SelectWorkspace(workspaceId);
_.agHelper.GetNClick(_.homePage._shareWorkspace(workspaceId));
Expand All @@ -46,10 +46,9 @@ describe(
});

it("3. Login as Invited user and validate Viewer role", function () {
_.homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
"App Viewer",
);
if (CURRENT_REPO === REPO.EE)
_.adminSettings.EnableGAC(false, true, "home");
Expand All @@ -69,7 +68,7 @@ describe(
});

it("4. Login as Workspace owner and Update the Invited user role to Developer", function () {
_.homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
if (CURRENT_REPO === REPO.EE) _.adminSettings.EnableGAC(false, true);
_.homePage.SelectWorkspace(workspaceId);
_.homePage.UpdateUserRoleInWorkspace(
Expand All @@ -81,10 +80,9 @@ describe(
});

it("5. Login as Invited user and validate Developer role", function () {
_.homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
"Developer",
);
if (CURRENT_REPO === REPO.EE)
_.adminSettings.EnableGAC(false, true, "home");
Expand Down Expand Up @@ -113,7 +111,7 @@ describe(
});

it("6. Login as Workspace owner and Update the Invited user role to Administrator", function () {
_.homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
if (CURRENT_REPO === REPO.EE) _.adminSettings.EnableGAC(false, true);
_.homePage.SelectWorkspace(workspaceId);
_.homePage.UpdateUserRoleInWorkspace(
Expand All @@ -125,10 +123,9 @@ describe(
});

it("7. Login as Invited user and validate Administrator role", function () {
_.homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
"Administrator",
);
if (CURRENT_REPO === REPO.EE)
_.adminSettings.EnableGAC(false, true, "home");
Expand Down Expand Up @@ -167,7 +164,7 @@ describe(
});

it("8. Login as Workspace owner and verify all 3 users are present", function () {
_.homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
if (CURRENT_REPO === REPO.EE) _.adminSettings.EnableGAC(false, true);
_.homePage.SelectWorkspace(workspaceId);
_.homePage.UpdateUserRoleInWorkspace(
Expand All @@ -189,7 +186,7 @@ describe(
});

it("9. Login as Developer, Verify leave workspace flow", () => {
_.homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
);
Expand All @@ -199,10 +196,9 @@ describe(
});

it("10. Login as App Viewer, Verify leave workspace flow", () => {
_.homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME2"),
Cypress.env("TESTPASSWORD2"),
"App Viewer",
);
if (CURRENT_REPO === REPO.EE)
_.adminSettings.EnableGAC(false, true, "home");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ describe(
});

it("2. login as Invited user and then validate viewer privilage", function () {
homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME1"),
Cypress.env("TESTPASSWORD1"),
"App Viewer",
);
if (CURRENT_REPO == REPO.EE) adminSettings.EnableGAC(false, true, "home");

Expand All @@ -61,7 +60,7 @@ describe(
});

it("3. Enable public access to Application", function () {
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
homePage.FilterApplication(appid);
homePage.EditAppFromAppHover();
agHelper.AssertElementAbsence(locators._loading);
Expand Down Expand Up @@ -90,7 +89,7 @@ describe(
});

it("5. login as uninvited user and then validate public access of Application", function () {
homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME2"),
Cypress.env("TESTPASSWORD2"),
);
Expand All @@ -105,7 +104,7 @@ describe(
});

it("6. login as Owner and disable public access", function () {
homePage.LogintoApp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
homePage.FilterApplication(appid);
agHelper
.GetElement(homePage._applicationCard)
Expand All @@ -120,7 +119,7 @@ describe(
});

it("7. login as uninvited user, validate public access disable feature ", function () {
homePage.LogintoApp(
cy.LoginFromAPI(
Cypress.env("TESTUSERNAME2"),
Cypress.env("TESTPASSWORD2"),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("Login failure", function () {
);
}),
);
cy.LoginUser("user@error.com", "pwd_error", false);
cy.LoginFromAPI("user@error.com", "pwd_error");
cy.GetUrlQueryParams().then((queryParams) => {
expect(decodeURIComponent(queryParams.error)).to.eq("true");
expect(decodeURIComponent(queryParams.redirectUrl)).to.eq(
Expand All @@ -36,7 +36,7 @@ describe("Login failure", function () {
true,
),
);
cy.LoginUser(Cypress.env("USERNAME"), Cypress.env("PASSWORD"), false);
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the comma operator to avoid potential confusion and obscure side effects.

-    }),
+    });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
}),
});
Tools
Biome

[error] 40-40: The comma operator is disallowed. (lint/style/noCommaOperator)

Its use is often confusing and obscures side effects.

cy.url().then((url) => {
agHelper.AssertElementVisibility(locators._emptyPageTxt);
Expand Down