From 6033413f822a10c26aaa9f0909e4e648d09b07f0 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:07:09 +0000 Subject: [PATCH] fix: tests data with faker --- test/scenario.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/scenario.js b/test/scenario.js index 381dc83..a62a0d2 100644 --- a/test/scenario.js +++ b/test/scenario.js @@ -1,5 +1,5 @@ const { expect } = require('chai'); -const faker = require('faker'); +const { faker } = require('@faker-js/faker'); let userData; const {I} = inject(); @@ -7,7 +7,7 @@ Feature('PUT tests'); Before(() => { userData = { - name: faker.name.firstName(), + name: faker.internet.userName(), job: 'leader' }; @@ -15,13 +15,13 @@ Before(() => { }); Scenario('Verify creating new user @C1', async () => { - userData.name = faker.name.firstName(); + userData.name = faker.internet.userName(); const res = await I.sendPutRequest('/api/users', userData); expect(res.data.name).to.eql(userData.name); }).tag('@pass'); Scenario('Verify creating new user @C2', async () => { - userData.name = faker.name.firstName(); + userData.name = faker.internet.userName(); const res = await I.sendPutRequest('/api/users', userData); expect(res.data.name).to.eql('abc'); }).tag('@fail');