This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Feature Suggestion: Support multiple browser instances from single test #381
Closed
Description
Currently I am working on some socket based multi-player games using angular. In order to perform an e2e test I need to have two browsers talk to each other as the games wont start till 2 people join.
I was wondering if this could be something that is added on top of protractor.
I kinda hacked up a proof of concept to allow me to test users joining and chatting on the game.
bobthekingofegypt@8ac849a
As a concept it appears to work ok, it allows you to write tests like
var browserOne = protractors[0].browser;
var browserTwo = protractors[1].browser;
var elementTwo = protractors[1].element;
var byOne = protractors[0].by;
var byTwo = protractors[1].by;
browserOne.get('http://127.0.0.1:4999/');
browserTwo.get('http://127.0.0.1:4999/');
var joinButton = browserOne.element(byOne.css('[value="Join"]'));
joinButton.click();
element(by.model('input.name')).sendKeys('Bob');
browserOne.element(byOne.css('[value="OK"]')).click();
var playerList = element.all(by.repeater('player in players'));
expect(playerList.count()).toBe(1);
var playerListOther = elementTwo.all(byTwo.repeater('player in players'));
expect(playerListOther.count()).toBe(1);
This change breaks certain things like saucelabs support and it's not very complete but it is meant as a conversation starter.
It is quite a niche use case but is this something you would consider supporting in protractor?