mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@@ -20,3 +20,10 @@ jobs:
|
|||||||
run: cp config.json.example config.json
|
run: cp config.json.example config.json
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Upload results on fail
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Test Results
|
||||||
|
path: ./test-results
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ dist/
|
|||||||
tmp/
|
tmp/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
ci/data.json
|
ci/data.json
|
||||||
|
test-results
|
||||||
@@ -2,6 +2,8 @@ import { Builder, By, until, WebDriver, WebElement } from "selenium-webdriver";
|
|||||||
import * as Chrome from "selenium-webdriver/chrome";
|
import * as Chrome from "selenium-webdriver/chrome";
|
||||||
import * as Path from "path";
|
import * as Path from "path";
|
||||||
|
|
||||||
|
import * as fs from "fs";
|
||||||
|
|
||||||
test("Selenium Chrome test", async () => {
|
test("Selenium Chrome test", async () => {
|
||||||
let driver: WebDriver;
|
let driver: WebDriver;
|
||||||
try {
|
try {
|
||||||
@@ -35,6 +37,14 @@ test("Selenium Chrome test", async () => {
|
|||||||
await toggleWhitelist(driver);
|
await toggleWhitelist(driver);
|
||||||
await toggleWhitelist(driver);
|
await toggleWhitelist(driver);
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
// Save file incase there is a layout change
|
||||||
|
const source = await driver.getPageSource();
|
||||||
|
|
||||||
|
fs.mkdirSync("./test-results");
|
||||||
|
fs.writeFileSync("./test-results/source.html", source);
|
||||||
|
|
||||||
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
await driver.quit();
|
await driver.quit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user