Yuki Takei 4 лет назад
Родитель
Сommit
c4009b336d

+ 0 - 5
packages/app/test/cypress/fixtures/example.json

@@ -1,5 +0,0 @@
-{
-  "name": "Using fixtures to represent data",
-  "email": "hello@cypress.io",
-  "body": "Fixtures are a great way to mock data for responses to routes"
-}

+ 6 - 0
packages/app/test/cypress/fixtures/user-admin.json

@@ -0,0 +1,6 @@
+{
+  "username": "admin",
+  "name": "Admin",
+  "email": "admin@example.com",
+  "password": "adminadmin"
+}

+ 6 - 4
packages/app/test/cypress/integration/1-install/install.spec.ts

@@ -42,10 +42,12 @@ context('Installing', () => {
   })
   })
 
 
   it('has succeeded', () => {
   it('has succeeded', () => {
-    cy.getByTestid('tiUsername').type('admin');
-    cy.getByTestid('tiName').type('Admin');
-    cy.getByTestid('tiEmail').type('admin@example.com');
-    cy.getByTestid('tiPassword').type('adminadmin');
+    cy.fixture("user-admin.json").then(user => {
+      cy.getByTestid('tiUsername').type(user.username);
+      cy.getByTestid('tiName').type(user.name);
+      cy.getByTestid('tiEmail').type(user.email);
+      cy.getByTestid('tiPassword').type(user.password);
+    });
     cy.screenshot(`${ssPrefix}-before-submit`);
     cy.screenshot(`${ssPrefix}-before-submit`);
 
 
     cy.getByTestid('btnSubmit').click();
     cy.getByTestid('btnSubmit').click();