-
-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Description
It is not possible to verify if a set of elements has 0 elements. Having the following assertion:
elems = $$('span');
await expect(elems).toBeElementsArrayOfSize(1);
will fail all the time due to:
Failed to execute expect command "toBeElementsArrayOfSize": Error: selector needs to be typeof `string` or `function`
at Browser.findElements (file:///path/to/project/test/wdio/node_modules/webdriverio/build/utils/index.js:308:11)
at Browser.$$ (file:///path/to/project/test/wdio/node_modules/webdriverio/build/commands/browser/$$.js:46:30)
at Browser.wrapCommandFn (file:///path/to/project/test/wdio/node_modules/@wdio/utils/build/shim.js:88:38)
at async refetchElements (file:///path/to/project/test/wdio/node_modules/expect-webdriverio/lib/util/refetchElements.js:5:24)
at async waitUntil (file:///path/to/project/test/wdio/node_modules/expect-webdriverio/lib/matchers/elements/toBeElementsArrayOfSize.js:25:20)
at async waitUntil (file:///path/to/project/test/wdio/node_modules/expect-webdriverio/lib/utils.js:23:43)
at async Object.toBeElementsArrayOfSize (file:///path/to/project/test/wdio/node_modules/expect-webdriverio/lib/matchers/elements/toBeElementsArrayOfSize.js:24:18)
at async BrowserFramework.#handleExpectation (file:///path/to/project/test/wdio/node_modules/@wdio/runner/build/browser.js:297:28)