Skip to content

fixed 1561 properly - #1576

Merged
DavertMik merged 2 commits into
codeceptjs:masterfrom
kobenguyent:fix/1561
Apr 13, 2019
Merged

DavertMik merged 2 commits into
codeceptjs:masterfrom
kobenguyent:fix/1561

Conversation

@kobenguyent

@kobenguyent kobenguyent commented Mar 23, 2019 •

Copy link
Copy Markdown
Collaborator

well the previous patch for seeTextEquals is not proper. This aims to make a proper fix.

I found the root cause, the problem is when codeceptjs try to get the text from the locator, it returns an array

const selected = await forEachAsync(res, async el => this.browser.getElementText(getElementId(el)));

In this case, the locator has no text it returns an empty array. However the the text you want to compare is a string. And the equals method is

const comparator = function (a, b) {
      return a === b;
    };

and by this, it returns false, even though both are empty but one is string, one is array.

@DavertMik

Copy link
Copy Markdown
Contributor

Wow, that was huge issue. Thank you!

@DavertMik
DavertMik merged commit 5370bcc into codeceptjs:master Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants