mirror of
https://github.com/sartography/spiffworkflow-frontend.git
synced 2025-02-23 19:58:25 +00:00
fix tests and add frontend tests
This commit is contained in:
parent
f3b5cb7ca5
commit
83f6185f17
@ -13,6 +13,15 @@ const checkTaskHasClass = (taskName, className) => {
|
||||
cy.get(`g[data-element-id=${taskName}]`).should('have.class', className);
|
||||
};
|
||||
|
||||
const kickOffModelWithForm = (modelId, formName) => {
|
||||
cy.navigateToProcessModel(
|
||||
'Acceptance Tests Group One',
|
||||
'Acceptance Tests Model 2',
|
||||
'acceptance-tests-model-2'
|
||||
);
|
||||
cy.runPrimaryBpmnFile(true);
|
||||
};
|
||||
|
||||
describe('tasks', () => {
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
@ -107,21 +116,15 @@ describe('tasks', () => {
|
||||
cy.contains('Status: complete');
|
||||
});
|
||||
|
||||
// it('can paginate items', () => {
|
||||
// cy.navigateToProcessModel(
|
||||
// 'Acceptance Tests Group One',
|
||||
// 'Acceptance Tests Model 1',
|
||||
// 'acceptance-tests-model-1'
|
||||
// );
|
||||
//
|
||||
// // make sure we have some tasks
|
||||
// cy.runPrimaryBpmnFile();
|
||||
// cy.runPrimaryBpmnFile();
|
||||
// cy.runPrimaryBpmnFile();
|
||||
// cy.runPrimaryBpmnFile();
|
||||
// cy.runPrimaryBpmnFile();
|
||||
//
|
||||
// cy.navigateToHome();
|
||||
// cy.basicPaginationTest();
|
||||
// });
|
||||
it('can paginate items', () => {
|
||||
// make sure we have some tasks
|
||||
kickOffModelWithForm();
|
||||
kickOffModelWithForm();
|
||||
kickOffModelWithForm();
|
||||
kickOffModelWithForm();
|
||||
kickOffModelWithForm();
|
||||
|
||||
cy.navigateToHome();
|
||||
cy.basicPaginationTest();
|
||||
});
|
||||
});
|
||||
|
@ -32,9 +32,8 @@ Cypress.Commands.add('getBySel', (selector, ...args) => {
|
||||
});
|
||||
|
||||
Cypress.Commands.add('navigateToHome', () => {
|
||||
cy.get('button[aria-label="Open menu"]').click();
|
||||
cy.getBySel('header-menu-expand-button').click();
|
||||
cy.getBySel('side-nav-items').contains('Home').click();
|
||||
// cy.getBySel('nav-home').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('navigateToAdmin', () => {
|
||||
@ -85,14 +84,21 @@ Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => {
|
||||
cy.contains(`Process Model: ${modelDisplayName}`);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('runPrimaryBpmnFile', (reload = true) => {
|
||||
cy.contains('Run').click();
|
||||
if (reload) {
|
||||
cy.contains(/Process Instance.*kicked off/);
|
||||
cy.reload(true);
|
||||
cy.contains(/Process Instance.*kicked off/).should('not.exist');
|
||||
Cypress.Commands.add(
|
||||
'runPrimaryBpmnFile',
|
||||
(expectAutoRedirectToHumanTask = false) => {
|
||||
cy.contains('Run').click();
|
||||
if (expectAutoRedirectToHumanTask) {
|
||||
// the url changes immediately, so also make sure we get some content from the next page, "Task:", or else when we try to interact with the page, it'll re-render and we'll get an error with cypress.
|
||||
cy.url().should('include', `/tasks/`);
|
||||
cy.contains('Task: ');
|
||||
} else {
|
||||
cy.contains(/Process Instance.*kicked off/);
|
||||
cy.reload(true);
|
||||
cy.contains(/Process Instance.*kicked off/).should('not.exist');
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
Cypress.Commands.add(
|
||||
'navigateToProcessModel',
|
||||
|
@ -177,6 +177,7 @@ export default function NavigationBar() {
|
||||
<Header aria-label="IBM Platform Name" className="cds--g100">
|
||||
<SkipToContent />
|
||||
<HeaderMenuButton
|
||||
data-qa="header-menu-expand-button"
|
||||
aria-label="Open menu"
|
||||
onClick={onClickSideNavExpand}
|
||||
isActive={isSideNavExpanded}
|
||||
|
Loading…
x
Reference in New Issue
Block a user