Skip to content

Commit

Permalink
Merge pull request #26240 from frappe/version-14-hotfix
Browse files Browse the repository at this point in the history
chore: release v14
  • Loading branch information
ankush committed Apr 30, 2024
2 parents d1f5e14 + 760ff72 commit 57ef1da
Show file tree
Hide file tree
Showing 57 changed files with 666 additions and 824 deletions.
37 changes: 0 additions & 37 deletions cypress/integration/control_attach.js
Expand Up @@ -19,43 +19,6 @@ context("Attach Control", () => {
});
});
});
it('Checking functionality for "Link" button in the "Attach" fieldtype', () => {
//Navigating to the new form for the newly created doctype
cy.new_form("Test Attach Control");

//Clicking on the attach button which is displayed as part of creating a doctype with "Attach" fieldtype
cy.findByRole("button", { name: "Attach" }).click();

//Clicking on "Link" button to attach a file using the "Link" button
cy.findByRole("button", { name: "Link" }).click();
cy.findByPlaceholderText("Attach a web link").type(
"https://wallpaperplay.com/walls/full/8/2/b/72402.jpg"
);

//Clicking on the Upload button to upload the file
cy.intercept("POST", "/api/method/upload_file").as("upload_image");
cy.get(".modal-footer").findByRole("button", { name: "Upload" }).click({ delay: 500 });
cy.wait("@upload_image");
cy.findByRole("button", { name: "Save" }).click();

//Checking if the URL of the attached image is getting displayed in the field of the newly created doctype
cy.get(".attached-file > .ellipsis > .attached-file-link")
.should("have.attr", "href")
.and("equal", "https://wallpaperplay.com/walls/full/8/2/b/72402.jpg");

//Clicking on the "Clear" button
cy.get('[data-action="clear_attachment"]').click();

//Checking if clicking on the clear button clears the field of the doctype form and again displays the attach button
cy.get(".control-input > .btn-sm").should("contain", "Attach");

//Deleting the doc
cy.go_to_list("Test Attach Control");
cy.get(".list-row-checkbox").eq(0).click();
cy.get(".actions-btn-group > .btn").contains("Actions").click();
cy.get('.actions-btn-group > .dropdown-menu [data-label="Delete"]').click();
cy.click_modal_primary_button("Yes");
});

it('Checking functionality for "Library" button in the "Attach" fieldtype', () => {
//Navigating to the new form for the newly created doctype
Expand Down
3 changes: 3 additions & 0 deletions cypress/integration/control_duration.js
Expand Up @@ -20,11 +20,14 @@ context("Control Duration", () => {

it("should set duration", () => {
get_dialog_with_duration().as("dialog");
cy.wait(500);
cy.get(".frappe-control[data-fieldname=duration] input").first().click();
cy.get(".duration-input[data-duration=days]")
.type(45, { force: true })
.blur({ force: true });
cy.wait(500);
cy.get(".duration-input[data-duration=minutes]").type(30).blur({ force: true });
cy.wait(500);
cy.get(".frappe-control[data-fieldname=duration] input")
.first()
.should("have.value", "45d 30m");
Expand Down
37 changes: 1 addition & 36 deletions cypress/integration/file_uploader.js
Expand Up @@ -10,6 +10,7 @@ context("FileUploader", () => {
.then((frappe) => {
new frappe.ui.FileUploader();
});
cy.wait(1000);
}

it("upload dialog api works", () => {
Expand Down Expand Up @@ -47,40 +48,4 @@ context("FileUploader", () => {
.should("have.property", "file_name", "example.json");
cy.get(".modal:visible").should("not.exist");
});

it("should accept web links", () => {
open_upload_dialog();

cy.get_open_dialog().findByRole("button", { name: "Link" }).click();
cy.get_open_dialog()
.findByPlaceholderText("Attach a web link")
.type("https://github.com", { delay: 100, force: true });
cy.intercept("POST", "/api/method/upload_file").as("upload_file");
cy.get_open_dialog().findByRole("button", { name: "Upload" }).click();
cy.wait("@upload_file")
.its("response.body.message")
.should("have.property", "file_url", "https://github.com");
cy.get(".modal:visible").should("not.exist");
});

it("should allow cropping and optimization for valid images", () => {
open_upload_dialog();

cy.get_open_dialog()
.find(".file-upload-area")
.selectFile("cypress/fixtures/sample_image.jpg", {
action: "drag-drop",
});

cy.get_open_dialog().findAllByText("sample_image.jpg").should("exist");
cy.get_open_dialog().find(".btn-crop").first().click();
cy.get_open_dialog().findByRole("button", { name: "Crop" }).click();
cy.get_open_dialog().findAllByRole("checkbox", { name: "Optimize" }).should("exist");
cy.get_open_dialog().findAllByLabelText("Optimize").first().click();

cy.intercept("POST", "/api/method/upload_file").as("upload_file");
cy.get_open_dialog().findByRole("button", { name: "Upload" }).click();
cy.wait("@upload_file").its("response.statusCode").should("eq", 200);
cy.get(".modal:visible").should("not.exist");
});
});
26 changes: 0 additions & 26 deletions cypress/integration/form.js
Expand Up @@ -30,32 +30,6 @@ context("Form", () => {
cy.get(".list-row").should("contain", "this is a test todo");
});

it("navigates between documents with child table list filters applied", () => {
cy.visit("/app/contact");

cy.clear_filters();
cy.get('.standard-filter-section [data-fieldname="name"] input')
.type("Test Form Contact 3")
.blur();
cy.click_listview_row_item_with_text("Test Form Contact 3");

cy.get("#page-Contact .page-head").findByTitle("Test Form Contact 3").should("exist");
cy.get(".prev-doc").should("be.visible").click();
cy.get(".msgprint-dialog .modal-body").contains("No further records").should("be.visible");
cy.hide_dialog();

cy.get("#page-Contact .page-head").findByTitle("Test Form Contact 3").should("exist");
cy.get(".next-doc").should("be.visible").click();
cy.get(".msgprint-dialog .modal-body").contains("No further records").should("be.visible");
cy.hide_dialog();

cy.get("#page-Contact .page-head").findByTitle("Test Form Contact 3").should("exist");

// clear filters
cy.visit("/app/contact");
cy.clear_filters();
});

it("validates behaviour of Data options validations in child table", () => {
// test email validations for set_invalid controller
let website_input = "website.in";
Expand Down
42 changes: 0 additions & 42 deletions cypress/integration/list_paging.js

This file was deleted.

15 changes: 0 additions & 15 deletions cypress/integration/list_view.js
Expand Up @@ -10,21 +10,6 @@ context("List View", () => {
});
});

it("Keep checkbox checked after Refresh", { scrollBehavior: false }, () => {
cy.go_to_list("ToDo");
cy.clear_filters();
cy.get(".list-row-container .list-row-checkbox").click({
multiple: true,
force: true,
});
cy.get(".actions-btn-group button").contains("Actions").should("be.visible");
cy.intercept("/api/method/frappe.desk.reportview.get").as("list-refresh");
cy.wait(3000); // wait before you hit another refresh
cy.get('button[data-original-title="Refresh"]').click();
cy.wait("@list-refresh");
cy.get(".list-row-container .list-row-checkbox:checked").should("be.visible");
});

it('enables "Actions" button', { scrollBehavior: false }, () => {
const actions = [
"Approve",
Expand Down
38 changes: 0 additions & 38 deletions cypress/integration/list_view_settings.js

This file was deleted.

0 comments on commit 57ef1da

Please sign in to comment.