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

use cy.appendTextToEditorUntilContains

Shun Miyazawa 2 лет назад
Родитель
Сommit
5892c93e25
1 измененных файлов с 2 добавлено и 12 удалено
  1. 2 12
      apps/app/test/cypress/e2e/20-basic-features/20-basic-features--comments.cy.ts

+ 2 - 12
apps/app/test/cypress/e2e/20-basic-features/20-basic-features--comments.cy.ts

@@ -103,12 +103,7 @@ context('Comment', () => {
       return cy.get('.comment-write').then($elem => $elem.is(':visible'));
       return cy.get('.comment-write').then($elem => $elem.is(':visible'));
     });
     });
 
 
-    cy.waitUntil(() => {
-      // do
-      cy.get('.CodeMirror').type(username);
-      // wait until
-      return cy.get('.CodeMirror-hints').then($elem => $elem.is(':visible'));
-    });
+    cy.appendTextToEditorUntilContains(username, 10000);
 
 
     cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}4-mention-username-found`) });
     cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}4-mention-username-found`) });
     // Click on mentioned username
     // Click on mentioned username
@@ -129,12 +124,7 @@ context('Comment', () => {
       return cy.get('.comment-write').then($elem => $elem.is(':visible'));
       return cy.get('.comment-write').then($elem => $elem.is(':visible'));
     });
     });
 
 
-    cy.waitUntil(() => {
-      // do
-      cy.get('.CodeMirror').type(username);
-      // wait until
-      return cy.get('.CodeMirror-hints').then($elem => $elem.is(':visible'));
-    });
+    cy.appendTextToEditorUntilContains(username);
 
 
     cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}6-mention-username-not-found`) });
     cy.get('#comments-container').within(() => { cy.screenshot(`${ssPrefix}6-mention-username-not-found`) });
     // Click on username not found hint
     // Click on username not found hint