|
|
@@ -68,3 +68,152 @@ context('Access to legacy private pages', () => {
|
|
|
});
|
|
|
|
|
|
});
|
|
|
+
|
|
|
+context('Search all pages', () => {
|
|
|
+ const ssPrefix = 'search-all-pages-';
|
|
|
+
|
|
|
+ beforeEach(() => {
|
|
|
+ // login
|
|
|
+ cy.fixture("user-admin.json").then(user => {
|
|
|
+ cy.login(user.username, user.password);
|
|
|
+ });
|
|
|
+ // collapse sidebar
|
|
|
+ cy.collapseSidebar(true);
|
|
|
+ });
|
|
|
+
|
|
|
+ it(`Search all pages by word is successfully loaded`, () => {
|
|
|
+ const searchText = 'help';
|
|
|
+ cy.visit('/');
|
|
|
+ cy.get('.rbt-input').click();
|
|
|
+ cy.screenshot(`${ssPrefix}search-input-focused`, { capture: 'viewport'});
|
|
|
+ cy.get('.rbt-input-main').type(`${searchText}`);
|
|
|
+ cy.screenshot(`${ssPrefix}insert-search-text`, { capture: 'viewport'});
|
|
|
+ cy.get('.rbt-input-main').type('{enter}');
|
|
|
+ cy.screenshot(`${ssPrefix}press-enter`, { capture: 'viewport'});
|
|
|
+
|
|
|
+ cy.getByTestid('search-result-list').should('be.visible');
|
|
|
+
|
|
|
+ cy.getByTestid('open-page-item-control-btn').first().click();
|
|
|
+ cy.screenshot(`${ssPrefix}click-three-dots-menu`, {capture: 'viewport'});
|
|
|
+ });
|
|
|
+
|
|
|
+ it(`Search all pages by tag is successfully loaded `, () => {
|
|
|
+ const searchText = `tag:help`;
|
|
|
+ cy.visit('/');
|
|
|
+ cy.get('.rbt-input').click();
|
|
|
+ cy.get('.rbt-input-main').type(`${searchText}`);
|
|
|
+ cy.screenshot(`${ssPrefix}insert-search-text-with-tag`, { capture: 'viewport'});
|
|
|
+ cy.get('.rbt-input-main').type('{enter}');
|
|
|
+ cy.getByTestid('search-result-list').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}search-with-tag-result`, {capture: 'viewport'});
|
|
|
+ cy.getByTestid('open-page-item-control-btn').first().click();
|
|
|
+ cy.screenshot(`${ssPrefix}click-three-dots-menu-search-with-tag`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Add Bookmark
|
|
|
+ cy.getByTestid('add-remove-bookmark-btn').first().click({force: true});
|
|
|
+ cy.get('.btn-bookmark.active').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}add-bookmark`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Duplicate page
|
|
|
+ cy.getByTestid('open-page-duplicate-modal-btn').first().click({force: true});
|
|
|
+ cy.getByTestid('page-duplicate-modal').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}duplicate-page`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Close Modal
|
|
|
+ cy.get('body').type('{esc}');
|
|
|
+
|
|
|
+ // Move / Rename Page
|
|
|
+ cy.getByTestid('open-page-move-rename-modal-btn').first().click({force: true});
|
|
|
+ cy.getByTestid('page-rename-modal').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}move-rename-page`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Close Modal
|
|
|
+ cy.get('body').type('{esc}');
|
|
|
+
|
|
|
+ // Delete page
|
|
|
+ cy.getByTestid('open-page-delete-modal-btn').first().click({ force: true});
|
|
|
+ cy.getByTestid('page-delete-modal').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}delete-page`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+});
|
|
|
+
|
|
|
+context('Search current tree', () => {
|
|
|
+ const ssPrefix = 'search-current-tree-';
|
|
|
+
|
|
|
+ beforeEach(() => {
|
|
|
+ // login
|
|
|
+ cy.fixture("user-admin.json").then(user => {
|
|
|
+ cy.login(user.username, user.password);
|
|
|
+ });
|
|
|
+ // collapse sidebar
|
|
|
+ cy.collapseSidebar(true);
|
|
|
+ });
|
|
|
+
|
|
|
+ it(`Search current tree by word is successfully loaded`, () => {
|
|
|
+ const searchText = 'help';
|
|
|
+ cy.visit('/');
|
|
|
+ cy.getByTestid('select-search-scope').first().click({force: true});
|
|
|
+ cy.get('.input-group-prepend.show > div > button:nth-child(2)').click({force: true});
|
|
|
+ cy.get('.rbt-input').click();
|
|
|
+ cy.screenshot(`${ssPrefix}search-input-focused`, { capture: 'viewport'});
|
|
|
+ cy.get('.rbt-input').type(`${searchText}`);
|
|
|
+ cy.screenshot(`${ssPrefix}insert-search-text`, { capture: 'viewport'});
|
|
|
+ cy.get('.rbt-input').type('{enter}');
|
|
|
+ cy.screenshot(`${ssPrefix}press-enter`, { capture: 'viewport'});
|
|
|
+
|
|
|
+ cy.getByTestid('search-result-list').should('be.visible');
|
|
|
+
|
|
|
+ cy.getByTestid('open-page-item-control-btn').first().click();
|
|
|
+ cy.screenshot(`${ssPrefix}click-three-dots-menu`, {capture: 'viewport'});
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ it(`Search current tree by tag is successfully loaded`, () => {
|
|
|
+ const searchText = `tag:help`;
|
|
|
+ cy.visit('/');
|
|
|
+ cy.getByTestid('select-search-scope').first().click({force: true});
|
|
|
+ cy.get('.input-group-prepend.show > div > button:nth-child(2)').click({force: true});
|
|
|
+
|
|
|
+ cy.get('.rbt-input').click();
|
|
|
+ cy.get('.rbt-input').type(`${searchText}`);
|
|
|
+ cy.screenshot(`${ssPrefix}insert-search-text-with-tag`, { capture: 'viewport'});
|
|
|
+ cy.get('.rbt-input').type('{enter}');
|
|
|
+
|
|
|
+ cy.getByTestid('search-result-list').should('be.visible');
|
|
|
+
|
|
|
+ cy.screenshot(`${ssPrefix}search-with-tag-result`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ cy.getByTestid('open-page-item-control-btn').first().click();
|
|
|
+ cy.screenshot(`${ssPrefix}click-three-dots-menu-search-with-tag`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Add Bookmark
|
|
|
+ cy.getByTestid('add-remove-bookmark-btn').first().click({force: true});
|
|
|
+ cy.get('.btn-bookmark.active').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}add-bookmark`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Duplicate page
|
|
|
+ cy.getByTestid('open-page-duplicate-modal-btn').first().click({force: true});
|
|
|
+ cy.getByTestid('page-duplicate-modal').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}duplicate-page`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Close Modal
|
|
|
+ cy.get('body').type('{esc}');
|
|
|
+
|
|
|
+ // Move / Rename Page
|
|
|
+ cy.getByTestid('open-page-move-rename-modal-btn').first().click({force: true});
|
|
|
+ cy.getByTestid('page-rename-modal').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}move-rename-page`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ // Close Modal
|
|
|
+ cy.get('body').type('{esc}');
|
|
|
+
|
|
|
+ // Delete page
|
|
|
+ cy.getByTestid('open-page-delete-modal-btn').first().click({ force: true});
|
|
|
+ cy.getByTestid('page-delete-modal').should('be.visible');
|
|
|
+ cy.screenshot(`${ssPrefix}delete-page`, {capture: 'viewport'});
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+});
|