fingerprintjs/fingerprintjs

Find a way to run Karma in Incognito Chrome and Private Firefox on BrowserStack

Open

#560 建立於 2020年10月9日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)TypeScript (20,435 star) (2,226 fork)batch import
help wantedtests

描述

We use Karma and BrowserStack to test FingerprintJS v3 in many browsers. Fingerprint must persist between regular and incognito mode of browser, therefore we should run our tests in incognito browsers too.

But I haven't succeeded to start an incognito browser on BrowserStack. We are trying to solve it with the BrowserStack support. This is what I've got so far: https://github.com/Finesse/karma-browserstack-example/blob/incognito/karma.conf.js. I've tried many other parameters of BrowserStack custom launchers, they all have started browsers in regular mode. Does anybody have similar experience? We will appreciate a lot if you help to setup the incognito testing.

A similar setup that uses Selenium to control a BrowserStack browser directly works as expected:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from time import sleep
from datetime import datetime
import os

desired_cap = {
    "browser": "Chrome",
    "goog:chromeOptions": {
        "args": ["incognito", ],
        "w3c": False
    },
}

driver = webdriver.Remote(
    # The environment variable value must be 'http://your-username:your-password@hub-cloud.browserstack.com/wd/hub'
    command_executor=os.environ.get('BROWSERSTACK_HUB_URL'),
    desired_capabilities=desired_cap
)

print("Session: https://automate.browserstack.com/dashboard/v2/sessions/" + driver.session_id)
print("protocol w3c:" + str(driver.w3c))

driver.get("https://google.com/")
driver.quit()

A fallback solution is to run incognito browsers in the CI directly like it's done in v2. But in contrast to v2, there should be multiple versions of browsers.

貢獻者指南