Skip to content
Snippets Groups Projects
Unverified Commit 1b3c9cda authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Fix subscription flakes related to "Email sent" string (#21441)

parent a6078be4
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,11 @@ export const openEmailPage = emailSubject => {
});
};
export const clickSend = () => {
cy.button("Send email now").click();
cy.button("Email sent", 30000);
};
export const sendSubscriptionsEmail = recipient => {
cy.icon("subscription").click();
......@@ -67,6 +72,5 @@ export const sendSubscriptionsEmail = recipient => {
.type(`${recipient}{enter}`)
.blur();
cy.button("Send email now").click();
cy.button("Email sent", 30000);
clickSend();
};
......@@ -3,6 +3,7 @@ import {
popover,
setupSMTP,
visitDashboard,
clickSend,
} from "__support__/e2e/cypress";
describe.skip("issue 18009", () => {
......@@ -30,8 +31,7 @@ describe.skip("issue 18009", () => {
// Click anywhere to close the popover that covers the "Send email now" button
cy.findByText("To:").click();
cy.button("Send email now").click();
cy.findByText("Email sent");
clickSend();
cy.request("GET", "http://localhost:80/email").then(({ body }) => {
expect(body[0].html).not.to.include(
......
......@@ -4,6 +4,7 @@ import {
saveDashboard,
setupSMTP,
visitDashboard,
clickSend,
} from "__support__/e2e/cypress";
import { USERS } from "__support__/e2e/cypress_data";
......@@ -48,8 +49,7 @@ describe("issue 18344", () => {
// Click this just to close the popover that is blocking the "Send email now" button
cy.findByText(`To:`).click();
cy.button("Send email now").click();
cy.findByText("Email sent");
clickSend();
cy.request("GET", "http://localhost:80/email").then(({ body }) => {
expect(body[0].html).to.include("OrdersFoo");
......
......@@ -3,6 +3,7 @@ import {
setupSMTP,
visitQuestion,
visitDashboard,
clickSend,
} from "__support__/e2e/cypress";
import { USERS } from "__support__/e2e/cypress_data";
......@@ -43,8 +44,7 @@ describe("issue 18352", () => {
// Click this just to close the popover that is blocking the "Send email now" button
cy.findByText(`To:`).click();
cy.button("Send email now").click();
cy.findByText("Email sent");
clickSend();
cy.request("GET", "http://localhost:80/email").then(
({ body: [{ html }] }) => {
......
......@@ -5,6 +5,7 @@ import {
setupSMTP,
sidebar,
visitDashboard,
clickSend,
} from "__support__/e2e/cypress";
import { USERS, SAMPLE_DB_ID } from "__support__/e2e/cypress_data";
......@@ -45,8 +46,7 @@ describeEE("issue 18669", () => {
cy.button("Update filter").click();
});
cy.button("Send email now").click();
cy.findByText("Email sent", { timeout: 10000 });
clickSend();
});
});
......
......@@ -7,8 +7,10 @@ import {
mockSlackConfigured,
isOSS,
visitDashboard,
clickSend,
} from "__support__/e2e/cypress";
import { USERS } from "__support__/e2e/cypress_data";
const { admin } = USERS;
describe("scenarios > dashboard > subscriptions", () => {
......@@ -216,8 +218,7 @@ describe("scenarios > dashboard > subscriptions", () => {
});
// Click anywhere outside to close the popover
cy.findByText("15705D").click();
cy.findByText("Send email now").click();
cy.findByText("Email sent");
clickSend();
cy.request("GET", "http://localhost:80/email").then(({ body }) => {
expect(body[0].html).not.to.include(
"An error occurred while displaying this card.",
......@@ -240,9 +241,7 @@ describe("scenarios > dashboard > subscriptions", () => {
assignRecipient();
// Click outside popover to close it and at the same time check that the text card content is shown as expected
cy.findByText(TEXT_CARD).click();
cy.findByText("Send email now").click();
cy.findByText(/^Sending/);
cy.findByText("Email sent");
clickSend();
cy.request("GET", "http://localhost:80/email").then(({ body }) => {
expect(body[0].html).to.include(TEXT_CARD);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment