-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
63 lines (55 loc) · 2.15 KB
/
test.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
test('Has the Search button been clicked. You have to physically click the search button within the first 2 seconds to make this test pass', function(assert) {
var done = assert.async();
setTimeout (function(){
var submitButton = document.getElementById('search');
submitButton.addEventListener("click", function(){
clicked = true;
});
assert.equal( clicked, true, 'Search Button has been clicked' );
done();
},2000);
});
test('Have Instagram results been returned when search is clicked', function(assert) {
var done = assert.async();
var check = false;
setTimeout (function(){
if(document.getElementsByTagName('img')){
check = true;
}
assert.equal( check, true, 'Instagram Images are showing' );
done();
},1000);
});
test("This is an auto search test, user will not need to click search button for this test to pass. It will automatically return Instagram results with foifighters.", function(assert) {
var done = assert.async();
setTimeout(function(){
// clickfunc();
// console.log(clickfunc());
assert.equal(clickfunc(),'foifighters','Instagram search returns six photos with the entered search result');
done();
},1000);
});
test('Have Soundcloud results been returned when search is clicked', function(assert) {
var done = assert.async();
var check = false;
setTimeout (function(){
console.log (document.getElementById("track").innerHTML);
if(document.getElementById("track").innerHTML){
check = true;
}
assert.equal( check, true, 'Soundcloud Track is available for play' );
done();
},1000);
});
test('Has the Soundcloud Play button been clicked?, User will need to manually click the play button for this test to pass. ', function(assert) {
var clicked = false;
var done = assert.async();
var playTest = document.getElementById('play');
playTest.addEventListener("click", function(){
clicked = true;
});
setTimeout (function(){
assert.equal( clicked, true, 'Play Button has been clicked' );
done();
},5000);
});