19836: Test tweaking.
[arvados.git] / cypress / integration / banner-tooltip.spec.js
index f331a8871c33381b8896aebcd948cffdf8f10df5..ccd4166a4155cd7e0969864b6cf66dcbe2aab9a6 100644 (file)
@@ -34,24 +34,29 @@ describe('Collection panel tests', function () {
                     .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(btoa(banner), 'banner.html');
-                                cy.get('[data-cy=drag-and-drop]').upload(btoa(tooltips), 'tooltips.json');
+                                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)});
@@ -60,7 +65,7 @@ describe('Collection panel tests', function () {
     beforeEach(function () {
         cy.clearCookies();
         cy.clearLocalStorage();
-        cy.intercept({ method: 'GET', hostname: 'localhost', url: '**/arvados/v1/config?nocache=*' }, (req) => {
+        cy.intercept({ method: 'GET', url: '**/arvados/v1/config?nocache=*' }, (req) => {
             req.reply((res) => {
                 res.body.Workbench.BannerUUID = collectionUUID;
             });