mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2026-02-03 00:06:46 +08:00
Merged master --> 2.4.x.
This commit is contained in:
@@ -21,9 +21,9 @@ description: Take pictures with the device camera.
|
|||||||
# under the License.
|
# under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|Android|iOS| Windows 8.1 Store | Windows 8.1 Phone | Windows 10 Store | Travis CI |
|
|Android 4.4|Android 5.1|Android 6.0|iOS 9.3|iOS 10.0|Windows 10 Store|Travis CI|
|
||||||
|:-:|:-:|:-:|:-:|:-:|:-:|
|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|
||||||
|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-store,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-8.1-phone,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-camera/)|[](https://travis-ci.org/apache/cordova-plugin-camera)
|
|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-6.0,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-camera/)|[](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-camera/)|[](https://travis-ci.org/apache/cordova-plugin-camera)
|
||||||
|
|
||||||
# cordova-plugin-camera
|
# cordova-plugin-camera
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,13 @@
|
|||||||
-->
|
-->
|
||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
### 2.4.1 (Apr 27, 2017)
|
||||||
|
* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Updated build badges in `README`
|
||||||
|
* [CB-12650](https://issues.apache.org/jira/browse/CB-12650) Fix manual test for uploading image
|
||||||
|
* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
|
||||||
|
* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) (android) Appium tests: Bust **Android** 6 and 7 permission dialogs
|
||||||
|
* [CB-12618](https://issues.apache.org/jira/browse/CB-12618) (android) Appium tests: Handle native cling
|
||||||
|
|
||||||
### 2.4.0 (Feb 28, 2017)
|
### 2.4.0 (Feb 28, 2017)
|
||||||
* [CB-12501](https://issues.apache.org/jira/browse/CB-12501) **Android**: Appium tests don't use `XPath` selectors anymore
|
* [CB-12501](https://issues.apache.org/jira/browse/CB-12501) **Android**: Appium tests don't use `XPath` selectors anymore
|
||||||
* [CB-12469](https://issues.apache.org/jira/browse/CB-12469) Appium tests can now run on **iOS 10**
|
* [CB-12469](https://issues.apache.org/jira/browse/CB-12469) Appium tests can now run on **iOS 10**
|
||||||
|
|||||||
@@ -225,6 +225,40 @@ describe('Camera tests Android.', function () {
|
|||||||
})
|
})
|
||||||
.waitForDeviceReady()
|
.waitForDeviceReady()
|
||||||
.injectLibraries()
|
.injectLibraries()
|
||||||
|
.then(function () {
|
||||||
|
var options = {
|
||||||
|
quality: 50,
|
||||||
|
allowEdit: false,
|
||||||
|
sourceType: cameraConstants.PictureSourceType.SAVEDPHOTOALBUM,
|
||||||
|
saveToPhotoAlbum: false,
|
||||||
|
targetWidth: 210,
|
||||||
|
targetHeight: 210
|
||||||
|
};
|
||||||
|
return driver
|
||||||
|
.then(function () { return getPicture(options, true); })
|
||||||
|
.context(CONTEXT_NATIVE_APP)
|
||||||
|
// case insensitive select, will be handy with Android 7 support
|
||||||
|
.elementByXPath('//android.widget.Button[translate(@text, "alow", "ALOW")="ALLOW"]')
|
||||||
|
.click()
|
||||||
|
.fail(function noAlert() { })
|
||||||
|
.deviceKeyEvent(BACK_BUTTON)
|
||||||
|
.sleep(2000)
|
||||||
|
.elementById('action_bar_title')
|
||||||
|
.then(function () {
|
||||||
|
// success means we're still in native app
|
||||||
|
return driver
|
||||||
|
.deviceKeyEvent(BACK_BUTTON);
|
||||||
|
}, function () {
|
||||||
|
// error means we're already in webview
|
||||||
|
return driver;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
// doing it inside a function because otherwise
|
||||||
|
// it would not hook up to the webviewContext var change
|
||||||
|
// in the first methods of this chain
|
||||||
|
return driver.context(webviewContext);
|
||||||
|
})
|
||||||
.deleteFillerImage(fillerImagePath)
|
.deleteFillerImage(fillerImagePath)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
fillerImagePath = null;
|
fillerImagePath = null;
|
||||||
@@ -291,6 +325,7 @@ describe('Camera tests Android.', function () {
|
|||||||
pending('This test requires a functioning camera on the Android device/emulator, and this test suite\'s functional camera test failed on your target environment.');
|
pending('This test requires a functioning camera on the Android device/emulator, and this test suite\'s functional camera test failed on your target environment.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
afterAll(function (done) {
|
afterAll(function (done) {
|
||||||
checkSession(done);
|
checkSession(done);
|
||||||
driver
|
driver
|
||||||
@@ -390,7 +425,7 @@ describe('Camera tests Android.', function () {
|
|||||||
return driver
|
return driver
|
||||||
.elementByAndroidUIAutomator('new UiSelector().text("Choose video")')
|
.elementByAndroidUIAutomator('new UiSelector().text("Choose video")')
|
||||||
.fail(function () {
|
.fail(function () {
|
||||||
throw 'Couldn\'t find "Choose video" element.';
|
throw 'Couldn\'t find a "Choose video" element.';
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.deviceKeyEvent(BACK_BUTTON)
|
.deviceKeyEvent(BACK_BUTTON)
|
||||||
@@ -610,6 +645,15 @@ describe('Camera tests Android.', function () {
|
|||||||
.deviceKeyEvent(BACK_BUTTON)
|
.deviceKeyEvent(BACK_BUTTON)
|
||||||
.elementById('Apps')
|
.elementById('Apps')
|
||||||
.click()
|
.click()
|
||||||
|
.then(function () {
|
||||||
|
return driver
|
||||||
|
.elementByXPath('//android.widget.Button[@text="OK"]')
|
||||||
|
.click()
|
||||||
|
.fail(function () {
|
||||||
|
// no cling is all right
|
||||||
|
// it is not a brand new emulator, then
|
||||||
|
});
|
||||||
|
})
|
||||||
.elementByAndroidUIAutomator('new UiSelector().text("Gallery")')
|
.elementByAndroidUIAutomator('new UiSelector().text("Gallery")')
|
||||||
.click()
|
.click()
|
||||||
.elementByAndroidUIAutomator('new UiSelector().textContains("Pictures")')
|
.elementByAndroidUIAutomator('new UiSelector().textContains("Pictures")')
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ module.exports.checkPicture = function (pid, options, cb) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (result.indexOf('file:') === 0 ||
|
if (result.indexOf('file:') === 0 ||
|
||||||
result.indexOf('content:') === 0 ||
|
result.indexOf('content:') === 0 ||
|
||||||
@@ -184,6 +185,8 @@ module.exports.checkPicture = function (pid, options, cb) {
|
|||||||
} else {
|
} else {
|
||||||
verifyFile(entry);
|
verifyFile(entry);
|
||||||
}
|
}
|
||||||
|
}, function (err) {
|
||||||
|
errorCallback(err);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
displayImage(result);
|
displayImage(result);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cordova-plugin-camera",
|
"name": "cordova-plugin-camera",
|
||||||
"version": "2.4.0",
|
"version": "2.4.1",
|
||||||
"description": "Cordova Camera Plugin",
|
"description": "Cordova Camera Plugin",
|
||||||
"types": "./types/index.d.ts",
|
"types": "./types/index.d.ts",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
||||||
id="cordova-plugin-camera"
|
id="cordova-plugin-camera"
|
||||||
version="2.4.0">
|
version="2.4.1">
|
||||||
<name>Camera</name>
|
<name>Camera</name>
|
||||||
<description>Cordova Camera Plugin</description>
|
<description>Cordova Camera Plugin</description>
|
||||||
<license>Apache 2.0</license>
|
<license>Apache 2.0</license>
|
||||||
|
|||||||
14
tests/package.json
Normal file
14
tests/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "cordova-plugin-camera-tests",
|
||||||
|
"version": "2.4.1-dev",
|
||||||
|
"description": "",
|
||||||
|
"cordova": {
|
||||||
|
"id": "cordova-plugin-camera-tests",
|
||||||
|
"platforms": []
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"ecosystem:cordova"
|
||||||
|
],
|
||||||
|
"author": "",
|
||||||
|
"license": "Apache 2.0"
|
||||||
|
}
|
||||||
@@ -22,11 +22,11 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
||||||
id="cordova-plugin-camera-tests"
|
id="cordova-plugin-camera-tests"
|
||||||
version="2.4.0">
|
version="2.4.1">
|
||||||
<name>Cordova Camera Plugin Tests</name>
|
<name>Cordova Camera Plugin Tests</name>
|
||||||
<license>Apache 2.0</license>
|
<license>Apache 2.0</license>
|
||||||
|
|
||||||
<dependency id="cordova-plugin-file" version=">=2.0.0" />
|
<dependency id="cordova-plugin-file-transfer" />
|
||||||
|
|
||||||
<js-module src="tests.js" name="tests">
|
<js-module src="tests.js" name="tests">
|
||||||
</js-module>
|
</js-module>
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
|
|||||||
ft.onprogress = function (progressEvent) {
|
ft.onprogress = function (progressEvent) {
|
||||||
console.log('progress: ' + progressEvent.loaded + ' of ' + progressEvent.total);
|
console.log('progress: ' + progressEvent.loaded + ' of ' + progressEvent.total);
|
||||||
};
|
};
|
||||||
var server = "http://cordova-filetransfer.jitsu.com";
|
var server = "http://sheltered-retreat-43956.herokuapp.com";
|
||||||
|
|
||||||
ft.upload(pictureUrl, server + '/upload', win, fail, options);
|
ft.upload(pictureUrl, server + '/upload', win, fail, options);
|
||||||
function win(information_back) {
|
function win(information_back) {
|
||||||
|
|||||||
Reference in New Issue
Block a user