Selenium-standalone

before(async function() { // Ensure drivers are installed (safe to call every time) await install(); // Start the server server = await start(); console.log('Selenium ready'); });

# Install drivers (runs fresh on every commit) - run: npx selenium-standalone install # Run server in background - run: npx selenium-standalone start & - run: npm test selenium-standalone

Run your test while selenium-standalone start is running in another terminal. They will connect automatically. The CLI is great, but the real power is using the API inside your test setup hooks. before(async function() { // Ensure drivers are installed

after(async function() { await server.kill(); // Clean shutdown }); // Clean shutdown })