|
@@ -1,5 +1,5 @@
|
|
|
context('Access to any page', () => {
|
|
context('Access to any page', () => {
|
|
|
- const ssPrefix = 'subnav-and-fab-';
|
|
|
|
|
|
|
+ const ssPrefix = 'subnav-';
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
beforeEach(() => {
|
|
|
// login
|
|
// login
|
|
@@ -13,7 +13,7 @@ context('Access to any page', () => {
|
|
|
cy.collapseSidebar(true, true);
|
|
cy.collapseSidebar(true, true);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- it('Subnavigation and fab displays changes on scroll down and up', () => {
|
|
|
|
|
|
|
+ it('Subnavigation displays changes on scroll down and up', () => {
|
|
|
cy.waitUntil(() => {
|
|
cy.waitUntil(() => {
|
|
|
// do
|
|
// do
|
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
@@ -21,8 +21,6 @@ context('Access to any page', () => {
|
|
|
// wait until
|
|
// wait until
|
|
|
return cy.getByTestid('grw-subnav-switcher').then($elem => !$elem.hasClass('grw-subnav-switcher-hidden'));
|
|
return cy.getByTestid('grw-subnav-switcher').then($elem => !$elem.hasClass('grw-subnav-switcher-hidden'));
|
|
|
});
|
|
});
|
|
|
- // wait until fab visible
|
|
|
|
|
- cy.waitUntil(() => cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('visible')));
|
|
|
|
|
|
|
|
|
|
cy.waitUntilSkeletonDisappear();
|
|
cy.waitUntilSkeletonDisappear();
|
|
|
cy.screenshot(`${ssPrefix}visible-on-scroll-down`);
|
|
cy.screenshot(`${ssPrefix}visible-on-scroll-down`);
|
|
@@ -34,13 +32,11 @@ context('Access to any page', () => {
|
|
|
// wait until
|
|
// wait until
|
|
|
return cy.waitUntil(() => cy.getByTestid('grw-subnav-switcher').then($elem => $elem.hasClass('grw-subnav-switcher-hidden')));
|
|
return cy.waitUntil(() => cy.getByTestid('grw-subnav-switcher').then($elem => $elem.hasClass('grw-subnav-switcher-hidden')));
|
|
|
});
|
|
});
|
|
|
- // wait until fab invisible
|
|
|
|
|
- cy.waitUntil(() => cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('invisible')));
|
|
|
|
|
|
|
|
|
|
cy.screenshot(`${ssPrefix}invisible-on-scroll-top`);
|
|
cy.screenshot(`${ssPrefix}invisible-on-scroll-top`);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- it('Subnavigation and fab are not displayed when move to other pages', () => {
|
|
|
|
|
|
|
+ it('Subnavigation is not displayed when move to other pages', () => {
|
|
|
cy.waitUntil(() => {
|
|
cy.waitUntil(() => {
|
|
|
// do
|
|
// do
|
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
// Scroll the window 250px down is enough to trigger sticky effect
|
|
@@ -48,7 +44,6 @@ context('Access to any page', () => {
|
|
|
// wait until
|
|
// wait until
|
|
|
return () => cy.getByTestid('grw-subnav-switcher').then($elem => !$elem.hasClass('grw-subnav-switcher-hidden'));
|
|
return () => cy.getByTestid('grw-subnav-switcher').then($elem => !$elem.hasClass('grw-subnav-switcher-hidden'));
|
|
|
});
|
|
});
|
|
|
- cy.waitUntil(() => cy.getByTestid('grw-fab-page-create-button').then($elem => $elem.hasClass('visible')));
|
|
|
|
|
|
|
|
|
|
// Move to /Sandbox page
|
|
// Move to /Sandbox page
|
|
|
cy.visit('/Sandbox');
|
|
cy.visit('/Sandbox');
|
|
@@ -56,51 +51,10 @@ context('Access to any page', () => {
|
|
|
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.waitUntil(() => cy.getByTestid('grw-subnav-switcher').then($elem => $elem.hasClass('grw-subnav-switcher-hidden')));
|
|
cy.waitUntil(() => cy.getByTestid('grw-subnav-switcher').then($elem => $elem.hasClass('grw-subnav-switcher-hidden')));
|
|
|
cy.screenshot(`${ssPrefix}not-visible-on-move-to-other-pages`);
|
|
cy.screenshot(`${ssPrefix}not-visible-on-move-to-other-pages`);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- it('Able to open create page modal from fab', () => {
|
|
|
|
|
- cy.waitUntil(() => {
|
|
|
|
|
- // do
|
|
|
|
|
- // Scroll the window back to top
|
|
|
|
|
- cy.scrollTo(0, 250);
|
|
|
|
|
- // wait until
|
|
|
|
|
- return cy.getByTestid('grw-fab-page-create-button')
|
|
|
|
|
- .should('have.class', 'visible')
|
|
|
|
|
- .within(() => {
|
|
|
|
|
- cy.get('.btn-create-page').click();
|
|
|
|
|
- return true;
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- cy.getByTestid('page-create-modal').should('be.visible').within(() => {
|
|
|
|
|
- cy.screenshot(`${ssPrefix}new-page-modal-opened-from-fab`);
|
|
|
|
|
- cy.get('button.close').click();
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- it('Able to scroll page to top from fab', () => {
|
|
|
|
|
- // Initial scroll down
|
|
|
|
|
- cy.waitUntil(() => {
|
|
|
|
|
- // do
|
|
|
|
|
- // Scroll the window 250px down is enough to trigger sticky effect
|
|
|
|
|
- cy.scrollTo(0, 250);
|
|
|
|
|
- // wait until
|
|
|
|
|
- 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.waitUntilSkeletonDisappear();
|
|
|
|
|
- cy.screenshot(`${ssPrefix}scroll-page-to-top`);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
it('Able to click buttons on subnavigation switcher when sticky', () => {
|
|
it('Able to click buttons on subnavigation switcher when sticky', () => {
|
|
|
cy.waitUntil(() => {
|
|
cy.waitUntil(() => {
|
|
|
// do
|
|
// do
|