Actions doesn't work with SELENIUM_PROMISE_MANAGER
See original GitHub issueBug report
The action builder doesn’t execute/wait the action chain in the correct order if SELENIUM_PROMISE_MANAGER is set to false.
- Node Version:
10.1.0
- Protractor Version:
5.4.2
- Angular Version:
7.0.0
- Browser(s):
Chrome
- Operating System and Version
Windows 10
- Your protractor configuration file
exports.config = {
allScriptsTimeout: 50000,
specs: [
'./src/*spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: '',
framework: 'jasmine',
SELENIUM_PROMISE_MANAGER: false,
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
- A relevant example test
describe('angular homepage', function() {
it('Should navigate with action builder', async function() {
await browser.manage().window().maximize()
await browser.get('https://angular.io/docs')
await browser.actions()
.mouseMove($('button[title="The fundamentals of Angular"]'))
.click()
.mouseMove($('button[title="The basic building blocks of Angular applications."]'))
.click()
.mouseMove($('a[title="Beyond the basics."]'))
.click()
.perform();
await browser.sleep(5000);
});
});
- Output from running the test N/A
- Steps to reproduce the bug Run the test with SELENIUM_PROMISE_MANAGER = false and true and check the difference
- The URL you are running your tests against (if relevant) N/A
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
async await in Protractor is ignored - Stack Overflow
I have set protractor.promise.USE_PROMISE_MANAGER = false ; to be able to use async await . When I set the selenium promise manager to...
Read more >Selenium promise manager not working #115 - GitHub
It seem that promise manager not work. I try to set SELENIUM_PROMISE_MANAGER = true, or process.env.SELENIUM_PROMISE_MANAGER = 1, but still ...
Read more >JavaScript async/await in Selenium WebDriver Tests - Applitools
It seems that the Selenium community understands that the scam that is this synchronous/asynchronous mode should be temporary: The promise ...
Read more >What is Promise in Protractor? - Tools QA
In this article, we will discuss What is Promise in Protractor Angular Automation? All the Protractor API methods return promise objects.
Read more >WebDriver in JavaScript with Promises
WebDriverJS provides a Promise Manager that helps with the scheduling and execution of all promises automatically. Specifically, WebDriverJS has ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think mouseMove takes a WebElement and not an ElementFinder. This might have worked via the magic of the control flow.
So maybe:
This is actually probably a complicated fix. Currently we expose
actions()
from selenium-webdriver. If you wanted it to take anElementFinder
, you would have to implement the entire Actions / ActionSequence API and check if it is an ElementFinder or a WebElement and convert ElementFinders to WebElements then pass it the Actions / ActionSequence API.I think understanding that sometimes Protractor outputs and exposes the underlying library is important. I am not sure if it is currently worth fixing. I’m going to close this issue since it looks resolved.