@Component
public class ProxyStepDefinitions
extends java.lang.Object
Constructor and Description |
---|
ProxyStepDefinitions() |
Modifier and Type | Method and Description |
---|---|
void |
allowUrl(java.lang.String url)
Allow access to all urls that match the regex
|
void |
blockUrl(java.lang.String url,
java.lang.Integer response)
Block access to all urls that match the regex
|
void |
blockUrl(java.lang.String url,
java.lang.String type,
java.lang.Integer response)
Block access to all urls that match the regex
|
void |
enableHar()
EWnable HAR logging
|
void |
enableWhitelist(java.lang.Integer response)
Allow access to all urls that match the regex
|
void |
saveHarFile(java.lang.String filename)
Saves a HAR file with the details of the transactions that have passed through BorwserMob
|
void |
stripHeaders(java.lang.String url)
Apps like life express will often include AWSELB cookies from both the root "/" context and the
application "/life-express" context.
|
@When(value="^I enable HAR logging$") public void enableHar()
@When(value="^I dump the HAR file(?: to \"(.*?)\")?$") public void saveHarFile(java.lang.String filename)
filename
- The optional filename to use for the HAR file@When(value="^I block access to the URL regex \"(.*?)\" with response \"(\\d+)\"$") public void blockUrl(java.lang.String url, java.lang.Integer response)
url
- A regular expression that matches URLs to be blockedresponse
- The response code to send back when a matching URL is accessed@When(value="^I block access to the URL regex \"(.*?)\" of the type \"(.*?)\" with response \"(\\d+)\"$") public void blockUrl(java.lang.String url, java.lang.String type, java.lang.Integer response)
url
- A regular expression that matches URLs to be blockedresponse
- The response code to send back when a matching URL is accessedtype
- The http type of request to block (CONNECT, GET, PUT etc)@When(value="^I enable the whitelist with responding with \"(\\d+)\" for unmatched requests$") public void enableWhitelist(java.lang.Integer response)
response
- The response code for all whitelisted urls@When(value="^I allow access to the URL regex \"(.*?)\"$") public void allowUrl(java.lang.String url)
url
- A regular expression that matches URLs to be allowed@When(value="^I (?:remove|delete) root AWSELB cookie from the request to the URL regex \"(.*?)\"$") public void stripHeaders(java.lang.String url)
url
- The regex that matches URLs that should have duplicate AWSELB cookies removed