Skip to content

Commit d47e0b5

Browse files
committed
Added one more test for protractor re SchizoDuckie#248
1 parent 6911cb9 commit d47e0b5

File tree

1 file changed

+17
-28
lines changed

1 file changed

+17
-28
lines changed

tests/FavoritesService.spec.js

+17-28
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
describe("Favorites Tests", function() {
22

33
var page = require('./Favorites');
4+
var util = require('util');
45
browser.get('/duckietv');
56

7+
browser.manage().logs().get('browser').then(function(browserLog) {
8+
console.log('browser log: ' + util.inspect(browserLog));
9+
});
10+
611
it("Should be showing the favorites page with the search box", function() {
712
browser.wait(function() {
813
if (!browser.isElementPresent(page.getSeriesList())) {
@@ -20,38 +25,22 @@ describe("Favorites Tests", function() {
2025
})).toEqual(11);
2126
});
2227

28+
it("Should start adding 'Doctor Who 2005' when clicking it", function() {
29+
page.getSearchResults().then(function(elements) {
30+
elements[1].click();
31+
expect(page.getDoctorWhoAddingEarmark().isDisplayed()).toBeTruthy();
2332

24-
/*
25-
it("Should wipe the existing form when clicking 'wis formulier'", function() {
26-
page.wipeForm();
27-
expect(element.all(by.css("form fieldset table tbody tr td input[name=number]")).count()).toEqual(1);
28-
29-
page.getSamples().then(function(samples) {
30-
element.all(by.binding('data.project.samples')).then(function(res) {
31-
expect(res.length).toEqual(0);
32-
});
33-
})
33+
});
3434
});
3535

36+
it("Should result in an 'added' check mark on 'Doctor Who 2005' has finished", function() {
37+
page.getSearchResults().then(function(elements) {
38+
browser.wait(function() {
39+
expect(page.getDoctorWhoAddedEarmark().isDisplayed()).toBeTruthy();
40+
}, 60000);
41+
});
42+
});
3643

37-
var randomAmount = 5;
38-
it("should be able to add a random amount (" + randomAmount + ") of samples", function() {
39-
40-
page.getClientReference().sendKeys('Automated ' + new Date().toDateString());
41-
page.getLocation().sendKeys('Samson-IT Rijswijk');
42-
page.getNote().sendKeys("Automated test project " + new Date().toString());
43-
44-
for (var i = 0; i < randomAmount; i++) {
45-
page.addSample(i, page.getRandomSampleType());
46-
if (i < randomAmount - 1) {
47-
page.getAddSampleButton().click();
48-
}
49-
}
50-
51-
52-
})
53-
54-
*/
5544

5645

5746
});

0 commit comments

Comments
 (0)