jest-puppeteer
jest-puppeteer copied to clipboard
expect-puppeteer .toMatch() fails when JavaScript is disabled
trafficstars
🐛 Bug Report
When page.setJavaScriptEnabled(false) has been called, expect(page).toMatch(..) fails.
Contrasting this with Puppeteer's own API, page.content() returns the serialized DOM string even when JavaScript is disabled.
To Reproduce
test('repro', () => {
page.setJavaScriptEnabled(false);
page.goto('https://example.com');
expect(page).toMatch('Example');
});
Expected behavior
The above should pass, but it fails since the function passed to puppeteer's evaluate() is never executed.
Environment Info
(affects all versions/envs)
System:
- OS: macOS 10.14.5
- Shell: 3.2.57 - /bin/bash
Binaries:
- Node: 10.15.0 - /usr/local/bin/node
- npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
- jest-puppeteer: ^4.2.0 => 4.2.0
Hello @developit, I am thinking about moving to @testing-library instead of maintaining expect-puppeteer. What do you think?
Please upgrade to v8 and reopen submit a new issue if you experience this problem.