Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop printing caps twice on session start #13101

Merged
merged 3 commits into from
Aug 22, 2019

Conversation

imurchie
Copy link
Contributor

Proposed changes

Remove generic logging of incoming capabilities, since this is now printed elsewhere.

Currently, logs are like

[Appium] Appium v1.15.0-beta.0 creating new AndroidUiautomator2Driver (v1.34.0) session
[Appium] Capabilities:
[Appium]   platformVersion: null
[Appium]   platformName: Android
[Appium]   deviceName: Android
[Appium]   app: /Users/isaac/code/appium/sample-code/apps/ApiDemos-debug.apk
[Appium]   automationName: UIAutomator2
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "appium:platformVersion": null,
[debug] [BaseDriver]     "platformName": "Android",
[debug] [BaseDriver]     "appium:deviceName": "Android",
[debug] [BaseDriver]     "appium:app": "/Users/isaac/code/appium/sample-code/apps/ApiDemos-debug.apk",
[debug] [BaseDriver]     "appium:automationName": "UIAutomator2"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 8cad7722-2b38-4b5d-90ff-4226a2915b9e
[Appium] Appium v1.15.0-beta.0 creating new AndroidUiautomator2Driver (v1.34.0) session
[Appium] Capabilities:
[Appium]   platformName: Android
[Appium]   automationName: UiAutomator2
[Appium]   deviceName: My Android Device
[Appium]   platformVersion: null
[Appium]   app: /Users/isaac/code/appium/sample-code/apps/ApiDemos-debug.apk
[Appium]   appActivity: .app.SearchInvoke
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {
[debug] [BaseDriver]   "platformName": "Android",
[debug] [BaseDriver]   "automationName": "UiAutomator2",
[debug] [BaseDriver]   "deviceName": "My Android Device",
[debug] [BaseDriver]   "platformVersion": null,
[debug] [BaseDriver]   "app": "/Users/isaac/code/appium/sample-code/apps/ApiDemos-debug.apk",
[debug] [BaseDriver]   "appActivity": ".app.SearchInvoke"
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 3daf41b4-a9d5-4c6c-a644-6b3fdc20625e

With this PR,

[Appium] Appium v1.15.0-beta.0 creating new AndroidUiautomator2Driver (v1.34.0) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "appium:platformVersion": null,
[debug] [BaseDriver]     "platformName": "Android",
[debug] [BaseDriver]     "appium:deviceName": "Android",
[debug] [BaseDriver]     "appium:app": "/Users/isaac/code/appium/sample-code/apps/ApiDemos-debug.apk",
[debug] [BaseDriver]     "appium:automationName": "UIAutomator2"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 03196548-0200-489d-b1c1-be44ef5ecf5e
[Appium] Appium v1.15.0-beta.0 creating new AndroidUiautomator2Driver (v1.34.0) session
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {
[debug] [BaseDriver]   "platformName": "Android",
[debug] [BaseDriver]   "automationName": "UiAutomator2",
[debug] [BaseDriver]   "deviceName": "My Android Device",
[debug] [BaseDriver]   "platformVersion": null,
[debug] [BaseDriver]   "app": "/Users/isaac/code/appium/sample-code/apps/ApiDemos-debug.apk",
[debug] [BaseDriver]   "appActivity": ".app.SearchInvoke"
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 341e9778-289a-42cb-bcf8-da09381f4d9b

Types of changes

What types of changes does your code introduce to Appium?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

@coveralls
Copy link

coveralls commented Aug 21, 2019

Coverage Status

Coverage decreased (-0.5%) to 89.383% when pulling 97337b7 on isaac-new-session-announcement into a1d4241 on master.

@@ -47,10 +47,10 @@ function postRequest (data, addr, port) {
}

// Move Selenium 3 configuration properties to configuration object
if (!jsonObject.hasOwnProperty('configuration')) {
if (!Object.prototype.hasOwnProperty.call(jsonObject, 'configuration')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot we simply use _.has ?

let configuration = {};
for (let property in jsonObject) {
if (jsonObject.hasOwnProperty(property) && property !== 'capabilities') {
for (const property in jsonObject) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_toPairs might also be easier to read here

@imurchie imurchie merged commit 8fba6bd into master Aug 22, 2019
@imurchie imurchie deleted the isaac-new-session-announcement branch August 22, 2019 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants