-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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`.
8739a98
to
9187032
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
getText
method to extract text, but the problem is that it's likely based onHTMLElement.innerText
which excludes text from hidden elements.These changes switch to using
textContent
to bring the behavior in-line with theUnitTestElement
.