fix: ui tests

This commit is contained in:
prssanna 2021-01-27 14:31:00 +05:30
parent 73b4aad317
commit 26821d4fbe
6 changed files with 9 additions and 6 deletions

View file

@ -92,7 +92,7 @@ context('Depends On', () => {
cy.fill_table_field('child_test_depends_on_field', '1', 'child_test_field', 'Some Value');
cy.fill_table_field('child_test_depends_on_field', '1', 'child_dependant_field', 'Some Other Value');
cy.get('@row1-form_in_grid').find('.octicon-triangle-up').click();
cy.get('@row1-form_in_grid').find('.grid-collapse-row').click();
// set the table to read-only
cy.fill_field('test_field', 'Some Other Value');

View file

@ -29,6 +29,7 @@ context('FileUploader', () => {
subjectType: 'drag-n-drop',
force: true
});
cy.get_open_dialog().find('.file-name').should('contain', 'example.json');
cy.server();
cy.route('POST', '/api/method/upload_file').as('upload_file');
@ -42,6 +43,7 @@ context('FileUploader', () => {
open_upload_dialog();
cy.get_open_dialog().find('.btn-file-upload div:contains("Library")').click();
cy.get('.file-filter').type('example.json');
cy.get_open_dialog().find('.tree-label:contains("example.json")').first().click();
cy.server();
cy.route('POST', '/api/method/upload_file').as('upload_file');

View file

@ -44,7 +44,7 @@ context('Form', () => {
it('validates behaviour of Data options validations in child table', () => {
// test email validations for set_invalid controller
let website_input = 'website.in';
let expectBackgroundColor = 'rgb(255, 220, 220)';
let expectBackgroundColor = 'rgb(255, 245, 245)';
cy.visit('/app/contact/new');
cy.get('.frappe-control[data-fieldname="email_ids"]').as('table');

View file

@ -11,6 +11,7 @@ context('List View', () => {
cy.go_to_list('ToDo');
cy.get('.list-row-container:contains("Pending") .list-row-checkbox').click({ multiple: true, force: true });
cy.get('.actions-btn-group button').contains('Actions').should('be.visible').click();
cy.wait(300);
cy.get('.dropdown-menu li:visible').should('have.length', 8).each((el, index) => {
cy.wrap(el).contains(actions[index]);
}).then((elements) => {

View file

@ -28,7 +28,7 @@ context('List View Settings', () => {
cy.get('.menu-btn-group button').click({ force: true });
cy.get('.dropdown-menu li').filter(':visible').contains('List Settings').click();
cy.get('.modal-dialog').should('contain', 'List Settings');
cy.get('.modal-dialog').should('contain', 'DocType Settings');
cy.get('input[data-fieldname="disable_count"]').uncheck({ force: true });
cy.get('input[data-fieldname="disable_sidebar_stats"]').uncheck({ force: true });
cy.get('button').filter(':visible').contains('Save').click();

View file

@ -32,10 +32,10 @@ context('Login', () => {
it('logs in using correct credentials', () => {
cy.get('#login_email').type('Administrator');
cy.get('#login_password').type(Cypress.config('adminPassword'));
cy.get('#login_password').type('root');
cy.get('.btn-login:visible').click();
cy.location('pathname').should('eq', '/app/home');
cy.location('pathname').should('eq', '/app');
cy.window().its('frappe.session.user').should('eq', 'Administrator');
});
@ -58,7 +58,7 @@ context('Login', () => {
);
cy.get('#login_email').type('Administrator');
cy.get('#login_password').type(Cypress.config('adminPassword'));
cy.get('#login_password').type('root');
cy.get('.btn-login:visible').click();