projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17500: Rearranges test in order to reduce its flakyness.
[arvados-workbench2.git]
/
cypress
/
support
/
commands.js
diff --git
a/cypress/support/commands.js
b/cypress/support/commands.js
index 8dc003fee1288f8b10cd76ec8bee7d27f1a17fc8..929ffb83d849a357c18d74680d9e762f0b833bdc 100644
(file)
--- a/
cypress/support/commands.js
+++ b/
cypress/support/commands.js
@@
-36,7
+36,7
@@
Cypress.Commands.add(
token = systemToken, auth = false, followRedirect = true) => {
return cy.request({
method: method,
token = systemToken, auth = false, followRedirect = true) => {
return cy.request({
method: method,
- url: `${controllerURL
}/${path
}`,
+ url: `${controllerURL
.replace(/\/+$/, '')}/${path.replace(/^\/+/, '')
}`,
body: data,
qs: auth ? qs : Object.assign({ api_token: token }, qs),
auth: auth ? { bearer: `${token}` } : undefined,
body: data,
qs: auth ? qs : Object.assign({ api_token: token }, qs),
auth: auth ? { bearer: `${token}` } : undefined,
@@
-176,7
+176,7
@@
Cypress.Commands.add(
Cypress.Commands.add(
"loginAs", (user) => {
cy.visit(`/token/?api_token=${user.token}`);
Cypress.Commands.add(
"loginAs", (user) => {
cy.visit(`/token/?api_token=${user.token}`);
- cy.url().should('contain', '/projects/');
+ cy.url(
{timeout: 10000}
).should('contain', '/projects/');
cy.get('div#root').should('contain', 'Arvados Workbench (zzzzz)');
cy.get('div#root').should('not.contain', 'Your account is inactive');
}
cy.get('div#root').should('contain', 'Arvados Workbench (zzzzz)');
cy.get('div#root').should('not.contain', 'Your account is inactive');
}
@@
-188,6
+188,12
@@
Cypress.Commands.add(
}
)
}
)
+Cypress.Commands.add(
+ "goToPath", (path) => {
+ return cy.window().its('appHistory').invoke('push', path);
+ }
+)
+
Cypress.Commands.add('getAll', (...elements) => {
const promise = cy.wrap([], { log: false })
Cypress.Commands.add('getAll', (...elements) => {
const promise = cy.wrap([], { log: false })
@@
-207,13
+213,13
@@
Cypress.Commands.add('shareWith', (srcUserToken, targetUserUUID, itemUUID, permi
});
})
});
})
-Cypress.Commands.add('addToFavorites', (
activeUserToken, activeU
serUUID, itemUUID) => {
- cy.createLink(
activeU
serToken, {
+Cypress.Commands.add('addToFavorites', (
userToken, u
serUUID, itemUUID) => {
+ cy.createLink(
u
serToken, {
head_uuid: itemUUID,
link_class: 'star',
name: '',
head_uuid: itemUUID,
link_class: 'star',
name: '',
- owner_uuid:
activeU
serUUID,
- tail_uuid:
activeU
serUUID,
+ owner_uuid:
u
serUUID,
+ tail_uuid:
u
serUUID,
});
})
});
})