feat: refs #8422 add testDmsAction command to handle create and delete actions with improved logic
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
be877fa2b8
commit
b26be0bf6d
|
@ -641,13 +641,19 @@ Cypress.Commands.add(
|
||||||
|
|
||||||
Cypress.Commands.add('testDmsAction', (action, selectors, data, message, content) => {
|
Cypress.Commands.add('testDmsAction', (action, selectors, data, message, content) => {
|
||||||
cy.get(selectors.actionBtn).click();
|
cy.get(selectors.actionBtn).click();
|
||||||
if (action !== 'delete') cy.fillInForm(data);
|
|
||||||
if (action === 'create')
|
if (action === 'create') {
|
||||||
cy.dataCy(selectors.fileInput).selectFile('test/cypress/fixtures/image.jpg', {
|
cy.dataCy(selectors.fileInput).selectFile('test/cypress/fixtures/image.jpg', {
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
if (action === 'delete') cy.clickConfirm();
|
}
|
||||||
if (action !== 'delete') cy.dataCy(selectors.saveFormBtn).click();
|
|
||||||
|
if (action !== 'delete') {
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.dataCy(selectors.saveFormBtn).click();
|
||||||
|
} else cy.clickConfirm();
|
||||||
|
|
||||||
cy.checkNotification(message);
|
cy.checkNotification(message);
|
||||||
|
|
||||||
if (action !== 'create') cy.containContent(selectors.selectorContentToCheck, content);
|
if (action !== 'create') cy.containContent(selectors.selectorContentToCheck, content);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue