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

Load plugins dynamically #562

Closed
NivedhaSenthil opened this issue May 22, 2019 · 1 comment

Comments

Projects
4 participants
@NivedhaSenthil
Copy link
Member

commented May 22, 2019

Taiko will be dynamically loading plugins and will let plugins override apis.

  • run with env variable like
TAIKO_PLUGIN='android'
TAIKO_PLUGIN='awslambda'
  • or using taiko runner like taiko code.js --plugin 'android'
  • as a fallback can load plugins from dependencies
  • export plugin object instead of exporting apis from plugin (eg: taiko-screencast plugin apis will exports via object named screencast and apis can be accessed like screencase.start() )
  • use convention taiko-<plugin> - all taiko plugin should prefix taiko-

Event driven pattern on actions

  • Plugins should not have taiko as dependencies it should use the same used in users code
  • loadPlugin() api should give taiko and eventHandler to plugin via callBack - callback is currently named clientHandler could be called init which will initialize the plugin (may not need an plugin id if dynamic loading is done)
  • all other communication between plugin and taiko should be based on event (eg: whenever a connection is done taiko emits an emit so that plugin can listen and update its cri client)

@NivedhaSenthil NivedhaSenthil added this to Backlog in Gauge Q2 2019 via automation May 22, 2019

@Debashis9012 Debashis9012 moved this from Backlog to Ready for Development in Gauge Q2 2019 May 22, 2019

@luciferankon luciferankon moved this from Ready for Development to In Progress in Gauge Q2 2019 May 27, 2019

negiDharmendra added a commit that referenced this issue May 28, 2019

negiDharmendra added a commit that referenced this issue May 29, 2019

Autoload plugin : #562
          - Export plugins API's under plugin ID.
          - Override taiko API's if overridden by plugin.

negiDharmendra added a commit that referenced this issue May 29, 2019

Autoload plugin : #562
          - Pass taiko as dependency to runFile and repl module.
          - Set plugin name in TAIKO_PLUGIN env when provided.

negiDharmendra added a commit that referenced this issue May 29, 2019

Autoload plugin : #562
          - Throw error when more than one plugin tries to override the same taiko API

luciferankon added a commit that referenced this issue May 30, 2019

negiDharmendra added a commit to getgauge-contrib/taiko-screencast that referenced this issue May 30, 2019

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Export plugins API's under plugin ID.
          - Override taiko API's if overridden by plugin.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Pass taiko as dependency to runFile and repl module.
          - Set plugin name in TAIKO_PLUGIN env when provided.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Throw error when more than one plugin tries to override the same taiko API

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Do not create wrapper function when exported API is not a function.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Refactored examples/browserLauncher to accommodate Taiko's autoload plugin feature.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Export plugins API's under plugin ID.
          - Override taiko API's if overridden by plugin.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Pass taiko as dependency to runFile and repl module.
          - Set plugin name in TAIKO_PLUGIN env when provided.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Throw error when more than one plugin tries to override the same taiko API

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Do not create wrapper function when exported API is not a function.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
          - Refactored examples/browserLauncher to accommodate Taiko's autoload plugin feature.

negiDharmendra added a commit that referenced this issue May 30, 2019

Autoload plugin : #562
       - Refactored plugins test to use mocha and rewire

luciferankon added a commit that referenced this issue May 31, 2019

luciferankon added a commit that referenced this issue May 31, 2019

@shubhamsc shubhamsc moved this from In Progress to Testing in Gauge Q2 2019 Jun 3, 2019

@Debashis9012

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

This enhancement has been verified and fixed based on the below observation.
Observation:
taiko allowing the plugins to override the apis.
Commit version: 7493c6afa8565c8482f8f01ada43c32dd1185627

Gauge Q2 2019 automation moved this from Testing to Done Jun 11, 2019

negiDharmendra added a commit to negiDharmendra/taiko-android that referenced this issue Jun 28, 2019

negiDharmendra added a commit to negiDharmendra/taiko-android that referenced this issue Jun 28, 2019

negiDharmendra added a commit to negiDharmendra/taiko-android that referenced this issue Jul 3, 2019

negiDharmendra added a commit to negiDharmendra/taiko-android that referenced this issue Jul 3, 2019

saikrishna321 added a commit to saikrishna321/taiko-android that referenced this issue Jul 3, 2019

Autoload plugin (#3)
* WIP autoload plugin

* Changed clientHandler API to init. getgauge/taiko#562

* Moved taiko to devDependencies. getgauge/taiko##562

* Fixed tests. getgauge/taiko#562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.