Shun Miyazawa 2 лет назад
Родитель
Сommit
895d844ff0

+ 2 - 2
apps/app/test/cypress/e2e/20-basic-features/20-basic-features--username-mention.cy.ts

@@ -30,7 +30,7 @@ context('Mention username in comment', () => {
     const username = 'adm';
 
     cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
-    cy.appendTextToEditorUntilContains('@' + username);
+    cy.appendTextToEditorUntilContains('@' + username, 10000);
     cy.wait('@searchUsername');
     cy.get('.CodeMirror-hints').should('be.visible');
 
@@ -44,7 +44,7 @@ context('Mention username in comment', () => {
     const username = 'user';
 
     cy.intercept('GET', `/_api/v3/users/usernames?q=${username}&limit=20`).as('searchUsername');
-    cy.appendTextToEditorUntilContains('@' + username);
+    cy.appendTextToEditorUntilContains('@' + username, 10000);
     cy.wait('@searchUsername');
     cy.get('.CodeMirror-hints').should('be.visible');
 

+ 2 - 2
apps/app/test/cypress/support/commands.ts

@@ -102,7 +102,7 @@ Cypress.Commands.add('collapseSidebar', (isCollapsed: boolean, waitUntilSaving =
 
 });
 
-Cypress.Commands.add('appendTextToEditorUntilContains', (inputText: string) => {
+Cypress.Commands.add('appendTextToEditorUntilContains', (inputText: string, timeout?: number) => {
   const lines: string[] = [];
   cy.waitUntil(() => {
     // do
@@ -114,5 +114,5 @@ Cypress.Commands.add('appendTextToEditorUntilContains', (inputText: string) => {
       }).then(() => {
         return lines.join('\n').endsWith(inputText);
       });
-  });
+  }, { timeout }); // default: 5000
 });

+ 1 - 1
apps/app/test/cypress/support/index.ts

@@ -40,7 +40,7 @@ declare global {
        collapseSidebar(isCollapsed: boolean, waitUntilSaving?: boolean): Chainable<void>,
        waitUntilSkeletonDisappear(): Chainable<void>,
        waitUntilSpinnerDisappear(): Chainable<void>,
-       appendTextToEditorUntilContains(inputText: string): Chainable<void>
+       appendTextToEditorUntilContains(inputText: string, timeout?: number): Chainable<void>
     }
   }
 }