Skip to content

Instantly share code, notes, and snippets.

@tzachz
Created January 30, 2024 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzachz/72e1bfd55ede850be28f3b09a8709caf to your computer and use it in GitHub Desktop.
Save tzachz/72e1bfd55ede850be28f3b09a8709caf to your computer and use it in GitHub Desktop.
Source Config Behave test example
Feature: test source amazon_brazil_v2
@release
Scenario: release test
When I apply source amazon_br_v2.json to cached htmls amazon_br_v2.response.json for the following queries
| queries |
| B079FX76R9 |
Then I expect response to match the scraped items in amazon_br_v2.response.json
@nightly
Scenario: nightly test
When I apply source amazon_br_v2.json without cached html pages for the following queries
| queries |
| B079FX76R9 |
Then I expect response to match at least the following number of items per query
| query | num_items |
| B079FX76R9 | 1 |
And I expect all items in response to contain the following fields
| fields |
| ASIN |
| Buybox Winner |
| Brand |
| Link |
| Rating |
| Image URL |
| Best Sellers Category Rank |
And I expect the following fields to be numeric
| fields |
| Rating |
| Best Sellers Category Rank |
And I expect the following fields are not null
| fields |
| ASIN |
And I validate the following fields to contain valid URLs
| fields |
| Link |
| Image URL |
And I expect response to match the following ranges of values
| query | field | min_value | max_value |
| B079FX76R9 | Rating | 0.0 | 5.0 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment