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

Using async/await inside setter when promise manager is off #4901

Open
StanislavKharchenko opened this issue Jul 24, 2018 · 1 comment
Open

Comments

@StanislavKharchenko
Copy link

StanislavKharchenko commented Jul 24, 2018

Hi there!
As I know due to 2969 the PROMISE_MANAGER will be deprecated, and so protractor will not use it at all.

Currently, I'm using setter to fill web-elements in page-objects, like:

set Information(value) {
    this.information.sendKeys(value);
}

And use it inside test case:

it('Filling Information', () => {
    mainPage.Information = "Advanced info";
});

Which has a good laconic style, instead of usage of methods.

But if PROMISE_MANAGER = off I need to use async/await statements, which are not allowed within setter. So, I can't use such approach.

Does protractor has some workaround for this example?

Thank you.

Feature Request

  • To have laconic style in test cases to fill data in web-pages. Functionality worked with PROMISE_MANAGER=on
  • This is a not breaking change.
@kylecordes
Copy link

I'm now using Protractor solely in the new async await style. My suggestion for the above is to not do the thing with the set. It seems quite un-idiomatic to me, that calling set causes a side effect on a remote system. I suggest naming the method in a way that suggests what it is doing.

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

No branches or pull requests

2 participants