All Projects → linkedin → Test Butler

linkedin / Test Butler

Licence: apache-2.0
Reliable Android Testing, at your service

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Test Butler

Datahub
The Metadata Platform for the Modern Data Stack
Stars: ✭ 4,232 (+333.61%)
Mutual labels:  linkedin
Linkedin scraper
A library that scrapes Linkedin for user data
Stars: ✭ 413 (-57.68%)
Mutual labels:  linkedin
Brooklin
An extensible distributed system for reliable nearline data streaming at scale
Stars: ✭ 668 (-31.56%)
Mutual labels:  linkedin
Laravel Socialite
Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban
Stars: ✭ 296 (-69.67%)
Mutual labels:  linkedin
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (-65.57%)
Mutual labels:  linkedin
Scrapedin
LinkedIn Scraper (currently working 2020)
Stars: ✭ 453 (-53.59%)
Mutual labels:  linkedin
KASocialLogins
This is Social login library in which you can login through Facebook , LinkedIn and Google
Stars: ✭ 15 (-98.46%)
Mutual labels:  linkedin
Cordova Plugin Linkedin
Cordova plugin for LinkedIn
Stars: ✭ 17 (-98.26%)
Mutual labels:  linkedin
Linkedin Api
👨‍💼Linkedin API for Python
Stars: ✭ 401 (-58.91%)
Mutual labels:  linkedin
Pygradle
Using Gradle to build Python projects
Stars: ✭ 525 (-46.21%)
Mutual labels:  linkedin
Linkedin
Linkedin Scraper using Selenium Web Driver, Chromium headless, Docker and Scrapy
Stars: ✭ 309 (-68.34%)
Mutual labels:  linkedin
Social Media Profiles Regexs
📇 Extract social media profiles and more with regular expressions
Stars: ✭ 324 (-66.8%)
Mutual labels:  linkedin
Socioboard 4.0
Socioboard is world's first and open source Social Technology Enabler. Socioboard Core is our flagship product.
Stars: ✭ 475 (-51.33%)
Mutual labels:  linkedin
Linkedin To Json Resume
An exporter from a LinkedIn profile to JSON Résumé
Stars: ✭ 276 (-71.72%)
Mutual labels:  linkedin
Attacksurfacemapper
AttackSurfaceMapper is a tool that aims to automate the reconnaissance process.
Stars: ✭ 702 (-28.07%)
Mutual labels:  linkedin
The Endorser
An OSINT tool that allows you to draw out relationships between people on LinkedIn via endorsements/skills.
Stars: ✭ 269 (-72.44%)
Mutual labels:  linkedin
Yii2 Authclient
Yii 2 authclient extension.
Stars: ✭ 430 (-55.94%)
Mutual labels:  linkedin
Linkedinsignin
Simple view controller to log in and retrieve an access token from LinkedIn.
Stars: ✭ 31 (-96.82%)
Mutual labels:  linkedin
Play Authenticate
An authentication plugin for Play Framework 2.x (Java)
Stars: ✭ 813 (-16.7%)
Mutual labels:  linkedin
Operative Framework
operative framework is a OSINT investigation framework, you can interact with multiple targets, execute multiple modules, create links with target, export rapport to PDF file, add note to target or results, interact with RESTFul API, write your own modules.
Stars: ✭ 511 (-47.64%)
Mutual labels:  linkedin

Test Butler

Build Status Maven Central

Reliable Android testing, at your service.

Motivation

Test Butler was inspired by the Google presentation "Going Green: Cleaning up the Toxic Mobile Environment". For more background, read the Test Butler announcement blog post.

What does it do?

  • Stabilizes the Android emulator, to help prevent test failures caused by emulator issues.
    • Disables animations so Espresso tests can run properly.
    • Disables crash & ANR dialogs so a system app misbehaving won't trigger a popup that causes your UI tests to fail.
    • Locks the keyguard, WiFi radio, and CPU to ensure they don't go to sleep unexpectedly while tests are running.
    • Disables system spell checker to avoid redline highlights and text auto correction.
  • Handles changing global emulator settings and holds relevant permissions so your app doesn't have to.
    • Enable/disable WiFi: Test Butler allows tests to simulate a situation where WiFi is not connected or changes availability at some point.
    • Change device orientation: Tests can manually set the orientation of the device during test execution.
    • Set location services mode: Test Butler lets your code simulate different location services modes, like battery saver or high accuracy.
    • Set application locale: Tests can set a custom Locale object for their application to simulate running the app in another language.
    • Grant runtime permissions: Tests can grant Marshmallow's runtime permissions to their application directly from test code.
    • Use hardware IME: Tests can tell the system to prefer the hardware IME.
    • Control immersive mode confirmation: Tests can enable or disable immersive mode confirmation.

How does it work?

Test Butler is a two-part project. It includes an Android library that your test code can depend on, as well as a companion Android app apk that must be installed on your Android emulator before using Test Butler. You can build the Test Butler APK yourself from source, or download the binary from Maven Central

The Test Butler library is a thin wrapper around an AIDL interface to give your tests a safe way to talk to the Test Butler app's service running in the background on the emulator.

The Test Butler app is signed using the system keystore for the Android emulator, so it is automatically granted signature-level permissions when installed. This means granting permissions via adb is not necessary. It also means that this app can only be installed on emulators that use the stock Android keystore!

Being a system app makes Test Butler much easier to use than existing Android solutions for changing emulator settings. To disable animations, you just need a single line of code in your app; no extra permissions in your debug manifest, no granting permissions via adb, no Gradle plugin to integrate.

Test Butler can even use permissions that can't be granted via adb, like the SET_ACTIVITY_WATCHER permission, which lets Test Butler disable crash & ANR dialogs during tests.

Any "gotchas" to look out for?

Only a few:

Test Butler helper app requires an emulator image with stock Android else it won't install, therefore it will not work with non-stock emulator images such as ones with Google APIs or Google Play!

Test Butler adds a custom IActivityController to the system to be able to suppress crash & ANR dialogs. This technique is also used internally by the Monkey tool. Unfortunately, the implementation of the isUserAMonkey() method takes advantage of the fact that the Monkey class is the only thing inside Android that sets an IActivityController and returns true whenever one is set.

This means that isUserAMonkey() will return true while Test Butler is running! If your app uses this method to invoke different behavior during actual monkey testing, you may encounter issues while running tests with Test Butler. An easy fix is to create a helper method in your app to call instead of isUserAMonkey(), which returns false while instrumentation tests are running and calls through to the real isUserAMonkey() when the app is not being instrumented.

Also, you can use methods in the TestButler class in the @BeforeClass & @AfterClass of a test class. However, be warned that the test suite will not report that the Test Butler app is not installed, instead it will skip the test. This is due to a bug in Android testing support.

Download

Download the latest .apk and .aar via Maven:

    <dependency>
      <groupId>com.linkedin.testbutler</groupId>
      <artifactId>test-butler-library</artifactId>
      <version>2.2.1</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.linkedin.testbutler</groupId>
      <artifactId>test-butler-app</artifactId>
      <version>2.2.1</version>
      <type>pom</type>
    </dependency>

or Gradle:

    androidTestImplementation 'com.linkedin.testbutler:test-butler-library:2.2.1'
    androidTestUtil 'com.linkedin.testbutler:test-butler-app:2.2.1'

You can also download the apk file manually from Maven Central if you prefer.

Getting Started

Install the Test Butler apk on your emulator prior to running tests, then add the following to your test runner class:

public class ExampleTestRunner extends AndroidJUnitRunner {
  @Override
  public void onStart() {
      TestButler.setup(getTargetContext());
      super.onStart();
  }

  @Override
  public void finish(int resultCode, Bundle results) {
      TestButler.teardown(getTargetContext());
      super.finish(resultCode, results);
  }
}

To change settings on the device from your tests, just use the methods in the TestButler class. For example:

@Before
public void setup() {
  TestButler.setLocationMode(Settings.Secure.LOCATION_MODE_OFF);
}

@Test
public void verifyBehaviorWithNoLocation() {
  // ...
}

@After
public void teardown() {
  TestButler.setLocationMode(Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);
}

NB: See gotchyas above to see why @BeforeClass & @AfterClass aren't used here.

Snapshots

You can use snapshot builds to test the latest unreleased changes. A new snapshot is published after every merge to the main branch by the Deploy Snapshot Github Action workflow.

Just add the Sonatype snapshot repository to your Gradle scripts:

repositories {
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots/"
    }
}

You can find the latest snapshot version to use in the gradle.properties file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].