Update eslint-config-appium to the latest version 🚀 (#11952)

* chore(package): update eslint-config-appium to version 4.0.1

* chore: fix linting

* chore: rebase and done
This commit is contained in:
greenkeeper[bot]
2019-01-08 08:43:50 -05:00
committed by Isaac A. Murchie
parent 97f324a58b
commit 10753839a9
21 changed files with 403 additions and 402 deletions

View File

@@ -1,9 +1,9 @@
const path = require('path');
if (process.env.SAUCE_LABS) {
exports.iosTestApp = "http://appium.github.io/appium/assets/TestApp7.1.app.zip";
exports.androidApiDemos = "http://appium.github.io/appium/assets/ApiDemos-debug.apk";
exports.iosTestApp = 'http://appium.github.io/appium/assets/TestApp7.1.app.zip';
exports.androidApiDemos = 'http://appium.github.io/appium/assets/ApiDemos-debug.apk';
} else {
exports.iosTestApp = path.resolve(__dirname, "..", "..", "apps", "TestApp.app.zip");
exports.androidApiDemos = path.resolve(__dirname, "..", "..", "apps", "ApiDemos-debug.apk");
exports.iosTestApp = path.resolve(__dirname, '..', '..', 'apps', 'TestApp.app.zip');
exports.androidApiDemos = path.resolve(__dirname, '..', '..', 'apps', 'ApiDemos-debug.apk');
}

View File

@@ -1,29 +1,29 @@
const iosCaps = {
platformName: "iOS",
automationName: "XCUITest",
deviceName: process.env.IOS_DEVICE_NAME || "iPhone 6s",
platformVersion: process.env.IOS_PLATFORM_VERSION || "12.1",
platformName: 'iOS',
automationName: 'XCUITest',
deviceName: process.env.IOS_DEVICE_NAME || 'iPhone 6s',
platformVersion: process.env.IOS_PLATFORM_VERSION || '12.1',
app: undefined // Will be added in tests
};
const iosWebCaps = {
platformName: "iOS",
automationName: "XCUITest",
deviceName: process.env.IOS_DEVICE_NAME || "iPhone 6s",
platformVersion: process.env.IOS_PLATFORM_VERSION || "12.1",
browserName: "Safari"
platformName: 'iOS',
automationName: 'XCUITest',
deviceName: process.env.IOS_DEVICE_NAME || 'iPhone 6s',
platformVersion: process.env.IOS_PLATFORM_VERSION || '12.1',
browserName: 'Safari'
};
// Leave the Android platformVersion blank and set deviceName to a random string (Android deviceName is ignored by Appium but is still required)
// If we're using SauceLabs, set the Android deviceName and platformVersion to the latest supported SauceLabs device and version
const DEFAULT_ANDROID_DEVICE_NAME = process.env.SAUCE
? "Android GoogleAPI Emulator"
: "My Android Device";
const DEFAULT_ANDROID_PLATFORM_VERSION = process.env.SAUCE ? "7.1" : null;
? 'Android GoogleAPI Emulator'
: 'My Android Device';
const DEFAULT_ANDROID_PLATFORM_VERSION = process.env.SAUCE ? '7.1' : null;
const androidCaps = {
platformName: "Android",
automationName: "UiAutomator2",
platformName: 'Android',
automationName: 'UiAutomator2',
deviceName: process.env.ANDROID_DEVICE_NAME || DEFAULT_ANDROID_DEVICE_NAME,
platformVersion:
process.env.ANDROID_PLATFORM_VERSION || DEFAULT_ANDROID_PLATFORM_VERSION,
@@ -31,18 +31,18 @@ const androidCaps = {
};
const androidWebCaps = {
platformName: "Android",
automationName: "UiAutomator2",
platformName: 'Android',
automationName: 'UiAutomator2',
deviceName: process.env.ANDROID_DEVICE_NAME || DEFAULT_ANDROID_DEVICE_NAME,
platformVersion:
process.env.ANDROID_PLATFORM_VERSION || DEFAULT_ANDROID_PLATFORM_VERSION,
browserName: "chrome"
browserName: 'chrome'
};
const serverConfig = {
host: process.env.APPIUM_HOST || "localhost",
host: process.env.APPIUM_HOST || 'localhost',
port: process.env.APPIUM_PORT || 4723,
logLevel: "info"
logLevel: 'info'
};
const androidOptions = Object.assign(

View File

@@ -1,23 +1,23 @@
const webdriverio = require("webdriverio");
const androidOptions = require("../../helpers/caps").androidOptions;
const app = require("../../helpers/apps").androidApiDemos;
const assert = require("chai").assert;
const webdriverio = require('webdriverio');
const androidOptions = require('../../helpers/caps').androidOptions;
const app = require('../../helpers/apps').androidApiDemos;
const assert = require('chai').assert;
androidOptions.capabilities.app = app;
describe("Create Android session", function () {
describe('Create Android session', function () {
let client;
before(async function () {
client = await webdriverio.remote(androidOptions);
});
it("should create and destroy a session", async function () {
it('should create and destroy a session', async function () {
const res = await client.status();
assert.isObject(res.build);
const current_package = await client.getCurrentPackage();
assert.equal(current_package, "io.appium.android.apis");
assert.equal(current_package, 'io.appium.android.apis');
const delete_session = await client.deleteSession();
assert.isNull(delete_session);

View File

@@ -1,8 +1,8 @@
const webdriverio = require("webdriverio");
const androidOptions = require("../../helpers/caps").androidWebOptions;
const assert = require("chai").assert;
const webdriverio = require('webdriverio');
const androidOptions = require('../../helpers/caps').androidWebOptions;
const assert = require('chai').assert;
describe("Create Chrome web session", function () {
describe('Create Chrome web session', function () {
let client;
before(async function () {
@@ -13,12 +13,12 @@ describe("Create Chrome web session", function () {
return await client.deleteSession();
});
it("should create and destroy Android browser session", async function () {
it('should create and destroy Android browser session', async function () {
// Navigate to google.com
const client = await webdriverio.remote(androidOptions);
await client.url("https://www.google.com");
await client.url('https://www.google.com');
const title = await client.getTitle();
assert.equal(title, "Google");
assert.equal(title, 'Google');
});
});

View File

@@ -1,11 +1,11 @@
const webdriverio = require("webdriverio");
const iosOptions = require("../../helpers/caps").iosOptions;
const app = require("../../helpers/apps").iosTestApp;
const assert = require("chai").assert;
const webdriverio = require('webdriverio');
const iosOptions = require('../../helpers/caps').iosOptions;
const app = require('../../helpers/apps').iosTestApp;
const assert = require('chai').assert;
iosOptions.capabilities.app = app;
describe("Basic IOS interactions", function () {
describe('Basic IOS interactions', function () {
let client;
beforeEach(async function () {
@@ -16,20 +16,20 @@ describe("Basic IOS interactions", function () {
await client.deleteSession();
});
it("should send keys to inputs", async function () {
const elementId = await client.findElement("accessibility id", "TextField1");
client.elementSendKeys(elementId.ELEMENT, "Hello World!");
it('should send keys to inputs', async function () {
const elementId = await client.findElement('accessibility id', 'TextField1');
client.elementSendKeys(elementId.ELEMENT, 'Hello World!');
const elementValue = await client.findElement("accessibility id", "TextField1");
await client.getElementAttribute(elementValue.ELEMENT, "value").then((attr) => {
assert.equal(attr, "Hello World!");
const elementValue = await client.findElement('accessibility id', 'TextField1');
await client.getElementAttribute(elementValue.ELEMENT, 'value').then((attr) => {
assert.equal(attr, 'Hello World!');
});
});
it("should click a button that opens an alert", async function () {
const element = await client.findElement("accessibility id", "show alert");
it('should click a button that opens an alert', async function () {
const element = await client.findElement('accessibility id', 'show alert');
await client.elementClick(element.ELEMENT);
assert.equal(await client.getAlertText(), "Cool title\nthis alert is so cool.");
assert.equal(await client.getAlertText(), 'Cool title\nthis alert is so cool.');
});
});

View File

@@ -1,24 +1,24 @@
const webdriverio = require("webdriverio");
const iosOptions = require("../../helpers/caps").iosOptions;
const app = require("../../helpers/apps").iosTestApp;
const assert = require("chai").assert;
const webdriverio = require('webdriverio');
const iosOptions = require('../../helpers/caps').iosOptions;
const app = require('../../helpers/apps').iosTestApp;
const assert = require('chai').assert;
iosOptions.capabilities.app = app;
describe("Create session", function () {
describe('Create session', function () {
let client;
beforeEach(async function () {
client = await webdriverio.remote(iosOptions);
});
it("should create and destroy IOS sessions", async function () {
it('should create and destroy IOS sessions', async function () {
const res = await client.status();
assert.isObject(res.build);
const element = await client.findElement("class name", "XCUIElementTypeApplication");
await client.getElementAttribute(element.ELEMENT, "name").then((attr) => {
assert.equal(attr, "TestApp");
const element = await client.findElement('class name', 'XCUIElementTypeApplication');
await client.getElementAttribute(element.ELEMENT, 'name').then((attr) => {
assert.equal(attr, 'TestApp');
});
const destroySession = await client.deleteSession();

View File

@@ -1,14 +1,14 @@
const webdriverio = require("webdriverio");
const iosOptions = require("../../helpers/caps").iosWebOptions;
const assert = require("chai").assert;
const webdriverio = require('webdriverio');
const iosOptions = require('../../helpers/caps').iosWebOptions;
const assert = require('chai').assert;
describe("Create Safari session", function () {
it("should create and destroy IOS Safari session", async function () {
describe('Create Safari session', function () {
it('should create and destroy IOS Safari session', async function () {
const client = await webdriverio.remote(iosOptions);
await client.url("https://www.google.com");
await client.url('https://www.google.com');
const title = await client.getTitle();
assert.equal(title, "Google");
assert.equal(title, 'Google');
await client.deleteSession();
});
});