From 10753839a9c7e90cf6be057b29fffd462bc107cb Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 8 Jan 2019 08:43:50 -0500 Subject: [PATCH] =?UTF-8?q?Update=20eslint-config-appium=20to=20the=20late?= =?UTF-8?q?st=20version=20=F0=9F=9A=80=20(#11952)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update eslint-config-appium to version 4.0.1 * chore: fix linting * chore: rebase and done --- bin/ios-webkit-debug-proxy-launcher.js | 2 +- docs/toc.js | 464 +++++++++--------- gulpfile.js | 38 +- lib/appium.js | 14 +- lib/config.js | 6 +- lib/logsink.js | 2 +- lib/parser.js | 4 +- package.json | 3 +- .../javascript-wd/test/helpers/apps.js | 8 +- .../javascript-webdriverio/helpers/apps.js | 8 +- .../javascript-webdriverio/helpers/caps.js | 38 +- .../test/basic/android-create-session.test.js | 14 +- .../basic/android-create-web-session.test.js | 14 +- .../test/basic/ios-basic-interactions.test.js | 28 +- .../test/basic/ios-create-session.test.js | 18 +- .../test/basic/ios-create-web-session.test.js | 14 +- test/config-specs.js | 82 ++-- test/driver-e2e-specs.js | 22 +- test/driver-specs.js | 18 +- test/helpers.js | 6 +- test/shrinkwrap-specs.js | 2 +- 21 files changed, 403 insertions(+), 402 deletions(-) diff --git a/bin/ios-webkit-debug-proxy-launcher.js b/bin/ios-webkit-debug-proxy-launcher.js index 62927493c..3bd4238a2 100644 --- a/bin/ios-webkit-debug-proxy-launcher.js +++ b/bin/ios-webkit-debug-proxy-launcher.js @@ -18,7 +18,7 @@ * brew install --HEAD ideviceinstaller */ -"use strict"; +'use strict'; const spawn = require('child_process').spawn; const _ = require('lodash'); diff --git a/docs/toc.js b/docs/toc.js index 05e01ef46..5936f5eb3 100644 --- a/docs/toc.js +++ b/docs/toc.js @@ -1,277 +1,277 @@ module.exports = { en: [ - ["Home", "about-appium/intro.md"], - ["About", ["about-appium", - ["Introduction", "intro.md"], - ["The Appium Clients", "appium-clients.md"], - ["Getting Started", "getting-started.md"], - ["Supported Platforms", "platform-support.md"], - ["API Documentation", "api.md"], + ['Home', 'about-appium/intro.md'], + ['About', ['about-appium', + ['Introduction', 'intro.md'], + ['The Appium Clients', 'appium-clients.md'], + ['Getting Started', 'getting-started.md'], + ['Supported Platforms', 'platform-support.md'], + ['API Documentation', 'api.md'], ]], - ["Drivers", ["drivers", - ["XCUITest (iOS)", "ios-xcuitest.md"], - ["XCUITest Real Devices (iOS)", "ios-xcuitest-real-devices.md"], - ["UIAutomation (iOS)", "ios-uiautomation.md"], - ["UIAutomation Safari Launcher (iOS)", "ios-uiautomation-safari-launcher.md"], - ["UIAutomator (Android)", "android-uiautomator.md"], - ["UIAutomator2 (Android)", "android-uiautomator2.md"], - ["Espresso (Android)", "android-espresso.md"], - ["Selendroid (Android)", "android-selendroid.md"], - ["Windows", "windows.md"], - ["Mac", "mac.md"], + ['Drivers', ['drivers', + ['XCUITest (iOS)', 'ios-xcuitest.md'], + ['XCUITest Real Devices (iOS)', 'ios-xcuitest-real-devices.md'], + ['UIAutomation (iOS)', 'ios-uiautomation.md'], + ['UIAutomation Safari Launcher (iOS)', 'ios-uiautomation-safari-launcher.md'], + ['UIAutomator (Android)', 'android-uiautomator.md'], + ['UIAutomator2 (Android)', 'android-uiautomator2.md'], + ['Espresso (Android)', 'android-espresso.md'], + ['Selendroid (Android)', 'android-selendroid.md'], + ['Windows', 'windows.md'], + ['Mac', 'mac.md'], ]], - ["Commands", ["commands", - ["Status", "status.md"], - ["Execute Mobile Command", "mobile-command.md"], - ["Session", ["session", - ["Create", "create.md"], - ["End", "delete.md"], - ["Get Session Capabilities", "get.md"], - ["Go Back", "back.md"], - ["Screenshot", "screenshot.md"], - ["Source", "source.md"], - ["Timeouts", ["timeouts", - ["Timeouts", "timeouts.md"], - ["Implicit Wait", "implicit-wait.md"], - ["Async Script", "async-script.md"], + ['Commands', ['commands', + ['Status', 'status.md'], + ['Execute Mobile Command', 'mobile-command.md'], + ['Session', ['session', + ['Create', 'create.md'], + ['End', 'delete.md'], + ['Get Session Capabilities', 'get.md'], + ['Go Back', 'back.md'], + ['Screenshot', 'screenshot.md'], + ['Source', 'source.md'], + ['Timeouts', ['timeouts', + ['Timeouts', 'timeouts.md'], + ['Implicit Wait', 'implicit-wait.md'], + ['Async Script', 'async-script.md'], ]], - ["Orientation", ["orientation", - ["Get Orientation", "get-orientation.md"], - ["Set Orientation", "set-orientation.md"], + ['Orientation', ['orientation', + ['Get Orientation', 'get-orientation.md'], + ['Set Orientation', 'set-orientation.md'], ]], - ["Geolocation", ["geolocation", - ["Get Geolocation", "get-geolocation.md"], - ["Set Geolocation", "set-geolocation.md"], + ['Geolocation', ['geolocation', + ['Get Geolocation', 'get-geolocation.md'], + ['Set Geolocation', 'set-geolocation.md'], ]], - ["Logs", ["logs", - ["Get Log Types", "get-log-types.md"], - ["Get Logs", "get-log.md"], + ['Logs', ['logs', + ['Get Log Types', 'get-log-types.md'], + ['Get Logs', 'get-log.md'], ]], - ["Settings", ["settings", - ["Update Settings", "update-settings.md"], - ["Get Device Settings", "get-settings.md"], + ['Settings', ['settings', + ['Update Settings', 'update-settings.md'], + ['Get Device Settings', 'get-settings.md'], ]], ]], - ["Device", ["device", - ["Activity", ["activity", - ["Start Activity", "start-activity.md"], - ["Current Activity", "current-activity.md"], - ["Current Package", "current-package.md"], + ['Device', ['device', + ['Activity', ['activity', + ['Start Activity', 'start-activity.md'], + ['Current Activity', 'current-activity.md'], + ['Current Package', 'current-package.md'], ]], - ["App", ["app", - ["Install App", "install-app.md"], - ["Is App Installed", "is-app-installed.md"], - ["Launch App", "launch-app.md"], - ["Background App", "background-app.md"], - ["Close App", "close-app.md"], - ["Reset App", "reset-app.md"], - ["Remove App", "remove-app.md"], - ["Activate App", "activate-app.md"], - ["Terminate App", "terminate-app.md"], - ["Get App State", "app-state.md"], - ["Get App Strings", "get-app-strings.md"], - ["End Test Coverage", "end-test-coverage.md"], + ['App', ['app', + ['Install App', 'install-app.md'], + ['Is App Installed', 'is-app-installed.md'], + ['Launch App', 'launch-app.md'], + ['Background App', 'background-app.md'], + ['Close App', 'close-app.md'], + ['Reset App', 'reset-app.md'], + ['Remove App', 'remove-app.md'], + ['Activate App', 'activate-app.md'], + ['Terminate App', 'terminate-app.md'], + ['Get App State', 'app-state.md'], + ['Get App Strings', 'get-app-strings.md'], + ['End Test Coverage', 'end-test-coverage.md'], ]], - ["Clipboard", ["clipboard", - ["Get Clipboard", "get-clipboard.md"], - ["Set Clipboard", "set-clipboard.md"], + ['Clipboard', ['clipboard', + ['Get Clipboard', 'get-clipboard.md'], + ['Set Clipboard', 'set-clipboard.md'], ]], - ["Emulator", ["emulator", - ["Power AC", "power_ac.md"], - ["Power Capacity", "power_capacity.md"], + ['Emulator', ['emulator', + ['Power AC', 'power_ac.md'], + ['Power Capacity', 'power_capacity.md'], ]], - ["Files", ["files", - ["Push File", "push-file.md"], - ["Pull File", "pull-file.md"], - ["Pull Folder", "pull-folder.md"], + ['Files', ['files', + ['Push File', 'push-file.md'], + ['Pull File', 'pull-file.md'], + ['Pull Folder', 'pull-folder.md'], ]], - ["Interactions", ["interactions", - ["Shake", "shake.md"], - ["Lock", "lock.md"], - ["Unlock", "unlock.md"], - ["Is Locked", "is-locked.md"], - ["Rotate", "rotate.md"], + ['Interactions', ['interactions', + ['Shake', 'shake.md'], + ['Lock', 'lock.md'], + ['Unlock', 'unlock.md'], + ['Is Locked', 'is-locked.md'], + ['Rotate', 'rotate.md'], ]], - ["Keys", ["keys", - ["Press keycode", "press-keycode.md"], - ["Long press keycode", "long-press-keycode.md"], - ["Hide Keyboard", "hide-keyboard.md"], - ["Is Keyboard Shown", "is-keyboard-shown.md"], + ['Keys', ['keys', + ['Press keycode', 'press-keycode.md'], + ['Long press keycode', 'long-press-keycode.md'], + ['Hide Keyboard', 'hide-keyboard.md'], + ['Is Keyboard Shown', 'is-keyboard-shown.md'], ]], - ["Network", ["network", - ["Toggle Airplane Mode", "toggle-airplane-mode.md"], - ["Toggle Data", "toggle-data.md"], - ["Toggle WiFi", "toggle-wifi.md"], - ["Toggle Location Services", "toggle-location-services.md"], - ["Send SMS", "send-sms.md"], - ["GSM Call", "gsm-call.md"], - ["GSM Signal", "gsm-signal.md"], - ["GSM Voice", "gsm-voice.md"], + ['Network', ['network', + ['Toggle Airplane Mode', 'toggle-airplane-mode.md'], + ['Toggle Data', 'toggle-data.md'], + ['Toggle WiFi', 'toggle-wifi.md'], + ['Toggle Location Services', 'toggle-location-services.md'], + ['Send SMS', 'send-sms.md'], + ['GSM Call', 'gsm-call.md'], + ['GSM Signal', 'gsm-signal.md'], + ['GSM Voice', 'gsm-voice.md'], ]], - ["Performance Data", ["performance-data", - ["Get Performance Data", "get-performance-data.md"], - ["Performance Data Types", "performance-data-types.md"], + ['Performance Data', ['performance-data', + ['Get Performance Data', 'get-performance-data.md'], + ['Performance Data Types', 'performance-data-types.md'], ]], - ["Screen Recording", ["recording-screen", - ["Start Screen Recording", "start-recording-screen.md"], - ["Stop Screen Recording", "stop-recording-screen.md"], + ['Screen Recording', ['recording-screen', + ['Start Screen Recording', 'start-recording-screen.md'], + ['Stop Screen Recording', 'stop-recording-screen.md'], ]], - ["Simulator", ["simulator", - ["Perform Touch ID", "touch-id.md"], - ["Toggle Touch ID Enrollment", "toggle-touch-id-enrollment.md"], + ['Simulator', ['simulator', + ['Perform Touch ID', 'touch-id.md'], + ['Toggle Touch ID Enrollment', 'toggle-touch-id-enrollment.md'], ]], - ["System", ["system", - ["Open Notifications", "open-notifications.md"], - ["System Bars", "system-bars.md"], - ["System Time", "system-time.md"], + ['System', ['system', + ['Open Notifications', 'open-notifications.md'], + ['System Bars', 'system-bars.md'], + ['System Time', 'system-time.md'], ]], - ["Authentication", ["authentication", - ["Finger Print", "finger-print.md"], + ['Authentication', ['authentication', + ['Finger Print', 'finger-print.md'], ]], ]], - ["Element", ["element", - ["Find Element", "find-element.md"], - ["Find Elements", "find-elements.md"], - ["Actions", ["actions", - ["Click", "click.md"], - ["Send Keys", "send-keys.md"], - ["Clear", "clear.md"], + ['Element', ['element', + ['Find Element', 'find-element.md'], + ['Find Elements', 'find-elements.md'], + ['Actions', ['actions', + ['Click', 'click.md'], + ['Send Keys', 'send-keys.md'], + ['Clear', 'clear.md'], ]], - ["Attributes", ["attributes", - ["Text", "text.md"], - ["Name", "name.md"], - ["Attribute", "attribute.md"], - ["Selected", "selected.md"], - ["Enabled", "enabled.md"], - ["Displayed", "displayed.md"], - ["Location", "location.md"], - ["Size", "size.md"], - ["Rect", "rect.md"], - ["CSS Property", "css-property.md"], - ["Location in View", "location-in-view.md"], + ['Attributes', ['attributes', + ['Text', 'text.md'], + ['Name', 'name.md'], + ['Attribute', 'attribute.md'], + ['Selected', 'selected.md'], + ['Enabled', 'enabled.md'], + ['Displayed', 'displayed.md'], + ['Location', 'location.md'], + ['Size', 'size.md'], + ['Rect', 'rect.md'], + ['CSS Property', 'css-property.md'], + ['Location in View', 'location-in-view.md'], ]], - ["Other", ["other", - ["Submit", "submit.md"], - ["Active Element", "active.md"], - ["Equals Element", "equals-element.md"], + ['Other', ['other', + ['Submit', 'submit.md'], + ['Active Element', 'active.md'], + ['Equals Element', 'equals-element.md'], ]] ]], - ["Context", ["context", - ["Get Context", "get-context.md"], - ["Get All Contexts", "get-contexts.md"], - ["Set Context", "set-context.md"], + ['Context', ['context', + ['Get Context', 'get-context.md'], + ['Get All Contexts', 'get-contexts.md'], + ['Set Context', 'set-context.md'], ]], - ["Interactions", ["interactions", - ["Mouse", ["mouse", - ["Move To", "moveto.md"], - ["Click", "click.md"], - ["Double Click", "doubleclick.md"], - ["Button Down", "button-down.md"], - ["Button Up", "button-up.md"], + ['Interactions', ['interactions', + ['Mouse', ['mouse', + ['Move To', 'moveto.md'], + ['Click', 'click.md'], + ['Double Click', 'doubleclick.md'], + ['Button Down', 'button-down.md'], + ['Button Up', 'button-up.md'], ]], - ["Touch", ["touch", - ["Single Tap", "tap.md"], - ["Double Tap", "double-tap.md"], - ["Move", "move.md"], - ["Touch Down", "touch-down.md"], - ["Touch Up", "touch-up.md"], - ["Long Press", "long-press.md"], - ["Scroll", "scroll.md"], - ["Flick", "flick.md"], - ["Multi Touch Perform", "multi-touch-perform.md"], - ["Touch Perform", "touch-perform.md"], + ['Touch', ['touch', + ['Single Tap', 'tap.md'], + ['Double Tap', 'double-tap.md'], + ['Move', 'move.md'], + ['Touch Down', 'touch-down.md'], + ['Touch Up', 'touch-up.md'], + ['Long Press', 'long-press.md'], + ['Scroll', 'scroll.md'], + ['Flick', 'flick.md'], + ['Multi Touch Perform', 'multi-touch-perform.md'], + ['Touch Perform', 'touch-perform.md'], ]], - ["W3C Actions", "actions.md"], + ['W3C Actions', 'actions.md'], ]], - ["Web", ["web", - ["Window", ["window", - ["Set Window", "set-window.md"], - ["Close Window", "close-window.md"], - ["Get Handle", "get-handle.md"], - ["Get Handles", "get-handles.md"], - ["Get Title", "title.md"], - ["Get Window Size", "get-window-size.md"], - ["Set Window Size", "set-window-size.md"], - ["Get Window Position", "get-window-position.md"], - ["Set Window Position", "set-window-position.md"], - ["Maximize Window", "maximize-window.md"], + ['Web', ['web', + ['Window', ['window', + ['Set Window', 'set-window.md'], + ['Close Window', 'close-window.md'], + ['Get Handle', 'get-handle.md'], + ['Get Handles', 'get-handles.md'], + ['Get Title', 'title.md'], + ['Get Window Size', 'get-window-size.md'], + ['Set Window Size', 'set-window-size.md'], + ['Get Window Position', 'get-window-position.md'], + ['Set Window Position', 'set-window-position.md'], + ['Maximize Window', 'maximize-window.md'], ]], - ["Navigation", ["navigation", - ["Go to URL", "go-to-url.md"], - ["Get URL", "url.md"], - ["Back", "back.md"], - ["Forward", "forward.md"], - ["Refresh", "refresh.md"], + ['Navigation', ['navigation', + ['Go to URL', 'go-to-url.md'], + ['Get URL', 'url.md'], + ['Back', 'back.md'], + ['Forward', 'forward.md'], + ['Refresh', 'refresh.md'], ]], - ["Storage", ["storage", - ["Get All Cookies", "get-all-cookies.md"], - ["Set Cookie", "set-cookie.md"], - ["Delete Cookie", "delete-cookie.md"], - ["Delete All Cookies", "delete-all-cookies.md"], + ['Storage', ['storage', + ['Get All Cookies', 'get-all-cookies.md'], + ['Set Cookie', 'set-cookie.md'], + ['Delete Cookie', 'delete-cookie.md'], + ['Delete All Cookies', 'delete-all-cookies.md'], ]], - ["Frame", ["frame", - ["Switch to Frame", "switch.md"], - ["Switch to Parent Frame", "parent.md"], + ['Frame', ['frame', + ['Switch to Frame', 'switch.md'], + ['Switch to Parent Frame', 'parent.md'], ]], - ["Execute Async", "execute-async.md"], - ["Execute", "execute.md"], + ['Execute Async', 'execute-async.md'], + ['Execute', 'execute.md'], ]], ]], - ["Writing & Running Tests", ["writing-running-appium", - ["Running Tests", "running-tests.md"], - ["Desired Capabilities", "caps.md"], - ["The --default-capabilities flag", "default-capabilities-arg.md"], - ["Finding Elements", "finding-elements.md"], - ["Touch Actions", "touch-actions.md"], - ["CLI Arguments", "server-args.md"], - ["Web/Web Views", ["web", - ["Mobile Web Testing", "mobile-web.md"], - ["Automating Hybrid Apps", "hybrid.md"], - ["Using ios-webkit-debug-proxy", "ios-webkit-debug-proxy.md"], - ["Using Chromedriver", "chromedriver.md"], + ['Writing & Running Tests', ['writing-running-appium', + ['Running Tests', 'running-tests.md'], + ['Desired Capabilities', 'caps.md'], + ['The --default-capabilities flag', 'default-capabilities-arg.md'], + ['Finding Elements', 'finding-elements.md'], + ['Touch Actions', 'touch-actions.md'], + ['CLI Arguments', 'server-args.md'], + ['Web/Web Views', ['web', + ['Mobile Web Testing', 'mobile-web.md'], + ['Automating Hybrid Apps', 'hybrid.md'], + ['Using ios-webkit-debug-proxy', 'ios-webkit-debug-proxy.md'], + ['Using Chromedriver', 'chromedriver.md'], ]], - ["iOS", ["ios", - ["XCUITest Mobile Gestures", "ios-xctest-mobile-gestures.md"], - ["XCUITest Mobile App Management", "ios-xctest-mobile-apps-management.md"], - ["iOS Pasteboard Guide", "ios-xctest-pasteboard.md"], - ["iOS Predicate Guide", "ios-predicate.md"], - ["iOS Touch ID Guide", "ios-touch-id.md"], - ["iOS Install Certificate", "ios-xctest-install-certificate.md"], + ['iOS', ['ios', + ['XCUITest Mobile Gestures', 'ios-xctest-mobile-gestures.md'], + ['XCUITest Mobile App Management', 'ios-xctest-mobile-apps-management.md'], + ['iOS Pasteboard Guide', 'ios-xctest-pasteboard.md'], + ['iOS Predicate Guide', 'ios-predicate.md'], + ['iOS Touch ID Guide', 'ios-touch-id.md'], + ['iOS Install Certificate', 'ios-xctest-install-certificate.md'], ]], - ["Android", ["android", - ["UiSelector Guide", "uiautomator-uiselector.md"], - ["Android Code Coverage Guide", "android-coverage.md"], - ["Activities Startup Troubleshooting Guide", "activity-startup.md"], - ["How To Execute Shell Commands On The Remote Device", "android-shell.md"], - ["How To Emulate IME Actions Generation", "android-ime.md"], - ["How To Test Android App Bundle", "android-appbundle.md"] + ['Android', ['android', + ['UiSelector Guide', 'uiautomator-uiselector.md'], + ['Android Code Coverage Guide', 'android-coverage.md'], + ['Activities Startup Troubleshooting Guide', 'activity-startup.md'], + ['How To Execute Shell Commands On The Remote Device', 'android-shell.md'], + ['How To Emulate IME Actions Generation', 'android-ime.md'], + ['How To Test Android App Bundle', 'android-appbundle.md'] ]], - ["Other", ["other", - ["Reset Strategies", "reset-strategies.md"], - ["Network Connection Guide", "network-connection.md"], - ["Using Unicode with Appium", "unicode.md"], - ["Troubleshooting", "troubleshooting.md"] + ['Other', ['other', + ['Reset Strategies', 'reset-strategies.md'], + ['Network Connection Guide', 'network-connection.md'], + ['Using Unicode with Appium', 'unicode.md'], + ['Troubleshooting', 'troubleshooting.md'] ]], ]], - ["Advanced", ["advanced-concepts", - ["Finding Image Elements", "image-elements.md"], - ["Using Element Finding Plugins", "element-finding-plugins.md"], - ["Migrating to XCUITest", "migrating-to-xcuitest.md"], - ["Using Selenium Grid with Appium", "grid.md"], - ["Cross-domain iframes", "cross-domain-iframes.md"], - ["Using a custom WDA server", "wda-custom-server.md"], - ["Running with multiple versions of Xcode", "multiple-xcode-versions.md"], - ["The Event Timings API", "event-timings.md"], - ["Setup for Parallel Testing", "parallel-tests.md"], - ["The Settings API", "settings.md"]]], - ["Contributing", ["contributing-to-appium", - ["Running Appium from Source", "appium-from-source.md"], - ["Developer Overview", "developers-overview.md"], - ["Standard Dev Commands", "dev-tools.md"], - ["Appium Style Guide", "style-guide.md"], - ["How to Write Docs", "how-to-write-docs.md"], - ["Appium Package Structure", "appium-packages.md"], - ["Credits", "credits.md"]]] - ], "cn": [ + ['Advanced', ['advanced-concepts', + ['Finding Image Elements', 'image-elements.md'], + ['Using Element Finding Plugins', 'element-finding-plugins.md'], + ['Migrating to XCUITest', 'migrating-to-xcuitest.md'], + ['Using Selenium Grid with Appium', 'grid.md'], + ['Cross-domain iframes', 'cross-domain-iframes.md'], + ['Using a custom WDA server', 'wda-custom-server.md'], + ['Running with multiple versions of Xcode', 'multiple-xcode-versions.md'], + ['The Event Timings API', 'event-timings.md'], + ['Setup for Parallel Testing', 'parallel-tests.md'], + ['The Settings API', 'settings.md']]], + ['Contributing', ['contributing-to-appium', + ['Running Appium from Source', 'appium-from-source.md'], + ['Developer Overview', 'developers-overview.md'], + ['Standard Dev Commands', 'dev-tools.md'], + ['Appium Style Guide', 'style-guide.md'], + ['How to Write Docs', 'how-to-write-docs.md'], + ['Appium Package Structure', 'appium-packages.md'], + ['Credits', 'credits.md']]] + ], 'cn': [ ] }; diff --git a/gulpfile.js b/gulpfile.js index f694f0d44..61d1750c5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,10 +1,10 @@ /* eslint no-console:0 */ /* eslint-disable promise/prefer-await-to-callbacks */ -"use strict"; +'use strict'; // turn all logging on since we have tests that rely on npmlog logs actually // getting sent to the handler -process.env._FORCE_LOGS = "1"; +process.env._FORCE_LOGS = '1'; const gulp = require('gulp'); const boilerplate = require('appium-gulp-plugins').boilerplate.use(gulp); @@ -52,20 +52,20 @@ boilerplate({ gulp.task('docs', gulp.series(['transpile']), function () { const parser = require('./build/lib/parser.js'); const appiumArguments = parser.getParser().rawArgs; - const docFile = path.resolve(__dirname, "docs/en/writing-running-appium/server-args.md"); - let md = "# Appium server arguments\n\n"; - md += "Many Appium 1.5 server arguments have been deprecated in favor of the "; - md += "[--default-capabilities flag](/docs/en/writing-running-appium/default-capabilities-arg.md)."; - md += "\n\nUsage: `node . [flags]`\n\n"; - md += "## Server flags\n"; - md += "All flags are optional, but some are required in conjunction with " + - "certain others.\n\n"; - md += "\n\n\n\n"; - md += "|Flag|Default|Description|Example|\n"; - md += "|----|-------|-----------|-------|\n"; + const docFile = path.resolve(__dirname, 'docs/en/writing-running-appium/server-args.md'); + let md = '# Appium server arguments\n\n'; + md += 'Many Appium 1.5 server arguments have been deprecated in favor of the '; + md += '[--default-capabilities flag](/docs/en/writing-running-appium/default-capabilities-arg.md).'; + md += '\n\nUsage: `node . [flags]`\n\n'; + md += '## Server flags\n'; + md += 'All flags are optional, but some are required in conjunction with ' + + 'certain others.\n\n'; + md += '\n\n\n\n'; + md += '|Flag|Default|Description|Example|\n'; + md += '|----|-------|-----------|-------|\n'; appiumArguments.forEach(function (arg) { const argNames = arg[0]; - const exampleArg = typeof arg[0][1] === "undefined" ? arg[0][0] : arg[0][1]; + const exampleArg = typeof arg[0][1] === 'undefined' ? arg[0][0] : arg[0][1]; const argOpts = arg[1]; // --keystore-path defaultValue contains a user-specific path, @@ -80,11 +80,11 @@ gulp.task('docs', gulp.series(['transpile']), function () { argOpts.defaultValue = '{}'; } - md += "|`" + argNames.join("`, `") + "`"; - md += "|" + ((typeof argOpts.defaultValue === "undefined") ? "" : argOpts.defaultValue); - md += "|" + argOpts.help; - md += "|" + ((typeof argOpts.example === "undefined") ? "" : "`" + exampleArg + " " + argOpts.example + "`"); - md += "|\n"; + md += '|`' + argNames.join('`, `') + '`'; + md += '|' + ((typeof argOpts.defaultValue === 'undefined') ? '' : argOpts.defaultValue); + md += '|' + argOpts.help; + md += '|' + ((typeof argOpts.example === 'undefined') ? '' : '`' + exampleArg + ' ' + argOpts.example + '`'); + md += '|\n'; }); fs.writeFile(docFile, md, function (err) { diff --git a/lib/appium.js b/lib/appium.js index c09bacbbc..17f624941 100755 --- a/lib/appium.js +++ b/lib/appium.js @@ -89,8 +89,8 @@ const PLATFORMS_MAP = { if (platformVersion && semver.satisfies(platformVersion, '>=6.0.0')) { log.warn("Consider setting 'automationName' capability to " + `'${AUTOMATION_NAMES.UIAUTOMATOR2}' ` + - "on Android >= 6, since UIAutomator framework " + - "is not maintained anymore by the OS vendor."); + 'on Android >= 6, since UIAutomator framework ' + + 'is not maintained anymore by the OS vendor.'); } return AndroidDriver; @@ -98,10 +98,10 @@ const PLATFORMS_MAP = { ios: (caps) => { const platformVersion = semver.valid(semver.coerce(caps.platformVersion)); if (platformVersion && semver.satisfies(platformVersion, '>=10.0.0')) { - log.info("Requested iOS support with version >= 10, " + + log.info('Requested iOS support with version >= 10, ' + `using '${AUTOMATION_NAMES.XCUITEST}' ` + - "driver instead of UIAutomation-based driver, since the " + - "latter is unsupported on iOS 10 and up."); + 'driver instead of UIAutomation-based driver, since the ' + + 'latter is unsupported on iOS 10 and up.'); return XCUITestDriver; } @@ -171,7 +171,7 @@ class AppiumDriver extends BaseDriver { getDriverForCaps (caps) { if (!_.isString(caps.platformName)) { - throw new Error("You must include a platformName capability"); + throw new Error('You must include a platformName capability'); } // we don't necessarily have an `automationName` capability, @@ -448,7 +448,7 @@ class AppiumDriver extends BaseDriver { // help decide which commands should be proxied to sub-drivers and which // should be handled by this, our umbrella driver function isAppiumDriverCommand (cmd) { - return !isSessionCommand(cmd) || cmd === "deleteSession"; + return !isSessionCommand(cmd) || cmd === 'deleteSession'; } export { AppiumDriver }; diff --git a/lib/config.js b/lib/config.js index b809dbcf4..71c094919 100644 --- a/lib/config.js +++ b/lib/config.js @@ -119,9 +119,9 @@ function checkNodeOk () { function warnNodeDeprecations () { let [major] = getNodeVersion(); if (major < 8) { - logger.warn("Appium support for versions of node < 8 has been " + - "deprecated and will be removed in a future version. Please " + - "upgrade!"); + logger.warn('Appium support for versions of node < 8 has been ' + + 'deprecated and will be removed in a future version. Please ' + + 'upgrade!'); } } diff --git a/lib/logsink.js b/lib/logsink.js index 46fd506d2..69a9ee3a4 100644 --- a/lib/logsink.js +++ b/lib/logsink.js @@ -10,7 +10,7 @@ logger.patchLogger(npmlog); global._global_npmlog = npmlog; // npmlog is used only for emitting, we use winston for output -npmlog.level = "silent"; +npmlog.level = 'silent'; const levels = { debug: 4, info: 3, diff --git a/lib/parser.js b/lib/parser.js index 4f0b4d169..efdc80776 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -357,7 +357,7 @@ const args = [ dest: 'webkitDebugProxyPort', required: false, type: 'int', - example: "27753", + example: '27753', help: '(IOS-only) Local port used for communication with ios-webkit-debug-proxy' }], @@ -366,7 +366,7 @@ const args = [ dest: 'wdaLocalPort', required: false, type: 'int', - example: "8100", + example: '8100', help: '(IOS-only, XCUITest-only) Local port used for communication with WebDriverAgent' }], diff --git a/package.json b/package.json index 8da6453d7..427f48e04 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "precommit-msg": "echo 'Pre-commit checks...' && exit 0", "precommit-test": "REPORTER=dot gulp once", "lint": "gulp eslint", + "lint:fix": "gulp eslint --fix", "coverage": "gulp coveralls", "generate-docs": "node ./build/commands-yml/parse.js", "shrinkwrap-prod": "rimraf package-lock.json && npm prune --production && npm shrinkwrap && npm install --no-shrinkwrap", @@ -101,7 +102,7 @@ "chai": "4.x", "chai-as-promised": "7.x", "eslint": "^5.2.0", - "eslint-config-appium": "3.x", + "eslint-config-appium": "^4.0.1", "eslint-plugin-import": "^2.2.0", "eslint-plugin-mocha": "^5.0.0", "eslint-plugin-promise": "^4.0.0", diff --git a/sample-code/javascript-wd/test/helpers/apps.js b/sample-code/javascript-wd/test/helpers/apps.js index d8895a200..1485e137d 100644 --- a/sample-code/javascript-wd/test/helpers/apps.js +++ b/sample-code/javascript-wd/test/helpers/apps.js @@ -1,14 +1,14 @@ import path from 'path'; -const githubAssetBase = "http://appium.github.io/appium/assets"; -const localAssetBase = path.resolve(__dirname, "..", "..", "..", "apps"); +const githubAssetBase = 'http://appium.github.io/appium/assets'; +const localAssetBase = path.resolve(__dirname, '..', '..', '..', 'apps'); if (process.env.SAUCE_LABS) { // TODO: Change thes URL's to updated locations exports.iosTestApp = `${githubAssetBase}/TestApp7.1.app.zip`; exports.androidApiDemos = `${githubAssetBase}/ApiDemos-debug.apk`; } else { - exports.iosTestApp = path.resolve(localAssetBase, "TestApp.app.zip"); - exports.androidApiDemos = path.resolve(localAssetBase, "ApiDemos-debug.apk"); + exports.iosTestApp = path.resolve(localAssetBase, 'TestApp.app.zip'); + exports.androidApiDemos = path.resolve(localAssetBase, 'ApiDemos-debug.apk'); } diff --git a/sample-code/javascript-webdriverio/helpers/apps.js b/sample-code/javascript-webdriverio/helpers/apps.js index 0e6b8ee5b..33fbc0f8e 100644 --- a/sample-code/javascript-webdriverio/helpers/apps.js +++ b/sample-code/javascript-webdriverio/helpers/apps.js @@ -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'); } diff --git a/sample-code/javascript-webdriverio/helpers/caps.js b/sample-code/javascript-webdriverio/helpers/caps.js index b4784b305..a1e054954 100644 --- a/sample-code/javascript-webdriverio/helpers/caps.js +++ b/sample-code/javascript-webdriverio/helpers/caps.js @@ -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( diff --git a/sample-code/javascript-webdriverio/test/basic/android-create-session.test.js b/sample-code/javascript-webdriverio/test/basic/android-create-session.test.js index 8874e2f7c..7ec2e51a3 100644 --- a/sample-code/javascript-webdriverio/test/basic/android-create-session.test.js +++ b/sample-code/javascript-webdriverio/test/basic/android-create-session.test.js @@ -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); diff --git a/sample-code/javascript-webdriverio/test/basic/android-create-web-session.test.js b/sample-code/javascript-webdriverio/test/basic/android-create-web-session.test.js index b33995917..94a1f93f5 100644 --- a/sample-code/javascript-webdriverio/test/basic/android-create-web-session.test.js +++ b/sample-code/javascript-webdriverio/test/basic/android-create-web-session.test.js @@ -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'); }); }); diff --git a/sample-code/javascript-webdriverio/test/basic/ios-basic-interactions.test.js b/sample-code/javascript-webdriverio/test/basic/ios-basic-interactions.test.js index 442f609d0..f857c001d 100644 --- a/sample-code/javascript-webdriverio/test/basic/ios-basic-interactions.test.js +++ b/sample-code/javascript-webdriverio/test/basic/ios-basic-interactions.test.js @@ -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.'); }); }); diff --git a/sample-code/javascript-webdriverio/test/basic/ios-create-session.test.js b/sample-code/javascript-webdriverio/test/basic/ios-create-session.test.js index b02db512c..80f7cfcb6 100644 --- a/sample-code/javascript-webdriverio/test/basic/ios-create-session.test.js +++ b/sample-code/javascript-webdriverio/test/basic/ios-create-session.test.js @@ -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(); diff --git a/sample-code/javascript-webdriverio/test/basic/ios-create-web-session.test.js b/sample-code/javascript-webdriverio/test/basic/ios-create-web-session.test.js index 7ab5eff52..7ede101a1 100644 --- a/sample-code/javascript-webdriverio/test/basic/ios-create-web-session.test.js +++ b/sample-code/javascript-webdriverio/test/basic/ios-create-web-session.test.js @@ -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(); }); }); diff --git a/test/config-specs.js b/test/config-specs.js index 139faa312..34bdbcfc0 100644 --- a/test/config-specs.js +++ b/test/config-specs.js @@ -58,64 +58,64 @@ describe('Config', function () { it('should get a configuration object if the local git metadata is not present', async function () { getStub.onCall(0).returns([ { - "name": `v${APPIUM_VER}`, - "zipball_url": "https://api.github.com/repos/appium/appium/zipball/v1.9.0-beta.1", - "tarball_url": "https://api.github.com/repos/appium/appium/tarball/v1.9.0-beta.1", - "commit": { - "sha": "3c2752f9f9c56000705a4ae15b3ba68a5d2e644c", - "url": "https://api.github.com/repos/appium/appium/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c" + 'name': `v${APPIUM_VER}`, + 'zipball_url': 'https://api.github.com/repos/appium/appium/zipball/v1.9.0-beta.1', + 'tarball_url': 'https://api.github.com/repos/appium/appium/tarball/v1.9.0-beta.1', + 'commit': { + 'sha': '3c2752f9f9c56000705a4ae15b3ba68a5d2e644c', + 'url': 'https://api.github.com/repos/appium/appium/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c' }, - "node_id": "MDM6UmVmNzUzMDU3MDp2MS45LjAtYmV0YS4x" + 'node_id': 'MDM6UmVmNzUzMDU3MDp2MS45LjAtYmV0YS4x' }, { - "name": "v1.8.2-beta", - "zipball_url": "https://api.github.com/repos/appium/appium/zipball/v1.8.2-beta", - "tarball_url": "https://api.github.com/repos/appium/appium/tarball/v1.8.2-beta", - "commit": { - "sha": "5b98b9197e75aa85e7507d21d3126c1a63d1ce8f", - "url": "https://api.github.com/repos/appium/appium/commits/5b98b9197e75aa85e7507d21d3126c1a63d1ce8f" + 'name': 'v1.8.2-beta', + 'zipball_url': 'https://api.github.com/repos/appium/appium/zipball/v1.8.2-beta', + 'tarball_url': 'https://api.github.com/repos/appium/appium/tarball/v1.8.2-beta', + 'commit': { + 'sha': '5b98b9197e75aa85e7507d21d3126c1a63d1ce8f', + 'url': 'https://api.github.com/repos/appium/appium/commits/5b98b9197e75aa85e7507d21d3126c1a63d1ce8f' }, - "node_id": "MDM6UmVmNzUzMDU3MDp2MS44LjItYmV0YQ==" + 'node_id': 'MDM6UmVmNzUzMDU3MDp2MS44LjItYmV0YQ==' } ]); getStub.onCall(1).returns({ - "sha": "3c2752f9f9c56000705a4ae15b3ba68a5d2e644c", - "node_id": "MDY6Q29tbWl0NzUzMDU3MDozYzI3NTJmOWY5YzU2MDAwNzA1YTRhZTE1YjNiYTY4YTVkMmU2NDRj", - "commit": { - "author": { - "name": "Isaac Murchie", - "email": "isaac@saucelabs.com", - "date": "2018-08-17T19:48:00Z" + 'sha': '3c2752f9f9c56000705a4ae15b3ba68a5d2e644c', + 'node_id': 'MDY6Q29tbWl0NzUzMDU3MDozYzI3NTJmOWY5YzU2MDAwNzA1YTRhZTE1YjNiYTY4YTVkMmU2NDRj', + 'commit': { + 'author': { + 'name': 'Isaac Murchie', + 'email': 'isaac@saucelabs.com', + 'date': '2018-08-17T19:48:00Z' }, - "committer": { - "name": "Isaac Murchie", - "email": "isaac@saucelabs.com", - "date": "2018-08-17T19:48:00Z" + 'committer': { + 'name': 'Isaac Murchie', + 'email': 'isaac@saucelabs.com', + 'date': '2018-08-17T19:48:00Z' }, - "message": "v1.9.0-beta.1", - "tree": { - "sha": "2c0974727470eba419ea0b9951c52f72f8036b18", - "url": "https://api.github.com/repos/appium/appium/git/trees/2c0974727470eba419ea0b9951c52f72f8036b18" + 'message': 'v1.9.0-beta.1', + 'tree': { + 'sha': '2c0974727470eba419ea0b9951c52f72f8036b18', + 'url': 'https://api.github.com/repos/appium/appium/git/trees/2c0974727470eba419ea0b9951c52f72f8036b18' }, - "url": "https://api.github.com/repos/appium/appium/git/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c", - "comment_count": 0, - "verification": { - "verified": false, - "reason": "unsigned", - "signature": null, - "payload": null + 'url': 'https://api.github.com/repos/appium/appium/git/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c', + 'comment_count': 0, + 'verification': { + 'verified': false, + 'reason': 'unsigned', + 'signature': null, + 'payload': null } }, - "url": "https://api.github.com/repos/appium/appium/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c", - "html_url": "https://github.com/appium/appium/commit/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c", - "comments_url": "https://api.github.com/repos/appium/appium/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c/comments", + 'url': 'https://api.github.com/repos/appium/appium/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c', + 'html_url': 'https://github.com/appium/appium/commit/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c', + 'comments_url': 'https://api.github.com/repos/appium/appium/commits/3c2752f9f9c56000705a4ae15b3ba68a5d2e644c/comments', }); await verifyBuildInfoUpdate(false); }); }); describe('showConfig', function () { before(function () { - sinon.spy(console, "log"); + sinon.spy(console, 'log'); }); it('should log the config to console', async function () { const config = getBuildInfo(); @@ -177,7 +177,7 @@ describe('Config', function () { describe('warnNodeDeprecations', function () { let spy; before(function () { - spy = sinon.spy(logger, "warn"); + spy = sinon.spy(logger, 'warn'); }); beforeEach(function () { spy.resetHistory(); diff --git a/test/driver-e2e-specs.js b/test/driver-e2e-specs.js index c112b3caf..325ec2f47 100644 --- a/test/driver-e2e-specs.js +++ b/test/driver-e2e-specs.js @@ -15,8 +15,8 @@ import sinon from 'sinon'; chai.use(chaiAsPromised); const should = chai.should(); -const shouldStartServer = process.env.USE_RUNNING_SERVER !== "0"; -const caps = {platformName: "Fake", deviceName: "Fake", app: TEST_FAKE_APP}; +const shouldStartServer = process.env.USE_RUNNING_SERVER !== '0'; +const caps = {platformName: 'Fake', deviceName: 'Fake', app: TEST_FAKE_APP}; describe('FakeDriver - via HTTP', function () { let server = null; @@ -136,12 +136,12 @@ describe('FakeDriver - via HTTP', function () { it('should accept a combo of W3C and JSONWP capabilities but default to W3C', async function () { const combinedCaps = { - "desiredCapabilities": { + 'desiredCapabilities': { ...caps, }, - "capabilities": { - "alwaysMatch": {...caps}, - "firstMatch": [{ + 'capabilities': { + 'alwaysMatch': {...caps}, + 'firstMatch': [{ w3cParam: 'w3cParam', }], } @@ -162,14 +162,14 @@ describe('FakeDriver - via HTTP', function () { it('should accept a combo of W3C and JSONWP and if JSONWP has extraneous keys, they should be merged into W3C capabilities', async function () { const combinedCaps = { - "desiredCapabilities": { + 'desiredCapabilities': { ...caps, automationName: 'Fake', anotherParam: 'Hello', }, - "capabilities": { - "alwaysMatch": {...caps}, - "firstMatch": [{ + 'capabilities': { + 'alwaysMatch': {...caps}, + 'firstMatch': [{ w3cParam: 'w3cParam', }], } @@ -195,7 +195,7 @@ describe('FakeDriver - via HTTP', function () { capabilities: { alwaysMatch: { ...caps, - automationName: "BadAutomationName", + automationName: 'BadAutomationName', }, }, }; diff --git a/test/driver-specs.js b/test/driver-specs.js index 84c6dc738..14f6465aa 100644 --- a/test/driver-specs.js +++ b/test/driver-specs.js @@ -42,7 +42,7 @@ describe('AppiumDriver', function () { }); it(`should call inner driver's createSession with desired capabilities`, async function () { - mockFakeDriver.expects("createSession") + mockFakeDriver.expects('createSession') .once().withExactArgs(BASE_CAPS, undefined, null, []) .returns([SESSION_ID, BASE_CAPS]); await appium.createSession(BASE_CAPS); @@ -52,7 +52,7 @@ describe('AppiumDriver', function () { let defaultCaps = {deviceName: 'Emulator'}; let allCaps = _.extend(_.clone(defaultCaps), BASE_CAPS); appium.args.defaultCapabilities = defaultCaps; - mockFakeDriver.expects("createSession") + mockFakeDriver.expects('createSession') .once().withArgs(allCaps) .returns([SESSION_ID, allCaps]); await appium.createSession(BASE_CAPS); @@ -63,7 +63,7 @@ describe('AppiumDriver', function () { // should do nothing let defaultCaps = {platformName: 'Ersatz'}; appium.args.defaultCapabilities = defaultCaps; - mockFakeDriver.expects("createSession") + mockFakeDriver.expects('createSession') .once().withArgs(BASE_CAPS) .returns([SESSION_ID, BASE_CAPS]); await appium.createSession(BASE_CAPS); @@ -93,7 +93,7 @@ describe('AppiumDriver', function () { let sessions = await appium.getSessions(); sessions.should.have.length(3); - mockFakeDriver.expects("createSession") + mockFakeDriver.expects('createSession') .once().withExactArgs(BASE_CAPS, undefined, null, []) .returns([SESSION_ID, BASE_CAPS]); await appium.createSession(BASE_CAPS); @@ -107,7 +107,7 @@ describe('AppiumDriver', function () { mockFakeDriver.verify(); }); it('should call "createSession" with W3C capabilities argument, if provided', async function () { - mockFakeDriver.expects("createSession") + mockFakeDriver.expects('createSession') .once().withArgs(null, undefined, W3C_CAPS) .returns([SESSION_ID, BASE_CAPS]); await appium.createSession(undefined, undefined, W3C_CAPS); @@ -121,7 +121,7 @@ describe('AppiumDriver', function () { 'appium:someOtherParm': 'someOtherParm', }, }; - mockFakeDriver.expects("createSession") + mockFakeDriver.expects('createSession') .once().withArgs(null, undefined, { alwaysMatch: { ...w3cCaps.alwaysMatch, @@ -158,7 +158,7 @@ describe('AppiumDriver', function () { }, }; - mockFakeDriver.expects("createSession") + mockFakeDriver.expects('createSession') .once().withArgs(jsonwpCaps, undefined, expectedW3cCaps) .returns([SESSION_ID, jsonwpCaps]); @@ -185,7 +185,7 @@ describe('AppiumDriver', function () { }); it('should call inner driver\'s deleteSession method', async function () { const [sessionId] = (await appium.createSession(BASE_CAPS)).value; - mockFakeDriver.expects("deleteSession") + mockFakeDriver.expects('deleteSession') .once().withExactArgs(sessionId, []) .returns(); await appium.deleteSession(sessionId); @@ -252,7 +252,7 @@ describe('AppiumDriver', function () { it('should remove session if inner driver unexpectedly exits with an error', async function () { let [sessionId,] = (await appium.createSession(_.clone(BASE_CAPS))).value; // eslint-disable-line comma-spacing _.keys(appium.sessions).should.contain(sessionId); - appium.sessions[sessionId].unexpectedShutdownDeferred.reject(new Error("Oops")); + appium.sessions[sessionId].unexpectedShutdownDeferred.reject(new Error('Oops')); // let event loop spin so rejection is handled await sleep(1); _.keys(appium.sessions).should.not.contain(sessionId); diff --git a/test/helpers.js b/test/helpers.js index c042384c3..a6b5aaabb 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -5,9 +5,9 @@ import {insertAppiumPrefixes} from '../lib/utils'; const TEST_HOST = 'localhost'; const TEST_PORT = 4723; -const TEST_FAKE_APP = path.resolve(__dirname, "..", "..", "node_modules", - "appium-fake-driver", "test", "fixtures", - "app.xml"); +const TEST_FAKE_APP = path.resolve(__dirname, '..', '..', 'node_modules', + 'appium-fake-driver', 'test', 'fixtures', + 'app.xml'); function initSession (caps) { let resolve = () => {}; diff --git a/test/shrinkwrap-specs.js b/test/shrinkwrap-specs.js index d0eb6654f..542f21773 100644 --- a/test/shrinkwrap-specs.js +++ b/test/shrinkwrap-specs.js @@ -20,7 +20,7 @@ describe.skip('shrinkwrap checks', function () { expect(shrinkwrap.dependencies, 'no shrinkwrap file found. run `npm shrinkwrap`').to.exist; _.values(shrinkwrap.dependencies).length.should.be.above(10); let message = "'fsevents' entry found in shrinkwrap. It causes problems " + - "on non-Mac systems. run `gulp fixShrinkwrap` and try again"; + 'on non-Mac systems. run `gulp fixShrinkwrap` and try again'; expect(shrinkwrap.dependencies.fsevents, message).to.not.exist; }); });