sto iniziando la mia avventura con Goniometro & Jasmine & PhantomJS. Quello che volevo ottenere è usare PhantomJS per eseguire i test da ProtractorDemo. Ma ho fallito, e non so perché. Dove sono passaggi esatti:L'impostazione di PhantomJs con Goniometro non funziona
Ho installato goniometro-demo (https://github.com/juliemr/protractor-demo)
git clone https://github.com/juliemr/protractor-demo.git
cd protractor-demo
npm install
phantomjs Poi ho installato:
npm install --save-dev phantomjs
configurazione Poi ho aggiornato (sulla base di http://angular.github.io/protractor/#/browser-setup):
capabilities: {
'browserName': 'phantomjs',
/*
* Can be used to specify the phantomjs binary path.
* This can generally be ommitted if you installed phantomjs globally.
*/
'phantomjs.binary.path':'./node_modules/phantomjs/bin/phantomjs',
/*
* Command line arugments to pass to phantomjs.
* Can be ommitted if no arguments need to be passed.
* Acceptable cli arugments: https://github.com/ariya/phantomjs/wiki/API-Reference#wiki-command-line-options
*/
'phantomjs.cli.args':['--logfile=PATH', '--loglevel=DEBUG']
}
Il file di configurazione completo è simile a questo:
// Tests for the calculator. exports.config = { seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [
'spec.js' ],
capabilities: {
'browserName': 'phantomjs',
/*
* Can be used to specify the phantomjs binary path.
* This can generally be ommitted if you installed phantomjs globally.
*/
'phantomjs.binary.path': './node_modules/phantomjs/bin/phantomjs',
/*
* Command line arugments to pass to phantomjs.
* Can be ommitted if no arguments need to be passed.
* Acceptable cli arugments: https://github.com/ariya/phantomjs/wiki/API-Reference#wiki-command-line-options
*/
'phantomjs.cli.args': ['--logfile=PATH', '--loglevel=DEBUG'] } };
comandi Poi ho eseguito da esercitazione:
.\node_modules\.bin\webdriver-manager update
ho iniziato WebDriver e web server:
.\node_modules\.bin\webdriver-manager start
npm start
L'output di questo comando è stato:
Using the selenium server at http://127.0.0.1:4444/wd/hub
Server running at http://localhost:3456
E passaggio finale:
node_modules\.bin\protractor test\conf.js
e la finestra altra console WebDriver-manager modulo di uscita è stata:
15:23:10.181 INFO - Executing: [new session: Capabilities [{phantomjs.binary.path=./node_modules/phantomjs/bin/phantomjs, count=1, browserName=phantomjs, phantomjs.cli.args=[--logfile=PATH, --loglevel=DEBUG]}]])
15:23:10.192 INFO - Creating a new session for Capabilities [{phantomjs.binary.path=./node_modules/phantomjs/bin/phantomjs, count=1, browserName=phantomjs, phantomjs.cli.args=[--logfile=PATH, --loglevel=DEBUG]}]
15:23:10.203 INFO - executable: d:\dev\protractor-demo\.\node_modules\phantomjs\bin\phantomjs
15:23:10.203 INFO - port: 44410
15:23:10.203 INFO - arguments: [--logfile=PATH, --loglevel=DEBUG, --webdriver=44410, --webdriver-logfile=d:\dev\protractor-demo\phantomjsdriver.log]
15:23:10.204 INFO - environment: {}
ma non succede nulla. Non vedo risultato di test eseguiti. C'è qualcosa che mi manca? Quando cambio il browser da phantomjs a chrome, vedo i risultati dei test.
Looks correlati: [prova di goniometro sul phantomjs con l'uso di vaso autonomo di selenio,] (http://stackoverflow.com/q/26096786) –
Grazie. Comunque, i miei passi sono corretti? Perché in seguito ho trovato un esempio in cui è sufficiente avviare PhantomJS come Remote WebDriver e, quando mi collego a questo driver utilizzando seleniumAddress, funziona. Non ho capito bene. – dragonfly
Non lo so, non l'ho mai fatto. –