Skip to content

Commit

Permalink
clarify some language around tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjson committed Apr 4, 2016
1 parent 953c971 commit c3cbe5d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"scripts": {
"test": "npm install; tests/setupTests.sh"
"test:ios": "npm install; tests/setupTestsiOS.sh"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,6 @@ Code | Name | Description
Type definitions for cordova-plugin-qrscanner are [available in the DefinitelyTyped project](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/cordova-plugin-qrscanner/cordova-plugin-qrscanner.d.ts).

## Contributing & Testing
To setup the tests, run `npm test`. This will create a new cordova project in the same directory as this repo, install cordova-plugin-qrscanner, and configure the [Cordova Plugin Test Framework](https://github.com/apache/cordova-plugin-test-framework).
To setup the tests, run `npm test:ios`. This will create a new cordova project in the same directory as this repo, install cordova-plugin-qrscanner, and configure the [Cordova Plugin Test Framework](https://github.com/apache/cordova-plugin-test-framework).

Both Automatic Tests (via Cordova Plugin Test Framework's built-in [Jasmine](https://github.com/jasmine/jasmine)) and Manual Tests are available. Automatic tests confirm the existence and expected structure of the javascript API, and manual tests should be used to confirm functionality on each platform.
2 changes: 2 additions & 0 deletions tests/setupTests.sh → tests/setupTestsiOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ sed 's/index\.html/cdvtests\/index\.html/' config.xml.tmp > config.xml.tmp2
sed 's/<platform name="ios">/<platform name="ios"><hook type="after_platform_add" src="plugins\/cordova-plugin-qrscanner\/scripts\/swift-support\.js" \/>/' config.xml.tmp2 > config.xml
rm config.xml.tmp config.xml.tmp2

npm install xcode

cordova platform add ios
cordova build ios

Expand Down
4 changes: 2 additions & 2 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ exports.defineManualTests = function(contentEl, createActionButton) {
var showBtn = 'QRScanner.show()';
qrscanner_tests += '<h3>Show QRScanner</h3>' +
'<div id="showBtn"></div>' +
'Expected result: Should clear background of provided html element and all parents (making the QRScanner layer visible through this webview).';
'Expected result: Should clear background of the body and html elements (making the QRScanner layer visible through this webview).';
var show = function() {
window.QRScanner.show(function(status) {
log(showBtn, null, status, 'webviewBackgroundIsTransparent');
Expand Down Expand Up @@ -136,7 +136,7 @@ exports.defineManualTests = function(contentEl, createActionButton) {
var startScan = function(pause){
console.log('scanning...');
window.QRScanner.scan(function(err, result) {
console.error('QRScanner.scan() callback returned.');
console.log('QRScanner.scan() callback returned.');
if(err){
console.error(err);
} else {
Expand Down

0 comments on commit c3cbe5d

Please sign in to comment.