Skip to content

Commit

Permalink
Merge pull request #9070 from ToolJet/release/platformv14.1
Browse files Browse the repository at this point in the history
Release platform v14.1
  • Loading branch information
gsmithun4 committed Mar 13, 2024
2 parents 51f4407 + 537a2c1 commit 7e7aaf2
Show file tree
Hide file tree
Showing 24 changed files with 340 additions and 292 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.32.4
2.32.5
4 changes: 2 additions & 2 deletions cypress-tests/cypress-app-builder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ module.exports = defineConfig({
experimentalRunAllSpecs: true,
baseUrl: "http://localhost:8082",
specPattern: [
"cypress/e2e/happypath/appbuilder/commonTestcases/**/*.cy.js",
"cypress/e2e/happypath/appbuilder/ceTestcases/**/*.cy.js"
"cypress/e2e/happyPath/appbuilder/commonTestcases/**/*.cy.js",
"cypress/e2e/happyPath/appbuilder/ceTestcases/**/*.cy.js"
],
numTestsKeptInMemory: 1,
redirectionLimit: 7,
Expand Down
4 changes: 2 additions & 2 deletions cypress-tests/cypress-marketplace.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ module.exports = defineConfig({
experimentalRunAllSpecs: true,
baseUrl: "http://localhost:8082",
specPattern: [
"cypress/e2e/happypath/marketplace/commonTestcases/**/*.cy.js",
"cypress/e2e/happypath/marketplace/ceTestcases/**/*.cy.js"
"cypress/e2e/happyPath/marketplace/commonTestcases/**/*.cy.js",
"cypress/e2e/happyPath/marketplace/ceTestcases/**/*.cy.js"
],
numTestsKeptInMemory: 1,
redirectionLimit: 7,
Expand Down
4 changes: 2 additions & 2 deletions cypress-tests/cypress-workspace.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ module.exports = defineConfig({
experimentalRunAllSpecs: true,
baseUrl: "http://localhost:8082",
specPattern: [
"cypress/e2e/happypath/platform/commonTestcases/**/*.cy.js",
"cypress/e2e/happypath/platform/ceTestcases/**/*.cy.js"
"cypress/e2e/happyPath/platform/commonTestcases/**/*.cy.js",
"cypress/e2e/happyPath/platform/ceTestcases/**/*.cy.js"
],
numTestsKeptInMemory: 1,
redirectionLimit: 15,
Expand Down
3 changes: 2 additions & 1 deletion cypress-tests/cypress/constants/selectors/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const commonSelectors = {
workspaceSettings: '[data-cy="workspace-settings"]',
manageUsersOption: '[data-cy="users-list-item"]',
manageGroupsOption: '[data-cy="groups-list-item"]',
manageSSOOption: '[data-cy="sso-list-item"]',
manageSSOOption: '[data-cy="workspace-login-list-item"]',
workspaceVariableOption: '[data-cy="workspace-variables-list-item"]',
clearFilterButton: '[data-cy="clear-filter-button"]',
userStatusSelect: '[data-cy="user-status-select-continer"]',
Expand Down Expand Up @@ -257,6 +257,7 @@ export const commonSelectors = {
},
defaultModalTitle: '[data-cy="modal-title"]',
workspaceConstantsIcon: '[data-cy="icon-workspace-constants"]',
confirmationButton: '[data-cy="confirmation-button"]',
};

export const commonWidgetSelector = {
Expand Down
21 changes: 14 additions & 7 deletions cypress-tests/cypress/constants/selectors/manageSSO.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const ssoSelector = {
pagetitle: "[data-cy=manage-sso-page-title]",
generalSettingsElements: {
generalSettings: '[data-cy="general-settings-list-item"]',
workspaceLoginPage: {
enableSignupLabel: '[data-cy="enable-sign-up-label"]',
helperText: "[data-cy=enable-sign-up-helper-text]",
allowDefaultSSOLabel: '[data-cy="allow-default-sso-label"]',
Expand All @@ -10,16 +9,22 @@ export const ssoSelector = {
allowedDomainHelperText: '[data-cy="allowed-domain-helper-text"]',
workspaceLoginUrl: '[data-cy="workspace-login-url-label"]',
workspaceLoginHelpText: '[data-cy="workspace-login-help-text"]',
ssoHeader: '[data-cy="sso-header"]',
instanceSSOHelperText: '[data-cy="instance-sso-helper-text"]',
googleLabel: '[data-cy="google-label"]',
githubLabel: '[data-cy="github-label"]',
defaultSSO: '[data-cy="instance-sso-card"]',
},
cardTitle: "[data-cy=card-title]",
enableSignUpToggle: '[data-cy="enable-sign-up-toggle"]',
allowDefaultSSOToggle: '[data-cy="allow-default-sso-toggle"]',
allowDefaultSSOToggle:
'[style="padding-left: 0px; margin-bottom: 1px;"] > .switch > .slider',
defaultSSOImage: '[data-cy="default-sso-status-image"]',
allowedDomainInput: "[data-cy=allowed-domain-input]",
allowedDomainInput: '[data-cy="allowed-domains"]',
workspaceLoginUrl: '[data-cy="workspace-login-url"]',
cancelButton: "[data-cy=cancel-button]",
saveButton: "[data-cy=save-button]",
google: '[data-cy="google-list-item"]',
google: '[data-cy="google-sso-card"]',
googleEnableToggle: '[data-cy="google-enable-toggle"]',
statusLabel: "[data-cy=status-label]",
clientIdLabel: "[data-cy=client-id-label]",
Expand All @@ -29,9 +34,9 @@ export const ssoSelector = {
googleTile: '[data-cy="google-sign-in-text"]',
googleIcon: "[data-cy=google-sso-icon]",
googleSSOText: "[data-cy=google-sso-text]",
git: '[data-cy="github-list-item"]',
git: '[data-cy="github-sso-card"]',
gitEnableToggle: '[data-cy="github-toggle-input"]',
githubLabel: '[data-cy="github-toggle-label"]',
githubLabel: '[data-cy="github-label"]',
clientSecretLabel: "[data-cy=client-secret-label]",
encriptedLabel: "[data-cy=encripted-label]",
clientSecretInput: "[data-cy=client-secret-input]",
Expand All @@ -52,4 +57,6 @@ export const ssoSelector = {
passwordLoginToggleLbale: '[data-cy="label-password-login"]',
alertText: '[data-cy="alert-text"]',
disablePasswordHelperText: '[data-cy="disable-password-helper-text"]',
defaultGoogle: '[data-cy="dropdown-options-google"]',
defaultGithub: '[data-cy="dropdown-options-git"]',
};
30 changes: 17 additions & 13 deletions cypress-tests/cypress/constants/texts/manageSSO.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const ssoText = {
pagetitle: " SSO",
generalSettingsElements: {
generalSettings: "General Settings",
pagetitle: " Workspace login",
workspaceLoginPage: {
enableSignupLabel: "Enable Signup",
helperText: "New account will be created for user's first time SSO sign in",
allowDefaultSSOLabel: "Allow default SSO",
Expand All @@ -12,34 +11,39 @@ export const ssoText = {
"Support multiple domains. Enter domain names separated by comma. example: tooljet.com,tooljet.io,yourorganization.com",
workspaceLoginUrl: "Login URL",
workspaceLoginHelpText: "Use this URL to login directly to this workspace",
ssoHeader: "SSO",
instanceSSOHelperText: "Display default SSO for workspace URL login",
googleLabel: "Google",
githubLabel: "GitHub",
defaultSSO: "Default SSO",
},
cancelButton: "Cancel",
saveButton: "Save changes",
allowedDomain: "tooljet.io,gmail.com",
ssoToast: "updated sso configurations",
ssoToast: "Organization settings have been updated",
ssoToast2: "updated SSO configurations",
googleTitle: "Google",
enabledLabel: "Enabled",
googleEnabledToast: "Enabled Google SSO",
googleSSOToast: "Saved Google SSO configurations",
disabledLabel: "Disabled",
googleDisableToast: "Disabled Google SSO",
googleSSOText: "Sign in with Google",
clientIdLabel: "Client Id",
clientIdLabel: "Client ID",
redirectUrlLabel: "Redirect URL",
clientId: "24567098-mklj8t20za1smb2if.apps.googleusercontent.com",
testClientId: "12345-client-id-.apps.googleusercontent.com",
gitTitle: "GitHub",
clientSecretLabel: "Client Secret",
clientSecretLabel: "Client secret",
encriptedLabel: "Encrypted",
gitEnabledToast: "Enabled GitHub SSO",
gitDisabledToast: "Disabled GitHub SSO",
gitSSOToast: "Saved Git SSO configurations",
gitSignInText: "Sign in with GitHub",
passwordTitle: "Password Login",
passwordEnabledToast: "Enabled Password login",
passwordDisabledToast: "Disabled Password login",
passwordDisabledToast: "Password login disabled successfully!",
passwordDisableWarning:
"Users won鈥檛 be able to login via username and password if password login is disabled. Please make sure that you have setup other authentication methods before disabling password login, do you want to continue?",
hostNameLabel: "Host Name",
"Disable password login only if you have configured SSO or else you will get locked out.",
hostNameLabel: "Host name",
hostNameHelpText: "Required if GitHub is self hosted",
hostName: "Tooljet",
signInHeader: "Sign in",
Expand All @@ -51,8 +55,8 @@ export const ssoText = {
gitSignUpText: "Sign up with GitHub",
gitUserStatusToast:
"GitHub login failed - User does not exist in the workspace",
passwordLoginToggleLbale: "Password login ",
passwordLoginToggleLbale: "Password login",
alertText: "Danger zone",
disablePasswordHelperText:
"Disable password login only if your SSO is configured otherwise you will get logged out.",
"Disable password login only if your SSO is configured otherwise you will get locked out",
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { commonSelectors } from "../../constants/selectors/common";
import { commonText } from "../../constants/texts/common";
import { commonSelectors } from "Selectors/common";
import { commonText } from "Texts/common";
import { fake } from "Fixtures/fake";
import { addNewUser } from "Support/utils/onboarding";
import { logout } from "Support/utils/common";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ describe("Manage SSO for multi workspace", () => {
const envVar = Cypress.env("environment");
beforeEach(() => {
cy.defaultWorkspaceLogin();
SSO.setSSOStatus("My workspace", "google", false);
SSO.setSSOStatus("My workspace", "git", false);
});
it("Should verify General settings page elements", () => {
common.navigateToManageSSO();

cy.get(commonSelectors.breadcrumbTitle).should(($el) => {
expect($el.contents().first().text().trim()).to.eq(
commonText.breadcrumbworkspaceSettingTitle
Expand All @@ -27,14 +28,12 @@ describe("Manage SSO for multi workspace", () => {

cy.get(ssoSelector.cardTitle).verifyVisibleElement(
"have.text",
ssoText.generalSettingsElements.generalSettings
"Workspace login"
);
for (const elements in ssoSelector.generalSettingsElements) {
cy.get(
ssoSelector.generalSettingsElements[elements]
).verifyVisibleElement(
cy.get(ssoSelector.workspaceLoginPage[elements]).verifyVisibleElement(
"have.text",
ssoText.generalSettingsElements[elements]
ssoText.workspaceLoginPage[elements]
);
}
cy.get(ssoSelector.enableSignUpToggle).should("be.visible");
Expand All @@ -51,12 +50,6 @@ describe("Manage SSO for multi workspace", () => {
ssoText.saveButton
);

SSO.generalSettings();

cy.get(ssoSelector.alertText).verifyVisibleElement(
"have.text",
ssoText.alertText
);
cy.get(ssoSelector.passwordEnableToggle).should("be.visible");
cy.get(ssoSelector.passwordLoginToggleLbale).verifyVisibleElement(
"have.text",
Expand All @@ -67,35 +60,32 @@ describe("Manage SSO for multi workspace", () => {
ssoText.disablePasswordHelperText
);

SSO.passwordPageElements();
SSO.generalSettings();
});

it("Should verify Google SSO page elements", () => {
common.navigateToManageSSO();
cy.get(ssoSelector.google).should("be.visible").click();
cy.get(ssoSelector.cardTitle).verifyVisibleElement(
"have.text",
ssoText.googleTitle
);
cy.get(ssoSelector.cardTitle)
.eq(1)
.verifyVisibleElement("have.text", ssoText.googleTitle);
cy.get(ssoSelector.googleEnableToggle).should("be.visible");
cy.get(ssoSelector.clientIdLabel).verifyVisibleElement(
"have.text",
ssoText.clientIdLabel
);
cy.get(ssoSelector.clientIdInput).should("be.visible");
cy.get(ssoSelector.cancelButton).verifyVisibleElement(
"have.text",
ssoText.cancelButton
);
cy.get(ssoSelector.saveButton).verifyVisibleElement(
"have.text",
ssoText.saveButton
);
cy.get(ssoSelector.cancelButton)
.eq(1)
.verifyVisibleElement("have.text", ssoText.cancelButton);
cy.get(ssoSelector.saveButton)
.eq(1)
.verifyVisibleElement("have.text", ssoText.saveButton);

SSO.googleSSOPageElements();
SSO.disableDefaultSSO();
SSO.visitWorkspaceLoginPage();

SSO.defaultSSO("My workspace", false);
cy.logoutApi();
cy.visit("/login/my-workspace");
cy.get(ssoSelector.googleIcon).should("be.visible");
cy.get(ssoSelector.googleSSOText).verifyVisibleElement(
"have.text",
Expand All @@ -104,6 +94,8 @@ describe("Manage SSO for multi workspace", () => {
});

it("Should verify Git SSO page elements", () => {
SSO.defaultSSO("My workspace", true);

common.navigateToManageSSO();

cy.get(ssoSelector.git).should("be.visible").click();
Expand Down Expand Up @@ -139,27 +131,27 @@ describe("Manage SSO for multi workspace", () => {
ssoText.encriptedLabel
);
cy.get(ssoSelector.clientSecretInput).should("be.visible");
cy.get(ssoSelector.cancelButton).verifyVisibleElement(
"have.text",
ssoText.cancelButton
);
cy.get(ssoSelector.saveButton).verifyVisibleElement(
"have.text",
ssoText.saveButton
);
cy.get(ssoSelector.cancelButton)
.eq(1)
.verifyVisibleElement("have.text", ssoText.cancelButton);
cy.get(ssoSelector.saveButton)
.eq(1)
.verifyVisibleElement("have.text", ssoText.saveButton);

SSO.gitSSOPageElements();
SSO.visitWorkspaceLoginPage();
SSO.defaultSSO("My workspace", false);
cy.logoutApi();
cy.visit("/login/my-workspace");

cy.get(ssoSelector.googleIcon).should("be.visible");
cy.get(ssoSelector.googleSSOText).verifyVisibleElement(
cy.get(ssoSelector.gitIcon).should("be.visible");
cy.get(ssoSelector.gitSignInText).verifyVisibleElement(
"have.text",
ssoText.googleSSOText
ssoText.gitSignInText
);
});

if (envVar === "Community") {
it("Should verify the workspace login page", () => {
it.skip("Should verify the workspace login page", () => {
data.workspaceName = fake.companyName.toLowerCase();
cy.apiLogin();
cy.apiCreateWorkspace(data.workspaceName, data.workspaceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { dashboardSelector } from "Selectors/dashboard";
import { updateWorkspaceName } from "Support/utils/userPermissions";
import { groupsSelector } from "Selectors/manageGroups";
import { groupsText } from "Texts/manageGroups";
import { addNewUser } from "../../support/utils/onboarding";
import { addNewUser } from "Support/utils/onboarding";

const data = {};
data.groupName = fake.firstName.replaceAll("[^A-Za-z]", "");
Expand Down
8 changes: 8 additions & 0 deletions cypress-tests/cypress/support/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,11 @@ export const releaseApp = () => {
cy.verifyToastMessage(commonSelectors.toastMessage, "Version v1 released");
cy.wait(1000);
};

export const verifyTooltipDisabled = (selector, message) => {
cy.get(selector)
.trigger("mouseover", { force: true })
.then(() => {
cy.get(".tooltip-inner").last().should("have.text", message);
});
};

0 comments on commit 7e7aaf2

Please sign in to comment.