Skip to content

Extend capability of Element #437

Description

@MichalBryxi

I tried to define custom element that inherits faltest Element:

const { Element: _Element } = require('@faltest/page-objects');

class Element extends _Element {
  async foo() {
    await super.click();
    await ...;
  }
}

And then I tried to use it in my code:

...
  button: create(
    '[data-test-my-button]',
  ),
...
  click: async() => {
    await pageObject.button.foo();
  }
...

But this ends with:

TypeError: pageObject.button.foo is not a function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions