From d417914738d7934e9cb8b99d9b8986e4630d5532 Mon Sep 17 00:00:00 2001 From: Denis Shelest Date: Tue, 1 Oct 2024 08:49:43 -0400 Subject: [PATCH] refactor: after code review --- .eslintrc.js | 1 + test/scenario.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index ad58458..1123dac 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,6 +9,7 @@ module.exports = { Feature: true, Before: true, Scenario: true, + inject: true, }, extends: 'eslint:recommended', parserOptions: { diff --git a/test/scenario.js b/test/scenario.js index e0ee179..746ffe6 100644 --- a/test/scenario.js +++ b/test/scenario.js @@ -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' @@ -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');