CodeceptJS
CodeceptJS copied to clipboard
wait* steps not works with arguments {name | id }
I try to call:
I.waitForVisible({ name: 'field_name' })
but locator contains:
Locator {
type: 'name',
output: null,
strict: true,
locator: { name: 'field_name' },
value: 'field_name'
}
And the waitForVisible
step checks if this locator isCss
will make locator.simplify
, else waitByXpath, but name
is not css, and CodeceptJS tries to search element by following xpath: 'field_name'
, but it is invalid xpath
A workaround is explicitly declaring your locatorObj type to 'css'. Working example:
module.exports = () => {
codeceptjs.locator.addFilter(( providedLocator, locatorObj) => {
if (...) {
locatorObj.type = 'css';
...