question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

appium 2.0 should automatically install a default set of drivers

See original GitHub issue

The problem

Appium 1, as we know, is batteries-included: when you install appium@1, you get drivers. It’s all one package. This is not the case with Appium 2. To get the drivers which were previously included, users must take extra steps (e.g., appium driver install <driver> perhaps multiple times).

While we personally may not feel this pain, I cannot emphasize enough how poor this experience is for users. A major complaint for the past many years in the JS ecosystem has been this: packages like Babel don’t do much and you have to install a slew of plugins to make it do literally anything. When you install software, that software should do something.. Sensible defaults, in other words.

I get the rationale behind decoupling modules. However, “the unix philosophy” (like anything in software development) is a tradeoff. I assert (without any evidence, mind you) that this philosophy is precisely why the command-line is so daunting to new developers (I’m done shaking my fist at clouds now).

Potential Solutions

So: Appium should do something about this. There are several ways to go about it, with the ultimate goal of providing a better out-of-box-experience. Ideas:

  1. A metapackage. Unfortunately, this will be confusing for users if any package name is chosen except appium. So then, the metapackage would be appium, and the appium@2.x in packages/appium would become e.g., @appium/core (I am going to hand-wave over implementation details for now).
  2. Abuse postinstall to check APPIUM_HOME for installed drivers, and install the default set if no drivers are found.
  3. On the first run of the server, check for drivers. If none are installed, install the default set, then continue. Provide a command-line flag to disable this behavior. I’m unsure of the interaction with --driver here, but I think the behavior could safely be disabled in that case (since --driver nonexistent-driver should fail anyway).

I prefer either 1 or 3.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jlippscommented, Sep 8, 2021

@StephanB75 I don’t think it’s possible for Appium, when it’s being installed, to know what is in the package.json of the project that is installing it as a dependency. However you could create a postinstall script in your project that installs drivers, for example:

{
    ...,
    "scripts": {
        "postinstall": "npx appium driver install xcuitest && npx appium plugin install images"
    }
}

in this case, when you npm install in the package, it will run these commands automatically. note that you’d probably also want to set a distinct APPIUM_HOME env for each project unless you want them to share drivers.

0reactions
boneskullcommented, Dec 6, 2021

Please see https://github.com/appium/appium/discussions/16149 for discussion about installation of drivers via npm.

That’s something I’d like to address, but isn’t the aim of this issue (however, it may be a prerequisite).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing Appium 2.0 and the Driver and Plugins CLI - HeadSpin
One question you might have had is: where does Appium install drivers when you use the driver CLI? By default, Appium creates a...
Read more >
Getting Started - Appium
Appium can be installed in one of two ways: via NPM or by downloading ... The minimum set of required capabilities for any...
Read more >
Automate Everything, Appium 2.0 and New Drivers - YouTube
... forward-looking topics in test automation.In this webinar, we cover: - Appium 2.0 sneak preview, coming 2020- Espresso Driver, pros and...
Read more >
What's new in Appium 2.x | it's installation | configuration
appium_java_tutorial_qavbox # appium #java-clientThis video will explain the appium server 2.x changes and how to migrate to 2.x and usage.
Read more >
Getting Started with Appium 2.0: Overview of the Core New ...
After the installation, you would need to install the relevant driver/s for your app under test. Appium 2.0 decouples its supported ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found