Question
Has anyone successfully checked if Bootstrap mod is displayed when a button is clicked?
More details
I am writing a Testacular test that checks to see if the Bootstrap mod is displayed when a button is clicked. The problem is that calling css('display') returns 'none' , although I can see the window pops up and is visible.
I am wondering if something is happening with Bootstrap Modal, which duplicates the html block and then displays this with a different identifier. I certainly hope not!
code
Scenario
describe('e2e', function() { beforeEach(function() { browser().navigateTo('/chessClub/'); }); it('should display editor when add member button clicked', function() { expect(element('title').text()).toBe("Chess Club"); expect(element('#myModal').css('display')).toBe('none');
test output
Chrome 25.0 e2e should display editor when add member button clicked FAILED expect element '#myModal' get css 'display' toBe "block" /Users/jgordon/learning/chessClub/web-app/test/e2e/scenarios.js:17:4: expected "block" but was "none"
HTML
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel">{{editorLabel}}</h3> </div> <div class="modal-body"> <form> <label> Name </label> <input type="text" ng-model="editedMember.name" placeholder="John Doe"> <label> Grade </label> <input type="text" ng-model="editedMember.grade"> <label> Ladder Position </label> <input type="text" ng-model="editedMember.ladderPosition"> </form> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button class="btn btn-primary" ng-click="saveMember()">Save changes</button> </div> </div>
source share