-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Closed
Copy link
Labels
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
latest
Node.js Version
latest
Mode
WDIO Testrunner
Which capabilities are you using?
anyWhat happened?
Given the following browser test:
let loads = $('.lifecycle-loads-a').$$('li');
await expect(loads).toBeElementsArrayOfSize(6);
await expect(loads[0]).toHaveText('componentWillLoad-a');
await expect(loads[1]).toHaveText('componentWillLoad-b');
await expect(loads[2]).toHaveText('componentWillLoad-c');
await expect(loads[3]).toHaveText('componentDidLoad-c');
await expect(loads[4]).toHaveText('componentDidLoad-b');
await expect(loads[5]).toHaveText('componentDidLoad-a');This currently can cause race conditions as it seems that $$ fails to refetch the element properly, causing the following issue:
Failed to execute expect command "toHaveText": TypeError: el.getText is not a function
What is your expected behavior?
This should work. WebdriverIO has the index information and should refetch the elements and return the value with the same index.
How to reproduce the bug.
n/a
Relevant log output
n/aCode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable