Просмотр исходного кода

feat: VRT tag - rename page from generated tag

https://youtrack.weseek.co.jp/issue/GW-7740
- Rename and modify duplicate page spec.ts
- Create spec.ts for rename page from generated tag
- Add class to Page rename modal
I Komang Mudana 4 лет назад
Родитель
Сommit
ee563d0f68

+ 1 - 1
packages/app/test/cypress/integration/7-tag/tag-duplicate-page.spec.ts → packages/app/test/cypress/integration/7-tag/duplicate-page.spec.ts

@@ -1,6 +1,6 @@
 /* eslint-disable cypress/no-unnecessary-waiting */
 /* eslint-disable cypress/no-unnecessary-waiting */
 context('Duplicate page by generated tag', () => {
 context('Duplicate page by generated tag', () => {
-  const ssPrefix = 'duplicate-tag-';
+  const ssPrefix = 'duplicate-page-';
 
 
   let connectSid: string | undefined;
   let connectSid: string | undefined;
 
 

+ 70 - 0
packages/app/test/cypress/integration/7-tag/rename-page.spec.ts

@@ -0,0 +1,70 @@
+/* eslint-disable cypress/no-unnecessary-waiting */
+context('Rename page from generated tag', () => {
+  const ssPrefix = 'rename-page-';
+
+  let connectSid: string | undefined;
+
+  before(() => {
+    // login
+    cy.fixture("user-admin.json").then(user => {
+      cy.login(user.username, user.password);
+    });
+    cy.getCookie('connect.sid').then(cookie => {
+      connectSid = cookie?.value;
+    });
+  });
+
+  beforeEach(() => {
+    if (connectSid != null) {
+      cy.setCookie('connect.sid', connectSid);
+    }
+  });
+
+  it('Rename page from generated tag', () => {
+    const tag = 'we';
+    const oldPageName = 'our';
+    const newPageName = 'ourus';
+
+    // Visit home
+    cy.visit('/');
+    cy.screenshot(`${ssPrefix}visit-home`, {capture: 'viewport'});
+
+    // Click tag that contain "we"
+    cy.get('#grw-subnav-container').within(()=>{
+      cy.get('a[href*="/_search?q=tag"]').contains(tag).click()
+    });
+    cy.wait(1500);
+    cy.screenshot(`${ssPrefix}click-tag-name`, {capture: 'viewport'});
+
+    cy.getByTestid('search-result-list').should('be.visible');
+
+    // Click three dot menu on item that contain /our
+    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.screenshot(`${ssPrefix}click-three-dots-menu`, {capture: 'viewport'});
+
+    // Rename page
+    cy.getByTestid('move-page').click({force: true});
+
+    cy.wait(1500);
+    cy.get('.grw-rename-page').should('be.visible');
+    cy.get('.grw-rename-page').within(() => {
+      cy.get('input[class="rbt-input-main"]').clear({force: true});
+      cy.get('input[class="rbt-input-main"]').type(`/${newPageName}`, {force: true});
+
+    });
+    cy.screenshot(`${ssPrefix}insert-new-page-name`, {capture: 'viewport'});
+  });
+
+
+
+
+
+});