Skip to content

Commit

Permalink
added e2e test for notes
Browse files Browse the repository at this point in the history
  • Loading branch information
abarnhard committed Dec 18, 2014
1 parent e930c37 commit dc6e9d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
test:
@node node_modules/lab/bin/lab -v -m 8000 test/unit test/acceptance
test-cov:
@node node_modules/lab/bin/lab -r lcov
@node node_modules/lab/bin/lab -r lcov test/unit test/acceptance
test-e2e:
@node node_modules/protractor/bin/protractor protractor.conf.js
test-e2e-d:
@node node_modules/protractor/bin/protractor debug protractor.conf.js

.PHONY: test test-cov test-e2e
.PHONY: test test-cov test-e2e test-e2e-d
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"syntax": "grunt build",
"test": "make test",
"e2e": "make test-e2e",
"e2e-d": "make test-e2e-d",
"coveralls": "make test-cov | coveralls"
},
"author": "Adam Barnhard <admbarn@gmail.com>",
Expand Down
10 changes: 7 additions & 3 deletions test/e2e/notes/notes_list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ describe('notes list', function(){
var image = path.resolve(__dirname, '../../fixtures/test_img.png');

element(by.model('note.title')).sendKeys('test title');
h.debug('red');
// h.debug('red');
element(by.model('note.body')).sendKeys('test body');
element(by.model('note.tags')).sendKeys('a,b,c');
element(by.css('input[type="file"]')).sendKeys(image);
// h.debug('blue');
element(by.css('button[ng-click]')).click();

h.debug('blue');
expect(element(by.model('note.title')).getAttribute('value')).toEqual('');
expect(element(by.model('note.body')).getAttribute('value')).toEqual('');
expect(element(by.model('note.tags')).getAttribute('value')).toEqual('');
expect(element.all(by.repeater('note in notes')).count()).toBeGreaterThan(0);

expect(element(by.css('a[ui-sref="notes.list"]')).isDisplayed()).toBeTruthy();
});

});
Expand Down

0 comments on commit dc6e9d6

Please sign in to comment.