Reduce Speed of Angular E2E Protractor Tests

Standard

In order to customize speed for protractor tests, You may utilize below code snippets. This will help you to debug your tests, watch them closely or to speed up the test cases flow.

Step1: Create customConfig.js file in your project and below code snippet in it.

var origFn = browser.driver.controlFlow().execute;
 
browser.driver.controlFlow().execute = function () {
    var args = arguments;
    
    origFn.call(browser.driver.controlFlow(), function () {
        //increase or reduce time value, its in millisecond
        return protractor.promise.delayed(200);
    });
    
    return origFn.apply(browser.driver.controlFlow(), args);
};

2015-11-09_12-37-48

 

Step2: Register this customConfig file to conf.js

// An example configuration file. 
exports.config = {
    // The address of a running selenium server. 
    seleniumAddress: 'http://localhost:4444/wd/hub', 
    
    // Capabilities to be passed to the webdriver instance. 
    capabilities: {
        'browserName': 'chrome'
    }, 
    
    // Spec patterns are relative to the current working directly when 
    // protractor is called. 
    specs: ['customConfig.js', 'menu.js', 'homePage.js'], 
    
    // Options to be passed to Jasmine-node. 
    jasmineNodeOpts: {
        showColors: true, 
        defaultTimeoutInterval: 30000
    }
};

2015-11-09_12-39-46

Output:

2015-11-09_12-43-30

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s