From d6e0cdb4fec74448c3fd949a3c4a967142ad942e Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 20 May 2020 22:45:29 +0530 Subject: [PATCH 1/5] fix (test): fix flaky relative filter test --- cypress/integration/relative_filters.js | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress/integration/relative_filters.js b/cypress/integration/relative_filters.js index 986c5ce342..411ede62fa 100644 --- a/cypress/integration/relative_filters.js +++ b/cypress/integration/relative_filters.js @@ -1,7 +1,6 @@ context('Relative Timeframe', () => { beforeEach(() => { cy.login(); - cy.visit('/desk#workspace/Website'); }); before(() => { cy.login(); From 7a1cb7fa00c9c893494c4bd225dc4d70ed630d2f Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 20 May 2020 23:21:09 +0530 Subject: [PATCH 2/5] refactor: don't login before each test --- cypress/integration/control_link.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/integration/control_link.js b/cypress/integration/control_link.js index 658a7fe320..07e427ab02 100644 --- a/cypress/integration/control_link.js +++ b/cypress/integration/control_link.js @@ -1,12 +1,16 @@ context('Control Link', () => { - beforeEach(() => { + before(() => { cy.login(); cy.visit('/desk#workspace/Website'); + }); + + beforeEach(() => { + cy.visit('/desk#workspace/Website'); cy.create_records({ doctype: 'ToDo', description: 'this is a test todo for link' }).as('todos'); - }); + }) function get_dialog_with_link() { return cy.dialog({ From 5d5cb26143f4866a5f73d48d85daea14a6fe6a04 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 20 May 2020 23:28:40 +0530 Subject: [PATCH 3/5] fix: add delay in typing --- cypress/integration/control_link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/control_link.js b/cypress/integration/control_link.js index 07e427ab02..eb9ab405b5 100644 --- a/cypress/integration/control_link.js +++ b/cypress/integration/control_link.js @@ -34,7 +34,7 @@ context('Control Link', () => { cy.get('.frappe-control[data-fieldname=link] input').focus().as('input'); cy.wait('@search_link'); - cy.get('@input').type('todo for link'); + cy.get('@input').type('todo for link', { delay: 200 }); cy.wait('@search_link'); cy.get('.frappe-control[data-fieldname=link] ul').should('be.visible'); cy.get('.frappe-control[data-fieldname=link] input').type('{enter}', { delay: 100 }); From 53855cad1d7d39a196c01c5e33a5530091350dbc Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 20 May 2020 23:29:30 +0530 Subject: [PATCH 4/5] fix (cypress): set default command timeout to 20 seconds --- cypress.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index ae0c45c3ae..97ac41bb61 100644 --- a/cypress.json +++ b/cypress.json @@ -2,6 +2,6 @@ "baseUrl": "http://test_site_ui:8000", "projectId": "92odwv", "adminPassword": "admin", - "defaultCommandTimeout": 10000, + "defaultCommandTimeout": 20000, "pageLoadTimeout": 15000 } From e33bcfa6bd5afd68d7815844a92275dcb1754674 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 21 May 2020 00:03:46 +0530 Subject: [PATCH 5/5] style: fix linting issue --- cypress/integration/control_link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/control_link.js b/cypress/integration/control_link.js index eb9ab405b5..0dc7d5b88e 100644 --- a/cypress/integration/control_link.js +++ b/cypress/integration/control_link.js @@ -10,7 +10,7 @@ context('Control Link', () => { doctype: 'ToDo', description: 'this is a test todo for link' }).as('todos'); - }) + }); function get_dialog_with_link() { return cy.dialog({