Skip to content

API implementation for fetching posts ,comments and albums#15

Open
DarshanS4444 wants to merge 1 commit intoznsio:mainfrom
DarshanS4444:getPostsOfUser
Open

API implementation for fetching posts ,comments and albums#15
DarshanS4444 wants to merge 1 commit intoznsio:mainfrom
DarshanS4444:getPostsOfUser

Conversation

@DarshanS4444
Copy link

No description provided.

Scenario: Get albums of user
Given def userId = 1
And def checkUserIdInAlbums = karate.call('classpath:com/znsio/templates/albumsTemplates.feature@getAlbumsOfUser', {'userId' : userId}).checkUserIdInAlbums
Then assert checkUserIdInAlbums == true

Choose a reason for hiding this comment

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

Not a correct validation, here true meaning of templates is broken.

@@ -0,0 +1,13 @@
@prod @posts

Choose a reason for hiding this comment

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

Why you have taken separate feature files?


Scenario: Get posts of user
Given def userId = 1
And def checkUserIdInPosts = karate.call('classpath:com/znsio/templates/postsTemplates.feature@getPostsOfUser', {'userId' : userId}).checkUserIdInPosts

Choose a reason for hiding this comment

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

checkUserIdInPosts incorrect name of the variable. It doesn't represent what it contains.

function(responseArray){
for (let i = 0; i < responseArray.length; i++){
if(responseArray[i].userId != userId) return false
else return true

Choose a reason for hiding this comment

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

This function is not required here, try to think of any other way .

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.

3 participants