Merge pull request #1365 from ajayyy/auto-selenium

Run Selenium tests in GitHub actions
This commit is contained in:
Ajay Ramachandran 2022-06-17 17:12:05 -04:00 committed by GitHub
commit bbc5b436e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -3,8 +3,7 @@ name: Tests
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
test:
build:
name: Run tests name: Run tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -15,6 +14,9 @@ jobs:
with: with:
node-version: '18' node-version: '18'
- run: npm ci - run: npm ci
- run: sudo apt-get install chromium-chromedriver
- name: Copy configuration
run: cp config.json.example config.json
- name: Run tests - name: Run tests
run: npm run test-without-building run: npm run test

View file

@ -37,6 +37,7 @@ async function setup(): Promise<WebDriver> {
options.addArguments("--load-extension=" + Path.join(__dirname, "../dist/")); options.addArguments("--load-extension=" + Path.join(__dirname, "../dist/"));
options.addArguments("--mute-audio"); options.addArguments("--mute-audio");
options.addArguments("--disable-features=PreloadMediaEngagementData, MediaEngagementBypassAutoplayPolicies"); options.addArguments("--disable-features=PreloadMediaEngagementData, MediaEngagementBypassAutoplayPolicies");
options.addArguments("--headless=chrome");
const driver = await new Builder().forBrowser("chrome").setChromeOptions(options).build(); const driver = await new Builder().forBrowser("chrome").setChromeOptions(options).build();
driver.manage().setTimeouts({ driver.manage().setTimeouts({