expect-webdriverio 4.15.0 → 4.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,20 +2,21 @@ import { DEFAULT_OPTIONS } from '../../constants.js';
2
2
  import { compareText, compareTextWithArray, enhanceError, executeCommand, waitUntil, wrapExpectedWithArray } from '../../utils.js';
3
3
  async function condition(el, text, options) {
4
4
  const actualTextArray = [];
5
- let actualText, checkAllValuesMatchCondition;
5
+ const resultArray = [];
6
+ let checkAllValuesMatchCondition;
6
7
  if (Array.isArray(el)) {
7
- const checkPromises = el.map(async (value) => {
8
- actualText = await value.getText();
8
+ for (const element of el) {
9
+ const actualText = await element.getText();
9
10
  actualTextArray.push(actualText);
10
- return Array.isArray(text)
11
+ const result = Array.isArray(text)
11
12
  ? compareTextWithArray(actualText, text, options).result
12
13
  : compareText(actualText, text, options).result;
13
- });
14
- const results = await Promise.all(checkPromises);
15
- checkAllValuesMatchCondition = results.every(result => result);
14
+ resultArray.push(result);
15
+ }
16
+ checkAllValuesMatchCondition = resultArray.every(result => result);
16
17
  }
17
18
  else {
18
- actualText = await el.getText();
19
+ const actualText = await el.getText();
19
20
  actualTextArray.push(actualText);
20
21
  checkAllValuesMatchCondition = Array.isArray(text)
21
22
  ? compareTextWithArray(actualText, text, options).result
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expect-webdriverio",
3
- "version": "4.15.0",
3
+ "version": "4.15.1",
4
4
  "author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
5
5
  "description": "WebdriverIO Assertion Library",
6
6
  "license": "MIT",