|
1 | 1 | import { testA11y } from 'cypress/support/utils'; |
| 2 | +import { method } from 'node_modules/cypress/types/bluebird'; |
2 | 3 |
|
3 | 4 | describe('My DSpace page', () => { |
4 | 5 | it('should display recent submissions and pass accessibility tests', () => { |
@@ -149,10 +150,7 @@ describe('My DSpace page', () => { |
149 | 150 | //Intercept the request to filter. |
150 | 151 | cy.intercept({ |
151 | 152 | method: 'GET', |
152 | | - url: '**/server/api/discover/facets/namedresourcetype**', |
153 | | - query: { |
154 | | - 'f.namedresourcetype': 'item,authority' |
155 | | - } |
| 153 | + url: '/server/api/discover/search/objects**', |
156 | 154 | }).as('filterByItem'); |
157 | 155 |
|
158 | 156 | //Apply the filter to the “archived” items. |
@@ -203,4 +201,42 @@ describe('My DSpace page', () => { |
203 | 201 | // New URL should include /workspaceitems, as we've started a new submission |
204 | 202 | cy.url().should('include', '/workspaceitems'); |
205 | 203 | }); |
| 204 | + |
| 205 | + it('should let you take task from workflow', () => { |
| 206 | + cy.visit('/mydspace'); |
| 207 | + |
| 208 | + //This page is restricted, so we will be shown the login form. Fill it in and submit it |
| 209 | + cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); |
| 210 | + |
| 211 | + //Wait for the page to display |
| 212 | + cy.get('ds-my-dspace-page').should('be.visible'); |
| 213 | + |
| 214 | + //Intercept to await backend response |
| 215 | + cy.intercept({ |
| 216 | + method: 'GET', |
| 217 | + url: '/server/api/discover/search/objects**' |
| 218 | + }).as('workflowSearch'); |
| 219 | + |
| 220 | + //Change view to see workflow tasks |
| 221 | + cy.get('ds-search-switch-configuration select').select('2: Object'); |
| 222 | + |
| 223 | + //Await backend search response |
| 224 | + cy.wait('@workflowSearch'); |
| 225 | + |
| 226 | + //Check that we have at least one item and that they all have the archived badge. |
| 227 | + cy.get('[data-test="objects"]') |
| 228 | + .find('[data-test="list-object"]') |
| 229 | + .each(($item) => { |
| 230 | + cy.wrap($item) |
| 231 | + .find('ds-claimed-task-actions, ds-pool-task-actions').should('exist') |
| 232 | + .within(() => { |
| 233 | + cy.get('button, a.btn').each(($btn) => { |
| 234 | + cy.wrap($btn) |
| 235 | + .should('exist') |
| 236 | + .and('be.visible') |
| 237 | + .and('not.be.disabled'); |
| 238 | + }); |
| 239 | + }); |
| 240 | + }); |
| 241 | + }); |
206 | 242 | }); |
0 commit comments