Skip to content

Commit

Permalink
e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zigaspindler committed Jun 1, 2015
1 parent f6db829 commit 3a47f48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 4 additions & 5 deletions angular/e2e/main.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

'use strict';

var MainPage = function() {
this.jumbEl = element(by.css('.jumbotron'));
this.h1El = this.jumbEl.element(by.css('h1'));
this.imgEl = this.jumbEl.element(by.css('img'));
this.thumbnailEls = element(by.css('body')).all(by.repeater('awesomeThing in awesomeThings'));
var MainPage = function() {
this.jumbotron = element(by.css('.jumbotron'));
this.h1 = this.jumbotron.element(by.css('h1'));
this.books = element(by.css('body')).all(by.repeater('book in ctrl.books'));
};

module.exports = new MainPage();
10 changes: 4 additions & 6 deletions angular/e2e/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ describe('The main view', function () {
var page;

beforeEach(function () {
browser.get('http://localhost:3000/index.html');
browser.get('http://localhost:3001/');
page = require('./main.po');
});

it('should include jumbotron with correct data', function() {
expect(page.h1El.getText()).toBe('\'Allo, \'Allo!');
expect(page.imgEl.getAttribute('src')).toMatch(/assets\/images\/yeoman.png$/);
expect(page.imgEl.getAttribute('alt')).toBe('I\'m Yeoman');
expect(page.h1.getText()).toBe('MyLibrary');
});

it('list more than 5 awesome things', function () {
expect(page.thumbnailEls.count()).toBeGreaterThan(5);
it('list more than 4 books', function () {
expect(page.books.count()).toBeGreaterThan(4);
});

});

0 comments on commit 3a47f48

Please sign in to comment.