diff --git a/cypress/integration/file_uploader.js b/cypress/integration/file_uploader.js index 6003313e05..9c5e5b8d52 100644 --- a/cypress/integration/file_uploader.js +++ b/cypress/integration/file_uploader.js @@ -21,7 +21,7 @@ context('FileUploader', () => { open_upload_dialog(); cy.fixture('example.json').then(fileContent => { - cy.get_open_dialog().find('.file-upload-area').upload({ + cy.get_open_dialog().find('.file-upload-area').attachFile({ fileContent, fileName: 'example.json', mimeType: 'application/json' @@ -34,7 +34,7 @@ context('FileUploader', () => { cy.server(); cy.route('POST', '/api/method/upload_file').as('upload_file'); cy.get_open_dialog().find('.btn-modal-primary').click(); - cy.wait('@upload_file').its('status').should('be', 200); + cy.wait('@upload_file').its('status').should('eq', 200); cy.get('.modal:visible').should('not.exist'); }); }); diff --git a/cypress/integration/form.js b/cypress/integration/form.js index 1a1b896498..f471858d8c 100644 --- a/cypress/integration/form.js +++ b/cypress/integration/form.js @@ -33,13 +33,12 @@ context('Form', () => { cy.hide_dialog(); cy.get('.next-doc').click(); cy.wait(200); + cy.hide_dialog(); cy.contains('Test Form Contact 2').should('not.exist'); - cy.get('.title-text').should('contain', 'Test Form Contact 1'); + cy.get('.title-text').should('contain', 'Test Form Contact 3'); // clear filters - cy.window().its('frappe').then((frappe) => { - let list_view = frappe.get_list_view('Contact'); - list_view.filter_area.filter_list.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 diff --git a/cypress/support/index.js b/cypress/support/index.js index 8035ef117b..1bee72d2ca 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -21,5 +21,5 @@ import './commands'; // require('./commands') Cypress.Cookies.defaults({ - whitelist: 'sid' + preserve: 'sid' }); \ No newline at end of file diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index 31b84ee98a..e9fa7217a8 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -571,10 +571,11 @@ def run_ui_tests(context, app, headless=False): plugin_path = "{0}/cypress-file-upload".format(node_bin) # check if cypress in path...if not, install it. - if not (os.path.exists(cypress_path) or os.path.exists(plugin_path)): + if not (os.path.exists(cypress_path) or os.path.exists(plugin_path)) \ + or not subprocess.getoutput("npm view cypress version").startswith("6."): # install cypress click.secho("Installing Cypress...", fg="yellow") - frappe.commands.popen("yarn add cypress@3 cypress-file-upload@^3.1 --no-lockfile") + frappe.commands.popen("yarn add cypress@^6 cypress-file-upload@^5 --no-lockfile") # run for headless mode run_or_open = 'run --browser chrome --record --key 4a48f41c-11b3-425b-aa88-c58048fa69eb' if headless else 'open' diff --git a/frappe/public/js/frappe/form/toolbar.js b/frappe/public/js/frappe/form/toolbar.js index c1752b884c..7e2502e58a 100644 --- a/frappe/public/js/frappe/form/toolbar.js +++ b/frappe/public/js/frappe/form/toolbar.js @@ -222,10 +222,10 @@ frappe.ui.form.Toolbar = class Toolbar { if (!this.frm.is_new() && !this.frm.meta.issingle) { this.page.add_action_icon("left", () => { this.frm.navigate_records(1); - }, 'prev-doc', __("Previous")); + }, 'prev-doc', __("Previous Document")); this.page.add_action_icon("right", ()=> { this.frm.navigate_records(0); - }, 'next-doc', __("Next")); + }, 'next-doc', __("Next Document")); } }