{
\"transactionId\": 001
\"documentNumber\": \"1234\",
\"purchaseDate\": \"2012-05-01T00:00:00\",
\"uploadedBy\": \"Kane, Lucy\"
},
{
\"transactionId\": 002,
\"userId\": \"f4b012345678\",
\"documentNumber\": \"105343998358653377\",
\"customerReference\": \"32145\",
\"purchaseDate\": \"2004-12-01T00:00:00\",
\"uploadedBy\": \"Mac, Mike\"
},
{
\"transactionId\": 003,
\"userId\": \"f4b0d0c3\",
\"documentNumber\": \"1085593563205677\",
\"purchaseDate\": \"2006-09-21T00:00:00\",
\"uploadedBy\": \"Kelly, Anne\"
},
Hi
After calling a API used for sorting, please see further below the typical JSON Response I need to perform assertions on.
Please note the results for transactionId are being returned in ascending order so I need to perform an assertion on this. I will need to carry out other assertions on new API calls for results being returned in descending order etc.
JSON Response
\"results\": [
{
\"transactionId\": 001
\"documentNumber\": \"1234\",
\"purchaseDate\": \"2012-05-01T00:00:00\",
\"uploadedBy\": \"Kane, Lucy\"
},
{
\"transactionId\": 002,
\"userId\": \"f4b012345678\",
\"documentNumber\": \"105343998358653377\",
\"customerReference\": \"32145\",
\"purchaseDate\": \"2004-12-01T00:00:00\",
\"uploadedBy\": \"Mac, Mike\"
},
{
\"transactionId\": 003,
\"userId\": \"f4b0d0c3\",
\"documentNumber\": \"1085593563205677\",
\"purchaseDate\": \"2006-09-21T00:00:00\",
\"uploadedBy\": \"Kelly, Anne\"
},
It is an integer. For other API calls I will also need to need to assert on strings (whether they are being returned in ascending/descending order). In other words, I need a solution for both. Thanks.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"213","kudosSumWeight":0,"postTime":"2017-06-30T08:02:36.287-07:00","lastPublishTime":"2017-06-30T08:02:36.287-07:00","metrics":{"__typename":"MessageMetrics","views":3627},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:145181/message:145204","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":true,"endCursor":"MjUuM3wyLjF8b3wxfDE0OjAsMzk6MXwx","hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuM3wyLjF8b3wxfDE0OjAsMzk6MXwx","node":{"__ref":"ForumReplyMessage:message:145208"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:145208":{"__typename":"ModerationData","id":"moderation_data:145208","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:145208":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:21201"},"id":"message:145208","revisionNum":1,"uid":145208,"depth":5,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"ForumReplyMessage:message:145204"},"conversation":{"__ref":"Conversation:conversation:145181"},"subject":"Re: Assertions to verify items are being returned in alphabetical order/ascending/descending order etc","moderationData":{"__ref":"ModerationData:moderation_data:145208"},"body":"Ok, thank you for clarifying. What is the other field / property name?","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"70","kudosSumWeight":0,"repliesCount":8,"postTime":"2017-06-30T08:09:06.027-07:00","lastPublishTime":"2017-06-30T08:09:06.027-07:00","metrics":{"__typename":"MessageMetrics","views":3622},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:145181/message:145208","customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"ModerationData:moderation_data:145207":{"__typename":"ModerationData","id":"moderation_data:145207","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:145207":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:75120"},"id":"message:145207","revisionNum":1,"uid":145207,"depth":4,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"ForumReplyMessage:message:145200"},"conversation":{"__ref":"Conversation:conversation:145181"},"subject":"Re: Assertions to verify items are being returned in alphabetical order/ascending/descending order etc","moderationData":{"__ref":"ModerationData:moderation_data:145207"},"body":"The response for TransactionId should not include leading zeros (I used dummy data), apologies this is an Integer field. Apologies for the confusion.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"151","kudosSumWeight":0,"repliesCount":0,"postTime":"2017-06-30T08:07:43.667-07:00","lastPublishTime":"2017-06-30T08:07:43.667-07:00","metrics":{"__typename":"MessageMetrics","views":3617},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:145181/message:145207","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"readyapi-questions","messageSubject":"assertions-to-verify-items-are-being-returned-in-alphabetical-orderascendingdesc","messageId":"145181","replyId":"145197"},"buildId":"-gVUpXaWnPcjlrLJZ92B7","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"smartbear","openTelemetryServiceVersion":"25.3.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":false,"inboxMuteWipFeatureEnabled":false},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["./components/seo/QAPageSchema/QAPageSchema.tsx","./components/community/Navbar/NavbarWidget.tsx","./components/community/Breadcrumb/BreadcrumbWidget.tsx","./components/messages/TopicWithThreadedReplyListWidget/TopicWithThreadedReplyListWidget.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","./components/messages/MessageListForNodeByRecentActivityWidget/MessageListForNodeByRecentActivityWidget.tsx","./components/messages/RelatedContentWidget/RelatedContentWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx","./components/messages/MessageView/MessageViewInline/MessageViewInline.tsx","../shared/client/components/common/Pager/PagerLoadMore/PagerLoadMore.tsx","./components/customComponent/CustomComponentContent/TemplateContent.tsx"],"appGip":true,"scriptLoader":[]}