SeleniumBase/integrations/node_js
Michael Mintz d6ab2c9ac5 Update integrations 2024-09-23 00:52:36 -04:00
..
ReadMe.md Update integrations 2024-09-23 00:52:36 -04:00
__init__.py Update integrations 2023-02-03 00:30:47 -05:00
index.html Update integrations 2024-09-23 00:52:36 -04:00
my_first_test.py Update examples 2023-03-01 02:06:09 -05:00
npm-shrinkwrap.json Update integrations 2024-09-23 00:52:36 -04:00
package.json Update integrations 2024-09-23 00:52:36 -04:00
server.js Use "CTRL+C" instead of "CTRL-C" in console messages 2021-02-18 23:40:55 -05:00
test_demo_site.py Update an integrations example test 2023-08-05 15:35:52 -04:00

ReadMe.md

Creating a Test Runner with NodeJS + Express

You can create a customized web app for running SeleniumBase tests by using NodeJS and Express. (This tutorial assumes that you've already installed SeleniumBase.

0. Clone SeleniumBase from GitHub

1. Install NodeJS (if not installed)

2. Upgrade NodeJS (if using an older version)

npm install -g npm@latest

3. Install the example Test Runner for SeleniumBase from integrations/node_js. (If dependencies were already installed, you can use npm ci for a speed improvement over npm i / npm install because npm ci uses npm-shrinkwrap.json, which is generated via npm shrinkwrap.)

npm install

(You should see a node_modules folder appear in your node_js folder.)

4. Run the NodeJS server for your SeleniumBase Test Runner web app

node server.js

(You can stop the server by using Ctrl+C)

5. Open the SeleniumBase Test Runner web app

6. Run an example test

Click on a button to run a SeleniumBase example test.

7. Expand your web app

Now that you have a web app for running SeleniumBase tests, you can expand it to run any script that you want after pressing a button.