Skip to content

Tests failed on receive a response -The "url" argument must be of type string. Received undefined #131

Answered by ASaiAnudeep
martynaol asked this question in Q&A
Discussion options

You must be logged in to vote

The method spec will create an instance through which we can make a single request. Please refer this for more usage details.

const spec_one = spec();
const spec_two = spec();

The method toss will execute the spec and returns a promise. Please refer this for more usage details.

await spec().get('/api/users').expectStatus(200).toss();
await spec().get('/api/projects/p1').expectStatus(404).toss();

In your step definitions file, you have created an empty spec and running without defining any request details.

When('I receive a response', async () => {
  await spec().toss();  // empty spec, this will throw an error
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@martynaol
Comment options

Answer selected by martynaol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants