-
Notifications
You must be signed in to change notification settings - Fork 90
Description
This is a feature request to slightly improve ergonomic of the Page Object Components definition.
Currently the shortest form of a component definition would look something like:
{
someField: {
scope: 'some-field-selector'
}
}
When I define few components on a page object it gets a bit noisy because we need to define an object with a scope
option to create a component. For me the most used building blocks of the Page Object are Components. I think it's great to have a shorthand syntax for component definitions like we do have for collections, e.g collection('items-selector')
.
I propose to consider all the string values of a page object definition as a component selectors, so the minimal syntax to define a page object would look something like:
create({
header: 'header',
body: 'article',
header: 'footer',
signOut: '[data-test-logout]',
breadcrumbs: collection('[date-test-breadcrumb]')
});
This change might break some existing page objects but honestly I can't imagine a use case for the need to store string values in the page object definition 🤔 Probably the feature (if)should be included in v2.
Would appreciate any thoughts.