Make test URL configurable with TEST_URL env var. resolves #240

This commit is contained in:
ngosang
2021-12-11 18:35:37 +01:00
parent a24b665bd1
commit c4ef6a472e
2 changed files with 4 additions and 1 deletions

View File

@@ -94,11 +94,13 @@ export async function testWebBrowserInstallation(): Promise<void> {
log.debug("FlareSolverr user home directory is OK: " + homeDir)
// test web browser
const testUrl = process.env.TEST_URL || "https://www.google.com";
log.debug("Test URL: " + testUrl)
const session = await create(null, {
oneTimeSession: true
})
const page = await session.browser.newPage()
await page.goto("https://www.google.com")
await page.goto(testUrl)
webBrowserUserAgent = await page.evaluate(() => navigator.userAgent)
// replace Linux ARM user-agent because it's detected