Skip to content

Commit

Permalink
make e2e test runnable
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Nov 1, 2018
1 parent 276dc6f commit ca6515d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
9 changes: 5 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"use strict";

let gulp = require('gulp'),
boilerplate = require('appium-gulp-plugins').boilerplate.use(gulp);
const gulp = require('gulp');
const boilerplate = require('appium-gulp-plugins').boilerplate.use(gulp);

boilerplate({
build: 'appium-adb',
jscs: false,
e2eTest: { android: true }
testTimeout: 120000,
e2eTest: { android: true },
eslint: true,
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"watch": "gulp watch",
"build": "gulp transpile",
"mocha": "mocha",
"e2e-test": "gulp e2e-test",
"e2e-test": "gulp transpile && mocha --timeout 600000 build/test/functional/",
"coverage": "gulp coveralls",
"precommit-msg": "echo 'Pre-commit checks...' && exit 0",
"precommit-test": "REPORTER=dot gulp once",
Expand Down
Binary file modified test/fixtures/selendroid-test-app.apk
Binary file not shown.
6 changes: 6 additions & 0 deletions test/functional/adb-commands-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let expect = chai.expect;
const IME = 'com.example.android.softkeyboard/.SoftKeyboard',
defaultIMEs = [
'com.android.inputmethod.latin/.LatinIME',
'com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME',
'io.appium.android.ime/.UnicodeIME',
],
contactManagerPath = path.resolve(rootDir, 'test',
Expand Down Expand Up @@ -105,6 +106,7 @@ describe('adb commands', function () {
it('should get device locale', async function () {
if (parseInt(apiLevel, 10) < 23) return this.skip(); // eslint-disable-line curly

await adb.setDeviceSysLocaleViaSettingApp('en', 'US');
['us', 'en', 'ca_en', 'en-US'].should.contain(await adb.getDeviceLocale());
});
it('should forward the port', async function () {
Expand Down Expand Up @@ -156,10 +158,14 @@ describe('adb commands', function () {
(await adb.isWifiOn()).should.be.false;
});
it('should be able to turn off animation @skip-ci', async function () {
await adb.grantPermission('io.appium.settings', 'android.permission.SET_ANIMATION_SCALE');

await adb.setAnimationState(false);
(await adb.isAnimationOn()).should.be.false;
});
it('should be able to turn on animation @skip-ci', async function () {
await adb.grantPermission('io.appium.settings', 'android.permission.SET_ANIMATION_SCALE');

await adb.setAnimationState(true);
(await adb.isAnimationOn()).should.be.true;
});
Expand Down
7 changes: 5 additions & 2 deletions test/functional/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ const API_LEVEL_MAP = {
'6': '23',
'7': '24',
'7.1': '25',
'8.0': '26',
'8.1': '27',
'9.0': '28',
};

const avdName = process.env.ANDROID_AVD || 'NEXUS_S_18_X86';
const platformVersion = process.env.PLATFORM_VERSION || '4.3';
const avdName = process.env.ANDROID_AVD || 'Nexus 5X API 27';
const platformVersion = process.env.PLATFORM_VERSION || '8.1';

let apiLevel = process.env.API_LEVEL ||
API_LEVEL_MAP[parseFloat(platformVersion).toString()];
Expand Down

0 comments on commit ca6515d

Please sign in to comment.