Skip to content

Commit

Permalink
refactor: after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Shelest committed Oct 1, 2024
1 parent 5d95cea commit d417914
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
Feature: true,
Before: true,
Scenario: true,
inject: true,
},
extends: 'eslint:recommended',
parserOptions: {
Expand Down
7 changes: 4 additions & 3 deletions test/scenario.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const { expect } = require('chai');
const faker = require('faker');

const { I } = inject();

Feature('PUT tests');

let userData;

Before(({ I }) => {
Before(() => {
userData = {
name: faker.name.firstName(),
job: 'leader'
Expand All @@ -15,13 +16,13 @@ Before(({ I }) => {
I.sendPostRequest('/api/users', userData);
});

Scenario('Verify creating new user @C1', async ({ I }) => {
Scenario('Verify creating new user @C1', async () => {
userData.name = faker.name.firstName();
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 ({ I }) => {
Scenario('Verify creating new user @C2', async () => {
userData.name = faker.name.firstName();
const res = await I.sendPutRequest('/api/users', userData);
expect(res.data.name).to.eql('abc');
Expand Down

0 comments on commit d417914

Please sign in to comment.