Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Group common property helpers #1

Closed
Robdel12 opened this issue Apr 15, 2018 · 3 comments
Closed

Group common property helpers #1

Robdel12 opened this issue Apr 15, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@Robdel12
Copy link
Contributor

While working with interaction page objects, I'm seeing stuff similar to this a lot:

hasField = isPresent('input[data-test-field]');
focusField = focusable('input[data-test-field]');
fillField = fillable('input[data-test-field]');
blurField = blurable('input[data-test-field]');

What if we simplified that with a single property helper?

field = input('input[data-test-field]');

That has a predetermined set of properties...

page
  .field.focus()
  .field.fill('value')
  .field.blur()

We could do something similar with other properties as well.

error = element('[data-test-error]');

...

expect(page.error.exists).to.be.true
expect(page.error.text).to.equal('some error')

And maybe even a way to compose these common properties?

field = element('[data-some-thing]').focusable().blurable().fillable()

(moved from thefrontside/bigtest#80)

@Robdel12 Robdel12 added the enhancement New feature or request label Apr 15, 2018
@wwilsman
Copy link
Contributor

wwilsman commented May 21, 2018

This can probably be closed with the addition of the scoped property creator.

The only additional interactor we might want to add could be used for including other default properties such as placeholder, type, etc, for inputs. But I can't currently think of other useful default interactors besides input.

I'll leave this open for now while we think about a default input interactor and possible others.

@Robdel12
Copy link
Contributor Author

🤔 How do we feel about this issue now that we're a few months past it?

@wwilsman
Copy link
Contributor

I was literally just looking at this minutes ago and debating on closing it. Besides forms, I can't think of other useful interactors to include out-of-box.

Looking back on the idea, I think if we do want common shareable interactors, it could maybe be another package

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants