Replicate User Activity with Faker and Puppeteer

Share this video with your friends

Send Tweet

In this lesson we are going to test a form submission by replicating keyboard input, mouse clicks, and touchscreen events. This will be done with random user information generated by Faker. We will test this in different contexts, including an iPhone 6 environment.

Platon
Platon
~ 7 years ago

Please don't replace older but still relevant parts of the lesson (page with html backend) with newer ones (page with touch backend), it makes the lesson git repository not as useful as could have been and forces me to hunt for the relevant parts of the video if I missed anything.

Just keep the old file as backup if necessary if making it work in parallel is a hassle.

Learn Sifnos
Learn Sifnos
~ 7 years ago

I'm using Puppeteer version 1.3.0and it seems DeviceDescriptors format has changed.

Replace const iPhone = devices['iPhone 6'] with const iphone = devices.filter(d => d.name === "iPhone 6")[0]

83042dc1-54ae-4175-971a-e14408ce5d8e@anonymous.zalando.com
83042dc1-54ae-4175-971a-e14408ce5d8e@anonymous.zalando.com
~ 6 years ago

or simply const iphone = devices.find(({name}) => name === 'iPhone 6')

Piotr
Piotr
~ 5 years ago

Is there a way to get rid of 16000 timeout in tests? What if test will run longer?

Luci Temple
Luci Temple
~ 2 years ago

Faker has been depreciated. Now need @faker-js/faker https://stackoverflow.com/questions/70892698/cannot-find-module-faker-or-its-corresponding-type-declarations-2307

Luci Temple
Luci Temple
~ 2 years ago

Getting an error when testing the Login form " ● Given the page loads › then the login form should work correctly

thrown: "Exceeded timeout of 18000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.""
Luci Temple
Luci Temple
~ 2 years ago

Even trying to run the tests from the example github repo, am getting a bunch of errors.