Skip to content

Provide a way of checking meta info of page object #483

@yratanov

Description

@yratanov

While working on assert lib for page object I faced and issue described here.

There is no way to check if property is a property or a function without calling it, for example:

create({
  clickOnMe: clickable('a'),
  href: attribute('href', a),
});

So to check if property is a function I need to call it like this:

typeof page.clickOnMe === 'function' // true
typeof page.href=== 'function' // false

The problem with this is that we actually execute getter and if it raises an error, our check will fail.

typeof page.href === 'function' // Element not found!

Do you think it's possible to store it somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions