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.
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.
I'm using Puppeteer version 1.3.0
and it seems DeviceDescriptors
format has changed.
Replace const iPhone = devices['iPhone 6']
with const iphone = devices.filter(d => d.name === "iPhone 6")[0]
or simply const iphone = devices.find(({name}) => name === 'iPhone 6')
Is there a way to get rid of 16000 timeout in tests? What if test will run longer?
Faker has been depreciated. Now need @faker-js/faker https://stackoverflow.com/questions/70892698/cannot-find-module-faker-or-its-corresponding-type-declarations-2307
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.""
Even trying to run the tests from the example github repo, am getting a bunch of errors.