For example, I would like to test a chat feature between two logged in users implemented using AngularJS.
The test needs to verify two or more separate sets of browser actions occur in the proper sequence. For example, user A logs in, user B logs in, user A sees B is logged in, user A sends user B chat text, user B receives chat text. user B responds to user A.
Is this something that can be done using protractor? If not, is there another way to automatically test multiple browser session workflows?
If you would like to test against multiple browsers, use the multiCapabilities configuration option. Protractor will run tests in parallel against each set of capabilities. Please note that if multiCapabilities is defined, the runner will ignore the capabilities configuration.
Protractor supports the two latest major versions of Chrome, Firefox, Safari, and IE. These are used in Protractor's own suite of tests.
Launching a browser locally Depending on the configuration file, protractor runner loads one of the driver providers. For a locally hosted selenium server, the driver provider will then use the selenium-webdriver node module (client) to create new session of the browser.
In order to run protractor tests on multiple browsers, Protractor offers multiCapabilities configuration option. These options should be defined as an array of objects. As we know we can run protractor specs on different browsers by setting the browser name property of the capabilities in the conf.js file.
Protractor make use of Selenium Grid to initialize, control and run browser instance. Can easily integrate with jasmine, mocha and cucumber framework to write your test. Excellent speed compare with other tools or libraries. Support cross browser parallel testing through multiple browsers.
What Is Protractor? Protractor is a JavaScript framework, end-to-end test automation framework for Angular and AngularJS application. It test against your application in real browser, like a real user would. Protractor is built on top of WebDriver JS (Selenium) and apart from default locator, it comes up with Angular-specific locator strategies.
Tests that pass don’t need to be strictly monitored since an increase in run time could slow down operations if a large number of tests have to be executed. As always, it is important to run the Protractor Selenium tests on real browsers and devices.
UPDATE This feature has finally being added see example usage and docs and tests here or see below:
browser.get('http://www.angularjs.org');
// To create a new browser with url as 'http://www.angularjs.org':
var browser2 = browser.forkNewDriverInstance(true);
// Interaction in the first browser
element(by.model(...)).click();
// Interaction in the second browser
browser2.$('.css').click();
Note that IE and Safari won't isolate cookies or cache so don't expect to be able to login with different users at the same time there unless your selenium provider is a grid that always uses a clean session like SauceLabs or BrowserStack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With