Simplified matchers

patch-1
sandeep 2021-05-18 22:59:14 +05:30
parent 3bd6843159
commit 80676bfd6d
1 changed files with 22 additions and 24 deletions

View File

@ -11,31 +11,29 @@ requests:
- method: GET
path:
- '{{BaseURL}}'
matchers:
- type: dsl
dsl:
- contains(tolower(all_headers), 'x-magento')
part: header
- method: GET
path:
- '{{BaseURL}}/js/varien/product.js'
- '{{BaseURL}}/graphql?query=+{customerDownloadableProducts+{+items+{+date+download_url+order_increment_id+remaining_downloads+status+}}+}'
# There might be a better way to do that, the idea of this check is that Magento might be behind some kind of proxy when
# consumed by a SPA/PWA app so we need a valid GraphQL query from Magento to check
# https://devdocs.magento.com/guides/v2.4/graphql/
- '{{BaseURL}}/graphql?query=+{customerDownloadableProducts+{+items+{+date+download_url+order_increment_id+remaining_downloads+status+}}+}'
matchers-condition: and
matchers:
- type: status
status:
- 200
- type: word
words:
- "The current customer isn't authorized."
part: body
- method: GET
path:
# Based on a check done by magereport.com
- '{{BaseURL}}/js/varien/product.js'
matchers:
- type: status
status:
- 200
- type: dsl
dsl:
- 'contains(tolower(all_headers), "x-magento")'
- 'status_code == 200'
condition: and
- type: dsl
dsl:
- 'contains(body, "Magento Core Team")'
- 'status_code == 200'
condition: and
- type: dsl
dsl:
- 'contains(body, "message")'
- 'contains(body, "The current customer")'
- 'status_code == 200'
condition: and