Steps to manage proxy.
These methods are mixed with glacejs Steps class and available via its instance $ in tests.
- Source:
Properties:
| Name | Type | Description | 
|---|---|---|
| webUrl | string | Web application URL. | 
| globalProxy | GlobalProxy | Global proxy instance. | 
| httpProxy | HttpProxy | HTTP proxy instance. | 
Methods
- 
    disableCache()
- 
    
    Step to disable cache. Returns:trueif step is passed.- Type
- boolean
 Example$.disableCache(); 
- 
    enableCache()
- 
    
    Step to enable cache. Returns:trueif step is passed.- Type
- boolean
 Example$.enableCache(); 
- 
    getProxyUrl( [opts])
- 
    
    Step to get proxy URL. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that proxy URL is defined. Throws:- 
        If proxy URL isn't defined. 
- Type
- AssertionError
 Returns:Proxy URL. - Type
- string
 Examplevar proxiedUrl = $.getProxiedUrl(); 
- 
        
- 
    getResponsesData( [opts])
- 
    
    Step to get measured responses data. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that responses data are present. Throws:- 
        If responses data are absent. 
- Type
- AssertionError
 Returns:List of captured response data. - Type
- Array.<object>
 Examplevar responses = $.getResponsesData(); 
- 
        
- 
    limitProxySpeed(speed [, opts])
- 
    
    Step to limit proxy speed. Parameters:Name Type Argument Description speednumber | object Proxy limited speed, kb/s. PropertiesName Type Argument Description reqnumber <optional> 
 <nullable>
 Requests speed, kb/s. resnumber <optional> 
 <nullable>
 Responses speed, kb/s. optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that proxy speed is limited. Throws:- 
        If proxy speed is not limited. 
- Type
- AssertionError
 Returns:trueif step was passed.- Type
- boolean
 Example$.limitProxySpeed(512); $.limitProxySpeed({ res: 512 });
- 
        
- 
    measureResponses( [opts])
- 
    
    Step to start responses measurement. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that responses measurement is launched. Throws:- 
        If responses measurement is not launched. 
- Type
- AssertionError
 Returns:trueif step is passed.- Type
- boolean
 Example$.measureResponses(); 
- 
        
- 
    registerProxy( [opts])
- 
    
    Helper to register proxy classes. Parameters:Name Type Argument Description optsobject <optional> 
 Options. PropertiesName Type Argument Description GlobalProxyobject <optional> 
 Global proxy class. HttpProxyobject <optional> 
 HTTP proxy class. Example$.registerProxy({ GlobalProxy: MyGlobalProxy, HttpProxy: MyHttpProxy });
- 
    <async> startGlobalProxy( [opts])
- 
    
    Step to start global proxy. Step recall will be skipped if global proxy wasn't stopped before. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description useCacheboolean <optional> 
 Flag to use proxy cache for responses. Default value will be requested from config.useCacheif it is specified.timeoutnumber <optional> 
 Proxy timeout to break connection. Default value will be requested from config.timeout.proxy.reconnectnumber <optional> 
 Number of proxy reconnects on failure. portnumber <optional> 
 Proxy port. Default value will be requested from config.globalProxyPort.checkboolean <optional> 
 true Flag to check that proxy was launched. Throws:- 
        If global proxy was not launched. 
- Type
- AssertionError
 Returns:trueif step was passed,falseif was skipped.- Type
- Promise.<boolean>
 Exampleawait $.startGlobalProxy(); await $.startGlobalProxy({ timeout: 30000 });
- 
        
- 
    <async> startHttpProxy( [opts])
- 
    
    Step to start HTTP proxy. Step recall will be skipped if proxy wasn't stopped before. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description webUrlstring <optional> 
 Web application url which will be proxied. Default value will be requested from config.web.urlif it is specified.useCacheboolean <optional> 
 Flag to use proxy cache for responses. Default value will be requested from config.useCacheif it is specified.timeoutnumber <optional> 
 Proxy timeout to break connection. Default value will be requested from config.timeout.proxy.reconnectnumber <optional> 
 Number of proxy reconnects on failure. portnumber <optional> 
 Proxy port. Default value will be requested from config.proxyPort.checkboolean <optional> 
 true Flag to check that proxy was launched. Throws:- 
        If proxy was not launched. 
- Type
- AssertionError
 Returns:- 
Proxied URL. - Type
- Promise.<string>
 
- 
falseif step was skipped- Type
- Promise.<boolean>
 
 Examplevar proxiedUrl = await $.startHttpProxy(); var proxiedUrl = await $.startHttpProxy({ webUrl: "http://example.com", }); var proxiedUrl = await $.startHttpProxy({ webUrl: "http://example.com", port: 8080 });
- 
        
- 
    <async> stopGlobalProxy( [opts])
- 
    
    Step to stop global proxy. Step call will be skipped if global proxy wasn't launched before. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that global proxy was stopped. Throws:- 
        If global proxy wasn't stopped. 
- Type
- AssertionError
 Returns:trueif step was passed,falseif was skipped.- Type
- Promise.<boolean>
 Exampleawait $.stopGlobalProxy(); 
- 
        
- 
    <async> stopHttpProxy( [opts])
- 
    
    Step to stop HTTP proxy. Step call will be skipped if proxy wasn't launched before. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that proxy was stopped. Throws:- 
        If proxy wasn't stopped. 
- Type
- AssertionError
 Returns:trueif step was passed,falseif was skipped.- Type
- Promise.<boolean>
 Exampleawait $.stopHttpProxy(); 
- 
        
- 
    unlimitProxySpeed( [opts])
- 
    
    Step to unlimit proxy speed. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that proxy speed is unlimited. Throws:- 
        If proxy speed is still limited. 
- Type
- AssertionError
 Returns:trueif step is passed.- Type
- boolean
 Example$.unlimitProxySpeed(); 
- 
        
- 
    unmeasureResponses( [opts])
- 
    
    Step to stop responses measurement. Parameters:Name Type Argument Description optsobject <optional> 
 Step options. PropertiesName Type Argument Default Description checkboolean <optional> 
 true Flag to check that responses measurement is stopped. Throws:- 
        If responses measurement is still running. 
- Type
- AssertionError
 Returns:trueif step is passed.- Type
- boolean
 Example$.unmeasureResponses(); 
-