1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | exports.defineAutoTests = function () {
|
25 | describe('Splashscreen (cordova)', function () {
|
26 | it("splashscreen.spec.1 should exist", function () {
|
27 | expect(navigator.splashscreen).toBeDefined();
|
28 | });
|
29 |
|
30 | it("splashscreen.spec.2 show method should exist", function () {
|
31 | expect(navigator.splashscreen.show).toBeDefined();
|
32 | expect(typeof navigator.splashscreen.show).toBe('function');
|
33 | });
|
34 |
|
35 | it("splashscreen.spec.3 hide method should exist", function () {
|
36 | expect(navigator.splashscreen.hide).toBeDefined();
|
37 | expect(typeof navigator.splashscreen.hide).toBe('function');
|
38 | });
|
39 | });
|
40 | };
|
41 |
|
42 | exports.defineManualTests = function (contentEl, createActionButton) {
|
43 | function showFor(duration) {
|
44 | navigator.splashscreen.show();
|
45 | window.setTimeout(function () {
|
46 | navigator.splashscreen.hide();
|
47 | }, 1000 * duration);
|
48 | }
|
49 |
|
50 | contentEl.innerHTML = '<h1>Splashscreen Tests</h1>' +
|
51 | '<h3>Note for WP: AutoHideSplashScreen must be set to false in config.xml</h3>' +
|
52 | '<div id="show1"></div>' +
|
53 | 'Expected result: Will show the Cordova splashscreen for 1 second' +
|
54 | '</p> <div id="show5"></div>' +
|
55 | 'Expected result: Will show the Cordova splashscreen for 5 seconds';
|
56 |
|
57 | createActionButton('Show for 1 second', function () {
|
58 | showFor(1);
|
59 | }, 'show1');
|
60 |
|
61 | createActionButton('Show for 5 seconds', function () {
|
62 | showFor(5);
|
63 | }, 'show5');
|
64 | };
|