Mudana-Grune 3 лет назад
Родитель
Сommit
214dc63044

+ 7 - 5
packages/app/test/cypress/integration/20-basic-features/20-basic-features--use-tools.spec.ts

@@ -108,18 +108,20 @@ context('Modal for page operation', () => {
       cy.get('#template-type').next().find('button:eq(0)').click({force: true});
       cy.getByTestid('grw-btn-edit-page').should('be.visible').click();
     });
-    cy.get('.toast-error').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.collapseSidebar(true);
     cy.screenshot(`${ssPrefix}create-template-for-children-error`);
-    cy.get('.toast-error').should('be.visible').click();
-    cy.get('.toast-error').should('not.exist');
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
+    });
 
     cy.getByTestid('page-create-modal').should('be.visible').within(() => {
       cy.get('#template-type').click();
       cy.get('#template-type').next().find('button:eq(1)').click({force: true});
       cy.getByTestid('grw-btn-edit-page').should('be.visible').click();
     });
-    cy.get('.toast-error').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.collapseSidebar(true);
     cy.screenshot(`${ssPrefix}create-template-for-descendants-error`);
   });
@@ -309,7 +311,7 @@ context('Tag Oprations', { scrollBehavior: false }, () =>{
       cy.get('div.modal-footer > button').click();
     });
 
-    cy.get('.toast').should('be.visible').trigger('mouseover');
+    cy.get('.Toastify__toast').should('be.visible').trigger('mouseover');
     cy.get('.grw-taglabels-container > .grw-tag-labels > a').contains(tag).should('exist');
 
     cy.screenshot(`${ssPrefix}2-click-done`);

+ 28 - 18
packages/app/test/cypress/integration/60-home/60-home--home.spec.ts

@@ -55,11 +55,13 @@ context('Access User settings', () => {
     cy.getByTestid('grw-user-settings').should('be.visible');
     cy.screenshot(`${ssPrefix}-user-information-1`);
     cy.getByTestid('grw-besic-info-settings-update-button').click();
-    cy.get('.toast').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.screenshot(`${ssPrefix}-user-information-2`);
 
-    cy.get('.toast-close-button').click({ multiple: true }); // close toast alert
-    cy.get('.toast').should('not.exist');
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
+    });
   });
 
   it('Access External account', () => {
@@ -70,26 +72,30 @@ context('Access User settings', () => {
     cy.getByTestid('grw-associate-modal').should('be.visible');
     cy.screenshot(`${ssPrefix}-external-account-2`);
     cy.getByTestid('grw-associate-modal').find('.modal-footer button').click(); // click add button in modal form
-    cy.get('.toast').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.screenshot(`${ssPrefix}-external-account-3`);
-    cy.get('.toast-close-button').click({ multiple: true }); // close toast alert
-    cy.get('.toast').should('not.exist');
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
+    });
     cy.getByTestid('grw-associate-modal').find('.close').click();
     cy.screenshot(`${ssPrefix}-external-account-4`);
 
-    cy.get('.toast').should('not.exist');
-  });
+      cy.get('.Toastify__toast').should('not.be.visible');
+    });
 
   it('Access Password setting', () => {
     cy.getByTestid('grw-personal-settings').find('.nav-title.nav li:eq(2) a').click();
     cy.scrollTo('top');
     cy.screenshot(`${ssPrefix}-password-settings-1`);
     cy.getByTestid('grw-password-settings-update-button').click();
-    cy.get('.toast').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.screenshot(`${ssPrefix}-password-settings-2`);
 
-    cy.get('.toast-close-button').click({ multiple: true }); // close toast alert
-    cy.get('.toast').should('not.exist');
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
+    });
   });
 
   it('Access API setting', () => {
@@ -98,11 +104,13 @@ context('Access User settings', () => {
     cy.screenshot(`${ssPrefix}-api-setting-1`);
     cy.getByTestid('grw-api-settings-update-button').click();
     cy.getByTestid('grw-api-settings-input').should('be.visible');
-    cy.get('.toast').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.screenshot(`${ssPrefix}-api-setting-2`);
 
-    cy.get('.toast-close-button').click({ multiple: true }); // close toast alert
-    cy.get('.toast').should('not.exist');
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
+    });
   });
 
   it('Access Editor setting', () => {
@@ -111,11 +119,13 @@ context('Access User settings', () => {
     cy.getByTestid('grw-editor-settings').should('be.visible');
     cy.screenshot(`${ssPrefix}-editor-setting-1`);
     cy.getByTestid('grw-editor-settings-update-button').click();
-    cy.get('.toast').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.screenshot(`${ssPrefix}-editor-setting-2`);
 
-    cy.get('.toast-close-button').click({ multiple: true }); // close toast alert
-    cy.get('.toast').should('not.exist');
+    cy.get('.Toastify__toast').should('be.visible').within(() => {
+      cy.get('.Toastify__close-button').should('be.visible').click();
+      cy.get('.Toastify__progress-bar').invoke('attr', 'style', 'display: none')
+    });
   });
 
   it('Access In-app notification setting', () => {
@@ -123,7 +133,7 @@ context('Access User settings', () => {
     cy.scrollTo('top');
     cy.screenshot(`${ssPrefix}-in-app-notification-setting-1`);
     cy.getByTestid('grw-in-app-notification-settings-update-button').click();
-    cy.get('.toast').should('be.visible').invoke('attr', 'style', 'opacity: 1');
+    cy.get('.Toastify__toast').should('be.visible');
     cy.screenshot(`${ssPrefix}-in-app-notification-setting-2`);
   });
 });