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

feat: VRT tag

https://youtrack.weseek.co.jp/issue/GW-7740
- Update taking screenshot sequence of add tag
- Create spec.ts for duplicate page by generated tag
I Komang Mudana 4 лет назад
Родитель
Сommit
fd9d6ffa57

+ 20 - 7
packages/app/test/cypress/integration/7-tag/add-tag.spec.ts

@@ -1,6 +1,6 @@
 /* eslint-disable cypress/no-unnecessary-waiting */
-context('Tag', () => {
-  const ssPrefix = 'tag-';
+context('Add Tag', () => {
+  const ssPrefix = 'add-tag-';
 
   let connectSid: string | undefined;
 
@@ -23,20 +23,33 @@ context('Tag', () => {
   it('Add Tag', () => {
     const tag = 'we';
     cy.visit('/');
+    cy.screenshot(`${ssPrefix}click-plus-button`, {capture: 'viewport'});
+
     cy.get('#edit-tags-btn-wrapper-for-tooltip > a').click({force: true});
     cy.wait(1000);
 
-    cy.screenshot(`${ssPrefix}click-add-tag`, {capture: 'viewport'});
+    cy.screenshot(`${ssPrefix}edit-tag-input`, {capture: 'viewport'});
 
     cy.get('#edit-tag-modal').within(() => {
       cy.get('.rbt-input-main').type(tag, {force: true});
-      cy.wait(1500)
-      cy.get('#rbt-menu-item-0 > a').should('be.visible');
-      cy.get('#rbt-menu-item-0 > a').click({force: true});
     });
     cy.wait(1000);
-    cy.screenshot(`${ssPrefix}insert-tag-name`, {capture: 'viewport'});
+    cy.screenshot(`${ssPrefix}type-tag-name`, {capture: 'viewport'});
+
+    cy.get('#edit-tag-modal').then(($item) => {
+      if($item.find('#rbt-menu-item-0 > a').length > 0){
+        cy.get('#rbt-menu-item-0 > a').click({force: true});
+        cy.wait(1000);
+        cy.screenshot(`${ssPrefix}insert-tag-name`, {capture: 'viewport'});
+      }
+    });
+
 
+    cy.get('#edit-tag-modal').within(() => {
+      cy.get('div.modal-footer > button').click();
+    });
+    cy.wait(1500);
+    cy.screenshot(`${ssPrefix}click-done`, {capture: 'viewport'});
   });
 
 });

+ 35 - 0
packages/app/test/cypress/integration/7-tag/tag-duplicate-page.spec.ts

@@ -0,0 +1,35 @@
+/* eslint-disable cypress/no-unnecessary-waiting */
+context('Duplicate page by generated tag', () => {
+  const ssPrefix = 'duplicate-tag-';
+
+  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('Duplicate page by generated tag', () => {
+    const tag = 'we';
+    cy.visit('/');
+    cy.screenshot(`${ssPrefix}visit-home`, {capture: 'viewport'});
+
+    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'});
+  });
+
+});