Skip to content

Fetch posts and albums for a given user | API Assignments#8

Open
Yatharth-P wants to merge 2 commits intoznsio:mainfrom
Yatharth-P:JsonPlaceHolder-Assignments
Open

Fetch posts and albums for a given user | API Assignments#8
Yatharth-P wants to merge 2 commits intoznsio:mainfrom
Yatharth-P:JsonPlaceHolder-Assignments

Conversation

@Yatharth-P
Copy link

No description provided.

Yatharth Pandya added 2 commits December 19, 2022 09:21
- Added negative validations.
- Segregated the json data files under template folder.
@@ -0,0 +1,36 @@
@usertemplate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File name is incorrect. Please give suitable name for Template.

Feature: Template for JsonPlaceHolder api

Background:
* print "jsonPlaceHolder url " + env.jsonPlaceholderUrl

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Karate.log() instead using print.


@t_getUserPosts
Scenario: Get all the posts for a given user
# * def query = {userId:'#(user_Id)'}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented lines.


"Payload":
{
"title": "ABC_10",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use randomiser functions to generate data.


Feature: Fetch user details wrt jsonPlaceHolder api
Background:
* def jsonPostsData = read('classpath:com/znsio/templates/postsData.json')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these variable is not common throughout scenarios, initialise them in scenario level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants