|
|
@@ -9,6 +9,7 @@ context('Switch Sidebar content', () => {
|
|
|
});
|
|
|
|
|
|
it('PageTree is successfully shown', () => {
|
|
|
+ cy.collapseSidebar(false);
|
|
|
cy.visit('/page');
|
|
|
cy.getByTestid('grw-sidebar-nav-primary-page-tree').click();
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
@@ -28,20 +29,75 @@ context('Modal for page operation', () => {
|
|
|
cy.fixture("user-admin.json").then(user => {
|
|
|
cy.login(user.username, user.password);
|
|
|
});
|
|
|
+ cy.collapseSidebar(true);
|
|
|
});
|
|
|
+ it("PageCreateModal is shown and closed successfully", () => {
|
|
|
+ cy.visit('/');
|
|
|
+ cy.getByTestid('newPageBtn').click();
|
|
|
|
|
|
- it("PageCreateModal is shown successfully", () => {
|
|
|
- cy.visit('/me');
|
|
|
+ cy.getByTestid('page-create-modal').should('be.visible').within(() => {
|
|
|
+ cy.screenshot(`${ssPrefix}new-page-modal-opened`);
|
|
|
+ cy.get('button.close').click();
|
|
|
|
|
|
+ });
|
|
|
+ cy.screenshot(`${ssPrefix}page-create-modal-closed`, {capture: 'viewport'});
|
|
|
+ });
|
|
|
+ it("Successfully Create Today's page", () => {
|
|
|
+ const pageName = "Today's page";
|
|
|
+ cy.visit('/');
|
|
|
cy.getByTestid('newPageBtn').click();
|
|
|
|
|
|
- cy.getByTestid('page-create-modal').should('be.visible').screenshot(`${ssPrefix}-open`);
|
|
|
+ cy.getByTestid('page-create-modal').should('be.visible').within(() => {
|
|
|
+ cy.get('.page-today-input2').type(pageName);
|
|
|
+ cy.screenshot(`${ssPrefix}today-add-page-name`);
|
|
|
+ cy.getByTestid('btn-create-memo').click();
|
|
|
+ });
|
|
|
+ cy.getByTestid('page-editor').should('be.visible');
|
|
|
+ cy.getByTestid('save-page-btn').click();
|
|
|
+ cy.get('body').should('not.have.class', 'on-edit');
|
|
|
|
|
|
- cy.getByTestid('row-create-page-under-below').find('input.form-control').clear().type('/new-page');
|
|
|
- cy.getByTestid('btn-create-page-under-below').click();
|
|
|
+ cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}create-today-page`);
|
|
|
+ });
|
|
|
+ it('Successfully create page under specific path', () => {
|
|
|
+ const pageName = 'child';
|
|
|
|
|
|
+ cy.visit('/SandBox');
|
|
|
+ cy.getByTestid('newPageBtn').click();
|
|
|
+
|
|
|
+ cy.getByTestid('page-create-modal').should('be.visible').within(() => {
|
|
|
+ cy.get('.rbt-input-main').type(pageName);
|
|
|
+ cy.screenshot(`${ssPrefix}under-path-add-page-name`);
|
|
|
+ cy.getByTestid('btn-create-page-under-below').click();
|
|
|
+ });
|
|
|
cy.getByTestid('page-editor').should('be.visible');
|
|
|
- cy.screenshot(`${ssPrefix}-create-clicked`, {capture: 'viewport'});
|
|
|
+ cy.getByTestid('save-page-btn').click();
|
|
|
+ cy.get('body').should('not.have.class', 'on-edit');
|
|
|
+
|
|
|
+ cy.getByTestid('grw-contextual-sub-nav').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}create-page-under-specific-page`);
|
|
|
+ });
|
|
|
+
|
|
|
+ it('Trying to create template page under the root page fail', () => {
|
|
|
+ cy.visit('/');
|
|
|
+ cy.getByTestid('newPageBtn').click();
|
|
|
+
|
|
|
+ cy.getByTestid('page-create-modal').should('be.visible').within(() => {
|
|
|
+ cy.get('#template-type').click();
|
|
|
+ cy.get('#template-type').next().find('button:eq(0)').click({force: true});
|
|
|
+ cy.get('#dd-template-type').next().find('button').click({force: true});
|
|
|
+ });
|
|
|
+ cy.get('.toast-error').should('be.visible').invoke('attr', 'style', 'opacity: 1');
|
|
|
+ cy.screenshot(`${ssPrefix}create-template-for-children-error`, {capture: 'viewport'});
|
|
|
+ cy.get('.toast-error').should('be.visible').click();
|
|
|
+
|
|
|
+ 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.get('#dd-template-type').next().find('button').click({force: true});
|
|
|
+ });
|
|
|
+ cy.get('.toast-error').should('be.visible').invoke('attr', 'style', 'opacity: 1');
|
|
|
+ cy.screenshot(`${ssPrefix}create-template-for-descendants-error`, {capture: 'viewport'});
|
|
|
});
|
|
|
|
|
|
it('PageDeleteModal is shown successfully', () => {
|
|
|
@@ -89,6 +145,7 @@ context('Open presentation modal', () => {
|
|
|
cy.fixture("user-admin.json").then(user => {
|
|
|
cy.login(user.username, user.password);
|
|
|
});
|
|
|
+ cy.collapseSidebar(true);
|
|
|
});
|
|
|
|
|
|
it('PresentationModal for "/" is shown successfully', () => {
|
|
|
@@ -115,6 +172,7 @@ context('Page Accessories Modal', () => {
|
|
|
cy.fixture("user-admin.json").then(user => {
|
|
|
cy.login(user.username, user.password);
|
|
|
});
|
|
|
+ cy.collapseSidebar(true);
|
|
|
});
|
|
|
|
|
|
it('Page History is shown successfully', () => {
|
|
|
@@ -160,6 +218,7 @@ context('Tag Oprations', () =>{
|
|
|
cy.fixture("user-admin.json").then(user => {
|
|
|
cy.login(user.username, user.password);
|
|
|
});
|
|
|
+ cy.collapseSidebar(true);
|
|
|
});
|
|
|
|
|
|
it('Successfully add new tag', () => {
|
|
|
@@ -188,8 +247,10 @@ context('Tag Oprations', () =>{
|
|
|
cy.get('div.modal-footer > button').click();
|
|
|
});
|
|
|
|
|
|
+ cy.get('.toast').should('be.visible').trigger('mouseover');
|
|
|
cy.get('.grw-taglabels-container > form > a').contains(tag).should('exist');
|
|
|
-
|
|
|
+ /* eslint-disable cypress/no-unnecessary-waiting */
|
|
|
+ cy.wait(150); // wait for toastr to change its color occured by mouseover
|
|
|
cy.screenshot(`${ssPrefix}4-click-done`, {capture: 'viewport'});
|
|
|
|
|
|
});
|
|
|
@@ -203,9 +264,14 @@ context('Tag Oprations', () =>{
|
|
|
cy.getByTestid('search-result-base').should('be.visible');
|
|
|
cy.getByTestid('search-result-list').should('be.visible');
|
|
|
cy.getByTestid('search-result-content').should('be.visible');
|
|
|
+ cy.get('#wiki').should('be.visible');
|
|
|
+ // force to add 'active' to pass VRT: https://github.com/weseek/growi/pull/6603
|
|
|
+ cy.getByTestid('page-list-item-L').first().invoke('addClass', 'active');
|
|
|
cy.screenshot(`${ssPrefix}1-click-tag-name`, {capture: 'viewport'});
|
|
|
|
|
|
cy.getByTestid('open-page-item-control-btn').first().click({force: true});
|
|
|
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
+ cy.wait(1500); // for wait rendering pagelist info
|
|
|
cy.screenshot(`${ssPrefix}2-click-three-dots-menu`, {capture: 'viewport'});
|
|
|
|
|
|
cy.getByTestid('open-page-duplicate-modal-btn').first().click({force: true});
|
|
|
@@ -233,24 +299,29 @@ context('Tag Oprations', () =>{
|
|
|
cy.getByTestid('search-result-base').should('be.visible');
|
|
|
cy.getByTestid('search-result-list').should('be.visible');
|
|
|
cy.getByTestid('search-result-content').should('be.visible');
|
|
|
+ cy.get('#wiki').should('be.visible');
|
|
|
cy.screenshot(`${ssPrefix}1-click-tag-name`, {capture: 'viewport'});
|
|
|
|
|
|
cy.getByTestid('search-result-list').within(() => {
|
|
|
cy.get('.list-group-item').each(($row) => {
|
|
|
if($row.find('a').text() === oldPageName){
|
|
|
cy.wrap($row).within(() => {
|
|
|
- cy.getByTestid('open-page-item-control-btn').click();
|
|
|
+ cy.getByTestid('open-page-item-control-btn').first().click();
|
|
|
+ cy.getByTestid('page-item-control-menu').should('have.class', 'show').first().within(() => {
|
|
|
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
+ cy.wait(300);
|
|
|
+ cy.screenshot(`${ssPrefix}2-open-page-item-control-menu`);
|
|
|
+ })
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- cy.screenshot(`${ssPrefix}2-click-three-dots-menu`, {capture: 'viewport'});
|
|
|
|
|
|
cy.getByTestid('search-result-list').within(() => {
|
|
|
cy.get('.list-group-item').each(($row) => {
|
|
|
if($row.find('a').text() === oldPageName){
|
|
|
cy.wrap($row).within(() => {
|
|
|
- cy.getByTestid('open-page-move-rename-modal-btn').click();
|
|
|
+ cy.getByTestid('open-page-move-rename-modal-btn').click({force: true});
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -265,6 +336,7 @@ context('Tag Oprations', () =>{
|
|
|
});
|
|
|
|
|
|
cy.visit(`/${newPageName}`);
|
|
|
+ cy.getByTestid('grw-tag-labels').should('be.visible');
|
|
|
cy.screenshot(`${ssPrefix}4-new-page-name-applied`, {capture: 'viewport'});
|
|
|
});
|
|
|
|