Yuki Takei 2 лет назад
Родитель
Сommit
8ac8180175

+ 10 - 10
apps/app/test/cypress/e2e/20-basic-features/20-basic-features--access-to-page.cy.ts

@@ -81,8 +81,9 @@ context('Access to page', () => {
     cy.screenshot(`${ssPrefix}-Sandbox-edit-page`);
     cy.screenshot(`${ssPrefix}-Sandbox-edit-page`);
   })
   })
 
 
+  const body1 = 'hello';
+  const body2 = ' world!';
   it('View and Edit contents are successfully loaded', () => {
   it('View and Edit contents are successfully loaded', () => {
-    const body1 = 'hello';
     cy.visit('/Sandbox/testForUseEditingMarkdown');
     cy.visit('/Sandbox/testForUseEditingMarkdown');
 
 
     openEditor();
     openEditor();
@@ -98,22 +99,21 @@ context('Access to page', () => {
   })
   })
 
 
   it('Editing contents are successfully loaded with shortcut key', () => {
   it('Editing contents are successfully loaded with shortcut key', () => {
-    const body2 = ' world!';
     const savePageShortcutKey = '{ctrl+s}';
     const savePageShortcutKey = '{ctrl+s}';
 
 
     cy.visit('/Sandbox/testForUseEditingMarkdown');
     cy.visit('/Sandbox/testForUseEditingMarkdown');
 
 
     openEditor();
     openEditor();
 
 
+    cy.get('.CodeMirror').contains(body1);
+
     // check editing contents with shortcut key
     // check editing contents with shortcut key
-    cy.get('.CodeMirror-line').children().first().invoke('text').then((text) => {
-      cy.get('.CodeMirror').type(body2);
-      cy.get('.CodeMirror').contains(text+body2);
-      cy.get('.page-editor-preview-body').contains(text+body2);
-      cy.get('.CodeMirror').type(savePageShortcutKey);
-      cy.get('.CodeMirror').contains(text+body2);
-      cy.get('.page-editor-preview-body').contains(text+body2);
-    })
+    cy.get('.CodeMirror').type(body2);
+    cy.get('.CodeMirror').contains(body1+body2);
+    cy.get('.page-editor-preview-body').contains(body1+body2);
+    cy.get('.CodeMirror').type(savePageShortcutKey);
+    cy.get('.CodeMirror').contains(body1+body2);
+    cy.get('.page-editor-preview-body').contains(body1+body2);
   })
   })
 
 
   it('/user/admin is successfully loaded', () => {
   it('/user/admin is successfully loaded', () => {

+ 1 - 0
apps/app/test/cypress/e2e/20-basic-features/20-basic-features--sticky-features.cy.ts

@@ -116,6 +116,7 @@ context('Access to any page', () => {
       return cy.get('.layout-root').then($elem => $elem.hasClass('editing'));
       return cy.get('.layout-root').then($elem => $elem.hasClass('editing'));
     });
     });
     cy.get('.grw-editor-navbar-bottom').should('be.visible');
     cy.get('.grw-editor-navbar-bottom').should('be.visible');
+    cy.get('.CodeMirror').should('be.visible');
     cy.screenshot(`${ssPrefix}open-editor-when-sticky`);
     cy.screenshot(`${ssPrefix}open-editor-when-sticky`);
   });
   });