Skip to content

Assignment 1 and Assignment 3#5

Open
gauravsrai wants to merge 3 commits intoznsio:mainfrom
gauravsrai:main
Open

Assignment 1 and Assignment 3#5
gauravsrai wants to merge 3 commits intoznsio:mainfrom
gauravsrai:main

Conversation

@gauravsrai
Copy link

  1. Implementation done for Api test on Fetch posts and comments for user id 1
  2. Implementation done for work flow test on creating and editing the same post
  3. Here I used json file to pass the details to edit the post

1.Changes are made in assignment 1 and 3
1. Separated JSON file based on Api request
2. Changes done based on the PR comments

@jsonPlaceHolder
Scenario: Fetch all the posts
* def userResponse = karate.call('classpath:com/znsio/templates/fetchingUserDetailsJsonPlaceHolder.feature@t_getPost', {userId:userid}).listOfPosts

Choose a reason for hiding this comment

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

userResponse name is incorrect. Its not reflecting what it contains.

Choose a reason for hiding this comment

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

??

@jsonPlaceHolder
Scenario: Fetch all the posts
* def userResponse = karate.call('classpath:com/znsio/templates/fetchingUserDetailsJsonPlaceHolder.feature@t_getPost', {userId:userid}).listOfPosts
* print userResponse

Choose a reason for hiding this comment

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

Use karate.log()

Choose a reason for hiding this comment

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

??

* match userResponse.id == '#number'
* match userResponse.name == '#string'
* match userResponse.email == '#string'
* match userResponse.body == '#string'

Choose a reason for hiding this comment

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

For both Posts and Comments API tests are missing. Try out all valid and invalid scenarios to achieve good test coverage!.

@@ -0,0 +1,50 @@
Feature: Fetching user details

Choose a reason for hiding this comment

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

Feature description is not appropriate. It should reflect overall what is there in this template feature.




#Reffference

Choose a reason for hiding this comment

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

Remove unwanted lines

* match userPosts.responseStatus == <status>
* match each userPosts.response[*] == <schema>
* match each userPosts.response[*].id == <id>
#increase test coverage (add id also in examples section)

Choose a reason for hiding this comment

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

remove commented lines.

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