diff --git a/cypress.json b/cypress.json index bd93405273..7d853271b9 100644 --- a/cypress.json +++ b/cypress.json @@ -1,4 +1,5 @@ { "baseUrl": "http://test_site_ui:8000", - "projectId": "92odwv" + "projectId": "92odwv", + "adminPassword": "admin" } diff --git a/cypress/integration/awesome_bar.js b/cypress/integration/awesome_bar.js index 18bfde520c..eafb5b338e 100644 --- a/cypress/integration/awesome_bar.js +++ b/cypress/integration/awesome_bar.js @@ -1,7 +1,7 @@ context('Awesome Bar', () => { before(() => { cy.visit('/login'); - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); }); @@ -10,8 +10,9 @@ context('Awesome Bar', () => { }); it('navigates to doctype list', () => { - cy.get('#navbar-search') - .type('todo{downarrow}{enter}', { delay: 100 }); + cy.get('#navbar-search').type('todo', { delay: 200 }); + cy.get('#navbar-search + ul').should('be.visible'); + cy.get('#navbar-search').type('{downarrow}{enter}', { delay: 100 }); cy.get('h1').should('contain', 'To Do'); @@ -20,7 +21,7 @@ context('Awesome Bar', () => { it('find text in doctype list', () => { cy.get('#navbar-search') - .type('test in todo{downarrow}{enter}', { delay: 100 }); + .type('test in todo{downarrow}{enter}', { delay: 200 }); cy.get('h1').should('contain', 'To Do'); @@ -31,14 +32,14 @@ context('Awesome Bar', () => { it('navigates to new form', () => { cy.get('#navbar-search') - .type('new blog post{downarrow}{enter}', { delay: 100 }); + .type('new blog post{downarrow}{enter}', { delay: 200 }); cy.get('.title-text:visible').should('have.text', 'New Blog Post 1'); }); it('calculates math expressions', () => { cy.get('#navbar-search') - .type('55 + 32{downarrow}{enter}', { delay: 100 }); + .type('55 + 32{downarrow}{enter}', { delay: 200 }); cy.get('.modal-title').should('contain', 'Result'); cy.get('.msgprint').should('contain', '55 + 32 = 87'); diff --git a/cypress/integration/control_link.js b/cypress/integration/control_link.js index dba46979c1..0524905cce 100644 --- a/cypress/integration/control_link.js +++ b/cypress/integration/control_link.js @@ -1,6 +1,6 @@ context('Control Link', () => { beforeEach(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); cy.create_records({ doctype: 'ToDo', diff --git a/cypress/integration/control_rating.js b/cypress/integration/control_rating.js index e9692ea95b..5fa479b888 100644 --- a/cypress/integration/control_rating.js +++ b/cypress/integration/control_rating.js @@ -1,6 +1,6 @@ context('Control Rating', () => { before(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); }); diff --git a/cypress/integration/file_uploader.js b/cypress/integration/file_uploader.js index b58e0d49a8..787644b596 100644 --- a/cypress/integration/file_uploader.js +++ b/cypress/integration/file_uploader.js @@ -1,6 +1,6 @@ context('FileUploader', () => { before(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); }); diff --git a/cypress/integration/form.js b/cypress/integration/form.js index 9bab715d5b..b7ddd6ecb7 100644 --- a/cypress/integration/form.js +++ b/cypress/integration/form.js @@ -1,6 +1,6 @@ context('Form', () => { before(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); }); diff --git a/cypress/integration/list_view.js b/cypress/integration/list_view.js index 45c5839ad9..52c6483ab4 100644 --- a/cypress/integration/list_view.js +++ b/cypress/integration/list_view.js @@ -1,6 +1,6 @@ context('List View', () => { before(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); cy.window().its('frappe').then(frappe => { frappe.call("frappe.tests.ui_test_helpers.setup_workflow"); diff --git a/cypress/integration/list_view_settings.js b/cypress/integration/list_view_settings.js index 59921b162c..0c564d4aac 100644 --- a/cypress/integration/list_view_settings.js +++ b/cypress/integration/list_view_settings.js @@ -1,6 +1,6 @@ context('List View Settings', () => { beforeEach(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); }); it('Default settings', () => { @@ -14,13 +14,13 @@ context('List View Settings', () => { cy.get('button').contains('Menu').click(); cy.get('.dropdown-menu li').filter(':visible').contains('Settings').click(); cy.get('.modal-dialog').should('contain', 'Settings'); - + cy.get('input[data-fieldname="disable_count"]').check({force: true}); cy.get('input[data-fieldname="disable_sidebar_stats"]').check({force: true}); cy.get('button').filter(':visible').contains('Save').click(); - + cy.reload(); - + cy.get('.list-count').should('be.empty'); cy.get('.list-sidebar .sidebar-stat').should('not.exist'); diff --git a/cypress/integration/login.js b/cypress/integration/login.js index 4da1f39229..3f13130b58 100644 --- a/cypress/integration/login.js +++ b/cypress/integration/login.js @@ -23,7 +23,7 @@ context('Login', () => { it('logs in using correct credentials', () => { cy.get('#login_email').type('Administrator'); - cy.get('#login_password').type('qwe'); + cy.get('#login_password').type(Cypress.config('adminPassword')); cy.get('.btn-login').click(); cy.location('pathname').should('eq', '/desk'); diff --git a/cypress/integration/query_report.js b/cypress/integration/query_report.js index 04bc1a6fd4..8aa6279887 100644 --- a/cypress/integration/query_report.js +++ b/cypress/integration/query_report.js @@ -1,6 +1,6 @@ context('Form', () => { before(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); }); diff --git a/cypress/integration/recorder.js b/cypress/integration/recorder.js index f037005dbb..e8b55a9d12 100644 --- a/cypress/integration/recorder.js +++ b/cypress/integration/recorder.js @@ -1,6 +1,6 @@ context('Recorder', () => { before(() => { - cy.login('Administrator', 'qwe'); + cy.login(); }); it('Navigate to Recorder', () => { diff --git a/cypress/integration/relative_filters.js b/cypress/integration/relative_filters.js index fac9a99d50..27f594f96e 100644 --- a/cypress/integration/relative_filters.js +++ b/cypress/integration/relative_filters.js @@ -1,10 +1,10 @@ context('Relative Timeframe', () => { beforeEach(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); }); before(() => { - cy.login('Administrator', 'qwe'); + cy.login(); cy.visit('/desk'); cy.window().its('frappe').then(frappe => { frappe.call("frappe.tests.ui_test_helpers.create_todo_records"); diff --git a/cypress/integration/table_multiselect.js b/cypress/integration/table_multiselect.js index cca9a6eb46..e75baf05f1 100644 --- a/cypress/integration/table_multiselect.js +++ b/cypress/integration/table_multiselect.js @@ -1,6 +1,6 @@ context('Table MultiSelect', () => { beforeEach(() => { - cy.login('Administrator', 'qwe'); + cy.login(); }); let name = 'table multiselect' + Math.random().toString().slice(2, 8); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 622d2c9ba8..84d896dbb0 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -25,6 +25,12 @@ import 'cypress-file-upload'; // -- This is will overwrite an existing command -- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }); Cypress.Commands.add('login', (email, password) => { + if (!email) { + email = 'Administrator'; + } + if (!password) { + password = Cypress.config('adminPassword'); + } cy.request({ url: '/api/method/login', method: 'POST', diff --git a/frappe/desk/page/setup_wizard/setup_wizard.js b/frappe/desk/page/setup_wizard/setup_wizard.js index fa131c9c02..9a950a694d 100644 --- a/frappe/desk/page/setup_wizard/setup_wizard.js +++ b/frappe/desk/page/setup_wizard/setup_wizard.js @@ -213,7 +213,7 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides { } setTimeout(function() { // Reload - window.location.href = ''; + window.location.href = '/desk'; }, 2000); } diff --git a/test_sites/test_site_ui/site_config.json b/test_sites/test_site_ui/site_config.json index c865934cb3..d233a6b553 100644 --- a/test_sites/test_site_ui/site_config.json +++ b/test_sites/test_site_ui/site_config.json @@ -7,7 +7,7 @@ "mail_server": "smtp.example.com", "mail_login": "test@example.com", "mail_password": "test", - "admin_password": "qwe", + "admin_password": "admin", "root_password": "travis", "run_selenium_tests": 1, "host_name": "http://test_site_ui:8000"