Skip to content

Commit

Permalink
fix: tests data with faker
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Oct 1, 2024
1 parent 58b288b commit 6033413
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/scenario.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
const { expect } = require('chai');
const faker = require('faker');
const { faker } = require('@faker-js/faker');
let userData;
const {I} = inject();

Feature('PUT tests');

Before(() => {
userData = {
name: faker.name.firstName(),
name: faker.internet.userName(),
job: 'leader'
};

I.sendPostRequest('/api/users', userData);
});

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');

0 comments on commit 6033413

Please sign in to comment.