From f14bd1bb0bf0ae93f5a23cee3f6c68fe2e447142 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 1 Feb 2021 07:35:28 +0530 Subject: [PATCH] test: Fix recorder and datetime tests --- cypress/integration/datetime.js | 2 +- cypress/integration/recorder.js | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/cypress/integration/datetime.js b/cypress/integration/datetime.js index d66680b96b..b310526c7c 100644 --- a/cypress/integration/datetime.js +++ b/cypress/integration/datetime.js @@ -42,7 +42,7 @@ context('Control Date, Time and DateTime', () => { .should('be.visible'); cy.get( '.datepickers-container .datepicker.active .datepicker--cell-day.-current-' - ).click(); + ).click({ force: true }); cy.window() .its('cur_frm') diff --git a/cypress/integration/recorder.js b/cypress/integration/recorder.js index bde6626ea1..7236200741 100644 --- a/cypress/integration/recorder.js +++ b/cypress/integration/recorder.js @@ -42,14 +42,13 @@ context('Recorder', () => { cy.get('.result-list').should('contain', '/api/method/frappe.desk.reportview.get'); cy.get('#page-recorder .primary-action').should('contain', 'Stop').click(); + cy.wait(500); cy.get('#page-recorder .btn-secondary').should('contain', 'Clear').click(); cy.get('.msg-box').should('contain', 'Inactive'); }); it('Recorder View Request', () => { cy.visit('/app/recorder'); - cy.get('#page-recorder .primary-action').should('contain', 'Stop').click(); - cy.get('#page-recorder .btn-secondary').should('contain', 'Clear').click(); cy.get('.primary-action').should('contain', 'Start').click(); cy.visit('/app/List/DocType/List'); @@ -59,18 +58,15 @@ context('Recorder', () => { cy.get('.title-text').should('contain', 'DocType'); cy.get('.list-count').should('contain', '20 of '); - // temporarily commenting out theses tests as they seem to be - // randomly failing maybe due a background event - - // cy.visit('/app/recorder'); + cy.visit('/app/recorder'); - // cy.get('.list-row-container span').contains('/api/method/frappe').click(); + cy.get('.list-row-container span').contains('/api/method/frappe').click(); - // cy.location('hash').should('contain', '#recorder/request/'); - // cy.get('form').should('contain', '/api/method/frappe'); + cy.url().should('include', '/recorder/request'); + cy.get('form').should('contain', '/api/method/frappe'); - // cy.get('#page-recorder .primary-action').should('contain', 'Stop').click(); - // cy.get('#page-recorder .btn-secondary').should('contain', 'Clear').click(); - // cy.location('hash').should('eq', '#recorder'); + cy.get('#page-recorder .primary-action').should('contain', 'Stop').click(); + cy.wait(200); + cy.get('#page-recorder .btn-secondary').should('contain', 'Clear').click(); }); }); \ No newline at end of file