Compare commits

...

6 Commits

Author SHA1 Message Date
Sefa Ilkimen
a4f121728c release v2.3.1 2019-12-14 04:36:31 +01:00
Sefa Ilkimen
21d991b04e chore: setup testing android version on BrowserStack 2019-12-14 04:09:11 +01:00
Sefa Ilkimen
31b1eee355 chore: update version and changelog 2019-12-14 02:15:49 +01:00
Sefa Ilkimen
3d1b195831 Merge pull request #275 from ath0mas/patch-1
Fix WebStorageCookieStore getAllCookies()
2019-12-14 02:08:23 +01:00
Alexis THOMAS
014753e127 fix(cookieStore): error in getAllCookies
typo in Array.prototype call was throwing a TypeError
2019-12-05 15:38:30 +01:00
Sefa Ilkimen
5ee26bc2cc Update badges in readme 2019-12-02 02:46:21 +01:00
13 changed files with 78 additions and 11 deletions

View File

@@ -36,6 +36,9 @@ jobs:
build-android:
runs-on: ubuntu-latest
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
- uses: actions/checkout@v1
- name: Install Node.js ${{ env.nodejs }}
@@ -53,4 +56,8 @@ jobs:
- name: Add workaround for mipsel reference
run: sudo mkdir -p $ANDROID_HOME/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64
- name: Build test app
run: scripts/build-test-app.sh --android --emulator
run: scripts/build-test-app.sh --android --device
- name: Upload artifact to BrowserStack
run: scripts/upload-browserstack.sh --android
- name: Run e2e tests
run: scripts/test-app.sh --android --device

View File

@@ -27,7 +27,7 @@ matrix:
- npm run testjs &&
npm run updatecert &&
scripts/build-test-app.sh --ios --emulator &&
scripts/upload-artifact.sh --ios &&
scripts/upload-saucelabs.sh --ios &&
scripts/test-app.sh --ios --emulator;
- name: "Android Build & Test"
@@ -55,5 +55,5 @@ matrix:
- npm run testjs &&
npm run updatecert &&
scripts/build-test-app.sh --android --emulator &&
scripts/upload-artifact.sh --android &&
scripts/upload-saucelabs.sh --android &&
scripts/test-app.sh --android --emulator;

View File

@@ -1,5 +1,9 @@
# Changelog
## 2.3.1
- Fixed #275: getAllCookies() is broken because of a typo (thanks ath0mas)
## 2.3.0
- Feature #101: Support "multipart/form-data" requests (thanks SDA SE Open Industry Solutions)

View File

@@ -1,8 +1,8 @@
Cordova Advanced HTTP
=====================
[![npm version](https://badge.fury.io/js/cordova-plugin-advanced-http.svg)](https://badge.fury.io/js/cordova-plugin-advanced-http)
[![npm version](https://img.shields.io/npm/v/cordova-plugin-advanced-http)](https://www.npmjs.com/package/cordova-plugin-advanced-http?activeTab=versions)
[![MIT Licence](https://img.shields.io/badge/license-MIT-blue?style=flat)](https://opensource.org/licenses/mit-license.php)
[![downloads/month](https://img.shields.io/npm/dm/cordova-plugin-advanced-http.svg)](https://www.npmjs.com/package/cordova-plugin-advanced-http)
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.png)](https://opensource.org/licenses/mit-license.php)
[![Travis Build Status](https://img.shields.io/travis/silkimen/cordova-plugin-advanced-http/master?label=Travis%20CI)](https://travis-ci.org/silkimen/cordova-plugin-advanced-http)
[![GitHub Build Status](https://img.shields.io/github/workflow/status/silkimen/cordova-plugin-advanced-http/Cordova%20HTTP%20Plugin%20CI/master?label=GitHub%20Actions)](https://github.com/silkimen/cordova-plugin-advanced-http/actions)

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-advanced-http",
"version": "2.3.0",
"version": "2.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-advanced-http",
"version": "2.3.0",
"version": "2.3.1",
"description": "Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning",
"scripts": {
"updatecert": "node ./scripts/update-e2e-server-cert.js && node ./scripts/update-e2e-client-cert.js",

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-advanced-http" version="2.3.0">
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-advanced-http" version="2.3.1">
<name>Advanced HTTP plugin</name>
<description>
Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning

33
scripts/upload-browserstack.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -e
PLATFORM=$([[ "${@#--android}" = "$@" ]] && echo "ios" || echo "android")
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ..; pwd )"
TEMP=$ROOT/temp
if [ -z $BROWSERSTACK_USERNAME ] || [ -z $BROWSERSTACK_ACCESS_KEY ]; then
echo "Skipping uploading artifact, because BrowserStack credentials are not set.";
exit 0;
fi
if [ $PLATFORM = "android" ]; then
curl -u $BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY \
-X POST \
https://api-cloud.browserstack.com/app-automate/upload \
-F "file=@$TEMP/platforms/android/app/build/outputs/apk/debug/app-debug.apk" \
-F "data={\"custom_id\": \"HttpTestAppAndroid\"}"
else
rm -rf $TEMP/HttpDemo.ipa
pushd $TEMP/platforms/ios/build/emulator
rm -rf ./Payload
mkdir -p ./Payload
cp -r ./HttpDemo.app ./Payload/HttpDemo.app
zip -r $TEMP/HttpDemo.ipa ./Payload
popd
curl -u $BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY \
-X POST \
https://api-cloud.browserstack.com/app-automate/upload \
-F "file=@$TEMP/HttpDemo.ipa" \
-F "data={\"custom_id\": \"HttpTestAppIos\"}"
fi

View File

@@ -56,11 +56,28 @@ const configs = {
deviceName: 'Android Emulator',
autoWebview: true,
app: 'sauce-storage:HttpDemo.apk'
},
// testing on BrowserStack
browserstackIosDevice: {
device: 'iPhone 7',
os_version: '10',
project: 'HTTP Test App',
autoWebview: true,
app: 'HttpTestAppAndroid'
},
browserstackAndroidDevice: {
device: 'Google Nexus 9',
os_version: '5.1',
project: 'HTTP Test App',
autoWebview: true,
app: 'HttpTestAppAndroid'
}
};
function getCaps(environment, os, runtime) {
const key = environment.toLowerCase() + capitalize(os) + capitalize(runtime);
console.log(key);
const caps = configs[key];
caps.name = `cordova-plugin-advanced-http (${os})`;

View File

@@ -9,6 +9,11 @@ const configs = {
host: 'ondemand.saucelabs.com',
port: 80,
auth: process.env.SAUCE_USERNAME + ":" + process.env.SAUCE_ACCESS_KEY
},
browserstack: {
host: 'hub-cloud.browserstack.com',
port: 80,
auth: process.env.BROWSERSTACK_USERNAME + ":" + process.env.BROWSERSTACK_ACCESS_KEY
}
}

View File

@@ -12,12 +12,13 @@ global.should = chai.should();
describe('Advanced HTTP e2e test suite', function () {
const isSauceLabs = !!process.env.SAUCE_USERNAME;
const isBrowserStack = !!process.env.BROWSERSTACK_USERNAME;
const isVerbose = process.argv.includes('--verbose');
const isDevice = process.argv.includes('--device');
const isAndroid = process.argv.includes('--android');
const targetInfo = { isSauceLabs, isDevice, isAndroid };
const environment = isSauceLabs ? 'saucelabs' : 'local';
const targetInfo = { isSauceLabs, isBrowserStack, isDevice, isAndroid };
const environment = isSauceLabs ? 'saucelabs' : isBrowserStack ? 'browserstack' : 'local';
let driver;
let allPassed = true;

View File

@@ -146,7 +146,7 @@ module.exports = function init(ToughCookie, _) {
Object.keys(store).forEach(function (domain) {
Object.keys(store[domain]).forEach(function (path) {
Array.protype.push.apply(cookies, _.values(store[domain][path]));
Array.prototype.push.apply(cookies, _.values(store[domain][path]));
});
});