-
Notifications
You must be signed in to change notification settings - Fork 674
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
Test fails while selecting every element ('*'), filtering by text and svg tag is a child #3684
Comments
Hello. I've reproduced this issue under Windows 10 / Chrome 73 / [email protected]. For team: <html>
<head>
</head>
<body>
<div>
<span>
<svg></svg>
</span>
<span>foo</span>
</div>
</body>
</html> test.js import { Selector } from 'testcafe';
fixture `My Fixture`
.page `./index.html`;
test('test', async (t) => {
const selector = Selector('*').addCustomDOMProperties({
outerHTML: el => el.outerHTML
});
const body = Selector('body').addCustomDOMProperties({
outerHTML: el => el.outerHTML
});
const span = Selector('span').addCustomDOMProperties({
outerHTML: el => el.outerHTML
});
const div = Selector('div').addCustomDOMProperties({
outerHTML: el => el.outerHTML
});
console.log('body.count:', await body.count);
console.log('div.count:', await div.count);
console.log('span.count:', await span.count);
await t
.expect(body.withExactText('foo').count).eql(0)
.expect(div.withExactText('foo').count).eql(1)
.expect(span.withExactText('foo').count).eql(1);
console.log('selector.count:', await selector.count);
for (let i = 0; i < 7; i++) {
console.log(i + ':', await selector.nth(i).outerHTML);
}
await t
.expect(selector.withExactText('foo').count).eql(1);
}); result log
|
Hello, I got the same problem, in this case I'm searching inside a Thanks |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
What is your Test Scenario?
I would like to select a node with
foo
text without providing a tag namehtml body:
What is the Current behavior?
When you want to filter only an element with a specific text and there is an svg tag for instance like in the example above you get
Cannot read property 'trim' of undefined
errorWhat is the Expected behavior?
Span wit
foo
text should be foundWhat is your web application and your TestCafe test code?
Your complete test report:
Steps to Reproduce:
Just run the above test with provided html body
Your Environment details:
1.1.2
v11.10.1
testcafe chrome test.js -L
Chrome 73.0.3683 / Mac OS X 10.14.4
macOS Mojave 10.14.4
The text was updated successfully, but these errors were encountered: