From 530168fca0a93ebb8117b5c1dd7bcd666d74cbb9 Mon Sep 17 00:00:00 2001 From: Juan Cook Date: Mon, 9 Nov 2015 18:28:17 -0300 Subject: [PATCH 1/3] new file blank --- client/demo/ex/assignment1/index.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 client/demo/ex/assignment1/index.html diff --git a/client/demo/ex/assignment1/index.html b/client/demo/ex/assignment1/index.html new file mode 100644 index 0000000..efcef94 --- /dev/null +++ b/client/demo/ex/assignment1/index.html @@ -0,0 +1,23 @@ + + + + + + + + + +
+
dasdasdas +

Text Analyzer

d + +

Stats

+

Chars: {{text.length}} Words: {{(text.split(' ')).length}}

+
    +
  • {{word | uppercase}}
  • +
+
+
+ + + From a7f091f15a70ab47c45337a36436db89766605ef Mon Sep 17 00:00:00 2001 From: Juan Cook Date: Tue, 10 Nov 2015 16:31:14 -0300 Subject: [PATCH 2/3] assign1 almost finish --- client/demo/ex/assignment1/index.html | 116 +++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 11 deletions(-) diff --git a/client/demo/ex/assignment1/index.html b/client/demo/ex/assignment1/index.html index efcef94..ed960e4 100644 --- a/client/demo/ex/assignment1/index.html +++ b/client/demo/ex/assignment1/index.html @@ -5,19 +5,113 @@ + Expense App Assignment1 -
-
dasdasdas -

Text Analyzer

d - -

Stats

-

Chars: {{text.length}} Words: {{(text.split(' ')).length}}

-
    -
  • {{word | uppercase}}
  • -
-
+
+

Expenses

+
+ +
+

Create Expense

+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + +
DateTypeDescriptionAmount
{{ exp.date | date: 'dd/MM/yy'}}{{ exp.type }}{{ exp.description }}{{ exp.amount }} + + +
+
+
+

Totals by Type

+
+ + + + + + + + + + + +
TypeTotal
{{type}}{{ exp.amount + total }} +
+
+
+

Total All Types

+
+
+

{{ exp.amount + total}}

+
+
+
- From ade3e52c4a96eaf286a7245314dcca51639f51ea Mon Sep 17 00:00:00 2001 From: Juan Cook Date: Mon, 23 Nov 2015 17:36:09 -0300 Subject: [PATCH 3/3] finished test and assignment1 --- client/demo/ex/assignment1/index.html | 8 +-- e2e/ex/main.spec.js | 76 +++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 e2e/ex/main.spec.js diff --git a/client/demo/ex/assignment1/index.html b/client/demo/ex/assignment1/index.html index ed960e4..02734b7 100644 --- a/client/demo/ex/assignment1/index.html +++ b/client/demo/ex/assignment1/index.html @@ -57,7 +57,7 @@

Create Expense

- +
@@ -66,18 +66,18 @@

Create Expense

- +
Date Type
{{ exp.date | date: 'dd/MM/yy'}}{{ exp.date | date: 'MM/dd/yy'}} {{ exp.type }} {{ exp.description }} {{ exp.amount }} - - diff --git a/e2e/ex/main.spec.js b/e2e/ex/main.spec.js new file mode 100644 index 0000000..2854682 --- /dev/null +++ b/e2e/ex/main.spec.js @@ -0,0 +1,76 @@ +'use strict'; + +describe('Expenses app', function () { + var page; + beforeEach(function () { + browser.get('/demo/ex/assignment1/'); + page = {}; + }); + + it('should include H1 title', function () { + expect(element(by.tagName('h1')).getText()).to.eventually.equal('Expenses'); + }); + + it('should add/edit/delete an item from/to the table', function () { + page.date = element(by.model('expense.date')); + page.date.sendKeys('09/06/1988'); + + page.type = element(by.cssContainingText('option', 'transportation')).click(); + page.description = element(by.model('expense.description')).sendKeys('Testing Expense'); + page.amount = element(by.model('expense.amount')).sendKeys('1000'); + + page.button = element(by.id('create-button')); + page.button.click(); + + //Quantity + var items = element.all(by.repeater('exp in expensGIT STATUes track by exp.id')); + expect(items.count()).to.eventually.equal(1); + + //Check content + element(by.css('.table.items')).all(by.css('tbody tr')).then(function (rows) { + return rows[0].$$('td').then(function (cols) { + expect(cols[0].getText()).to.eventually.equal('09/06/88'); + expect(cols[1].getText()).to.eventually.equal('transportation'); + expect(cols[2].getText()).to.eventually.equal('Testing Expense'); + expect(cols[3].getText()).to.eventually.equal('1000'); + }); + }); + + //Check if fields were cleaned + expect(page.date.getAttribute('value')).to.eventually.equal(''); + expect(page.description.getAttribute('value')).to.eventually.equal(''); + expect(page.amount.getAttribute('value')).to.eventually.equal(''); + + //Edit + var items = element.all(by.repeater('exp in expenses track by exp.id')); + items.first().then(function () { + page.button = element(by.css('.edit-expense')); + page.button.click(); + }); + + page.date = element(by.model('expense.date')); + page.date.sendKeys('01/01/2015'); + + page.button = element(by.id('update-button')); + page.button.click(); + + element(by.css('.table.items')).all(by.css('tbody tr')).then(function (rows) { + return rows[0].$$('td').then(function (cols) { + expect(cols[0].getText()).to.eventually.equal('01/01/15'); + expect(cols[1].getText()).to.eventually.equal('transportation'); + expect(cols[2].getText()).to.eventually.equal('Testing Expense'); + expect(cols[3].getText()).to.eventually.equal('1000'); + }); + }); + + //Delete + var items = element.all(by.repeater('exp in expenses track by exp.id')); + items.first().then(function () { + page.button = element(by.css('.delete-expense')); + page.button.click(); + }); + + expect(element.all(by.repeater('exp in expenses track by exp.id')).count()).to.eventually.equal(0); + }); + +});