Comments (8)
When I use expect-puppeteer with typescript by import expect from 'expect-puppeteer'
, the expect()
method only accepts the Page or ElementHandle type parameter, other types will report error, so how I use puppeteer-expect and native expect both:
import ppExpect from 'expect-puppeteer'
...
await ppExpect(page).toClick(...)
expect('test').toBe('test')
from jest-puppeteer.
I expected this kind of problem. I think we can find a workaround for that. Actually the problem will only occur on ElementHandle
and Page
instances.
Two workarounds before the fix:
await expect(page).toMatchElement('input') // This will wait for element to be displayed
// or
const elementHandle = await page.$('input')
expect(elementHandle === null).toBe(false)
from jest-puppeteer.
@neoziro The issue is that I need to use the elements elsewhere in the test. So far the only workaround I've found uses another bug which is that promises don't get resolved by expect-puppeteer:
await expect(Promise.resolve(elementHandle)).resolves.not.toBe(null);
But again, that's a bit of a hack
from jest-puppeteer.
OK, please be patient, I will work on this bug as soon as possible. It will be fixed before the end of week.
from jest-puppeteer.
I'm using [email protected]
and I'm getting the following exception when running a standard assertion:
expect(response.status()).toBe(200)
The exception thrown:
Error: 200 is not supported
from jest-puppeteer.
I am facing this issue while trying to compare 2 strings.
expect('test').toContainEquals('Test');
It is throwing error:
test is not supported
@neoziro Any idea on this?
from jest-puppeteer.
I think toContainEquals
doesn't exist, either in Jest or in Puppeteer Expect.
You probably want toContainEqual
and it only works with object. Nothing related with this project.
from jest-puppeteer.
@neoziro Sorry, it was a typing error, I did used
expect('test').toContainEqual('Test');
I am getting same error for below codes as well,
expect('test').toBe('Test');
expect('test').toMatch('Test');
from jest-puppeteer.
Related Issues (20)
- JSHandle@node is not supported HOT 6
- `spawnd` package should have `exit` as a dependency, not a devDependency
- Dependency Errors Using `npm i` HOT 2
- Cannot find module 'node:stream' on fresh install HOT 1
- Compiler errors importing `JestPuppeteerConfig` interface HOT 2
- Compiler errors extending `PuppeteerEnvironment`
- Compiler errors accessing `PuppeteerEnvironment` globals HOT 1
- Jest preset not working with latest jest and jest-puppeteer HOT 6
- Snapshot serializers added with `expect.addSnapshotSerializer` are not used HOT 3
- Remove Warning On New Headless Setting HOT 5
- Many browser windows open when running tests HOT 3
- [jest-dev-server] not working server.usedPortAction: 'ignore' config when running React application with react-scripts
- Invariant: WORKERS_COUNT not found HOT 4
- @types/expect-puppeteer no such type toMatchTextContent HOT 1
- Using jest-puppeteer with nx HOT 4
- How can I launch jest-puppeteer with args? HOT 1
- Regression: `injectGlobals:false` no longer supported ("Cannot convert undefined or null to object") HOT 1
- Puppeteer 21 regression: `[object Object] is not supported` HOT 4
- Is @types/jest-environment-puppeteer still required? HOT 3
- jest-dev-server - "kill" missing in "usedPortAction" type definition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest-puppeteer.