You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When embedding Appium with some drivers into a single npm package, I would like Appium to reliably discover the drivers. However, Appium's useDrivers param only accepts string and we can pass neither the full path of drivers nor actual driver module. What we can do is to pass the parent directory of node_modules as appiumHome and hope that the drivers are installed into that node_modules directory. However, depending on the environment, the drivers might be installed in different node_modules such as in the parent's directory. This can cause unpredictable behavior.
Describe the solution you'd like
Appium should support "embedded" use case like the following:
In this code, we are directly passing the actual instance of appium-xcuitest-driver. So that we can completely bypass Appium's own way of discovering drivers and we can simply rely on Node.js's module discovery mechanism, which is easier to reason about and consistent with other parts of the system.
Conceptually, this is similar to how ESLint flat config works, where users need to explicitly import ESLint plugins without relying on ESLint's its own plugin discovery mechanism. It looks like this is a recent trend to let Node.js resolve "plugins" without relying on library specific discovery mechanism.
Additional context
I am not sure about the other usage of appiumHome except for discovering the drivers but we might want to have this automatically configured (e.g. just node_modules where appium is installed) for the embedded use case as well. We might want to have additional flag to opt-in this behavior
The text was updated successfully, but these errors were encountered:
naruaway
changed the title
[Feat]: Allow passing already resolved drivers in useDrivers for reliably embedding Appium into an npm package with drivers
[Feat]: Allow passing resolved drivers to reliably embed Appium with drivers into an npm package
Mar 12, 2024
Is your feature request related to a problem? Please describe.
When embedding Appium with some drivers into a single npm package, I would like Appium to reliably discover the drivers. However, Appium's
useDrivers
param only acceptsstring
and we can pass neither the full path of drivers nor actual driver module. What we can do is to pass the parent directory ofnode_modules
asappiumHome
and hope that the drivers are installed into thatnode_modules
directory. However, depending on the environment, the drivers might be installed in different node_modules such as in the parent's directory. This can cause unpredictable behavior.Describe the solution you'd like
Appium should support "embedded" use case like the following:
In this code, we are directly passing the actual instance of
appium-xcuitest-driver
. So that we can completely bypass Appium's own way of discovering drivers and we can simply rely on Node.js's module discovery mechanism, which is easier to reason about and consistent with other parts of the system.Conceptually, this is similar to how ESLint flat config works, where users need to explicitly
import
ESLint plugins without relying on ESLint's its own plugin discovery mechanism. It looks like this is a recent trend to let Node.js resolve "plugins" without relying on library specific discovery mechanism.Additional context
I am not sure about the other usage of
appiumHome
except for discovering the drivers but we might want to have this automatically configured (e.g. justnode_modules
where appium is installed) for the embedded use case as well. We might want to have additional flag to opt-in this behaviorThe text was updated successfully, but these errors were encountered: