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

chore(test): clean up no control flow typescript tests #5023

Merged
merged 1 commit into from
Nov 9, 2018

Conversation

cnishina
Copy link
Contributor

@cnishina cnishina commented Nov 9, 2018

No description provided.

Copy link
Contributor

@heathkit heathkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these tests seem like they might not make sense now, but we might as well port them over and review later.

await browser.get('index.html#/form');

const usernameInput = element(by.model('username'));
const name = element(by.binding('username'));

await expect(name.getText()).toEqual('Anon');
expect(await name.getText()).toEqual('Anon');

await((usernameInput.clear() as any) as ElementFinder).sendKeys('Jane');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wat? Can't this at least be (usernameInput.clear() as ElementFinder)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. wat is right. I might need to fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casting it just directly to ElementFinder does not work as shown above. Per the documentation, the return type is webdriver.promise.Promise.<void> so I'm not sure how this actually works. Shouldn't it return a promise for an ElementFinder? That would make more sense.

Copy link
Contributor

@heathkit heathkit Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, yeah it should be as Promise<ElementFinder>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a TODO to fix this and it is logged as an issue.

@cnishina cnishina merged commit eb5913a into angular:selenium4 Nov 9, 2018
cnishina added a commit to cnishina/protractor that referenced this pull request Dec 19, 2018
cnishina added a commit to cnishina/protractor that referenced this pull request Mar 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants