fix(cdk/testing): protractor element not extracting hidden text #21540
Conversation
We use Protractor's `getText` method to extract text, but the problem is that it's likely based on `HTMLElement.innerText` which excludes text from hidden elements. These changes switch to using `textContent` to bring the behavior in-line with the `UnitTestElement`.
LGTM
|
Caretaker note: this has a chance of breaking some e2e tests, but I suspect it to be somewhat unlikely |
|
There were only a few failures as a result of this, but investigating one of them uncovered something that I guess is more of a problem with the stepper. The stepper leaves steps that are not visible in the DOM. There is a project using |
|
I suppose to correct way to handle it would be to use a selector. They would've had this issue if they were running the test using |
|
Isn't a selector just going to have the same problem? I didn't really see any classes that identify the currently visible step to select on |
|
Doesn't look like we have any classes that would identify it so the stepper harness uses |
|
Ok that seems reasonable, or better yet maybe I can just change their test to use the stepper harness |
We use Protractor's `getText` method to extract text, but the problem is that it's likely based on `HTMLElement.innerText` which excludes text from hidden elements. These changes switch to using `textContent` to bring the behavior in-line with the `UnitTestElement`. (cherry picked from commit 26366e7)
In angular#21540 we added support for extracting text from hidden elements in Protractor, but before the PR could be merged, we introduced the WebDriver environment which didn't include the fix and is failing the e2e tests. These changes port over the fix.
In #21540 we added support for extracting text from hidden elements in Protractor, but before the PR could be merged, we introduced the WebDriver environment which didn't include the fix and is failing the e2e tests. These changes port over the fix.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
We use Protractor's
getTextmethod to extract text, but the problem is that it's likely based onHTMLElement.innerTextwhich excludes text from hidden elements.These changes switch to using
textContentto bring the behavior in-line with theUnitTestElement.The text was updated successfully, but these errors were encountered: