getgauge / taiko

A node.js library for testing modern web applications
https://taiko.dev
MIT License
3.56k stars 452 forks source link

Use npm cache to store Chromium browser to avoid redownloading it #2664

Closed believer-ufa closed 1 month ago

believer-ufa commented 1 year ago

Sometimes we all remove node_modules folder for some reason. Also, NPM v6 removes it automatically while using npm ci command.

It is comfortable when libraries which downloads huge dependencies like Chromium or, for example, node-sass bindings are store these dependencies in npm-cache folder on local user machine to avoid redownload them from Internet every time when node_modules folder was removed in project.

You can find example how you can do it in node-sass library source code on Github: https://github.com/sass/node-sass/blob/ee13eb9c62449d1e535189a063cbdd15583ebf32/scripts/install.js#L56-L115.

ghost commented 1 year ago

@believer-ufa You can also install taiko globally on your local machine through npm install -g taiko. So even if you delete the node_modules folder you do not have to download the browsers again.

marques-work commented 1 year ago

Additionally you can also install your browser via package manager and set the environment variable to tell taiko where to find it.

I think it's TAIKO_BROWSER_PATH (or something like that -- check the docs).