Skip to content

Commit

Permalink
Merge pull request #32006 from appsmithorg/release
Browse files Browse the repository at this point in the history
22/03 Daily Promotion
  • Loading branch information
trishaanand authored Mar 22, 2024
2 parents 79726f2 + b8ede95 commit 14531b1
Show file tree
Hide file tree
Showing 76 changed files with 8,941 additions and 648 deletions.
2 changes: 1 addition & 1 deletion .github/config.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions app/client/.fork-ts-checkerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
typescript: {
memoryLimit: 4096,
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import adminsSettings from "../../../../locators/AdminsSettings";
import { agHelper } from "../../../../support/Objects/ObjectsCore";
import {
agHelper,
adminSettings as adminSettingsHelper,
} from "../../../../support/Objects/ObjectsCore";

const {
GITHUB_SIGNUP_SETUP_DOC,
GOOGLE_SIGNUP_SETUP_DOC,
} = require("../../../../../src/constants/ThirdPartyConstants");

Expand All @@ -24,15 +26,15 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.get(".admin-settings-menu-option").should("be.visible");
cy.get(".admin-settings-menu-option").click();
cy.url().should("contain", "/settings/general");
cy.url().should("contain", adminSettingsHelper.routes.GENERAL);
cy.wait("@getEnvVariables");
cy.LogOut();
});

it("2. Should test that settings page is not accessible to normal users", () => {
cy.LoginFromAPI(Cypress.env("TESTUSERNAME3"), Cypress.env("TESTPASSWORD3"));
cy.get(".admin-settings-menu-option").should("not.exist");
cy.visit("/settings/general", { timeout: 60000 });
agHelper.VisitNAssert(adminSettingsHelper.routes.GENERAL);
// non super users are redirected to home page
cy.url().should("contain", "/applications");
cy.LogOut(false);
Expand All @@ -41,7 +43,7 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
it("3. Should test that settings page is redirected to default tab", () => {
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.visit("/settings", { timeout: 60000 });
cy.url().should("contain", "/settings/general");
cy.url().should("contain", adminSettingsHelper.routes.GENERAL);
cy.wait("@getEnvVariables");
});

Expand All @@ -56,16 +58,16 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
cy.get(".admin-settings-menu-option").click();
cy.wait("@getEnvVariables");
cy.get(adminsSettings.generalTab).click();
cy.url().should("contain", "/settings/general");
cy.url().should("contain", adminSettingsHelper.routes.GENERAL);
cy.get(adminsSettings.advancedTab).click();
cy.url().should("contain", "/settings/advanced");
cy.url().should("contain", adminSettingsHelper.routes.ADVANCED);
cy.get(adminsSettings.authenticationTab).click();
cy.url().should("contain", "/settings/authentication");
cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION);
cy.get(adminsSettings.emailTab).click();
cy.url().should("contain", "/settings/email");
cy.url().should("contain", adminSettingsHelper.routes.EMAIL);
cy.get(adminsSettings.developerSettingsTab).should("not.exist");
cy.get(adminsSettings.versionTab).click();
cy.url().should("contain", "/settings/version");
cy.url().should("contain", adminSettingsHelper.routes.VERSION);
},
);

Expand All @@ -74,25 +76,31 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
"5. Should test that authentication page redirects and google and github auth doesn't exist - airgap",
{ tags: ["@tag.airgap"] },
() => {
agHelper.VisitNAssert("/settings/general", "getEnvVariables");
agHelper.VisitNAssert(
adminSettingsHelper.routes.GENERAL,
"getEnvVariables",
);
cy.get(adminsSettings.authenticationTab).click();
cy.url().should("contain", "/settings/authentication");
cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION);
cy.get(adminsSettings.googleButton).should("not.exist");
cy.get(adminsSettings.githubButton).should("not.exist");
cy.get(adminsSettings.formloginButton).click();
cy.url().should("contain", "/settings/authentication/form-login");
cy.url().should("contain", adminSettingsHelper.routes.FORMLOGIN);
},
);

it(
"6. Should test that configure link redirects to google signup setup doc",
{ tags: ["@tag.excludeForAirgap"] },
() => {
agHelper.VisitNAssert("/settings/general", "getEnvVariables");
agHelper.VisitNAssert(
adminSettingsHelper.routes.GENERAL,
"getEnvVariables",
);
cy.get(adminsSettings.authenticationTab).click();
cy.url().should("contain", "/settings/authentication");
cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION);
cy.get(adminsSettings.googleButton).click();
cy.url().should("contain", "/settings/authentication/google-auth");
cy.url().should("contain", adminSettingsHelper.routes.GOOGLEAUTH);
cy.get(adminsSettings.readMoreLink).within(() => {
cy.get("a")
.should("have.attr", "target", "_blank")
Expand All @@ -104,7 +112,10 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
);

it("7. Should test save and clear buttons disabled state", () => {
agHelper.VisitNAssert("/settings/general", "getEnvVariables");
agHelper.VisitNAssert(
adminSettingsHelper.routes.GENERAL,
"getEnvVariables",
);
const assertVisibilityAndDisabledState = () => {
cy.get(adminsSettings.saveButton).should("be.visible");
cy.get(adminsSettings.saveButton).should("be.disabled");
Expand All @@ -123,7 +134,10 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
});

it("8. Should test saving a setting value", () => {
agHelper.VisitNAssert("/settings/general", "getEnvVariables");
agHelper.VisitNAssert(
adminSettingsHelper.routes.GENERAL,
"getEnvVariables",
);

cy.get(adminsSettings.restartNotice).should("not.exist");
cy.get(adminsSettings.instanceName).should("be.visible");
Expand All @@ -145,7 +159,10 @@ describe("Admin settings page", { tags: ["@tag.Settings"] }, function () {
});

it("9.Should test saving settings value from different tabs", () => {
agHelper.VisitNAssert("/settings/general", "getEnvVariables");
agHelper.VisitNAssert(
adminSettingsHelper.routes.GENERAL,
"getEnvVariables",
);
cy.get(adminsSettings.restartNotice).should("not.exist");
cy.get(adminsSettings.instanceName).should("be.visible");
let instanceName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO";
import { agHelper } from "../../../../support/Objects/ObjectsCore";

const Access = {
AdminSettingsEntryLink: ".admin-settings-menu-option",
LeftPaneAuditLogsLink: ".t--settings-category-audit-logs",
};
import {
agHelper,
adminSettings as adminSettingsHelper,
} from "../../../../support/Objects/ObjectsCore";
import adminsSettings from "../../../../locators/AdminsSettings";

const Header = {
Heading: "[data-testid='t--header-heading-container']",
Expand All @@ -25,18 +24,18 @@ const UpgradePage = {
...Carousel,
};

const locators = { ...Access, ...UpgradePage };
const locators = { ...UpgradePage };

describe("Audit logs", { tags: ["@tag.Settings"] }, () => {
it("1. Super user can access audit logs page", () => {
if (CURRENT_REPO === REPO.CE) {
cy.LogOut();
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.get(locators.AdminSettingsEntryLink).should("be.visible");
cy.get(locators.AdminSettingsEntryLink).click();
cy.url().should("contain", "/settings/general");
cy.get(locators.LeftPaneAuditLogsLink).should("be.visible");
agHelper.GetNClick(locators.LeftPaneAuditLogsLink);
cy.get(adminSettingsHelper._adminSettingsBtn).should("be.visible");
cy.get(adminSettingsHelper._adminSettingsBtn).click();
cy.url().should("contain", adminSettingsHelper.routes.GENERAL);
cy.get(adminsSettings.auditLogs).should("be.visible");
agHelper.GetNClick(adminsSettings.auditLogs);
agHelper.AssertElementVisibility(locators.UpgradeContainer);
cy.get(locators.HeaderContainer).should("be.visible");
cy.get(locators.CarouselContainer).should("be.visible");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ const commonlocators = require("../../../../locators/commonlocators.json");
const widgetsPage = require("../../../../locators/Widgets.json");
import * as _ from "../../../../support/Objects/ObjectsCore";
import { REPO, CURRENT_REPO } from "../../../../fixtures/REPO";
import { agHelper, homePage } from "../../../../support/Objects/ObjectsCore";
import {
agHelper,
homePage,
adminSettings,
} from "../../../../support/Objects/ObjectsCore";
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";

const locators = {
AdminSettingsEntryLink: ".admin-settings-menu-option",
LeftPaneBrandingLink: ".t--settings-category-branding",
AdminSettingsColorInput: ".t--settings-brand-color-input input[type=text]",
AdmingSettingsLogoInput: ".t--settings-brand-logo-input input[type=file]",
Expand Down Expand Up @@ -54,9 +57,9 @@ describe("Branding", { tags: ["@tag.Settings"] }, () => {
it("2. Super user can access branding page", () => {
cy.LogOut(false);
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.get(locators.AdminSettingsEntryLink).should("be.visible");
cy.get(locators.AdminSettingsEntryLink).click();
cy.url().should("contain", "/settings/general");
cy.get(adminSettings._adminSettingsBtn).should("be.visible");
cy.get(adminSettings._adminSettingsBtn).click();
cy.url().should("contain", adminSettings.routes.GENERAL);
agHelper.AssertElementVisibility(locators.LeftPaneBrandingLink);
agHelper.GetNClick(locators.LeftPaneBrandingLink);
});
Expand Down Expand Up @@ -284,9 +287,9 @@ describe("Branding", { tags: ["@tag.Settings"] }, () => {
it("6. Super user sees upgrade option in branding page in free plan", () => {
cy.LogOut(false);
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.get(locators.AdminSettingsEntryLink).should("be.visible");
cy.get(locators.AdminSettingsEntryLink).click();
cy.url().should("contain", "/settings/general");
cy.get(adminSettings._adminSettingsBtn).should("be.visible");
cy.get(adminSettings._adminSettingsBtn).click();
cy.url().should("contain", adminSettings.routes.GENERAL);

cy.get(locators.LeftPaneBrandingLink).should("be.visible");
cy.get(locators.LeftPaneBrandingLink).click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
/// <reference types="cypress-tags" />
import adminsSettings from "../../../../locators/AdminsSettings";

const {
GITHUB_SIGNUP_SETUP_DOC,
GOOGLE_MAPS_SETUP_DOC,
GOOGLE_SIGNUP_SETUP_DOC,
} = require("../../../../../src/constants/ThirdPartyConstants");

const routes = {
APPLICATIONS: "/applications",
SETTINGS: "/settings",
GENERAL: "/settings/general",
EMAIL: "/settings/email",
DEVELOPER_SETTINGS: "/settings/developer-settings",
AUTHENTICATION: "/settings/authentication",
GOOGLEAUTH: "/settings/authentication/google-auth",
GITHUBAUTH: "/settings/authentication/github-auth",
FORMLOGIN: "/settings/authentication/form-login",
ADVANCED: "/settings/advanced",
VERSION: "/settings/version",
};
import { adminSettings as adminSettingsHelper } from "../../../../support/Objects/ObjectsCore";

describe("Admin settings page", { tags: ["@tag.IDE"] }, function () {
beforeEach(() => {
Expand All @@ -39,59 +20,59 @@ describe("Admin settings page", { tags: ["@tag.IDE"] }, function () {
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.get(".admin-settings-menu-option").should("be.visible");
cy.get(".admin-settings-menu-option").click();
cy.url().should("contain", routes.GENERAL);
cy.url().should("contain", adminSettingsHelper.routes.GENERAL);
cy.wait("@getEnvVariables");
});

it("2. should test that page header is visible", () => {
cy.get(adminsSettings.appsmithHeader).should("be.visible");
cy.visit(routes.DEVELOPER_SETTINGS, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.DEVELOPER_SETTINGS, { timeout: 60000 });
cy.url().should("contain", "/developer-settings");
cy.wait(2000); //page to load properly
cy.get(adminsSettings.appsmithHeader).should("be.visible");
cy.visit(routes.GOOGLEAUTH, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.GOOGLEAUTH, { timeout: 60000 });
cy.url().should("contain", "/google-auth");
cy.wait(2000); //page to load properly
cy.get(adminsSettings.appsmithHeader).should("be.visible");
});

it("3. should test that clicking on logo should redirect to applications page", () => {
cy.visit(routes.GENERAL, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 });
cy.get(adminsSettings.appsmithHeader).should("be.visible");
cy.get(adminsSettings.appsmithLogo).should("be.visible");
cy.get(adminsSettings.appsmithLogo).click();
cy.url().should("contain", routes.APPLICATIONS);
cy.url().should("contain", adminSettingsHelper.routes.APPLICATIONS);
});

it("4. should test that settings page is redirected to default tab", () => {
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD"));
cy.visit(routes.SETTINGS, { timeout: 60000 });
cy.url().should("contain", routes.GENERAL);
cy.visit(adminSettingsHelper.routes.SETTINGS, { timeout: 60000 });
cy.url().should("contain", adminSettingsHelper.routes.GENERAL);
});

it(
"airgap",
"5. should test that settings page tab redirects and google maps doesn't exist - airgap",
() => {
cy.visit(routes.APPLICATIONS, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.APPLICATIONS, { timeout: 60000 });
cy.wait(3000);
cy.get(".admin-settings-menu-option").click();
cy.get(adminsSettings.generalTab).click();
cy.url().should("contain", routes.GENERAL);
cy.url().should("contain", adminSettingsHelper.routes.GENERAL);
cy.get(adminsSettings.advancedTab).click();
cy.url().should("contain", routes.ADVANCED);
cy.url().should("contain", adminSettingsHelper.routes.ADVANCED);
cy.get(adminsSettings.authenticationTab).click();
cy.url().should("contain", routes.AUTHENTICATION);
cy.url().should("contain", adminSettingsHelper.routes.AUTHENTICATION);
cy.get(adminsSettings.emailTab).click();
cy.get(adminsSettings.developerSettingsTab).should("not.exist");
cy.url().should("contain", routes.EMAIL);
cy.url().should("contain", adminSettingsHelper.routes.EMAIL);
cy.get(adminsSettings.versionTab).click();
cy.url().should("contain", routes.VERSION);
cy.url().should("contain", adminSettingsHelper.routes.VERSION);
},
);

it("6. should test save and clear buttons disabled state", () => {
cy.visit(routes.GENERAL, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 });
const assertVisibilityAndDisabledState = () => {
cy.get(adminsSettings.saveButton).should("be.visible");
cy.get(adminsSettings.saveButton).should("be.disabled");
Expand All @@ -110,7 +91,7 @@ describe("Admin settings page", { tags: ["@tag.IDE"] }, function () {
});

it("7. should test saving a setting value", () => {
cy.visit(routes.GENERAL, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 });
cy.get(adminsSettings.restartNotice).should("not.exist");
cy.get(adminsSettings.instanceName).should("be.visible");
let instanceName;
Expand All @@ -129,7 +110,7 @@ describe("Admin settings page", { tags: ["@tag.IDE"] }, function () {
});

it("8. should test saving settings value from different tabs", () => {
cy.visit(routes.GENERAL, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 });
cy.get(adminsSettings.restartNotice).should("not.exist");
cy.get(adminsSettings.instanceName).should("be.visible");
let instanceName;
Expand Down Expand Up @@ -168,7 +149,7 @@ describe("Admin settings page", { tags: ["@tag.IDE"] }, function () {
});

it("9. should test that instance name and admin emails exist on general tab", () => {
cy.visit(routes.GENERAL, { timeout: 60000 });
cy.visit(adminSettingsHelper.routes.GENERAL, { timeout: 60000 });
cy.get(adminsSettings.instanceName).should("be.visible");
cy.get(adminsSettings.adminEmails).should("be.visible");
});
Expand Down
Loading

0 comments on commit 14531b1

Please sign in to comment.