diff --git a/cypress/integration/web_form.js b/cypress/integration/web_form.js index acdb4f6198..eac99eab61 100644 --- a/cypress/integration/web_form.js +++ b/cypress/integration/web_form.js @@ -1,6 +1,6 @@ context('Web Form', () => { before(() => { - cy.login('Administrator', 'frappe') + cy.login(); }); it('Navigate and Submit a WebForm', () => { @@ -12,7 +12,7 @@ context('Web Form', () => { }); it('Timeline should have submit and cancel activity information', () => { - cy.call('frappe.tests.ui_test_helpers.update_webform_to_multistep').then(r => { + cy.call('frappe.tests.ui_test_helpers.update_webform_to_multistep').then(() => { cy.visit('/update-profile'); cy.get_field('last_name', 'Data').type('_Test User', {force: true}).wait(200); cy.get('.btn-next').should('be.visible'); diff --git a/frappe/public/js/frappe/web_form/web_form.js b/frappe/public/js/frappe/web_form/web_form.js index 8c975136dd..f71e681f85 100644 --- a/frappe/public/js/frappe/web_form/web_form.js +++ b/frappe/public/js/frappe/web_form/web_form.js @@ -90,12 +90,12 @@ export default class WebForm extends frappe.ui.FieldGroup { if (!is_validated) return; - for (let idx = me.current_section; idx < me.sections.length; idx--) { + for (let idx = me.current_section; idx < me.sections.length; idx--) { // eslint-disable-line no-console let is_empty = me.is_previous_section_empty(idx); me.current_section = me.current_section > 0 ? me.current_section - 1 : me.current_section; if (!is_empty) { - break + break; } } me.toggle_section(); @@ -111,7 +111,7 @@ export default class WebForm extends frappe.ui.FieldGroup { me.current_section = me.current_section < me.sections.length ? me.current_section + 1 : me.current_section; if (!is_empty) { - break + break; } } me.toggle_section(); @@ -186,7 +186,7 @@ export default class WebForm extends frappe.ui.FieldGroup { if (this.allow_incomplete) return true; let fields = $(`.form-section:eq(${this.current_section}) .form-control`); - let errors = [] + let errors = []; for (let field of fields) { let fieldname = $(field).attr("data-fieldname");