-
Notifications
You must be signed in to change notification settings - Fork 90
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
content with display: none is still captured (does not match innerText) #514
Comments
This is how I am getting around this currently. const page = create({
example: getter(function() {
let [element] = findOne(this, '#example');
return element.innerText.trim();
})
}); |
And just in case someone wonders why this is an issue here is an example use case: With this CSS.auto-hiding-delimeter:first-child,
.auto-hiding-delimeter:last-child,
.auto-hiding-delimeter + .auto-hiding-delimeter {
display: none;
} You can do things like these{{#each @things as |thing|}}
{{#if thing}}<span class="thing">{{thing}}</span>{{/if}}
<span class="auto-hiding-delimiter">[seperator]</span>
{{/each}} {{#if this.boolFlagOne}}<span>1</span>{{/if}}
<span class="auto-hiding-delimiter">|</span>
{{#if this.boolFlagTwo}}<span>2</span>{{/if}}
<span class="auto-hiding-delimiter">|</span>
{{#if this.boolFlagThree}}<span>3</span>{{/if}}
<span class="auto-hiding-delimiter">|</span>
{{#if this.boolFlagFour}}<span>4</span>{{/if}}
<span class="auto-hiding-delimiter">|</span>
{{#if this.boolFlagFive}}<span>5</span>{{/if}} |
Thanks for reporting! This is surprising to me. I didn't know that jquery uses I think replacing our current usage of the A side note: due to an intention to enable node.js support, we'd probably need to distinct between |
oh.. I've just faced the issue when upgraded ec-page-object in a lib from 1.16 to 1.17. This seems to be a regression introduced in #466 I believe we should revert |
So I ran into this today as well :) Any plans to revert this breaking change? |
@Alonski would be glad to accept a PR |
What would you recommend the fix to be? |
The change done in this PR: san650#466 caused a regression. $.text() can find the text in `visibility: hidden` or `display: none` elements. element.innerText does not return the text. Fixes: san650#514
Opened a PR :) |
@Alonski sorry for the late reply. Yes, I believe, basically, we just need to drop A thing I'm worried about at this point, is that a fix may appear a breaking change for users who was to update their test suites according to this |
Thanks @ro0gr Thanks! |
so seems I've confused 2 different issues here. At some point I've faced a regression with the I think this may be a good feature to think about in general, but I'm reluctant to break the existing |
The
PageObject.text
helper returns hidden text. While — by comparison —innerText
does not.Given
Expected
Actual
The text was updated successfully, but these errors were encountered: