Appfigurate™️
HomeDocumentation
  • Introducing Appfigurate™️ 3
  • Getting Started
    • Getting Started
    • Examples
    • Upgrade guide
      • v1.4.0 to v2.2.0
      • v2.1.1 to v2.2.0
      • v2.2.1 to v3.0.0
      • v3.2.1 to v4.0.0
    • iOS native app integration
      • iOS app extension integration
    • watchOS app integration
      • watchOS app extension integration
    • Android native app integration
    • Mobile Flutter integration
      • Flutter iOS
      • Flutter Android
    • React Native integration
      • iOS native module integration
      • Android native module integration
      • JavaScript integration
    • Third party remote configuration providers
      • Firebase Remote Config
      • Launch Darkly
      • Other third party remote configuration providers
  • Configuration subclasses
    • Supported property types
      • Boolean
      • Integer
      • Float
      • Double
      • Plain String
      • Encrypted String
    • Custom executable actions
    • Slider icon types
  • Additional reading
    • Info.plist options
    • AndroidManifest.xml options
    • Displaying overridden configuration
    • Security
      • Best practice
      • Encryption
      • Export compliance
      • App Store compliance
      • PrivacyInfo.xcprivacy
      • Rotating your private key
  • Automation testing
    • iOS native app automation testing
    • Android native automation testing
  • API
    • iOS and watchOS API
    • Android API
    • Mobile Flutter API
    • React Native API
  • Appfigurate User Guide
    • Introduction
    • Main menu
    • Select app
    • Add app
    • Import app
    • Install example apps
    • Settings
      • Passcode Lock
      • Restore
      • Backup
      • Delete all apps and Settings
      • Analytics
    • Edit app
    • Configure app
    • Permissions
  • Appfigurate SE user guide
    • Introduction
    • Manual encryption
      • ENCRYPTED_STRING macro/function
      • ENCRYPTED_STRING_IOS_WATCHOS macro/function
    • Setup iOS Simulator app
    • Setup Android Emulator app
    • Xcode source editor extension
      • Troubleshooting
    • Real device cloud testing services
      • BrowserStack
  • LEGAL
    • License Agreement
    • Privacy Policy
    • Release History
    • Third party notices
Powered by GitBook
On this page
  • Ensure allowInvalidSignatures returns true
  • Test setup
  • Applying configuration to an automation test
  • Additional automation launch methods
  • Applying configuration at runtime to the app under test
  1. Automation testing

Android native automation testing

PreviousiOS native app automation testingNextReact Native API

Last updated 5 months ago

Appfigurate doesn't currently support automation testing Mobile Flutter apps or React Native apps.

Appfigurate can change the configuration of an Android app being automation tested using using Espresso.

An example UI automation test using Espresso is available in AppfigurateExample. To test, ensure MainActivityTest is selected as the Run Configuration, then tap the run button.

Ensure allowInvalidSignatures returns true

Test setup

private var config: ExampleConfiguration? = null
    
@Before
fun setUp() {
    config = Configuration.sharedConfiguration() as ExampleConfiguration
    config?.automationReset()
}
private ExampleConfiguration config;

@Before
public void setUp() {
    config = (ExampleConfiguration) Configuration.sharedConfiguration();
    config.automationReset();
}

Applying configuration to an automation test

@Test
fun yourTest() {
    config?.bool = false
    config?.string_Textfield = "thursday"
    config?.automationApply()
    ...
@Test
public void yourTest() {
    config.bool = false;
    config.string_Textfield = "thursday";
    config.automationApply();
    ...

Additional automation launch methods

Applying configuration at runtime to the app under test

In your subclass, ensure that your method returns true when running automation tests.

Before each test, call the method to ensure the app's configuration is reset to factory defaults.

In your test method, set your configuration properties to the values you require, then call the method.

See also method of

Android's Espresso tests run in the same process as the app under test, and therefore the iOS specific APIs , , , , and functions are not required and not implemented in Android.

nz.co.electricbolt.appfiguratelibrary.Configuration
allowInvalidSignatures
automationReset
automationApply
automationAction
nz.co.electricbolt.appfiguratelibrary.Configuration
automationSendConfiguration
automationSendConfigurationReset
automationSendConfigurationWithAction
automationSendReadConfiguration
APLAutomationSendMessage
APLAutomationMessageReceivedBlock