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

docs(appium): add an example for getSessions endpoint and add Deprecated for endpoionts which have no vendor key in the path and not in w3c spec #19851

Merged
merged 7 commits into from
Mar 5, 2024

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Mar 4, 2024

Proposed changes

https://github.com/appium/appium-inspector/pull/1369/files#r1510701460

It looks like we should put an example of the response of /sessions since it is not in W3C webdriver spec. This example would help.

e.g. https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessions

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)
  • Documentation Update (if none of the other choices apply)

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 the necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions github-actions bot added appium core Documentation related to writing, reading, or generating documentation labels Mar 4, 2024
`MultiSessionData`<`C`\>[]

A list of session data objects
A list of session data objects.
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should mark this endpoint as deprecated and not recommended for use, same as getSession one as they are not part of the W3C spec.

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense. I have added a few deprecated marks by following this file's others.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are there any replacements for those deprecated endpoints? They might be used in the Inspector.

Copy link
Member Author

Choose a reason for hiding this comment

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

No for now I believe.
I think the inspector can be just "attach to a session" and users should give explicit session id. Current attach to an existing session does not let a user set an arbitrary session id by themselves, but it can have such setting an arbitrary session id to "attach to" the session.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That would be a lot more inconvenient than the current process of automatic session discovery. Maybe this information can be added in the /status endpoint response, similarly to Selenium Grid? And for GET session/:sessionId, maybe something like GET /session/:sessionId/appium/info?
Can't comment on getLog and getLogTypes, but those could also just be moved to the corresponding /session/:sessionId/appium/... endpoint.

Copy link
Member Author

Choose a reason for hiding this comment

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

Then, we might need to add mobile: getSessions as current base method to define additional commands not in w3c webdriver spec.

/status should be ready and message https://www.w3.org/TR/webdriver2/#status , so not for this usage.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, or maybe we could define the /sessions endpoint in a new plugin? but not in the base driver?

Copy link
Collaborator

Choose a reason for hiding this comment

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

mobile: getSessions sort of implies it isn't compatible with other Appium-supported platforms like Mac. And while having this in a separate plugin is feasible, from a user perspective it would feel quite arbitrary to separate this.

I think /status could still work here because while it has to include ready and message, it "may additionally include arbitrary meta information that is specific to the implementation". Selenium Grid also seems to do this, though I'm not sure if its /status endpoint is W3C-compliant.

Copy link
Member Author

@KazuCocoa KazuCocoa Mar 4, 2024

Choose a reason for hiding this comment

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

then it looks like a new plugin for it would be nice. I don't know that response format by the grid, so we may need to check the response format first.
e.g. selenium-grid-status plugin for the new /status format like the grid usage (need to check the format), sessions-plugin to keep /sessions

Copy link
Member Author

Choose a reason for hiding this comment

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

#19856 for the plugin

@KazuCocoa KazuCocoa changed the title docs(appium): add an example for getSessions endpoint docs(appium): add an example for getSessions endpoint and add Deprecated for endpoiont which has no vendor in the path and not in w3c Mar 4, 2024
@KazuCocoa KazuCocoa changed the title docs(appium): add an example for getSessions endpoint and add Deprecated for endpoiont which has no vendor in the path and not in w3c docs(appium): add an example for getSessions endpoint and add Deprecated for endpoiont which has no vendor in the path and not in w3c spec Mar 4, 2024
@KazuCocoa KazuCocoa changed the title docs(appium): add an example for getSessions endpoint and add Deprecated for endpoiont which has no vendor in the path and not in w3c spec docs(appium): add an example for getSessions endpoint and add Deprecated for endpoionts which have no vendor key in the path and not in w3c spec Mar 4, 2024
Copy link
Collaborator

@eglitise eglitise left a comment

Choose a reason for hiding this comment

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

At this point I would prefer if the deprecation labels were moved to a separate PR and merged after #19856/#19857/#19858

For the label format in MkDocs, it would also be better to use something like

!!! warning "Deprecated"

    Please use the `<endpoint>` endpoint instead

XCUITest driver docs already use this format.

@KazuCocoa
Copy link
Member Author

KazuCocoa commented Mar 5, 2024

Sure, then this pr can drop deprecated marks from sessions and session/<session_id>. These should be ok, and will create another Pr to modify the format with existing ones as well. -> #19859

Btw, other Appium clients will drop/dropped these endpoint call (since dependent selenium already dropped them) so maybe the appium-inspector usage is the main discussion focus right now.

@github-actions github-actions bot added @appium/execute-driver-plugin Bug a problem that needs fixing Dependencies issues with dependencies labels Mar 5, 2024
@KazuCocoa KazuCocoa removed Bug a problem that needs fixing Dependencies issues with dependencies labels Mar 5, 2024
@github-actions github-actions bot added Bug a problem that needs fixing and removed @appium/execute-driver-plugin labels Mar 5, 2024
@github-actions github-actions bot added the Dependencies issues with dependencies label Mar 5, 2024
@github-actions github-actions bot removed the Dependencies issues with dependencies label Mar 5, 2024
@KazuCocoa KazuCocoa removed the Bug a problem that needs fixing label Mar 5, 2024
@KazuCocoa KazuCocoa merged commit 7f7939d into master Mar 5, 2024
5 checks passed
@KazuCocoa KazuCocoa deleted the add-example-getsessions branch March 5, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appium core Documentation related to writing, reading, or generating documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants