Skip to content

Conversation

@sukima
Copy link

@sukima sukima commented Feb 2, 2022

One of the issues I ran into I didn't have access to the selector strings but instead the actual DOM element. This is usually the case in addons like fractal-page-object.

With this change we can seamlessly use both. Ember test-helpers function with both a string selector or a DOM Element. Here is a working example:

class Foo extends PageObject {
  form = selector('[data-test-selector=my-form]', class extends PageObject {
    calendar = selector('ember-power-calendar', class extends PageObject {
      selectDate(date) {
        return calendarSelect(this.element, date);
      }
    });
  });
}

One of the issues I ran into I didn't have access to the selector strings but instead the actual DOM element. This is usually the case in addons like [fractal-page-object](https://github.com/bendemboski/fractal-page-object).

With this change we can seamlessly use both. Ember test-helpers function with both a string selector or a DOM Element. Here is a working example:

```js
class Foo extends PageObject {
  form = selector('[data-test-selector=my-form]', class extends PageObject {
    calendar = selector('ember-power-calendar', class extends PageObject {
      selectDate(date) {
        return calendarSelect(this.element, date);
      }
    });
  });
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant