lundi 26 décembre 2016

Protractor: working with canvas element - ng-if / ng-show

I'm new with protractor and angular JS page.

For my end2end testing I need validated if my canvas has been received at least one image (There's a websocket.io thats populate some images in this canvas).

For now I should validate just if canvas starts received that images.

My html page:

<div class="terminal-screenshots" ng-class="{ online: isConnected() && vm.hasImage }">
        <canvas ng-show="isConnected() && vm.hasImage" style="width: 100%;" id="remoteTerminalCanvas"></canvas>
        <span ng-if="!isConnected() || !vm.hasImage">
          
        </span>
</div>
          

This is my expect:

expect(element(by.id('remoteTerminalCanvas')).isDisplayed()).toBe(true);

But it's return true before the first image show up in the canvas.

Aucun commentaire:

Enregistrer un commentaire