1.0.5 • Published 4 years ago

protractor-multibrowser v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Protractor Multibrowser Support

Support for multiple different browsers within a single protractor test. Used for integration tests which involve websites that don't all support the same browsers. Test a customer facing site in IE and an internal site in Chrome as one unified test.


Quick Usage Overview

Use var PMB = require("protractor-multibrowser/protractor-multibrowser.js"); to import the package feature set into a protractor test case file.

Use PMB.initAuxBrowser() to initialize a secondary browser which can be different from the starting browser.

Use PMB.runAuxBrowser() to run protractor commands on the secondary browser.


Documentation

Visit and clone the demo repository here

initAuxBrowser

ParameterDescription
urlThe starting url (provide a string in the event a baseUrl is not specified in the conf object)
confConfiguration object for the secondary browser
nonAngularSiteSet to true when the intended site is not made with Angular
windowLayoutDetermine the layout of the browsers on the screen (optional)
const auxBrowser = PMB.initAuxBrowser(
    'https://www.protractortest.org/#/', 
    auxConf, 
    true, 
    PMB.windowLayouts.MAXIMIZE
);

runAuxBrowser

ParameterDescription
auxBrowserInitialized secondary browser returned by the initAuxBrowser() function
testCaseCmdsFunction housing the test case commands, remember to use auxBrowser.element(); inside of function
timeoutInMSSet the max wait time for test case before failure (optional)
PMB.runAuxBrowser(
    auxBrowser, 
    () => {
        auxBrowser.element(by.id("drop1")).click();
    }, 
    45000
);