0

マイprotractor.conf.js(関連部分)分度器はbrowser.actions()

capabilities: { 
    'browserName': 'chrome', 
    'chromeOptions': { 
     'args': ['headless', 'disable-gpu'] 
    } 
    } 

を実行しません。同様にmap.click()でこのコードを置き換えた場合

browser.actions() 
    .mouseDown() 
    .mouseMove(map, {x: 500, y: 150}) 
    .click() 
    .mouseDown() 
    .perform(); 

編集:自分の状況では役に立たないと思ったので、前にエラーを追加しませんでした。しかし、ここでは、誰かが関連性があると考えているからです。

障害:

1) Protractor Demo App place sorting should create 2 places on different distances from map center Message: Expected 0 to be 2. Stack: Error: Failed expectation at Object.it (/home/piliponful/projects/mocha-test/spec.js:138:38) at /home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/jasminewd2/index.js:112:25 at new ManagedPromise (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1067:7) at ControlFlow.promise (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2396:12) at schedulerExecute (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/jasminewd2/index.js:95:18) at TaskQueue.execute_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2970:14) at TaskQueue.executeNext_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2953:27) at asyncRun (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2860:25) at /home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:676:7 at process._tickCallback (internal/process/next_tick.js:109:7)

2) Protractor Demo App place sorting should sort places Message: Expected 0 to be 2. Stack: Error: Failed expectation at Object.it (/home/piliponful/projects/mocha-test/spec.js:148:38) at /home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/jasminewd2/index.js:112:25 at new ManagedPromise (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1067:7) at ControlFlow.promise (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2396:12) at schedulerExecute (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/jasminewd2/index.js:95:18) at TaskQueue.execute_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2970:14) at TaskQueue.executeNext_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2953:27) at asyncRun (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2860:25) at /home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:676:7 at process._tickCallback (internal/process/next_tick.js:109:7) Message: Failed: Index out of bound. Trying to access element at index: 0, but there are only 0 elements that match locator by.binding("place.title") Stack: NoSuchElementError: Index out of bound. Trying to access element at index: 0, but there are only 0 elements that match locator by.binding("place.title") at selenium_webdriver_1.promise.all.then (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/lib/element.ts:287:17) at ManagedPromise.invokeCallback_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1366:14) at TaskQueue.execute_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2970:14) at TaskQueue.executeNext_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2953:27) at asyncRun (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2813:27) at /home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:676:7 at process._tickCallback (internal/process/next_tick.js:109:7)Error at ElementArrayFinder.applyAction_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/lib/element.ts:482:23) at ElementArrayFinder.(anonymous function).args [as getText] (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/lib/element.ts:96:21) at ElementFinder.(anonymous function).args [as getText] (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/lib/element.ts:873:14) at placeListText.then.places (/home/piliponful/projects/mocha-test/spec.js:150:38) at ManagedPromise.invokeCallback_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1366:14) at TaskQueue.execute_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2970:14) at TaskQueue.executeNext_ (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2953:27) at asyncRun (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2813:27) at /home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:676:7 at process._tickCallback (internal/process/next_tick.js:109:7) From: Task: Run it("should sort places") in control flow at Object. (/home/piliponful/.nvm/versions/node/v7.10.0/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:19) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5) From asynchronous test: Error at Suite.describe (/home/piliponful/projects/mocha-test/spec.js:140:5) at Suite.describe (/home/piliponful/projects/mocha-test/spec.js:87:3) at Object. (/home/piliponful/projects/mocha-test/spec.js:1:1) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17)

13 specs, 3 failures

+0

あなたの質問に半分のようですか?あなたはどんなエラーを出していますか? – demouser123

+0

エラーを追加しました。 – Piliponful

+0

私はクロムヘッドレスがこれらの機能をドキュメントでサポートしているかどうかを確認します。 – cnishina

答えて

0

私はクロームでヘッドレスモードで動作するように)(分度器browser.actionsを取得するために解決策を見つけていませんでした。しかし、私はXvfbドッカーの画像(webnicer /分度器 - ヘッドレス)を使用し、それはすべて期待どおりに働いた。

0

オプションの構文がProtractor specificationsと異なることがわかります。また、ヘッドレスでウィンドウサイズを先に指定する必要があります。これを試して助けてください。

capabilities: { 
    'browserName': 'chrome', 
    'chromeOptions': { 
     'args': ['--headless', '--disable-gpu', '--window-size=800,600'] 
    } 
    } 
0

期待通りではないすべてのブラウザのアクションが動作するようはい、あなたはヘッドレスクロームでmouseMove()を使用することはできません。例えば、browser.actions().sendKeys(Key.DELETE).perform()

代わりのmouseMoveイベントは()だけを使用します。

browser.executeScript("arguments[0].scrollIntoView();", map) 

map.click()