Skip to content

wait* steps not works with arguments {name | id } #2469

Open
@Vorobeyko

Description

@Vorobeyko
Contributor

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

Activity

self-assigned this
on Jun 26, 2020
changed the title [-]wait* steps now works with arguments {name | id | }[/-] [+]wait* steps now works with arguments {name | id }[/+] on Jun 26, 2020
changed the title [-]wait* steps now works with arguments {name | id }[/-] [+]wait* steps not works with arguments {name | id }[/+] on Aug 2, 2020
swtech-11

swtech-11 commented on Jul 28, 2021

@swtech-11

A workaround is explicitly declaring your locatorObj type to 'css'. Working example:

module.exports = () => {
    codeceptjs.locator.addFilter(( providedLocator, locatorObj) => {
        if (...) {
            locatorObj.type = 'css';
            ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Vorobeyko@swtech-11

      Issue actions

        wait* steps not works with arguments {name | id } · Issue #2469 · codeceptjs/CodeceptJS