Question: Versions You will be using the following tools with these versions Node: 14.3.0 Cucumber. 6.0.5 Supertest: 4.0.2 Mocha: 7.1.1 Create a test suite for API

 Versions You will be using the following tools with these versions

Versions

You will be using the following tools with these versions

Node: 14.3.0

Cucumber. 6.0.5

Supertest: 4.0.2

Mocha: 7.1.1

Create a test suite for API verification of a new application. The team has provided you with an api.feature file, which has been written in Gherkin syntax using the BDD approach. Your role is to create a set of tests using the tools that have already been set up and whose specification has already been defined in the Feature file Cucumber for Gherkin and test integration, and the supertest library for testing the application's API. Test cases explained - The first test defined in the Feature file should verify whether the endpoint /users, on sending a GET request, returns in its response the expected list of users. In this case it should be a JSON file such as: [ [ "name" : "anna" , "email" : "anna@codility.com" },{ "name" : "bob", "email" : "bobecodility .com" } " - The second test should verify whether, on sending a GET request to the endpoint ew/, the response returns a welcome to the new page! message. - The next test should check whether sending a GET request to the root path endpoint / results in a redirect to the ew endpoint, status code 301 and a message Moved Permanently. Redirecting to ew. - The fourth test should confirm that sending a GET request to a onexisting endpoint returns a 404 status code in the response. - The final test should verify whether, on sending a POST request to /users with the user name and user email, the expected message is returned. For those tests, the scenario anna@codility.com, should differ from other cases. Disclaimer Your solution will be run against multiple correct and incorrect versions of the implemented application. If the tests don't pass for the correct implementation, your task will be evaluated as 0% score. Do not edit the api. feature file or your solution will fail to compile and you will receive a 0% score. Also, do not remove the included imports

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!