projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
21704: clarified comments
[arvados.git]
/
services
/
workbench2
/
cypress
/
e2e
/
banner-tooltip.cy.js
diff --git
a/services/workbench2/cypress/e2e/banner-tooltip.cy.js
b/services/workbench2/cypress/e2e/banner-tooltip.cy.js
index bd57863c94a82291656a2b59b7342d17490d85ba..7cb2bc405e77889144e42841fa39a40c079776b9 100644
(file)
--- a/
services/workbench2/cypress/e2e/banner-tooltip.cy.js
+++ b/
services/workbench2/cypress/e2e/banner-tooltip.cy.js
@@
-4,7
+4,6
@@
// SPDX-License-Identifier: AGPL-3.0
describe('Banner / tooltip tests', function () {
// SPDX-License-Identifier: AGPL-3.0
describe('Banner / tooltip tests', function () {
- let activeUser;
let adminUser;
let collectionUUID;
let adminUser;
let collectionUUID;
@@
-17,11
+16,6
@@
describe('Banner / tooltip tests', function () {
.as('adminUser').then(function () {
adminUser = this.adminUser;
});
.as('adminUser').then(function () {
adminUser = this.adminUser;
});
- cy.getUser('collectionuser1', 'Collection', 'User', false, true)
- .as('activeUser').then(function () {
- activeUser = this.activeUser;
- });
-
cy.getAll('@adminUser').then(([adminUser]) => {
// This collection will not be deleted after each test, we'll
// clean it up manually.
cy.getAll('@adminUser').then(([adminUser]) => {
// This collection will not be deleted after each test, we'll
// clean it up manually.
@@
-64,8
+58,14
@@
describe('Banner / tooltip tests', function () {
return false;
}
});
return false;
}
});
+
+ //login here instead of in specific tests to preserve localStorage and intercept listener
cy.loginAs(adminUser);
cy.loginAs(adminUser);
+
+ //must be in localstorage to have banner option in notifications menu
+ //it doesn't matter what the value is, as long as it's truthy
window.localStorage.setItem('bannerFileData', 'foo');
window.localStorage.setItem('bannerFileData', 'foo');
+
cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
req.on('response', (res) => {
res.body.Workbench.BannerUUID = collectionUUID;
cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
req.on('response', (res) => {
res.body.Workbench.BannerUUID = collectionUUID;
@@
-79,19
+79,23
@@
describe('Banner / tooltip tests', function () {
});
it('should re-show the banner', () => {
});
it('should re-show the banner', () => {
- //reload instead of cy.login
a
s() to preserve localStorage and intercept listener
+ //reload instead of cy.login
A
s() to preserve localStorage and intercept listener
//logged in as adminUser
cy.reload();
cy.waitForDom();
//logged in as adminUser
cy.reload();
cy.waitForDom();
+ //check that banner appears on reload
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('be.visible');
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('not.exist');
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('be.visible');
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('not.exist');
+ //check that banner appears on toggle
cy.get('[title=Notifications]').click();
cy.get('li').contains('Restore Banner').click();
cy.waitForDom().get('[data-cy=confirmation-dialog-ok-btn]', {timeout: 10000}).should('be.visible');
cy.get('[title=Notifications]').click();
cy.get('li').contains('Restore Banner').click();
cy.waitForDom().get('[data-cy=confirmation-dialog-ok-btn]', {timeout: 10000}).should('be.visible');
+ cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
+ cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('not.exist');
});
});
@@
-101,6
+105,7
@@
describe('Banner / tooltip tests', function () {
cy.reload();
cy.waitForDom();
cy.reload();
cy.waitForDom();
+ //banner appears on reload
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('be.visible');
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('not.exist');
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('be.visible');
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
cy.waitForDom().get('[data-cy=confirmation-dialog]', {timeout: 10000}).should('not.exist');