Hi,
I am using Ember 3.3 + "ember-cli-page-object": "^1.15.2".
I'm trying to add new property to be used in page object like this:
// page
export default create({
role: powerSelect('.role'),
submit: clickOnText('.btn'),
});
// powerSelect property defined like this
export function powerSelect(selector) {
return {
isDescriptor: true,
get(_) {
return function(text) {
wait().then(() => {
selectChoose(selector, text);
});
return this;
};
}
};
}
//test
module('Some module', function(hooks) {
setupApplicationTest(hooks);
test('adding priority', async assert => {
await visit('/');
await page.role('Admin');
await page.submit();
});
});
But it doesn't work properly. selectChoose does not finish, while submit is already clicked.
I looked in the code and it seems that my helper return value should be wrapped in runAsync from rfs268.js, but it is a private api....
So in genearal I have these questions:
- Why creation of new properties is not covered in the docs? Is it an unexpeted usage of the library?
- Why
runAsync for all contexts is private?
- If I suppose to be able to write custom properties with interactions, how should I do it?
Hi,
I am using Ember 3.3 +
"ember-cli-page-object": "^1.15.2".I'm trying to add new property to be used in page object like this:
But it doesn't work properly.
selectChoosedoes not finish, while submit is already clicked.I looked in the code and it seems that my helper return value should be wrapped in
runAsyncfromrfs268.js, but it is a private api....So in genearal I have these questions:
runAsyncfor all contexts is private?