Sfoglia il codice sorgente

test: fix fill_field command for code fieldtype

version-14
Suraj Shetty 6 anni fa
parent
commit
3d21bba74d
2 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. +1
    -1
      cypress/integration/table_multiselect.js
  2. +4
    -1
      cypress/support/commands.js

+ 1
- 1
cypress/integration/table_multiselect.js Vedi File

@@ -9,7 +9,7 @@ context('Table MultiSelect', () => {
cy.new_form('Assignment Rule'); cy.new_form('Assignment Rule');
cy.fill_field('__newname', name); cy.fill_field('__newname', name);
cy.fill_field('document_type', 'ToDo'); cy.fill_field('document_type', 'ToDo');
cy.fill_field('assign_condition', 'status=="Open"');
cy.fill_field('assign_condition', 'status=="Open"', 'Code');
cy.get('input[data-fieldname="users"]').focus().as('input'); cy.get('input[data-fieldname="users"]').focus().as('input');
cy.get('input[data-fieldname="users"] + ul').should('be.visible'); cy.get('input[data-fieldname="users"] + ul').should('be.visible');
cy.get('@input').type('test{enter}', { delay: 100 }); cy.get('@input').type('test{enter}', { delay: 100 });


+ 4
- 1
cypress/support/commands.js Vedi File

@@ -41,13 +41,16 @@ Cypress.Commands.add('fill_field', (fieldname, value, fieldtype='Data') => {
if (fieldtype === 'Text Editor') { if (fieldtype === 'Text Editor') {
selector = `[data-fieldname="${fieldname}"] .ql-editor`; selector = `[data-fieldname="${fieldname}"] .ql-editor`;
} }
if (fieldtype === 'Code') {
selector = `[data-fieldname="${fieldname}"] .ace_text-input`;
}


cy.get(selector).as('input'); cy.get(selector).as('input');


if (fieldtype === 'Select') { if (fieldtype === 'Select') {
return cy.get('@input').select(value); return cy.get('@input').select(value);
} else { } else {
return cy.get('@input').type(value);
return cy.get('@input').type(value, {waitForAnimations: false});
} }
}); });




Caricamento…
Annulla
Salva