@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 |
changeHeader(java.lang.String headerName,
java.lang.String headerValue)
Set new or modify an existing HTTP header
|
void |
enableHar()
EWnable HAR logging
|
void |
enableWhitelist(java.lang.Integer response)
Allow access to all urls that match the regex
|
void |
removeHeader(java.lang.String headerName)
Remove HTTP header
|
void |
saveHarFile(java.lang.String alias,
java.lang.String filename)
Saves a HAR file with the details of the transactions that have passed through BrowserMob.
|
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( alias)? \"(.*?)\")?$") public void saveHarFile(java.lang.String alias, java.lang.String filename)
alias
- If this word is found in the step, it means the filename is found from the
data set.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@When(value="^I set header \"([^\"]*)\" with value \"([^\"]*)\"$") public void changeHeader(java.lang.String headerName, java.lang.String headerValue)
headerName
- HTTP header nameheaderValue
- HTTP header value@When(value="^I remove header \"([^\"]*)\"$") public void removeHeader(java.lang.String headerName)
headerName
- HTTP header name