[arvados] updated: 2.7.0-6218-gaee2fb2b73
git repository hosting
git at public.arvados.org
Tue Mar 19 14:52:28 UTC 2024
Summary of changes:
.../workbench2/cypress/e2e/banner-tooltip.cy.js | 65 ++++++++++++----------
services/workbench2/cypress/support/commands.js | 11 ++--
2 files changed, 42 insertions(+), 34 deletions(-)
via aee2fb2b736a714d3c8dc5b4624bff3fae8d7ba4 (commit)
from be3378300d63ce537a5843c5fc23ecd76f4f1f5c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit aee2fb2b736a714d3c8dc5b4624bff3fae8d7ba4
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Mar 19 10:52:22 2024 -0400
21600: combined changes by Stephen and Lucas Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/services/workbench2/cypress/e2e/banner-tooltip.cy.js b/services/workbench2/cypress/e2e/banner-tooltip.cy.js
index 63d2c264d8..f8100961aa 100644
--- a/services/workbench2/cypress/e2e/banner-tooltip.cy.js
+++ b/services/workbench2/cypress/e2e/banner-tooltip.cy.js
@@ -1,3 +1,4 @@
+
// Copyright (C) The Arvados Authors. All rights reserved.
//
// SPDX-License-Identifier: AGPL-3.0
@@ -20,23 +21,18 @@ describe('Banner / tooltip tests', function () {
.as('activeUser').then(function () {
activeUser = this.activeUser;
});
- });
- beforeEach(function () {
- cy.on('uncaught:exception', (err, runnable, promise) => {
- Cypress.log({ message: `Application Error: ${err}`});
- if (promise) {
- return false;
- }
+ cy.getAll('@adminUser').then(([adminUser]) => {
+ // This collection will not be deleted after each test, we'll
+ // clean it up manually.
+ cy.createCollection(adminUser.token, {
+ name: `BannerTooltipTest${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: adminUser.user.uuid,
+ }, true).as('bannerCollection');
});
- cy.createCollection(adminUser.token, {
- name: `BannerTooltipTest${Math.floor(Math.random() * 999999)}`,
- owner_uuid: adminUser.user.uuid,
- }).as('bannerCollection');
-
cy.getAll('@bannerCollection').then(function ([bannerCollection]) {
- collectionUUID=bannerCollection.uuid;
+ collectionUUID = bannerCollection.uuid;
cy.loginAs(adminUser);
@@ -58,15 +54,28 @@ describe('Banner / tooltip tests', function () {
.should('contain', 'banner.html');
cy.get('[data-cy=collection-files-right-panel]')
.should('contain', 'tooltips.json');
+ });
+ });
- cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
- req.on('response', (res) => {
- res.body.Workbench.BannerUUID = collectionUUID;
- });
+ beforeEach(function () {
+ cy.on('uncaught:exception', (err, runnable, promise) => {
+ Cypress.log({ message: `Application Error: ${err}`});
+ if (promise) {
+ return false;
+ }
+ });
+ cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
+ req.on('response', (res) => {
+ res.body.Workbench.BannerUUID = collectionUUID;
});
});
});
+ after(function () {
+ // Delete banner collection after all test used it.
+ cy.deleteResource(adminUser.token, "collections", collectionUUID);
+ });
+
it('should re-show the banner', () => {
cy.loginAs(adminUser);
cy.waitForDom();
@@ -84,24 +93,20 @@ describe('Banner / tooltip tests', function () {
it('should show tooltips and remove tooltips as localStorage key is present', () => {
cy.loginAs(adminUser);
- cy.waitForDom();
-
- cy.get('[data-cy=side-panel-tree]').then(($el) => {
- const el = $el.get(0) //native DOM element
- expect(el._tippy).to.exist;
- });
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
- cy.waitForDom();
- cy.get('[data-cy=confirmation-dialog]').should('not.exist');
+
+ cy.contains('This allows you to navigate through the app').should('not.exist'); // This content comes from tooltips.txt
+ cy.get('[data-cy=side-panel-tree]').trigger('mouseover');
+ cy.get('[data-cy=side-panel-tree]').trigger('mouseenter');
+ cy.contains('This allows you to navigate through the app').should('be.visible');
cy.get('[title=Notifications]').click();
cy.get('li').contains('Disable tooltips').click();
- cy.waitForDom();
- cy.get('[data-cy=side-panel-tree]').then(($el) => {
- const el = $el.get(0) //native DOM element
- expect(el._tippy).to.be.undefined;
- });
+ cy.contains('This allows you to navigate through the app').should('not.exist');
+ cy.get('[data-cy=side-panel-tree]').trigger('mouseover');
+ cy.get('[data-cy=side-panel-tree]').trigger('mouseenter');
+ cy.contains('This allows you to navigate through the app').should('not.exist');
});
});
diff --git a/services/workbench2/cypress/support/commands.js b/services/workbench2/cypress/support/commands.js
index da7300a430..529d776088 100644
--- a/services/workbench2/cypress/support/commands.js
+++ b/services/workbench2/cypress/support/commands.js
@@ -182,11 +182,11 @@ Cypress.Commands.add("createWorkflow", (token, data) => {
});
});
-Cypress.Commands.add("createCollection", (token, data) => {
+Cypress.Commands.add("createCollection", (token, data, keep = false) => {
return cy.createResource(token, "collections", {
collection: JSON.stringify(data),
ensure_unique_name: true,
- });
+ }, keep);
});
Cypress.Commands.add("getCollection", (token, uuid) => {
@@ -321,16 +321,19 @@ Cypress.Commands.add("getResource", (token, suffix, uuid) => {
});
});
-Cypress.Commands.add("createResource", (token, suffix, data) => {
+Cypress.Commands.add("createResource", (token, suffix, data, keep = false) => {
return cy
.doRequest("POST", "/arvados/v1/" + suffix, data, null, token, true)
.its("body")
.then(function (resource) {
- createdResources.push({ suffix, uuid: resource.uuid });
+ if (! keep) {
+ createdResources.push({ suffix, uuid: resource.uuid });
+ };
return resource;
});
});
+
Cypress.Commands.add("deleteResource", (token, suffix, uuid, failOnStatusCode = true) => {
return cy
.doRequest("DELETE", "/arvados/v1/" + suffix + "/" + uuid, null, null, token, false, true, failOnStatusCode)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list