This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 193
/
sherlocked.js
138 lines (113 loc) · 3.87 KB
/
sherlocked.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Visual regression test script for Sherlocked.
var ROOT = 'http://localhost:' + require('./config').PORT + '/';
function mobile(client, path) {
return client
.setViewportSize({width: 320, height: 960})
.url(ROOT + (path || ''));
}
function desktop(client, path) {
return client
.setViewportSize({width: 1050, height: 2048})
.url(ROOT + (path || ''));
}
require('sherlocked')
.investigate('Home Page on Mobile', function(client) {
return mobile(client)
.waitForExist('.feed-home', 60000);
})
.investigate('Home Page on Desktop', function(client) {
return desktop(client)
.waitForExist('.feed-home', 60000);
})
.investigate('Home Page on Mobile RTL', function(client) {
return mobile(client, '?lang=ar')
.waitForExist('.feed-home', 60000);
})
.investigate('Home Page on Desktop RTL', function(client) {
return desktop(client, '?lang=ar')
.waitForExist('.feed-home', 60000);
})
.investigate('Collection on Mobile', function(client) {
return mobile(client, 'feed/editorial/brand-list')
.waitForExist('.app-list', 60000);
})
.investigate('Collection on Desktop', function(client) {
return desktop(client, 'feed/editorial/brand-list')
.waitForExist('.app-list', 60000);
})
.investigate('Popular Page on Mobile', function(client) {
return mobile(client, 'popular')
.waitForExist('.app-list', 60000);
})
.investigate('Popular Page on Desktop', function(client) {
return desktop(client, 'popular')
.waitForExist('.app-list', 60000);
})
.investigate('App Detail on Mobile', function(client) {
return mobile(client, 'app/swanky-chocolate-9')
.waitForExist('.mkt-tile', 60000);
})
.investigate('App Detail on Desktop', function(client) {
return desktop(client, 'app/swanky-chocolate-9')
.waitForExist('.mkt-tile', 60000);
})
.investigate('App Detail on Mobile RTL', function(client) {
return mobile(client, 'app/drôle-sandwich-2?lang=ar')
.waitForExist('.mkt-tile', 60000);
})
.investigate('App Detail on Desktop RTL', function(client) {
return desktop(client, 'app/drôle-sandwich-2?lang=ar')
.waitForExist('.mkt-tile', 60000);
})
.investigate('Reviews on Mobile', function(client) {
return mobile(client, 'app/swanky-chocolate-9/ratings')
.waitForExist('.review', 60000);
})
.investigate('Reviews on Desktop', function(client) {
return desktop(client, 'app/swanky-chocolate-9/ratings')
.waitForExist('.review', 60000);
})
.investigate('Category on Mobile', function(client) {
return mobile(client, 'category/music')
.waitForExist('.app-list', 60000);
})
.investigate('Category on Desktop', function(client) {
return desktop(client, 'category/music')
.waitForExist('.app-list', 60000);
})
.investigate('Category menu on Mobile', function(client) {
return mobile(client)
.waitForExist('.feed-home', 60000)
.click('mkt-nav-toggle[for=nav]')
.click('mkt-nav-child-toggle[for=categories]');
})
.investigate('Category menu on Desktop', function(client) {
return desktop(client)
.waitForExist('.feed-home', 60000)
.click('mkt-header-child-toggle[for=header--categories]');
})
.investigate('Category menu on Mobile RTL', function(client) {
return mobile(client, '?lang=ar')
.waitForExist('.feed-home', 60000)
.click('mkt-nav-toggle[for=nav]')
.click('mkt-nav-child-toggle[for=categories]');
})
.investigate('Category menu on Desktop RTL', function(client) {
return desktop(client, '?lang=ar')
.waitForExist('.feed-home', 60000)
.click('mkt-header-child-toggle[for=header--categories]');
})
.begin([
{
browserName: 'firefox',
platform: 'OS X 10.9'
},
{
browserName: 'chrome',
platform: 'OS X 10.9'
},
{
browserName: 'safari',
platform: 'OS X 10.9'
}
]);