diff --git a/app/client/cypress/e2e/Regression/ClientSide/AdminSettings/Email_settings_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/AdminSettings/Email_settings_Spec.ts new file mode 100644 index 000000000000..3c299d11d93b --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/AdminSettings/Email_settings_Spec.ts @@ -0,0 +1,532 @@ +import { + agHelper, + adminSettings, + homePage, + inviteModal, + appSettings, + embedSettings, +} from "../../../../support/Objects/ObjectsCore"; +import AdminsSettings from "../../../../locators/AdminsSettings"; +import formWidgetsPage from "../../../../locators/FormWidgets.json"; +import SignupPageLocators from "../../../../locators/SignupPage.json"; +import { CURRENT_REPO, REPO } from "../../../../fixtures/REPO"; +import homePageLocators from "../../../../locators/HomePage"; + +describe( + "Admin Email Page - Email setting page validations", + { tags: ["@tag.Settings", "@tag.Email"] }, + () => { + const fromEmail = `sagar.${Math.random().toString(36).substring(2, 25)}@appsmith.com`; + const POLL_INTERVAL = 5000; + const TIMEOUT = 100000; + const originUrl = Cypress.config("baseUrl"); + + let workspaceName: string, applicationName: string; + const emailOne = `sagarspec1.${Math.random().toString(36).substring(2, 25)}@appsmith.com`; + const emailTwo = `sagarspec2.${Math.random().toString(36).substring(2, 25)}@appsmith.com`; + const emailThree = `sagarspec3.${Math.random().toString(36).substring(2, 25)}@appsmith.com`; + const emailFour = `sagarspec4.${Math.random().toString(36).substring(2, 25)}@appsmith.com`; + const tempPassword = "testPassword"; + + before(() => { + cy.LogOut(); + cy.SignupFromAPI(emailOne, tempPassword); + cy.LogOut(); + cy.SignupFromAPI(emailTwo, tempPassword); + cy.LogOut(); + cy.SignupFromAPI(emailThree, tempPassword); + cy.LogOut(); + cy.SignupFromAPI(emailFour, tempPassword); + cy.LogOut(); + }); + + it("1. Verify adding new admin user and sign up process", () => { + cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); + adminSettings.NavigateToAdminSettings(); + agHelper.AssertElementVisibility(AdminsSettings.LeftPaneBrandingLink); + cy.get(AdminsSettings.addEmailGhostInput) + .click({ force: true }) + .type(fromEmail); + agHelper.ClickOutside(); + + agHelper.GetNClick(AdminsSettings.saveButton, 0, true); + cy.waitForServerRestart().then(() => { + agHelper.WaitUntilEleAppear(homePage._profileMenu); + }); + agHelper.AssertContains( + fromEmail, + "exist", + formWidgetsPage.dropdownInput, + ); + cy.SignupFromAPI(fromEmail, "testPassword"); + cy.LoginFromAPI(fromEmail, "testPassword"); + }); + + it("2. Verify admin setup smtp and test email works", () => { + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + agHelper.CypressReload(); + const testEmailSubject: string = "Test email from Appsmith"; + const testEmailBody: string = + "This is a test email from Appsmith, initiated from Admin Settings page. If you are seeing this, your email configuration is working!"; + adminSettings.NavigateToAdminSettings(false); + agHelper.AssertElementVisibility(AdminsSettings.LeftPaneBrandingLink); + agHelper.GetNClick(AdminsSettings.emailTab); + + cy.get(AdminsSettings.smtpAppsmithMailHostInput) + .clear() + .type("host.docker.internal") + .invoke("val") + .then((text) => { + expect(text).to.equal("host.docker.internal"); + }); + + cy.get(AdminsSettings.smtpAppsmithMailPortInput) + .clear() + .type("25") + .invoke("val") + .then((text) => { + expect(text).to.equal("25"); + }); + + cy.get(AdminsSettings.smtpAppsmithMailFromInput) + .clear() + .type(fromEmail) + .invoke("val") + .then((text) => { + expect(text).to.equal(fromEmail); + }); + + cy.get(AdminsSettings.smtpAppsmithMailReplyToInput) + .clear() + .type(fromEmail) + .invoke("val") + .then((text) => { + expect(text).to.equal(fromEmail); + }); + + cy.get(AdminsSettings.smtpAppsmithMailUserNameInput) + .clear() + .type("root") + .invoke("val") + .then((text) => { + expect(text).to.equal("root"); + }); + + cy.get(AdminsSettings.smtpAppsmithMailPasswordInput) + .clear() + .type("root") + .invoke("val") + .then((text) => { + expect(text).to.equal("root"); + }); + cy.intercept("POST", "/api/v1/admin/send-test-email").as("sendTestEmail"); + agHelper.GetNClick(AdminsSettings.smtpAppsmithMailTestButton); + cy.wait("@sendTestEmail").then((interception) => { + expect(interception.response.statusCode).to.eq(200); + cy.log( + "Intercepted API Response:", + JSON.stringify(interception.response.body), + ); + }); + try { + agHelper + .waitForEmail({ + pollInterval: POLL_INTERVAL, + timeout: TIMEOUT, + targetSubject: testEmailSubject, + targetEmail: fromEmail, + }) + .then((email) => { + if (email) { + expect(email).to.exist; + expect(email.headers.subject).to.equal(testEmailSubject); + expect(email.headers.to).to.equal(fromEmail); + expect(email.text.trim()).to.equal(testEmailBody); + } else { + cy.log("No email received, continuing test without failure."); + } + }); + } catch (error) { + cy.log("Error occurred while fetching email:", error); + } + agHelper.GetNClick(AdminsSettings.saveButton, 0, true); + cy.waitForServerRestart(); + agHelper.WaitUntilEleAppear(homePage._profileMenu); + }); + + it("3. To verify forget password email", () => { + agHelper.VisitNAssert("/applications", "getAllWorkspaces"); + const resetPassSubject: string = + CURRENT_REPO === REPO.EE + ? "Reset your Appsmith password" + : "Reset your Appsmith password"; + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); + + agHelper.GetNClick(SignupPageLocators.forgetPasswordLink, 0, true); + agHelper.GetElement(SignupPageLocators.username).type(emailOne); + + cy.intercept( + { + method: "POST", + url: "/api/v1/users/forgotPassword", // Match the endpoint + }, + (req) => { + req.headers["Origin"] = originUrl.replace(/\/$/, ""); + req.continue(); + }, + ).as("forgotPasswordCall"); + + agHelper.GetNClick(SignupPageLocators.submitBtn); + + // Wait for the intercepted request and validate + cy.wait("@forgotPasswordCall").then((interception) => { + if (interception.response) { + expect(interception.response.statusCode).to.equal(200); // Ensure the response is successful + } else { + cy.log("Interception did not receive a response."); + } + }); + + agHelper.AssertContains( + `A password reset link has been sent to your email address ${emailOne} registered with Appsmith.`, + ); + + try { + agHelper + .waitForEmail({ + pollInterval: POLL_INTERVAL, + timeout: TIMEOUT, + targetSubject: resetPassSubject, + targetEmail: emailOne, + }) + .then((email) => { + if (email) { + expect(email).to.exist; + expect(email.headers.subject).to.equal(resetPassSubject); + expect(email.headers.to).to.equal(emailOne); + + const emailHtml = email.html; // Store the email HTML content + const resetPasswordLinkMatch = emailHtml.match( + /href="([^"]*resetPassword[^"]*)"/, + ); + + console.log("Reset Password data:", resetPasswordLinkMatch); + + if (resetPasswordLinkMatch) { + const resetPasswordLink = resetPasswordLinkMatch[1] + .replace(new RegExp(`(${originUrl})(\\/+)`, "g"), "$1/") + .replace(/=/g, "="); + + console.log("Reset Password Link:", resetPasswordLink); + + cy.visit(resetPasswordLink, { timeout: 60000 }); + agHelper.AssertContains("Reset password"); + agHelper.AssertContains("New password"); + agHelper + .GetElement(SignupPageLocators.password) + .type(tempPassword); + agHelper.GetNClick(SignupPageLocators.submitBtn); + agHelper.AssertContains("Your password has been reset"); + } else { + cy.log("Reset password link not found in the email HTML"); + } + } else { + cy.log("No email found with subject:", resetPassSubject); + } + }); + } catch (error) { + cy.log( + "Error occurred while fetching the email or processing the reset password link:", + error, + ); + } + }); + + it("4. To verify invite workspace email", () => { + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + agHelper.CypressReload(); + const inviteEmailSubject: string = + CURRENT_REPO === REPO.EE + ? "You’re invited to the workspace" + : "You’re invited to the Appsmith workspace"; + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + agHelper.CypressReload(); + cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + if (CURRENT_REPO === REPO.EE) adminSettings.EnableGAC(false, true); + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + workspaceName = `workspace-${uid}`; + applicationName = `application-${uid}`; + homePage.CreateNewWorkspace(workspaceName, true); + homePage.CreateAppInWorkspace(workspaceName, applicationName); + homePage.NavigateToHome(); + homePage.InviteUserToWorkspace(workspaceName, emailTwo, "Developer"); + }); + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); + cy.LoginFromAPI(emailTwo, tempPassword); + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + try { + agHelper + .waitForEmail({ + pollInterval: POLL_INTERVAL, + timeout: TIMEOUT, + targetSubject: inviteEmailSubject, + targetEmail: emailTwo, + }) + .then((email) => { + if (email) { + expect(email).to.exist; + expect(email.headers.subject).to.include(inviteEmailSubject); + expect(email.headers.to).to.equal(emailTwo); + + const emailHtml = email.html; // Store the email HTML content + const inviteLinkMatch = emailHtml.match( + /href="([^"]*applications[^"]*)"/, + ); // Extract the link using regex + + if (inviteLinkMatch) { + const inviteLink = inviteLinkMatch[1].replace( + /([^:]\/)\/+/g, + "$1", + ); + console.log("Invite workspace Link:", inviteLink); + cy.visit(inviteLink, { timeout: 60000 }); + homePage.SelectWorkspace(workspaceName); + agHelper.AssertContains(workspaceName); + cy.get(homePageLocators.applicationCard) + .first() + .trigger("mouseover"); + agHelper.AssertElementExist(homePageLocators.appEditIcon); + } else { + cy.log("Invite workspace app link not found in the email HTML"); + } + } else { + cy.log("No email found with subject:", inviteEmailSubject); + } + }); + } catch (error) { + cy.log( + "Error occurred while fetching the email or processing the invite link:", + error, + ); + } + }); + + it("5. To verify application invite email with developer right", () => { + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + agHelper.CypressReload(); + const inviteEmailSubject: string = + CURRENT_REPO === REPO.EE + ? "You're invited to the app" + : "You’re invited to the Appsmith workspace."; + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); + cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + if (CURRENT_REPO === REPO.EE) adminSettings.EnableGAC(false, true); + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + workspaceName = `workspace-${uid}`; + applicationName = `application-${uid}`; + homePage.CreateNewWorkspace(workspaceName); + homePage.CreateAppInWorkspace(workspaceName, applicationName); + }); + + appSettings.OpenAppSettings(); + appSettings.GoToEmbedSettings(); + embedSettings.ToggleMarkForkable(); + embedSettings.TogglePublicAccess(); + + inviteModal.OpenShareModal(); + homePage.InviteUserToApplication(emailThree, "Developer"); + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); + cy.LoginFromAPI(emailThree, tempPassword); + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + try { + agHelper + .waitForEmail({ + pollInterval: POLL_INTERVAL, + timeout: TIMEOUT, + targetSubject: inviteEmailSubject, + targetEmail: emailThree, + }) + .then((email) => { + if (email) { + console.log("Email:", email); + expect(email).to.exist; + expect(email.headers.subject).to.include(inviteEmailSubject); + expect(email.headers.to).to.include(emailThree); + + const emailHtml = email.html; // Store the email HTML content + + // Match all href links inside the + const bodyMatch = emailHtml.match( + /]*>([\s\S]*?)<\/body>/i, + ); + console.log("bodyMatch: ", bodyMatch); + + if (bodyMatch && bodyMatch[1]) { + const bodyContent = bodyMatch[1]; + + const inviteLinkMatch = bodyContent.match( + /href="https?:\/\/[^"]*"/, + ); + console.log("inviteLinkMatch: ", inviteLinkMatch); + + if (inviteLinkMatch) { + const inviteLink = inviteLinkMatch[0] + .replace(/([^:]\/)\/+/g, "$1") + .replace(/href=|=|"|"/g, ""); + + console.log("Invite workspace Link:", inviteLink); + cy.visit(inviteLink, { timeout: 60000 }); + homePage.SelectWorkspace(workspaceName); + agHelper.AssertContains(applicationName); + cy.get(homePageLocators.applicationCard) + .first() + .trigger("mouseover"); + agHelper.AssertElementExist(homePageLocators.appEditIcon); + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear( + SignupPageLocators.forgetPasswordLink, + ); + } else { + cy.log( + "Invite developer app link not found in the email HTML", + ); + } + } else { + cy.log("No body content found in the email HTML"); + } + } else { + cy.log("No email found with subject:", inviteEmailSubject); + } + }); + } catch (error) { + cy.log( + "Error occurred while fetching the email or processing the invite link:", + error, + ); + } + }); + + it("6. To verify application invite email with view right", () => { + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + agHelper.CypressReload(); + const inviteEmailSubject: string = + CURRENT_REPO === REPO.EE + ? "You're invited to the app" + : "You’re invited to the Appsmith workspace."; + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); + agHelper.VisitNAssert(adminSettings.routes.APPLICATIONS); + cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); + + if (CURRENT_REPO === REPO.EE) adminSettings.EnableGAC(false, true); + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + workspaceName = `workspace-${uid}`; + applicationName = `application-${uid}`; + homePage.CreateNewWorkspace(workspaceName); + homePage.CreateAppInWorkspace(workspaceName, applicationName); + }); + + appSettings.OpenAppSettings(); + appSettings.GoToEmbedSettings(); + embedSettings.ToggleMarkForkable(); + embedSettings.TogglePublicAccess(); + + inviteModal.OpenShareModal(); + homePage.InviteUserToApplication(emailFour, "App Viewer"); + homePage.LogOutviaAPI(); + agHelper.VisitNAssert("/"); + agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); + cy.LoginFromAPI(emailFour, tempPassword); + try { + agHelper + .waitForEmail({ + pollInterval: POLL_INTERVAL, + timeout: TIMEOUT, + targetSubject: inviteEmailSubject, + targetEmail: emailFour, + }) + .then((email) => { + if (email) { + console.log("Email:", email); + if (email.headers.subject.includes(inviteEmailSubject)) { + console.log("Subject matches:", email.headers.subject); + } else { + console.log("Subject does not match expected subject."); + } + + if (email.headers.to && email.headers.to.includes(emailFour)) { + console.log("Recipient matches:", email.headers.to); + } else { + console.log("Recipient does not match expected email."); + } + + const emailHtml = email.html; + + const bodyMatch = emailHtml.match( + /]*>([\s\S]*?)<\/body>/i, + ); + console.log("bodyMatch: ", bodyMatch); + + if (bodyMatch && bodyMatch[1]) { + const bodyContent = bodyMatch[1]; + + const inviteLinkMatch = bodyContent.match( + /href="https?:\/\/[^"]*"/, + ); + console.log("inviteLinkMatch: ", inviteLinkMatch); + + if (inviteLinkMatch) { + const inviteLink = inviteLinkMatch[0] + .replace(/([^:]\/)\/+/g, "$1") + .replace(/href=|=|"|"/g, ""); + + console.log("Invite workspace Link:", inviteLink); + cy.visit(inviteLink, { timeout: 60000 }); + homePage.SelectWorkspace(workspaceName); + agHelper.AssertContains(applicationName); + cy.get(homePageLocators.applicationCard) + .first() + .trigger("mouseover"); + agHelper.AssertElementAbsence(homePageLocators.appEditIcon); + } else { + cy.log("Invite viewer app link not found in the email HTML"); + } + } else { + cy.log("No body content found in the email HTML"); + } + } else { + cy.log("No email found with subject:", inviteEmailSubject); + } + }); + } catch (error) { + const errorMessage = + error.message || + "An unknown error occurred during email fetching or invite link processing."; + const errorStack = error.stack || "No stack trace available."; + + cy.log( + `Error occurred while fetching the email or processing the invite link: ${errorMessage}`, + ); + cy.log(`Stack Trace: ${errorStack}`); + } + }); + }, +); diff --git a/app/client/cypress/locators/AdminsSettings.js b/app/client/cypress/locators/AdminsSettings.js index a93d245b98a8..6a03d6238b22 100644 --- a/app/client/cypress/locators/AdminsSettings.js +++ b/app/client/cypress/locators/AdminsSettings.js @@ -70,4 +70,12 @@ export default { businessTag: ".business-tag", upgradeBanner: ".upgrade-banner", upgradeButton: "[data-testid='t--button-upgrade']", + smtpAppsmithMailHostInput: "[name='APPSMITH_MAIL_HOST']", + smtpAppsmithMailPortInput: "[name='APPSMITH_MAIL_PORT']", + smtpAppsmithMailFromInput: "[name='APPSMITH_MAIL_FROM']", + smtpAppsmithMailReplyToInput: "[name='APPSMITH_REPLY_TO']", + smtpAppsmithMailUserNameInput: "[name='APPSMITH_MAIL_USERNAME']", + smtpAppsmithMailPasswordInput: "[name='APPSMITH_MAIL_PASSWORD']", + smtpAppsmithMailTestButton: "[data-testid='admin-settings-button']", + addEmailGhostInput: "[data-testid='admin-settings-tag-input'] .bp3-input-ghost", }; diff --git a/app/client/cypress/locators/SignupPage.json b/app/client/cypress/locators/SignupPage.json index e55ca15aef5b..13bc4d70ce38 100644 --- a/app/client/cypress/locators/SignupPage.json +++ b/app/client/cypress/locators/SignupPage.json @@ -5,5 +5,6 @@ "proficiencyGroupButton": "[data-testid='t--user-proficiency'] button", "useCaseGroupButton": "[data-testid='t--user-use-case'] button", "dropdownOption": ".rc-select-item-option:first", - "getStartedSubmit": ".t--get-started-button" -} \ No newline at end of file + "getStartedSubmit": ".t--get-started-button", + "forgetPasswordLink": "[href='/user/forgotPassword']" +} diff --git a/app/client/cypress/support/Pages/AggregateHelper.ts b/app/client/cypress/support/Pages/AggregateHelper.ts index c07b6a8151dd..466b32c26381 100644 --- a/app/client/cypress/support/Pages/AggregateHelper.ts +++ b/app/client/cypress/support/Pages/AggregateHelper.ts @@ -1999,4 +1999,97 @@ export class AggregateHelper { cy.spy(win.console, "warn").as("warn"); }); } + + public waitForEmail({ + pollInterval, + targetEmail, + targetSubject, + timeout, + }: { + pollInterval: number; + timeout: number; + targetSubject: string; + targetEmail?: string; + }): Cypress.Chainable { + const endTime = Date.now() + timeout; + let latestEmail: any = null; + + function parseDate(dateString: string): Date { + return new Date(dateString.replace(/ \([A-Za-z\s]*\)$/, "")); + } + + function fetchEmail(): Cypress.Chainable { + return cy + .request("http://localhost:5001/api/v1/maildev-emails") + .then((res) => { + if (res.status !== 200) { + cy.log(`Request failed with status ${res.status}`); + return cy.wrap(null); + } + + const emails: Array<{ + headers: { + subject: string; + date: string; + to: string; + from: string; + }; + text: string; + }> = res.body; + + const matchingEmails = emails.filter((email) => { + const subjectMatch = email.headers.subject + .trim() + .toLowerCase() + .includes(targetSubject.trim().toLowerCase()); + + if (targetEmail) { + const emailTo = email.headers.to.trim().toLowerCase(); + return ( + subjectMatch && emailTo === targetEmail.trim().toLowerCase() + ); + } + + return subjectMatch; + }); + + if (matchingEmails.length > 0) { + latestEmail = matchingEmails.reduce((latest, email) => { + const emailDate = parseDate(email.headers.date); + const latestDate = parseDate( + latest?.headers?.date || "1970-01-01", + ); + + return emailDate > latestDate ? email : latest; + }, null); + + if (latestEmail) { + cy.log("===== Email Details ====="); + cy.log(`From: ${latestEmail.headers.from}`); + cy.log(`To: ${latestEmail.headers.to}`); + cy.log(`Subject: ${latestEmail.headers.subject}`); + cy.log("========================="); + } + + return cy.wrap(latestEmail); + } + + if (Date.now() > endTime) { + cy.log("===== Info ====="); + cy.log( + `No email with subject "${targetSubject}" found${ + targetEmail ? ` for recipient "${targetEmail}"` : "" + } within the timeout period.`, + ); + cy.log("================"); + + return cy.wrap(null); + } + + return cy.wait(pollInterval).then(fetchEmail); + }); + } + + return fetchEmail(); + } } diff --git a/app/client/cypress/support/Pages/HomePage.ts b/app/client/cypress/support/Pages/HomePage.ts index b231b0f12dd1..a0ca049a15aa 100644 --- a/app/client/cypress/support/Pages/HomePage.ts +++ b/app/client/cypress/support/Pages/HomePage.ts @@ -242,7 +242,7 @@ export class HomePage { this.agHelper.GetNClick(this._inviteButton, 0, true); cy.wait("@mockPostInvite") .its("request.headers") - .should("have.property", "origin", "Cypress"); + .should("have.property", "origin", Cypress.config("baseUrl")); this.agHelper.ValidateToastMessage(successMessage); } @@ -266,10 +266,10 @@ export class HomePage { public StubPostHeaderReq() { cy.intercept("POST", "/api/v1/users/invite", (req) => { - req.headers["origin"] = "Cypress"; + req.headers["origin"] = Cypress.config("baseUrl"); }).as("mockPostInvite"); cy.intercept("POST", "/api/v1/applications/invite", (req) => { - req.headers["origin"] = "Cypress"; + req.headers["origin"] = Cypress.config("baseUrl"); }).as("mockPostAppInvite"); } @@ -684,7 +684,7 @@ export class HomePage { this.agHelper.GetNClick(this._inviteButton, 0, true); cy.wait("@mockPostInvite") .its("request.headers") - .should("have.property", "origin", "Cypress"); + .should("have.property", "origin", Cypress.config("baseUrl")); // cy.contains(email, { matchCase: false }); if (validate) { cy.contains(successMessage); @@ -704,7 +704,7 @@ export class HomePage { this.agHelper.GetNClick(this._inviteButton, 0, true); cy.wait("@mockPostAppInvite") .its("request.headers") - .should("have.property", "origin", "Cypress"); + .should("have.property", "origin", Cypress.config("baseUrl")); // cy.contains(email, { matchCase: false }); cy.contains(successMessage); } diff --git a/app/client/cypress/tags.js b/app/client/cypress/tags.js index 09843e88d6db..0d8cb65aa49b 100644 --- a/app/client/cypress/tags.js +++ b/app/client/cypress/tags.js @@ -18,6 +18,7 @@ module.exports = { "@tag.Divider", "@tag.DocumentViewer", "@tag.Dropdown", + "@tag.Email", "@tag.Filepicker", "@tag.Fork", "@tag.Form",