Skip to content

Commit

Permalink
test: fix cypress tests (frappe#26012)
Browse files Browse the repository at this point in the history
* ci: less retries for cypress

waste of cpu cycles and time, produces misleading output

* test: fix workspace tests

* chore: drop flaky af tests

* fix: Avoid sending `"undefined"` as docname
  • Loading branch information
ankush committed Apr 17, 2024
1 parent be0e935 commit 1dcfadf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 101 deletions.
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ module.exports = defineConfig({
viewportHeight: 960,
viewportWidth: 1400,
retries: {
runMode: 2,
openMode: 2,
runMode: 1,
openMode: 1,
},
e2e: {
// We've imported your old cypress plugins here.
Expand Down
97 changes: 0 additions & 97 deletions cypress/integration/folder_navigation.js

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/integration/workspace_blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ context("Workspace Blocks", () => {

// add number card
cy.fill_field("number_card_name", "Test Number Card", "Link");
cy.get('[data-fieldname="number_card_name"] ul li').contains("Test Number Card").click();
cy.get('[data-fieldname="number_card_name"] ul div').contains("Test Number Card").click();
cy.click_modal_primary_button("Add");
cy.get(".ce-block .number-widget-box").first().as("number_card");
cy.get("@number_card").find(".widget-title").should("contain", "Test Number Card");
Expand Down
5 changes: 4 additions & 1 deletion realtime/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ function frappe_handlers(socket) {
socket.has_permission = (doctype, name) => {
return new Promise((resolve) => {
socket
.frappe_request("/api/method/frappe.realtime.has_permission", { doctype, name })
.frappe_request("/api/method/frappe.realtime.has_permission", {
doctype,
name: name || "",
})
.then((res) => res.json())
.then(({ message }) => {
if (message) {
Expand Down

0 comments on commit 1dcfadf

Please sign in to comment.