Session Management via Puppeteer

1. What is the puppeteer?

Puppeteer is a Node library which is providing a high-level API to control Chrome or Chromium over the DevTools Protocol. In simpler terms, being from the same parent gives it greater control and flexibility to work with Chrome, you can do the things manually in the browser using Puppeteer.

Puppeteer’s functionalities easily can challenge to other open-source automation tools.

2. Steps for installing puppeteer and other packages inside a project?

Index.js: This is our entry file. It will call the login file than our login file will logged in us inside the web site after the login it is wait for some events to be happened by our chokidar’s watcher.

Add async queue which will be used to add our task in queue and execute provided callback, Here we call main() function to process further and whenever user fire any event then those event will be added in a queue and process further

Create watcher add event function this will be called each time when user execute our another script (redirect.js) to create new file inside our watcher Files folder and then the watcher passed this newly created event in async queue and async queue will call our main function and redirect it to appropriate page.

redirect.js: This script simply creates one file inside folder watcherFile so our watcher code inside index.js get execute and because our watcher's keep listing for any file event and the moment any new file created inside our watcherFile folder then our index.js watcher code get executed and rest of the process follow inside our index.js file