With GraphQL, what you queried is what you get, nothing more and nothing less. It is easy to use as it has a JSON like syntax and also provides lots of performance benefits.
Here's a query for the Star Wars API: https://swapi.apis.guru/graphiql
query{
allFilms
{
films {
id
title
episodeID
}
}
}
This query returns the id, title, and episodeID of the 6 original Star Wars movies. Now consider that there are 2 vendors that are consuming this API and one of them wants id, title, and episodeID and the other one wants the only id, and title but NOT the episodeID. Now without GraphQL, we would have created 2 versions of this API i.e. the first one with the id, title, and episodeID in the response and the second version giving a response with id and title only. Isn't it a headache to maintain so many versions if you have different requests from various vendors that are consuming your APIs?
That's where a GraphQL is a real lifesaver.
Please check graphQLComplete method shown in the below image where we are getting all 3 data points i.e. id, title, and episodeID requested by the 1st vendor and graphQLPartial method which returns the id, and title as requested by the 2nd vendor.
restAssured api apitesting automation graphQL
What is an ARIA Snapshot in Playwright? An ARIA snapshot in Playwright is a structured representation of a page’s accessibility tree , which is used by assistive technologies (e.g., screen readers) to interpret the content of a web page. This snapshot helps verify if elements have the correct roles, names, and properties required for accessibility. Playwright provides the page.accessibility.snapshot() API to capture this accessibility tree at any given moment during test execution. How Does ARIA Work? ARIA ( Accessible Rich Internet Applications ) is a set of attributes that help improve accessibility by defining roles, states, and properties for elements that are not natively accessible. Example: In this case, the aria-label ensures that screen readers identify the button as “Submit Form.” How to Use ARIA Snapshots in Playwright? Playwright’s accessibility.snapshot() method retrieves the accessible structure of the page. Ex...

Comments
Post a Comment