forked from SchizoDuckie/DuckieTV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFavoritesService.spec.js
46 lines (36 loc) · 1.51 KB
/
FavoritesService.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
describe("Favorites Tests", function() {
var page = require('./Favorites');
var util = require('util');
browser.get('/duckietv');
browser.manage().logs().get('browser').then(function(browserLog) {
console.log('browser log: ' + util.inspect(browserLog));
});
it("Should be showing the favorites page with the search box", function() {
browser.wait(function() {
if (!browser.isElementPresent(page.getSeriesList())) {
return page.getDrawer().click();
}
return true;
}, 10000);
expect(browser.isElementPresent(page.getSearchBox())).toBeTruthy();
});
it("should execute a cached search with 11 results upon typing 'doctor who'", function() {
element(page.getSearchBox()).sendKeys('doctor who');
expect(page.getSearchResults().then(function(elements) {
return elements.length;
})).toEqual(11);
});
it("Should start adding 'Doctor Who 2005' when clicking it", function() {
page.getSearchResults().then(function(elements) {
elements[1].click();
expect(page.getDoctorWhoAddingEarmark().isDisplayed()).toBeTruthy();
});
});
it("Should result in an 'added' check mark on 'Doctor Who 2005' has finished", function() {
page.getSearchResults().then(function(elements) {
browser.wait(function() {
expect(page.getDoctorWhoAddedEarmark().isDisplayed()).toBeTruthy();
}, 60000);
});
});
});