Skip to content

feat: add support for plugins#14556

Merged
jlipps merged 10 commits into
appium:2.0from
jlipps:2.0
Aug 31, 2020
Merged

feat: add support for plugins#14556
jlipps merged 10 commits into
appium:2.0from
jlipps:2.0

Conversation

@jlipps

@jlipps jlipps commented Jul 14, 2020

Copy link
Copy Markdown
Member

This PR adds the following:

  • a new appium plugin CLI which has the same shape and behavior as the driver CLI (so lots of refactoring to share code)
  • the ability for plugins to modify the Appium express app and http server
  • the ability for plugins to add new (or override old) routes/commands to the method map
  • the ability for plugins to handle specific server commands (either to wrap the original behavior or to replace it)

As of now, every installed plugin is always active. A next step is to make it so that you have to opt into installed plugins, via server args or caps.

This depends on some BaseDriver changes (appium/appium-base-driver#422)

The plugin used for testing is the new @appium/fake-plugin, which is built on a base class (@appium/base-plugin) that everyone can use to build their own plugins.

@coveralls

coveralls commented Jul 14, 2020

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-1.7%) to 70.529% when pulling da9ab55 on jlipps:2.0 into 3812e03 on appium:2.0.

Comment thread lib/appium.js Outdated
Comment thread lib/appium.js Outdated
Comment thread lib/appium.js
Comment thread lib/cli/args.js Outdated
@mykola-mokhnach

Copy link
Copy Markdown
Collaborator

The PR is complicated and hard to read and understand without a spec and any documentation. Thus, I would not be able to review it properly

@jlipps

jlipps commented Jul 15, 2020

Copy link
Copy Markdown
Member Author

The PR is complicated and hard to read and understand without a spec and any documentation. Thus, I would not be able to review it properly

@mykola-mokhnach i understand. I will work on updating the appium 2.0 plugin spec to reflect the new reality. In the meantime, does the extensive commenting on the base plugin help? https://github.com/appium/appium-base-plugin/blob/master/lib/plugin.js

@jlipps

jlipps commented Jul 15, 2020

Copy link
Copy Markdown
Member Author

@mykola-mokhnach I updated the Appium 2.0 draft spec (plugins section) so you can read my intentions here in prose.

@jlipps

jlipps commented Jul 15, 2020

Copy link
Copy Markdown
Member Author

OK @mykola-mokhnach I cleaned up a few things per your request, did some refactoring, and finished implementing the spec as described in that gist. What do you think?

Comment thread lib/appium.js Outdated
Comment thread lib/appium.js Outdated
Comment thread lib/appium.js Outdated
Comment thread lib/appium.js
Comment thread lib/appium.js Outdated
Comment thread lib/appium.js Outdated
Comment thread lib/appium.js Outdated
Comment thread lib/cli/extension-command.js Outdated
Comment thread lib/cli/extension-command.js
Comment thread lib/cli/parser-helpers.js Outdated
Comment thread lib/extension-config.js
Comment thread lib/main.js Outdated
@mykola-mokhnach

Copy link
Copy Markdown
Collaborator

it looks like tests are not very happy

@jlipps

jlipps commented Jul 20, 2020

Copy link
Copy Markdown
Member Author

it looks like tests are not very happy

This depends on the basedriver code which has not been published, so tests will fail until that PR is merged, published, and this one updated.

@jlipps

jlipps commented Jul 22, 2020

Copy link
Copy Markdown
Member Author

ok, basedriver PR has been merged and brought in here, so let's see how CI does.

@jlipps jlipps merged commit 70c886f into appium:2.0 Aug 31, 2020
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.

3 participants