chore: drop flaky not so important UI tests (#26092)

This commit is contained in:
Ankush Menat 2024-04-22 17:20:02 +05:30 committed by GitHub
parent 2f38e7968c
commit d75b41793d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 0 additions and 221 deletions

View file

@ -1,85 +0,0 @@
context("Discussions", () => {
before(() => {
cy.login();
cy.visit("/app");
return cy
.window()
.its("frappe")
.then((frappe) => {
return frappe.call("frappe.tests.ui_test_helpers.create_data_for_discussions");
});
});
const reply_through_modal = () => {
cy.visit("/test-page-discussions");
// Open the modal
cy.get(".reply").click();
cy.wait(500);
cy.get(".discussion-modal").should("be.visible");
// Enter title
cy.get(".modal .topic-title")
.type("Discussion from tests")
.should("have.value", "Discussion from tests");
// Enter comment
cy.get(".modal .discussions-comment").type(
"This is a discussion from the cypress ui tests."
);
// Submit
cy.get(".modal .submit-discussion").click();
cy.wait(2000);
// Check if discussion is added to page and content is visible
cy.get(".sidebar-parent:first .discussion-topic-title").should(
"have.text",
"Discussion from tests"
);
cy.get(".discussion-on-page:visible").should("have.class", "show");
cy.get(".discussion-on-page:visible .reply-card .reply-text .ql-editor p").should(
"have.text",
"This is a discussion from the cypress ui tests."
);
};
const reply_through_comment_box = () => {
cy.get(".discussion-form:visible .discussions-comment").type(
"This is a discussion from the cypress ui tests. \n\nThis comment was entered through the commentbox on the page."
);
cy.get(".discussion-form:visible .submit-discussion").click();
cy.wait(3000);
cy.get(".discussion-on-page:visible").should("have.class", "show");
cy.get(".discussion-on-page:visible")
.children(".reply-card")
.eq(1)
.find(".reply-text")
.should(
"have.text",
"This is a discussion from the cypress ui tests. This comment was entered through the commentbox on the page.\n"
);
};
const single_thread_discussion = () => {
cy.visit("/test-single-thread");
cy.get(".discussions-sidebar").should("have.length", 0);
cy.get(".reply").should("have.length", 0);
cy.get(".discussion-form:visible .discussions-comment").type(
"This comment is being made on a single thread discussion."
);
cy.get(".discussion-form:visible .submit-discussion").click();
cy.wait(3000);
cy.get(".discussion-on-page")
.children(".reply-card")
.eq(-1)
.find(".reply-text")
.should("have.text", "This comment is being made on a single thread discussion.\n");
};
it("reply through modal", reply_through_modal);
it("reply through comment box", reply_through_comment_box);
it("single thread discussion", single_thread_discussion);
});

View file

@ -1,51 +0,0 @@
context("First Day of the Week", () => {
before(() => {
cy.login();
});
beforeEach(() => {
cy.visit("/app/system-settings");
cy.findByText("Date and Number Format").click();
});
it("Date control starts with same day as selected in System Settings", () => {
cy.intercept(
"POST",
"/api/method/frappe.core.doctype.system_settings.system_settings.load"
).as("load_settings");
cy.fill_field("first_day_of_the_week", "Tuesday", "Select");
cy.findByRole("button", { name: "Save" }).click();
cy.wait("@load_settings");
cy.dialog({
title: "Date",
fields: [
{
label: "Date",
fieldname: "date",
fieldtype: "Date",
},
],
});
cy.get_field("date").click();
cy.get(".datepicker--day-name").eq(0).should("have.text", "Tu");
});
it("Calendar view starts with same day as selected in System Settings", () => {
cy.intercept(
"POST",
"/api/method/frappe.core.doctype.system_settings.system_settings.load"
).as("load_settings");
cy.fill_field("first_day_of_the_week", "Monday", "Select");
cy.findByRole("button", { name: "Save" }).click();
cy.wait("@load_settings");
cy.visit("app/todo/view/calendar/default");
cy.get(".fc-day-header > span").eq(0).should("have.text", "Mon");
});
after(() => {
cy.visit("/app/system-settings");
cy.findByText("Date and Number Format").click();
cy.fill_field("first_day_of_the_week", "Sunday", "Select");
cy.findByRole("button", { name: "Save" }).click();
});
});

View file

@ -1,49 +0,0 @@
context("List View", () => {
before(() => {
cy.login();
cy.go_to_list("DocType");
});
it("List view check rows on drag", () => {
cy.get(".filter-x-button").click();
cy.get(".list-row-checkbox").then(($checkbox) => {
cy.wrap($checkbox).first().trigger("mousedown");
cy.get(".level.list-row").each(($ele) => {
cy.wrap($ele).trigger("mousemove");
});
cy.document().trigger("mouseup");
});
cy.get(".level.list-row .list-row-checkbox").each(($checkbox) => {
cy.wrap($checkbox).should("be.checked");
});
});
it("Check all rows are checked", () => {
cy.get(".level.list-row .list-row-checkbox")
.its("length")
.then((len) => {
cy.get(".level-item.list-header-meta")
.should("be.visible")
.should("contain.text", `${len} items selected`);
});
});
it("List view uncheck rows on drag", () => {
cy.get(".list-row-checkbox").then(($checkbox) => {
cy.wrap($checkbox).first().trigger("mousedown");
cy.get(".level.list-row").each(($ele) => {
cy.wrap($ele).trigger("mousemove");
});
cy.document().trigger("mouseup");
});
cy.get(".level.list-row .list-row-checkbox").each(($checkbox) => {
cy.wrap($checkbox).should("not.be.checked");
});
});
it("Check all rows are unchecked", () => {
cy.get(".level-item.list-header-meta").should("not.be.visible");
});
});

View file

@ -1,36 +0,0 @@
context("Blog Post", () => {
before(() => {
cy.login();
cy.visit("/app");
});
it("Blog Category dropdown works as expected", () => {
cy.create_records([
{
doctype: "Blog Category",
title: "Category 1",
published: 1,
},
{
doctype: "Blogger",
short_name: "John",
full_name: "John Doe",
},
{
doctype: "Blog Post",
title: "Test Blog Post",
content: "Test Blog Post Content",
blog_category: "category-1",
blogger: "John",
published: 1,
},
]);
cy.set_value("Blog Settings", "Blog Settings", { browse_by_category: 1 });
cy.visit("/blog");
cy.findByLabelText("Browse by category").select("Category 1");
cy.location("pathname").should("eq", "/blog/category-1");
cy.set_value("Blog Settings", "Blog Settings", { browse_by_category: 0 });
cy.visit("/blog");
cy.findByLabelText("Browse by category").should("not.exist");
});
});