如何在量角器测试中使用phantomjs?

时间:2014-10-14 02:23:53

标签: angularjs jasmine phantomjs protractor

我试图使用phantomjs但没有成功:(

将此示例用作测试用例:

https://github.com/angular/protractor/blob/master/docs/page-objects.md

我的protractor.conf.js看起来像这样:

exports.config = {
    // The address of a running selenium server.
    seleniumAddress: 'http://localhost:4444/wd/hub',

    // Capabilities to be passed to the webdriver instance.
    capabilities: {
        'browserName': 'phantomjs'
    },

    // Spec patterns are relative to the location of the spec file. They may
    // include glob patterns.
    suites: {
        homepage: '*.spec.js',
        search: ['tests/e2e/contact_search/**/*Spec.js',
            'tests/e2e/venue_search/**/*Spec.js']
    },

    // Options to be passed to Jasmine-node.
    jasmineNodeOpts: {
        showColors: true, // Use colors in the command line report.
        isVerbose:true,
        includeStackTrace: true
    }
    ,
    specs: ['example_spec.js']
};

当我跑步时,我得到:

 "C:\Program Files (x86)\JetBrains\WebStorm 8.0.4\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\lib\cli.js protractor.conf.js
Using the selenium server at http://localhost:4444/wd/hub
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
The last active task was: 
WebDriver.createSession()
    at Function.webdriver.WebDriver.acquireSession_ (c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:148:22)
    at Function.webdriver.WebDriver.createSession (c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:122:30)
    at Builder.build (c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:293:22)
    at HostedDriverProvider.getDriver (c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\lib\driverProviders\hosted.js:63:9)
    at c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:238:41
    at _fulfilled (c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:797:54)
    at self.promiseDispatch.done (c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:826:30)
    at Promise.promise.promiseDispatch (c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:759:13)
    at c:\Users\harry.redknapp\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:573:44

我如何让phantomjs工作?

0 个答案:

没有答案