Skip to content
Snippets Groups Projects
Commit e6e61d5b authored by jurgenhaas's avatar jurgenhaas
Browse files

Optimize command to assert field conditions by adding support for hidden fields and radio buttons

parent 33be5cf2
No related branches found
No related tags found
No related merge requests found
Pipeline #701327 passed
......@@ -50,7 +50,6 @@ let maxTid = -1;
Cypress.Commands.add('rememberLatestTaxonomyTerm', () => {
cy.drush('sql:query "select max(tid) from taxonomy_term_data"').then((result) => {
cy.log(result);
maxTid = result.stdout;
});
})
......@@ -77,12 +76,18 @@ Cypress.Commands.add('assertFieldCondition', (data) => {
cy.get(field + '-value').uncheck()
}
}
else if (data.radio !== undefined) {
cy.get(field + '-' + data.radio).check()
}
else if (data.select !== undefined) {
cy.get(field).select(data.select)
}
else if (data.value !== undefined) {
cy.get(field + '-value').type(data.value)
}
else if (data.hidden !== undefined && data.hidden) {
cy.get(field + '-wrapper').should('not.exist');
}
else {
cy.get(field + '-wrapper').as('field')
if (data.visible) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment