Skip to content

Commit

Permalink
Merge branch 'ric9176-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lathonez committed Mar 11, 2016
2 parents 27931fa + 9ef35a9 commit 440d463
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 29 deletions.
22 changes: 0 additions & 22 deletions app/app.e2e.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/pages/clickerList/clickerList.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ion-content padding>
<clicker-form></clicker-form>
<ion-row *ngFor="#clicker of clickerService.getClickers()">
<ion-row *ngFor="#clicker of clickerService.getClickers()" class="clickerList">
<ion-col width-80><clicker-button [clicker]="clicker"></clicker-button></ion-col>
<ion-col>
<button block danger outline (click)="clickerService.removeClicker(clicker.id)"><ion-icon name="trash"></ion-icon></button>
Expand Down
2 changes: 1 addition & 1 deletion app/pages/page2/page2.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<ion-title>{{title}}</ion-title>
</ion-navbar>

<ion-content padding>
<ion-content padding class="message">
<h2>Bye!</h2>
</ion-content>
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"coveralls": "2.11.8",
"del": "2.2.0",
"es6-module-loader": "0.17.11",
"gulp": "3.9.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-inline-ng2-template": "^1.1.2",
"gulp-load-plugins": "1.2.0",
Expand All @@ -28,6 +28,7 @@
"gulp-typescript": "^2.12.1",
"gulp-watch": "4.3.5",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "^2.4.0",
"karma": "0.13.21",
"karma-chrome-launcher": "0.2.2",
"karma-coverage": "0.5.3",
Expand All @@ -40,11 +41,13 @@
"strip-sourcemap-loader": "0.0.1",
"systemjs": "0.19.23",
"traceur": "0.0.102",
"ts-node": "0.5.5",
"ts-node": "^0.5.5",
"tslint": "3.5.0",
"tslint-eslint-rules": "1.0.1",
"typescript": "1.8.2",
"typings": "0.7.7"
"typescript-node": "^0.1.3",
"typings": "0.7.7",
"webpack": "^1.12.14"
},
"name": "clicker",
"description": "clicker: An Ionic project",
Expand Down
71 changes: 71 additions & 0 deletions test/e2e/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
describe('App', () => {

var clickerField = element(by.css('.text-input'));
var clickerButton = element.all(by.className('button')).first();
var removeButton = element.all(by.css('.button-outline-danger')).first();
var clickerList = element.all(by.className('clickerList')).first();
var message = element(by.className('message'));

beforeEach(() => {
browser.get('');
});

it('should have a title', () => {
expect(browser.getTitle()).toEqual('Ionic');
});

it('should have <nav>', () => {
expect(element(by.css('ion-navbar')).isPresent()).toEqual(true);
});

it('should have correct nav text for Home', () => {
expect(element(by.css('ion-navbar:first-child')).getText()).toEqual('Clickers');
});

it('has a menu button that displays the left menu', () => {
element(by.css('.bar-button-menutoggle')).click();
expect(element.all(by.css('.toolbar-title')).first().getText()).toEqual('Menu');
});

it('the left menu has a link with title Clickers', () => {
element(by.css('.bar-button-menutoggle')).click();
expect(element.all(by.css('ion-label')).first().getText()).toEqual('Clickers');
});

it('should display Clickers when Clickers link is selected', () => {
element(by.css('.bar-button-menutoggle')).click();
element.all(by.css('ion-label')).first().click();
clickerField.sendKeys('deal with protractor');
clickerButton.click();
expect(clickerList.getText()).toContain('deal with protractor');
});

it('the left menu has a link with title Goodbye Ionic', () => {
element(by.css('.bar-button-menutoggle')).click();
expect(element.all(by.css('ion-label')).last().getText()).toEqual('Goodbye Ionic');
});

it('should have correct text when Goodbye Ionic is selected', () => {
element(by.css('.bar-button-menutoggle')).click();
element.all(by.css('ion-label')).last().click();
expect(message.getText()).toEqual('Bye!');
});

it('has an input box for new Clickers', () => {
expect(element(by.css('.text-input')).isPresent()).toEqual(true);
});

it('should add a new Clicker to the page', () => {
clickerField.sendKeys('deal with protractor');
clickerButton.click();
expect(clickerList.getText()).toContain('deal with protractor');
});

it('should delete a Clicker from the page when delete button selected', () => {
clickerField.sendKeys('master angular');
clickerButton.click();
removeButton.click();
expect(clickerList.getText()).not.toContain('master angular');
});

});
4 changes: 2 additions & 2 deletions test/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
exports.config = {
baseUrl: 'http://localhost:5555',
baseUrl: 'http://localhost:8100',

specs: [
'build/e2e/**/*.e2e.js'
'e2e/app.js'
],
exclude: [],

Expand Down

0 comments on commit 440d463

Please sign in to comment.