|
@@ -11,7 +11,7 @@ context('Access to sticky Fab', () => {
|
|
|
cy.visit('/');
|
|
cy.visit('/');
|
|
|
|
|
|
|
|
cy.waitUntilSkeletonDisappear();
|
|
cy.waitUntilSkeletonDisappear();
|
|
|
- cy.collapseSidebar(true);
|
|
|
|
|
|
|
+ cy.collapseSidebar(true, true);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('Fab display changes on scroll down and up', () => {
|
|
it('Fab display changes on scroll down and up', () => {
|
|
@@ -22,9 +22,7 @@ context('Access to sticky Fab', () => {
|
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
|
cy.scrollTo(0, 250);
|
|
cy.scrollTo(0, 250);
|
|
|
// wait until
|
|
// wait until
|
|
|
- return cy.getByTestid('grw-fab-container').within(() => {
|
|
|
|
|
- return cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('visible'));
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('visible'));
|
|
|
});
|
|
});
|
|
|
cy.screenshot(`${ssPrefix}is-visible-on-scroll-down`);
|
|
cy.screenshot(`${ssPrefix}is-visible-on-scroll-down`);
|
|
|
|
|
|
|
@@ -34,11 +32,8 @@ context('Access to sticky Fab', () => {
|
|
|
// Scroll the window back to top
|
|
// Scroll the window back to top
|
|
|
cy.scrollTo(0, 0);
|
|
cy.scrollTo(0, 0);
|
|
|
// wait until
|
|
// wait until
|
|
|
- return cy.getByTestid('grw-fab-container').within(() => {
|
|
|
|
|
- return cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('invisible'));
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('invisible'));
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
cy.screenshot(`${ssPrefix}is-invisible-on-scroll-top`);
|
|
cy.screenshot(`${ssPrefix}is-invisible-on-scroll-top`);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -50,9 +45,7 @@ context('Access to sticky Fab', () => {
|
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
|
cy.scrollTo(0, 250);
|
|
cy.scrollTo(0, 250);
|
|
|
// wait until
|
|
// wait until
|
|
|
- return cy.getByTestid('grw-fab-container').within(() => {
|
|
|
|
|
return cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('visible'));
|
|
return cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('visible'));
|
|
|
- });
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// Move to /Sandbox page
|
|
// Move to /Sandbox page
|
|
@@ -61,7 +54,7 @@ context('Access to sticky Fab', () => {
|
|
|
cy.waitUntilSkeletonDisappear();
|
|
cy.waitUntilSkeletonDisappear();
|
|
|
cy.collapseSidebar(true);
|
|
cy.collapseSidebar(true);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ cy.waitUntil(() => cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('invisible')));
|
|
|
cy.screenshot(`${ssPrefix}is-not-visible-on-move-to-other-pages`);
|
|
cy.screenshot(`${ssPrefix}is-not-visible-on-move-to-other-pages`);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -70,17 +63,15 @@ context('Access to sticky Fab', () => {
|
|
|
//do
|
|
//do
|
|
|
// Scroll the window back to top
|
|
// Scroll the window back to top
|
|
|
cy.scrollTo(0, 250);
|
|
cy.scrollTo(0, 250);
|
|
|
|
|
+
|
|
|
// wait until
|
|
// wait until
|
|
|
- return cy.getByTestid('grw-fab-container').within(() => {
|
|
|
|
|
- return cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('visible'));
|
|
|
|
|
|
|
+ return cy.getByTestid('grw-fab-page-create-button')
|
|
|
|
|
+ .should('have.class', 'visible')
|
|
|
|
|
+ .within(() => {
|
|
|
|
|
+ cy.get('.btn-create-page').click();
|
|
|
|
|
+ return true;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
- cy.waitUntil(() => {
|
|
|
|
|
- //do
|
|
|
|
|
- cy.getByTestid('grw-fab-page-create-button').click();
|
|
|
|
|
- // wait until
|
|
|
|
|
- return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
cy.getByTestid('page-create-modal').should('be.visible').within(() => {
|
|
cy.getByTestid('page-create-modal').should('be.visible').within(() => {
|
|
|
cy.screenshot(`${ssPrefix}new-page-modal-opened-from-fab`);
|
|
cy.screenshot(`${ssPrefix}new-page-modal-opened-from-fab`);
|
|
@@ -89,15 +80,22 @@ context('Access to sticky Fab', () => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it('Able to scroll page to top', () => {
|
|
it('Able to scroll page to top', () => {
|
|
|
- cy.getByTestid('grw-fab-container').within(() => {
|
|
|
|
|
- cy.getByTestid('grw-fab-return-to-top').should('have.class', 'visible');
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
|
|
+ // Initial scroll down
|
|
|
cy.waitUntil(() => {
|
|
cy.waitUntil(() => {
|
|
|
- //do
|
|
|
|
|
- cy.getByTestid('grw-fab-return-to-top').click();
|
|
|
|
|
|
|
+ // do
|
|
|
|
|
+ // Scroll the window 250px down is enough to trigger sticky effect
|
|
|
|
|
+ cy.scrollTo(0, 250);
|
|
|
|
|
+
|
|
|
// wait until
|
|
// wait until
|
|
|
- return cy.getByTestid('grw-fab-return-to-top').then($elem => $elem.hasClass('invisible'));
|
|
|
|
|
|
|
+ return cy.getByTestid('grw-fab-return-to-top')
|
|
|
|
|
+ .should('have.class', 'visible')
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ cy.waitUntil(() => {
|
|
|
|
|
+ cy.get('.btn-scroll-to-top').click();
|
|
|
|
|
+ return cy.getByTestid('grw-fab-return-to-top').should('have.class', 'invisible');
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
cy.screenshot(`${ssPrefix}scroll-page-to-top`);
|
|
cy.screenshot(`${ssPrefix}scroll-page-to-top`);
|