|
|
@@ -13,12 +13,14 @@ describe('Access to sidebar', () => {
|
|
|
beforeEach(() => {
|
|
|
cy.visit('/');
|
|
|
cy.waitUntilSkeletonDisappear();
|
|
|
+ // Since this is a sidebar test, call collapseSidebar in beforeEach.
|
|
|
cy.collapseSidebar(false);
|
|
|
});
|
|
|
|
|
|
describe('Test show/collapse button', () => {
|
|
|
it('Successfully show sidebar', () => {
|
|
|
cy.getByTestid('grw-pagetree-item-container').should('be.visible');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}1-sidebar-shown`, {
|
|
|
capture: 'viewport',
|
|
|
// Blackout for recalculation of toc content hight
|
|
|
@@ -28,6 +30,7 @@ describe('Access to sidebar', () => {
|
|
|
|
|
|
it('Successfully collapse sidebar', () => {
|
|
|
cy.getByTestid('grw-navigation-resize-button').click({force: true});
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}2-sidebar-collapsed`, {
|
|
|
capture: 'viewport',
|
|
|
// Blackout for recalculation of toc content hight
|
|
|
@@ -40,6 +43,7 @@ describe('Access to sidebar', () => {
|
|
|
it('Successfully access to page tree', () => {
|
|
|
cy.getByTestid('grw-contextual-navigation-sub').within(() => {
|
|
|
cy.getByTestid('grw-pagetree-item-container').should('be.visible');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}page-tree-1-access-to-page-tree`);
|
|
|
});
|
|
|
});
|
|
|
@@ -49,34 +53,37 @@ describe('Access to sidebar', () => {
|
|
|
cy.get('.grw-pagetree-open').should('be.visible');
|
|
|
|
|
|
// hide page tree tiems
|
|
|
- cy.get('.grw-pagetree-triangle-btn').eq(0).click();
|
|
|
+ cy.get('.grw-pagetree-triangle-btn').first().click();
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}page-tree-2-hide-page-tree-items`);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
it('Successfully click Add to Bookmarks button', () => {
|
|
|
// click three dots
|
|
|
- cy.get('.grw-pagetree-item-children').eq(0).within(() => {
|
|
|
- cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click();
|
|
|
+ cy.get('.grw-pagetree-item-children').first().within(() => {
|
|
|
+ cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click();
|
|
|
});
|
|
|
|
|
|
cy.getByTestid('page-item-control-menu').should('have.class', 'show');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}page-tree-3-before-click-button`, {
|
|
|
// Blackout for recalculation of toc content hight
|
|
|
blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
|
|
|
});
|
|
|
|
|
|
// click add remove bookmark btn
|
|
|
- cy.getByTestid('page-item-control-menu').should('have.class', 'show').within(() => {
|
|
|
- cy.getByTestid('add-remove-bookmark-btn').click();
|
|
|
- });
|
|
|
+ cy.getByTestid('page-item-control-menu').should('have.class', 'show')
|
|
|
+ cy.getByTestid('add-remove-bookmark-btn').click();
|
|
|
+
|
|
|
|
|
|
// show dropdown again
|
|
|
- cy.get('.grw-pagetree-item-children').eq(0).within(() => {
|
|
|
- cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click();
|
|
|
+ cy.get('.grw-pagetree-item-children').first().within(() => {
|
|
|
+ cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click();
|
|
|
});
|
|
|
|
|
|
cy.getByTestid('page-item-control-menu').should('have.class', 'show');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}page-tree-4-after-click-button`, {
|
|
|
// Blackout for recalculation of toc content hight
|
|
|
blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
|
|
|
@@ -84,45 +91,50 @@ describe('Access to sidebar', () => {
|
|
|
});
|
|
|
|
|
|
it('Successfully show duplicate page modal', () => {
|
|
|
- cy.get('.grw-pagetree-item-children').eq(0).within(() => {
|
|
|
- cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click();
|
|
|
+ cy.get('.grw-pagetree-item-children').first().within(() => {
|
|
|
+ cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click();
|
|
|
});
|
|
|
cy.get('.dropdown-menu.show').should('be.visible').within(() => {
|
|
|
cy.getByTestid('open-page-duplicate-modal-btn').click();
|
|
|
});
|
|
|
cy.getByTestid('page-duplicate-modal').should('be.visible').within(() => {
|
|
|
cy.get('.rbt-input-main').type('_test');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}page-tree-5-duplicate-page-modal`);
|
|
|
+
|
|
|
cy.get('.modal-header > button').click();
|
|
|
});
|
|
|
});
|
|
|
|
|
|
it('Successfully rename page', () => {
|
|
|
cy.getByTestid('grw-contextual-navigation-sub').within(() => {
|
|
|
- cy.get('.grw-pagetree-item-children').eq(0).within(() => {
|
|
|
- cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click()
|
|
|
+ cy.get('.grw-pagetree-item-children').first().within(() => {
|
|
|
+ cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click()
|
|
|
});
|
|
|
cy.get('.dropdown-menu.show').should('be.visible').within(() => {
|
|
|
cy.getByTestid('open-page-move-rename-modal-btn').click();
|
|
|
});
|
|
|
- cy.get('.grw-pagetree-item-children').eq(0).within(() => {
|
|
|
+ cy.get('.grw-pagetree-item-children').first().within(() => {
|
|
|
cy.getByTestid('closable-text-input').type('_newname');
|
|
|
});
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}page-tree-6-rename-page`);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
it('Successfully show delete page modal', () => {
|
|
|
cy.getByTestid('grw-contextual-navigation-sub').within(() => {
|
|
|
- cy.get('.grw-pagetree-item-children').eq(0).within(() => {
|
|
|
- cy.getByTestid('open-page-item-control-btn').find('button').eq(0).invoke('css','display','block').click()
|
|
|
+ cy.get('.grw-pagetree-item-children').first().within(() => {
|
|
|
+ cy.getByTestid('open-page-item-control-btn').find('button').first().invoke('css','display','block').click()
|
|
|
});
|
|
|
cy.get('.dropdown-menu.show').should('be.visible').within(() => {
|
|
|
cy.getByTestid('open-page-delete-modal-btn').click();
|
|
|
});
|
|
|
});
|
|
|
cy.getByTestid('page-delete-modal').should('be.visible').within(() => {
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}page-tree-7-delete-page-modal`);
|
|
|
+
|
|
|
cy.get('.modal-header > button').click();
|
|
|
});
|
|
|
});
|
|
|
@@ -137,6 +149,7 @@ describe('Access to sidebar', () => {
|
|
|
|
|
|
cy.getByTestid('grw-contextual-navigation-sub').within(() => {
|
|
|
cy.get('.grw-sidebar-content-header.h5').find('a');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}custom-sidebar-1-access-to-custom-sidebar`);
|
|
|
});
|
|
|
});
|
|
|
@@ -146,7 +159,9 @@ describe('Access to sidebar', () => {
|
|
|
|
|
|
cy.get('.grw-sidebar-content-header.h5').find('a').click();
|
|
|
cy.get('.CodeMirror textarea').type(content, {force: true});
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}custom-sidebar-2-redirect-to-editor`);
|
|
|
+
|
|
|
cy.getByTestid('save-page-btn').click();
|
|
|
cy.get('.layout-root').should('not.have.class', 'editing');
|
|
|
});
|
|
|
@@ -154,6 +169,7 @@ describe('Access to sidebar', () => {
|
|
|
it('Successfully create custom sidebar content', () => {
|
|
|
cy.getByTestid('grw-contextual-navigation-sub').within(() => {
|
|
|
cy.get('.grw-custom-sidebar-content').should('be.visible');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}custom-sidebar-3-content-created`);
|
|
|
});
|
|
|
});
|
|
|
@@ -169,7 +185,7 @@ describe('Access to sidebar', () => {
|
|
|
cy.getByTestid('grw-recent-changes').should('be.visible');
|
|
|
cy.get('.list-group-item').should('be.visible');
|
|
|
|
|
|
- // The scope of the capture is not narrowed because the blackout is shifted
|
|
|
+ // The scope of the screenshot is not narrowed because the blackout is shifted
|
|
|
cy.screenshot(`${ssPrefix}recent-changes-1-access-to-recent-changes`, {
|
|
|
// Blackout for recalculation of toc content hight
|
|
|
blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
|
|
|
@@ -182,7 +198,7 @@ describe('Access to sidebar', () => {
|
|
|
cy.get('.list-group-item').should('be.visible');
|
|
|
});
|
|
|
|
|
|
- // The scope of the capture is not narrowed because the blackout is shifted
|
|
|
+ // The scope of the screenshot is not narrowed because the blackout is shifted
|
|
|
cy.screenshot(`${ssPrefix}recent-changes-2-switch-content-size`, {
|
|
|
// Blackout for recalculation of toc content hight
|
|
|
blackout: ['.grw-side-contents-container', '[data-hide-in-vrt=true]'],
|
|
|
@@ -199,6 +215,7 @@ describe('Access to sidebar', () => {
|
|
|
|
|
|
cy.getByTestid('grw-contextual-navigation-sub').within(() => {
|
|
|
cy.getByTestid('grw-tags-list').should('be.visible');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}tags-1-access-to-tags`);
|
|
|
});
|
|
|
});
|
|
|
@@ -207,11 +224,12 @@ describe('Access to sidebar', () => {
|
|
|
cy.get('.grw-container-convertible > div > .btn-primary').click({force: true});
|
|
|
cy.collapseSidebar(true);
|
|
|
cy.getByTestid('grw-tags-list').should('be.visible');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}tags-2-click-all-tags-button`);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- // TODO: No Drafts pages on GROWI version 6
|
|
|
+ // // TODO: No Drafts pages on GROWI version 6
|
|
|
// it('Successfully access to My Drafts page', () => {
|
|
|
// cy.visit('/');
|
|
|
// cy.collapseSidebar(true);
|
|
|
@@ -241,6 +259,7 @@ describe('Access to sidebar', () => {
|
|
|
|
|
|
cy.get('.grw-page-path-hierarchical-link').should('be.visible');
|
|
|
cy.get('.grw-custom-nav-tab').should('be.visible');
|
|
|
+
|
|
|
cy.screenshot(`${ssPrefix}access-to-trash-page`);
|
|
|
});
|
|
|
});
|