How to generate user interface tests from dsl?

I'm not sure this question relates to SO, because it can be wide, but I don’t know where to ask it (I did not find a better site for the stack).

Context

I use UiAutomator to write some Ui test on Android. I created some functions that simplify writing tests, for example, in a document

public void startMainActivityFromHomeScreen() {
    /*Start the app from the home screen*/
}

As a developer, this works great. But non-technical nations (the contractor) cannot easily use these functions to write tests.

Needs

I am looking for a way for non-technical users to write some scripts using an already defined function. Here is an example of dummy code (both format and script actions)

Suite: Launch the app twice from the home screen

Case: Launch the app for the first time
  Do startMainActivityFromHomeScreen
  Expect ...

Case: Launch the app for the second time
  Do startMainActivityFromHomeScreen
  Expect ...

java-. , calabash, java-.

( )

  • lib
  • groovy dsl ( groovy java),
  • java-, groovy script Android ( lib (from (1)) gradle).
  • gradle androidTestCompile

lib, . , lib .

, , , .

  • , ?
  • ?
+4
1

https://cucumber.io/docs/reference/jvm#java, , , , Java.

Java :

@When("^I open the app from the (main|home) screen$")
public void openApp(String launchScreen) { 
    ... 
}

:

Feature: Launching app

Scenario: Launching from first screen
    When I open the app from the main screen
    Then I see a blue icon...

Scenario: Launching from second screen
    When I open the app from the second screen
    Then I see a green icon...
0

Source: https://habr.com/ru/post/1618866/


All Articles