Permalink
Browse files

attempting to add some list e2e tests

  • Loading branch information...
1 parent ffd17b2 commit 3fd2c106443134d1e76f3a24c372d6450344f52c @annavester annavester committed Mar 3, 2013
Showing with 21 additions and 10 deletions.
  1. +20 −9 test/e2e/list/list.js
  2. +1 −1 test/e2e/runner1.html
View
@@ -6,37 +6,48 @@ describe('list', function() {
browser().navigateTo('../../app/list/index.html');
});
- it('should render 2 controls', function() {
+ xit('should render 2 controls', function() {
expect(element('.ade-editable').count()).toEqual(2);
});
- it('should go into edit mode (show popup)', function() {
+ xit('should go into edit mode (show popup)', function() {
element('.ade-editable:eq(0)').click();
sleep(1);
expect(element('.ade-editable:eq(0) + .select2-dropdown-open').count()).toEqual(1);
});
- xit('should detect Enter key and dismiss the popup', function() {
+ xit('should detect Enter key, save data and dismiss the popup', function() {
element('.ade-editable:eq(0)').click();
sleep(1);
+ element('.select2-highlighted:eq(0) span').click();
appElement('.select2-drop-active .select2-input', function(elm) {
- elm.trigger({ type : 'keydown', keyCode: 13 });
+ elm.val('apple');
+ elm.trigger({ type : 'keypress', keyCode: 13 });
});
sleep(1);
+ expect(element('.ade-editable:eq(0)').text()).toBe(1);
expect(element('.ade-editable:eq(0) + .select2-dropdown-open').count()).toEqual(0);
});
- xit('should detect TAB key and dismiss the popup', function() {
+ it('should detect TAB key, save data and dismiss the popup', function() {
element('.ade-editable:eq(0)').click();
sleep(1);
- appElement('.select2-drop-active .select2-input', function(elm) {
+
+ element('.select2-drop-active .select2-result-selectable:eq(3)').attr('class', 'select2-results-dept-0 select2-result select2-result-selectable');
+ element('.select2-drop-active .select2-result-selectable:eq(0)').attr('class', 'select2-results-dept-0 select2-result select2-result-selectable select2-highlighted');
+
+ element('.select2-container-active .select2-choice span').text('apple');
+ appElement('.select2-drop-active .select2-search input', function(elm) {
elm.trigger({ type : 'keydown', keyCode: 9 });
});;
sleep(1);
- expect(element('.ade-editable:eq(0) + .select2-dropdown-open').count()).toEqual(0);
+ element('.select2-container-active .select2-choice span').text('apple');
+ console.log(element('.select2-container-active .select2-choice span').text());
+ console.log(element('.ade-editable:eq(0)').text());
+ expect(element('.ade-editable:eq(0)').text()).toBe('apple');
});
- it('should detect ESC key and dismiss popup', function() {
+ xit('should detect ESC key and dismiss popup', function() {
element('.ade-editable:eq(0)').click();
sleep(1);
appElement('.ade-editable:eq(0) + .select2-dropdown-open', function(elm) {
@@ -45,7 +56,7 @@ describe('list', function() {
expect(element('.select2-dropdown-open').count()).toEqual(0);
});
- it('should abort editing entry', function() {
+ xit('should abort editing entry', function() {
element('.ade-editable:eq(1)').click();
sleep(1);
element('.select2-highlighted span').click();
View
@@ -7,7 +7,7 @@
<script src="common.js"></script>
- <script src="email/email.js"></script>
+ <script src="list/list.js"></script>
</head>
<body>

0 comments on commit 3fd2c10

Please sign in to comment.