karma-runner / karma-webdriver-launcher

A plugin for Karma. Launch any browser with WebDriver.
MIT License
66 stars 40 forks source link

iOS launching Safari to 127.0.0.1:4723/Welcome #27

Closed fraserhart closed 9 years ago

fraserhart commented 9 years ago

I'm trying to implement this in my Karma flow for a webapp using appium.

When I run karma, the iOS simulator launches and opens safari to 127.0.0.1:4723/Welcome

Karma is able to open every other browser (chrome, firefox, phantom, safari (all on mac)) to the service it creates (localhost:9876). Is this something that needs to be set in the config or am I going about something fundamentally wrong?

My setup is as follows:

var webdriverConfig = {
    hostname: '192.168.10.126',
    port: 4723
}

and

customLaunchers: {
        'iOS-Safari' : {
            base: 'WebDriver',
            platformName: "iOS",
            deviceName: 'iPhone 6 Plus',
            config: webdriverConfig,
            browserName: 'Safari',
            platform: 'iPhone 6 Plus',
            version: '8.4'
        }
    },

Appium config is as such: screen shot 2015-08-19 at 16 14 58

Thank you

fraserhart commented 9 years ago

Update, I've been able to point to the correct Karma URL with:

customLaunchers: { 'iOS-Safari' : { base: 'WebDriver', platformName: "iOS", deviceName: 'iPhone 6 Plus', config: webdriverConfig, browserName: 'Safari', platform: 'iPhone 6 Plus', version: '8.4', safariInitialUrl: 'http://192.168.10.126:9876' } }, However, it appears that Karma's service has closes down as soon as the simulator attempts to connect and and I just get a standard "Safari cannot open the page because it could not connect to the server". This is the case whether I run karma with singlerun true or false (tried false to keep it alive). I get this in my console:

Fatal error: [init({"platform":"iPhone 6 Plus","testName":"Karma test","tags":[],"version":"8.4","base":"WebDriver","platformName":"iOS","deviceName":"iPhone 6 Plus","browserName":"Safari","safariInitialUrl":"http://192.168.10.126:9876"})] The environment you requested was unavailable.

(Bear in mind this is after it has launched the emulator and safari and navigated to the URL)

fraserhart commented 9 years ago

I managed to solve this by simply unchecking the UDID checkbox in the Appium settings for iOS