Is there a way to run a Angular E2E test written using protractor slowly so that I can watch what is happening?
TLDR. The Angular team plans to end development of Protractor at the end of 2022 (in conjunction with Angular v15). Why? Protractor was created in 2013 when WebDriver APIs were not yet a standard and end-to-end (e2e) tests were hard to write due to lack of support for async / await .
To do this is quite simple in protractor. Adding the shardTestFiles and maxInstences to your capabilities config should allow you to (in this case) run at most two test in parrallel. Increase the maxInstences to increase the number of tests run. Note : be careful not to set the number too high.
Since Protractor is being deprecated, existing Protractor users need to migrate their tests to other frameworks.
Selenium, PhantomJS, WebdriverIO, Jasmine, and Compass are the most popular alternatives and competitors to Protractor.
Below is my solution to do that. So basically I created a decorator for current control flow execute
function, which now additionaly queues a delay of 100ms before each queued action.
This needs to be run before any tests are invoked (outside describe
block)
var origFn = browser.driver.controlFlow().execute; browser.driver.controlFlow().execute = function() { var args = arguments; // queue 100ms wait origFn.call(browser.driver.controlFlow(), function() { return protractor.promise.delayed(100); }); return origFn.apply(browser.driver.controlFlow(), args); };
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