Explorar o código

feat: VRT Search

https://youtrack.weseek.co.jp/issue/GW-7739
- Implement vrt Duplicate, move, rename, delete with tag for search all pages and search current page
I Komang Mudana %!s(int64=4) %!d(string=hai) anos
pai
achega
88068e9c76

+ 27 - 7
packages/app/test/cypress/integration/3-search/search-all-pages.spec.ts

@@ -1,3 +1,4 @@
+/* eslint-disable cypress/no-unnecessary-waiting */
 context('Search all pages', () => {
 context('Search all pages', () => {
   const ssPrefix = 'search-all-pages-';
   const ssPrefix = 'search-all-pages-';
 
 
@@ -21,7 +22,7 @@ context('Search all pages', () => {
     }
     }
   });
   });
 
 
-  it(`Search by typing help and press ENTER`, () => {
+  it(`Search all paeges by typing help and press ENTER`, () => {
     const searchText = 'help';
     const searchText = 'help';
     cy.visit('/');
     cy.visit('/');
     cy.get('div.rbt-input-hint-container > input').click();
     cy.get('div.rbt-input-hint-container > input').click();
@@ -38,7 +39,7 @@ context('Search all pages', () => {
   });
   });
 
 
 
 
-  it(`Search by tag, ex: tag:help and press ENTER`, () => {
+  it(`Search all pages by tag, ex: tag:help and press ENTER`, () => {
     const searchText = `tag:help`;
     const searchText = `tag:help`;
     cy.visit('/');
     cy.visit('/');
     cy.get('div.rbt-input-hint-container > input').click();
     cy.get('div.rbt-input-hint-container > input').click();
@@ -53,12 +54,31 @@ context('Search all pages', () => {
     cy.getByTestid('open-page-item-control-btn').first().click();
     cy.getByTestid('open-page-item-control-btn').first().click();
     cy.screenshot(`${ssPrefix}click-three-dots-menu-search-with-tag`, {capture: 'viewport'});
     cy.screenshot(`${ssPrefix}click-three-dots-menu-search-with-tag`, {capture: 'viewport'});
 
 
-    /** TODO
-     * - Implement Add bookmark, move/rename , delete with tag
-     *
-    */
+    // Add Bookmark
+    cy.getByTestid('add-bookmark').first().click({force: true});
+    cy.wait(2000);
+    cy.screenshot(`${ssPrefix}add-bookmark`, {capture: 'viewport'});
 
 
+    // Duplicate page
+    cy.getByTestid('duplicate-page').first().click({force: true});
+    cy.wait(1000);
+    cy.screenshot(`${ssPrefix}duplicate-page`, {capture: 'viewport'});
 
 
-  })
+    // Close Modal
+    cy.get('body').type('{esc}');
+
+    // Move / Rename Page
+    cy.getByTestid('move-page').first().click({force: true});
+    cy.wait(1000);
+    cy.screenshot(`${ssPrefix}move-rename-page`, {capture: 'viewport'});
+
+    // Close Modal
+    cy.get('body').type('{esc}');
+
+    // Delete page
+    cy.getByTestid('delete-page').first().click({ force: true});
+    cy.wait(1000);
+    cy.screenshot(`${ssPrefix}delete-page`, {capture: 'viewport'});
+  });
 
 
 });
 });

+ 32 - 12
packages/app/test/cypress/integration/3-search/search-current-tree.spec.ts

@@ -1,5 +1,6 @@
-context('Search all pages', () => {
-  const ssPrefix = 'search-all-pages-';
+/* eslint-disable cypress/no-unnecessary-waiting */
+context('Search current tree', () => {
+  const ssPrefix = 'search-current-page-';
 
 
   let connectSid: string | undefined;
   let connectSid: string | undefined;
 
 
@@ -21,11 +22,11 @@ context('Search all pages', () => {
     }
     }
   });
   });
 
 
-  it(`Search by typing help and press ENTER`, () => {
+  it(`Search current tree by typing help and press ENTER`, () => {
     const searchText = 'help';
     const searchText = 'help';
     cy.visit('/');
     cy.visit('/');
     cy.getByTestid('select-search-scope').first().click({force: true});
     cy.getByTestid('select-search-scope').first().click({force: true});
-    cy.getByTestid('earch-current-tree').first().click({force: true});
+    cy.get('div.input-group-prepend.show > div > button:nth-child(2)').click({force: true});
     cy.get('div.rbt-input-hint-container > input').click();
     cy.get('div.rbt-input-hint-container > input').click();
     cy.screenshot(`${ssPrefix}search-input-focused`, { capture: 'viewport'});
     cy.screenshot(`${ssPrefix}search-input-focused`, { capture: 'viewport'});
     cy.get('div.rbt-input-hint-container > input').type(`${searchText}`);
     cy.get('div.rbt-input-hint-container > input').type(`${searchText}`);
@@ -40,12 +41,11 @@ context('Search all pages', () => {
   });
   });
 
 
 
 
-  it(`Search by tag, ex: tag:help and press ENTER`, () => {
+  it(`Search current tree by tag, ex: tag:help and press ENTER`, () => {
     const searchText = `tag:help`;
     const searchText = `tag:help`;
     cy.visit('/');
     cy.visit('/');
-
     cy.getByTestid('select-search-scope').first().click({force: true});
     cy.getByTestid('select-search-scope').first().click({force: true});
-    cy.getByTestid('earch-current-tree').first().click({force: true});
+    cy.get('div.input-group-prepend.show > div > button:nth-child(2)').click({force: true});
 
 
     cy.get('div.rbt-input-hint-container > input').click();
     cy.get('div.rbt-input-hint-container > input').click();
     cy.get('div.rbt-input-hint-container > input').type(`${searchText}`);
     cy.get('div.rbt-input-hint-container > input').type(`${searchText}`);
@@ -59,12 +59,32 @@ context('Search all pages', () => {
     cy.getByTestid('open-page-item-control-btn').first().click();
     cy.getByTestid('open-page-item-control-btn').first().click();
     cy.screenshot(`${ssPrefix}click-three-dots-menu-search-with-tag`, {capture: 'viewport'});
     cy.screenshot(`${ssPrefix}click-three-dots-menu-search-with-tag`, {capture: 'viewport'});
 
 
-    /** TODO
-     * - Implement Add bookmark, move/rename , delete with tag
-     *
-    */
+    // Add Bookmark
+    cy.getByTestid('add-bookmark').first().click({force: true});
+    cy.wait(2000);
+    cy.screenshot(`${ssPrefix}add-bookmark`, {capture: 'viewport'});
+
+    // Duplicate page
+    cy.getByTestid('duplicate-page').first().click({force: true});
+    cy.wait(1000);
+    cy.screenshot(`${ssPrefix}duplicate-page`, {capture: 'viewport'});
+
+    // Close Modal
+    cy.get('body').type('{esc}');
 
 
+    // Move / Rename Page
+    cy.getByTestid('move-page').first().click({force: true});
+    cy.wait(1000);
+    cy.screenshot(`${ssPrefix}move-rename-page`, {capture: 'viewport'});
 
 
-  })
+    // Close Modal
+    cy.get('body').type('{esc}');
+
+    // Delete page
+    cy.getByTestid('delete-page').first().click({ force: true});
+    cy.wait(1000);
+    cy.screenshot(`${ssPrefix}delete-page`, {capture: 'viewport'});
+
+  });
 
 
 });
 });