Puppeteer - quick start | QAProvider.com
Subscribe me on new discussions

Puppeteer - quick start

Views: 55

Puppeteer is a Node library which provides a high-level API to control Chrome.

We have found this tool easy to start and useful in snapshot testing. Today we will show how to do a snapshot testing script.

https://github.com/GoogleChrome/puppeteer you can start to learn Puppeteer from here.

  • First install puppeteer on your machine with a line: npm i puppeteer
  • Let's create a first script that will open QAProvider homepage and do screenshots with different screen resolutions.

Find code here: https://gist.github.com/QAProvider/d2fb7cf8382656e4185315e59518652a

  • Let's run the script node qaprovider.js
  • Let's check results. We could find that we have a minor bug on 800x600 resolution

View port 640x480

View port 800x600 with a bug

View port 1024x768

This is a quick start with Puppeteer. We will try to do a snapshot tests at the end of this tutorial.

Karma: {{ total }}
Published: 8 months ago by QAProvider Team
Raja at 2019-09-25 06:30:52
Karma: {{ total }}

Is it better than Lambdatest ?? I mean we can do snapshot testing using Lambdatest too I guess.

QAProvider Team replied to Raja's comment at 2019-09-25 06:37:54
Karma: {{ total }}

Lambdatest is an online tool and you have to pay to use it.

You can install Puppeteer on your machine, use all the futures for free and have a full control of test automation process.

But Lambdatest has everything configured for you, you just need to click buttons :) It might save a lot of your time if you need all this infrastructure.