Skip to content

Commit

Permalink
[CM-3489] Added splashscreen tests to autotest or mobilespec
Browse files Browse the repository at this point in the history
- created splashscreen jasmine tests
- created splashscreen html page to launch tests
- added splashscreen tests to all page
  • Loading branch information
ldeluca authored and filmaj committed Jun 20, 2013
1 parent 950c42e commit a0c2690
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions autotest/index.html
Expand Up @@ -53,6 +53,7 @@ <h1>Cordova API Specs</h1>
<a href="pages/platform.html" class="btn large" style="width:100%;">Run Platform Tests</a>
<a href="pages/storage.html" class="btn large" style="width:100%;">Run Storage Tests</a>
<a href="pages/bridge.html" class="btn large" style="width:100%;">Run Bridge Tests</a>
<a href="pages/splashscreen.html" class="btn large" style="width:100%;">Run Splashscreen Tests</a>

<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
</body>
Expand Down
1 change: 1 addition & 0 deletions autotest/pages/all.html
Expand Up @@ -61,6 +61,7 @@
<script type="text/javascript" src="../tests/notification.tests.js"></script>
<script type="text/javascript" src="../tests/platform.tests.js"></script>
<script type="text/javascript" src="../tests/storage.tests.js"></script>
<script type="text/javascript" src="../tests/splashscreen.tests.js"></script>

<script type="text/javascript">
var root, temp_root, persistent_root;
Expand Down
71 changes: 71 additions & 0 deletions autotest/pages/splashscreen.html
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->


<html>

<head>
<title>Cordova: Splashscreen API Specs</title>

<meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes, initial-scale=1.0;" />
<!-- Load jasmine -->
<link href="../jasmine.css" rel="stylesheet"/>
<script type="text/javascript" src="../jasmine.js"></script>
<script type="text/javascript" src="../html/HtmlReporterHelpers.js"></script>
<script type="text/javascript" src="../html/HtmlReporter.js"></script>
<script type="text/javascript" src="../html/ReporterView.js"></script>
<script type="text/javascript" src="../html/SpecView.js"></script>
<script type="text/javascript" src="../html/SuiteView.js"></script>
<script type="text/javascript" src="../html/TrivialReporter.js"></script>

<!-- Source -->
<script type="text/javascript" src="../../cordova-incl.js"></script>

<!-- Load Test Runner -->
<script type="text/javascript" src="../test-runner.js"></script>

<!-- Tests -->
<script type="text/javascript" src="../tests/splashscreen.tests.js"></script>

<script type="text/javascript">
document.addEventListener('deviceready', function () {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;

var htmlReporter = new jasmine.HtmlReporter();

jasmineEnv.addReporter(htmlReporter);

jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};

jasmineEnv.execute();
}, false);
</script>
</head>

<body>
<a href="javascript:" class="backBtn" onclick="backHome();">Back</a>
</body>
</html>

36 changes: 36 additions & 0 deletions autotest/tests/splashscreen.tests.js
@@ -0,0 +1,36 @@
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/

describe('Splashscreen (cordova)', function () {
it("splashscreen.spec.1 should exist", function() {
expect(navigator.splashscreen).toBeDefined();
});

it("splashscreen.spec.2 exec method should exist", function() {
expect(navigator.splashscreen.show).toBeDefined();
expect(typeof navigator.splashscreen.show).toBe('function');
});

it("splashscreen.spec.2 exec method should exist", function() {
expect(navigator.splashscreen.hide).toBeDefined();
expect(typeof navigator.splashscreen.hide).toBe('function');
});
});

0 comments on commit a0c2690

Please sign in to comment.