Comments (4)
I didn't get what exactly you mean, sorry. Do you mean that most of the time there's enough data in ChainablePromiseEvent?
WebdriverIO is able to resolve the chain of promises, so it only matters that you have 1 await
at the beginning of the chain like await $('foo').$('bar').$('loo').click()
. In this case the bar
element is fetched once the foo
query is resolved, then the loo
element is fetched once the bar
element is resolved and the actual click is done once loo
is resolved. This has been battle tested and works pretty great even for arrays like await $('foo').$$('bar')[123].$('loo').click()
.
from webdriverio.
Thanks for raising the issue @shadowusr
It is worth to take a look at this again for v9 as it is quite confusing. The biggest drawback of the ChainablePromiseElement
is that IDEs autocomplete element chains to things like await (await $('foo')).click()
. The reason we have this separation is because we implement the ability to just do await $('foo').$('bar').click()
later on and so properties of ChainablePromiseElement
are all promises, e.g.
const elem = await $('foo')
console.log(elem.elementId) // returns a string
// while
const elem = $('foo')
console.log(elem.elementId) // returns a Promise<string>
Over time it turned out that it really doesn't matter to have WebdriverIO.Element
properties resolved when accessing it. Therefor I suggest to make ChainablePromiseElement
the new WebdriverIO.Element
.
from webdriverio.
Thanks for reporting!
We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!
from webdriverio.
Over time it turned out that it really doesn't matter to have WebdriverIO.Element properties resolved when accessing it.
I didn't get what exactly you mean, sorry. Do you mean that most of the time there's enough data in ChainablePromiseEvent?
I personally think being able to write $().$().click()
is very convenient and hope this new solution won't lead to getting rid of it. Because that'd require changing a lot of tests code.
If it's possible to replace WebdriverIO.Element
with ChainablePromiseElement
while keeping this feature, and use this single type everywhere in commands, that'd be great for sure!
from webdriverio.
Related Issues (20)
- [🐛 Bug]: reloadSession causes problem for selenium HOT 6
- Failed to download chromedriver due to 404 error HOT 20
- [🐛 Bug]: VSCode adds parentheses around methods during auto-completion HOT 3
- [🐛 Bug]: getLogs('browser') Function Not Working in Multiremote Mode HOT 1
- [🐛 Bug]: Webdriver-io cannot run in selenium standalone mode HOT 4
- [🐛 Bug]: afterTest hook is getting called with wrong test when test is timed out HOT 1
- [🐛 Bug]: Mock hoisting fails for direct imports
- [🐛 Bug]: Mock factory module parameter has an invalid type
- [💡 Feature]: add new mobile custom command to relaunch the app HOT 6
- [🐛 Bug]: 404s when downloading Chromedriver for an unsupported version of Electron HOT 8
- [🐛 Bug]: Investigate failing Stencil component tests in v9
- image comparison with certain misMatch % difference is not allowed to certify via assertion. HOT 1
- [🐛 Bug]: Setup through CLI - npx wdio config --npm-tag latest! error HOT 13
- [💡 Feature]: Find the `wdio.conf.ts` if you call `wdio` without anything else HOT 1
- Bug: Docs: The webdriverio/docs/accessibility is getting displayed in google search without proper UI formatting HOT 3
- [📖 Docs]: } added after method names in INFO panels HOT 4
- [💡 Feature]: Support for Grid Managed Downloads HOT 2
- BrowserStack build identifier is not set when `BROWSERSTACK_BUILD_NAME` environment variable is set
- [🐛 Bug]: BrowserStack build identifier is not set when BROWSERSTACK_BUILD_NAME environment variable is set HOT 5
- [💡 Feature]: Timeout for Entirety of WebDriverIO Test Runner Instance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webdriverio.