Web Application & REST API Integration Plugin
The plugin provides the integration between web application testing functionality and REST API features.
Installation
-
Copy the below line to
dependencies
section of the projectbuild.gradle
fileExample 1. build.gradleimplementation(group: 'org.vividus', name: 'vividus-plugin-web-app-to-rest-api', version: '0.5.12')
-
If the project was imported to the IDE before adding new dependency, re-generate the configuration files for the used IDE and then refresh the project in the used IDE.
Table Transformers
FROM_SITEMAP
FROM_SITEMAP
transformer generates table based on the website sitemap.
Parameter | Description |
---|---|
|
relative URL of |
|
ignore sitemap parsing errors (true or false) |
|
the column name in the generated table |
Property Name | Acceptable values | Default | Description |
---|---|---|---|
|
|
|
ignore sitemap parsing errors |
|
|
|
defines whether urls that has redirect to the one that has already been included in the table are excluded from the table |
FROM_HEADLESS_CRAWLING
FROM_HEADLESS_CRAWLING
transformer generates table based on the results of headless crawling.
Parameter Name | Description |
---|---|
|
The column name in the generated table. |
Property Name | Acceptable values | Default | Description |
---|---|---|---|
General |
|||
|
Comma-separated list of values |
List of relative URLs, a seed URL is a URL that is fetched by the crawler to extract new URLs in it and follow them for crawling. |
|
|
Regular expression a |
|
The regular expression to match extensions in URLs. The crawler will ignore all URLs referring to files with extensions matching the given regular expression. URLs without extensions will always be crawled. |
|
|
|
Defines whether urls that has redirect to the one that has already been included in the table are excluded from the table. |
|
|
|
Socket timeout in milliseconds. |
|
|
|
Connection timeout in milliseconds. |
|
|
|
Max allowed size of a page in bytes. Pages larger than this size will not be fetched. |
|
|
|
Maximum connections per host. |
|
|
|
Maximum total connections. |
|
|
|
Whether to follow redirects. |
|
|
|
Maximum depth of crawling, for unlimited depth this parameter should be set to -1. |
|
|
|
Number of pages to fetch, for unlimited number of pages this parameter should be set to -1. |
|
|
|
Politeness delay in milliseconds between sending two requests to the same host. |
|
|
|
Max number of outgoing links which are processed from a page. |
|
|
|
Whether to honor links with nofollow flag. |
|
|
|
Whether to honor links with noindex flag. |
|
|
|
|
|
|
|
Cookie policy as defined per cookie specification. |
|
|
|
Whether to consider single level domains valid (e.g. http://localhost). |
|
|
|
Whether to crawl https pages. |
Proxy |
|||
|
|
|
Proxy host. |
|
|
|
Proxy port. |
|
|
|
Username to authenticate with proxy. |
|
|
|
Password to authenticate with proxy. |
Steps
Validate resources
Validates resources on web pages
Resource validation logic:
-
If the
pages
row contains relative URL then it gets resolved against URL inweb-application.main-page-url
property, i.e. if the main page URL ishttps://elderscrolls.bethesda.net/
and relative URL is/skyrim10
the resulting URL will behttps://elderscrolls.bethesda.net/skyrim10
-
Collect elements by the CSS selector from each page
-
Get either
href
orsrc
attribute value from each element, if neither of the attributes exists the validation fails -
For each received value execute HEAD request
-
If the status code is 200 OK then the resource validation is considered as passed
-
If the status code is one of 404 Not Found, 405 Method Not Allowed, 501 Not Implemented, 503 Service Unavailable then GET request will be executed
-
If the GET status code is 200 OK then the resource validation is considered as passed, otherwise failed
-
Then all resources by selector `$cssSelector` are valid on:$pages
-
$cssSelector
- The CSS selector -
$pages
- The pages to validate resources on
Then all resources by selector `a` are valid on:
|pages |
|https://vividus.org/ |
|/test-automation-made-awesome|