次の html 構造を生成するディレクティブがあります。
<div class="popover ng-isolate-scope" ng-mouseover="toggle(true)" ng-mouseleave="toggle(false)" popover="" label="hover time!" trigger-class="button" content-class="specialContentClass">
<span id="thing" class="popover-trigger button">hover time!</span>
<div ng-transclude="" ng-show="show" class="popover-content ng-hide">
<div class="ng-scope">Popover content </div>
</div>
</div>
コードは正常に動作し、ブラウザーを使用して手動でマウスオーバーすると、ポップオーバー コンテンツが正しく表示されます。
次の分度器テストでマウスオーバー機能をテストしようとしています:
it('should display the popover-content on mouseover', function() {
browser.get('http://localhost:9000/');
browser.actions()
.mouseMove(element(by.css('.popover')).find()).perform();
expect(element(by.css('.popover-content'))
.isDisplayed().toBeTruthy());
});
テストは実行されているようで、ブラウザは開きますが、ブラウザが閉じる前にポップアップ コンテンツが表示されないので、何らかの理由で mousemove ビットが機能していないと確信しています。次に、ターミナルに次のように出力されます。
launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1
ycompu:angular ycompu$
私はドキュメントを読みましたが、ブラウザを使用することは間違いなくこのテストに取り組む正しい方法です。構文が正しいように見えるので、途方に暮れています。