[arvados-workbench2] updated: 2.5.0-42-g854ddaf2
git repository hosting
git at public.arvados.org
Thu Feb 23 15:12:54 UTC 2023
Summary of changes:
cypress/integration/banner-tooltip.spec.js | 93 ++++++++++++++++--------------
1 file changed, 50 insertions(+), 43 deletions(-)
via 854ddaf2187cab8d97800e29b8d0c3c9dea7bb15 (commit)
from 20e369b56a0ad9f5a15f43eb7d6d8110af3cb80c (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 854ddaf2187cab8d97800e29b8d0c3c9dea7bb15
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Thu Feb 23 16:09:26 2023 +0100
19836: Change test setup
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/cypress/integration/banner-tooltip.spec.js b/cypress/integration/banner-tooltip.spec.js
index ccd4166a..b9232072 100644
--- a/cypress/integration/banner-tooltip.spec.js
+++ b/cypress/integration/banner-tooltip.spec.js
@@ -20,44 +20,6 @@ describe('Collection panel tests', function () {
cy.getUser('collectionuser1', 'Collection', 'User', false, true)
.as('activeUser').then(function () {
activeUser = this.activeUser;
- }
- )
-
- cy.getAll('@adminUser')
- .then(function([adminUser]) {
- 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;
-
- cy.loginAs(adminUser);
-
- cy.goToPath(`/collections/${bannerCollection.uuid}`);
-
- cy.get('[data-cy=upload-button]').click();
-
- cy.fixture('files/banner.html').as('banner');
- cy.fixture('files/tooltips.txt').as('tooltips');
-
- cy.getAll('@banner', '@tooltips')
- .then(([banner, tooltips]) => {
- console.log(tooltips)
- cy.get('[data-cy=drag-and-drop]').upload(banner, 'banner.html', false);
- cy.get('[data-cy=drag-and-drop]').upload(tooltips, 'tooltips.json', false);
- });
-
- cy.get('[data-cy=form-submit-btn]').click();
- cy.get('[data-cy=form-submit-btn]').should('not.exist');
- cy.get('[data-cy=collection-files-right-panel]')
- .contains('banner.html').should('exist');
- cy.get('[data-cy=collection-files-right-panel]')
- .contains('tooltips.json').should('exist');
- });
});
cy.on('uncaught:exception', (err, runnable) => {console.error(err)});
});
@@ -65,16 +27,15 @@ describe('Collection panel tests', function () {
beforeEach(function () {
cy.clearCookies();
cy.clearLocalStorage();
- cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
- req.reply((res) => {
- res.body.Workbench.BannerUUID = collectionUUID;
- });
- });
});
it('should re-show the banner', () => {
+ setupTheEnvironment();
+
cy.loginAs(adminUser);
+ cy.goToPath(`/collections/${collectionUUID}`);
+
cy.wait(2000);
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
@@ -89,8 +50,12 @@ describe('Collection panel tests', function () {
it('should show tooltips and remove tooltips as localStorage key is present', () => {
+ setupTheEnvironment();
+
cy.loginAs(adminUser);
+ cy.goToPath(`/collections/${collectionUUID}`);
+
cy.wait(2000);
cy.get('[data-cy=side-panel-tree]').then(($el) => {
@@ -110,4 +75,46 @@ describe('Collection panel tests', function () {
expect(el._tippy).to.be.undefined;
});
});
+
+ const setupTheEnvironment = () => {
+ 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;
+
+ cy.loginAs(adminUser);
+
+ cy.goToPath(`/collections/${bannerCollection.uuid}`);
+
+ cy.get('[data-cy=upload-button]').click();
+
+ cy.fixture('files/banner.html').as('banner');
+ cy.fixture('files/tooltips.txt').as('tooltips');
+
+ cy.getAll('@banner', '@tooltips')
+ .then(([banner, tooltips]) => {
+ console.log(tooltips)
+ cy.get('[data-cy=drag-and-drop]').upload(banner, 'banner.html', false);
+ cy.get('[data-cy=drag-and-drop]').upload(tooltips, 'tooltips.json', false);
+ });
+
+ cy.get('[data-cy=form-submit-btn]').click();
+ cy.get('[data-cy=form-submit-btn]').should('not.exist');
+ cy.get('[data-cy=collection-files-right-panel]')
+ .contains('banner.html').should('exist');
+ cy.get('[data-cy=collection-files-right-panel]')
+ .contains('tooltips.json').should('exist');
+
+ cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
+ req.reply((res) => {
+ res.body.Workbench.BannerUUID = collectionUUID;
+ });
+ });
+ });
+ }
});
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list