# Then Steps

### Then I wait `{time in seconds}` seconds <a href="#then-i-wait-time-in-seconds-seconds" id="then-i-wait-time-in-seconds-seconds"></a>

Make the test wait for desired seconds enough for hte mobile to be displayed or anything that is needed for wait.

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
```

### &#x20;<a href="#then-i-capture-mobile-screen-as-path-to-image" id="then-i-capture-mobile-screen-as-path-to-image"></a>

### Then I capture mobile screen as `{path to image}` <a href="#then-i-capture-mobile-screen-as-path-to-image" id="then-i-capture-mobile-screen-as-path-to-image"></a>

Captures the current screen image of the mobile app. No need to include file extension as this will be appended with .png, and since images will be in PNG format.

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I capture mobile screen as "mobile_home"
```

### &#x20;<a href="#then-i-swipe-to-the-direction" id="then-i-swipe-to-the-direction"></a>

### Then I swipe to the `{direction}` <a href="#then-i-swipe-to-the-direction" id="then-i-swipe-to-the-direction"></a>

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I swipe to the left
    Then I swipe to the right
    Then I swipe to the up
    Then I swipe to the down
```

### &#x20;<a href="#then-i-tap-on-element-with-accessibility-id-of-accessibility-id" id="then-i-tap-on-element-with-accessibility-id-of-accessibility-id"></a>

### Then I tap on element with accessibility id of `{accessibility id}` <a href="#then-i-tap-on-element-with-accessibility-id-of-accessibility-id" id="then-i-tap-on-element-with-accessibility-id-of-accessibility-id"></a>

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I tap on element with accessibility id of "Sign In"
```

### &#x20;<a href="#then-i-tap-on-element-with-xpath-of-xpath" id="then-i-tap-on-element-with-xpath-of-xpath"></a>

### Then I tap on element with xpath of `{XPath}` <a href="#then-i-tap-on-element-with-xpath-of-xpath" id="then-i-tap-on-element-with-xpath-of-xpath"></a>

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I tap on element with xpath of "//XCUIElementTypeButton[@name="Hello"]"
```

### &#x20;<a href="#then-i-tap-on-x-coordinate-y-coordinate" id="then-i-tap-on-x-coordinate-y-coordinate"></a>

### Then I tap on `{X Coordinate}`, `{Y Coordinate}` <a href="#then-i-tap-on-x-coordinate-y-coordinate" id="then-i-tap-on-x-coordinate-y-coordinate"></a>

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I tap on 300, 300
```

### &#x20;<a href="#then-i-set-value-value-to-element-with-accessibility-id-of-accessibility-id" id="then-i-set-value-value-to-element-with-accessibility-id-of-accessibility-id"></a>

### Then I set `{value}` value to element with accessibility id of `{accessibility id}` <a href="#then-i-set-value-value-to-element-with-accessibility-id-of-accessibility-id" id="then-i-set-value-value-to-element-with-accessibility-id-of-accessibility-id"></a>

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I set "Hello World" value to element with accessibility id of "MyField"
```

### &#x20;<a href="#then-i-set-value-value-to-element-with-xpath-of-xpath" id="then-i-set-value-value-to-element-with-xpath-of-xpath"></a>

### Then I set `{value}` value to element with xpath of `{XPath}` <a href="#then-i-set-value-value-to-element-with-xpath-of-xpath" id="then-i-set-value-value-to-element-with-xpath-of-xpath"></a>

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I set "Hello World" value to element with xpath of "//XCUIElement"
```

### &#x20;<a href="#then-i-expect-element-with-accessibility-id-of-accessibility-id-has-value-value" id="then-i-expect-element-with-accessibility-id-of-accessibility-id-has-value-value"></a>

### Then I expect element with accessibility id of `{accessibility id}` has value `{value}` <a href="#then-i-expect-element-with-accessibility-id-of-accessibility-id-has-value-value" id="then-i-expect-element-with-accessibility-id-of-accessibility-id-has-value-value"></a>

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I expect element with accessibility id of "FieldName" has value "Hello"
```

### &#x20;<a href="#then-i-expect-device-keyboard-is-visibile" id="then-i-expect-device-keyboard-is-visibile"></a>

### Then I expect device keyboard is visibile <a href="#then-i-expect-device-keyboard-is-visibile" id="then-i-expect-device-keyboard-is-visibile"></a>

Check if mobile keyboard is visible

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I expect device keyboard is visibile
```

### &#x20;<a href="#then-i-hide-device-keyboard" id="then-i-hide-device-keyboard"></a>

### Then I hide device keyboard <a href="#then-i-hide-device-keyboard" id="then-i-hide-device-keyboard"></a>

Trigger to hide on screen keyboard

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I hide device keyboard
```

### &#x20;<a href="#then-i-shake-the-device" id="then-i-shake-the-device"></a>

### Then I shake the device <a href="#then-i-shake-the-device" id="then-i-shake-the-device"></a>

Perform shake gesture on the device

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I shake the device
```

### &#x20;<a href="#then-i-make-the-app-run-in-the-background-and-make-active-after-time-in-seconds-seconds" id="then-i-make-the-app-run-in-the-background-and-make-active-after-time-in-seconds-seconds"></a>

### Then I make the app run in the background and make active after `{time in seconds}` seconds <a href="#then-i-make-the-app-run-in-the-background-and-make-active-after-time-in-seconds-seconds" id="then-i-make-the-app-run-in-the-background-and-make-active-after-time-in-seconds-seconds"></a>

Make the application runs in the background and make it active when time in seconds elapsed.

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I make the app run in the background and make active after 3 seconds
```

### &#x20;<a href="#then-i-close-the-session" id="then-i-close-the-session"></a>

### Then I close the session <a href="#then-i-close-the-session" id="then-i-close-the-session"></a>

Close the appium server session of the mobile app and close it as well.

```
Scenario: Autokin Mobile
    Given that I set "iOS" as platform with version of "13.0"
    Given that I set "iPhone 11 Pro" as device
    Given that app is located at "http://www.autokinjs.com/myapps/myios_sample_app.zip"
    When I create new session on "https://appium.autokinjs.com:4723/wd/hub"
    Then I wait 3 seconds
    Then I make the app run in the background and make active after 3 seconds
    Then I close the session
```
