javascript - Run protractor tests with different window sizes? -
i want start 4 different chrome windows run same tests on 4 resolutions. –
i know protractor has feature called multicapabilities, , know can set window size this: browser.manage().window().setsize(320, 480);
but don't find way combine these 2. or there easier way create behaviour
a simple solution comes in mind create for
loop in test file switch
make tests running 4 times different resolution.
at beginning of specs:
describe('myapp', function () { (var = 0; < 4; i++) { switch (i) { case 0: //set resolution 1 browser.manage().window().setsize(320, 480); break; case 1: //set resolution 2 browser.manage().window().setsize(600, 800); break; case 2: //set resolution 3 browser.manage().window().setsize(768, 1024); break; case 3: //set resolution 4 browser.manage().window().setsize(1080, 1920); break; default: return; } } // beforeeach() {...}; // it('should something', function(){...}; });
Comments
Post a Comment