/

Given Steps

Autokin Web Steps


Given that an application is hosted at {url}

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"

Given that I reload the page

Forces to reload the page

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I reload the page

Given that I set the browser window size to {width} and {height}

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to "1200" and "800"

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to 1200 and 800

Given that I emulate as {device name} device

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to "1200" and "800"
    Given that I emulate as "iPad Pro" device

For device list, see Supported Emulated Devices

Given that I set mode to {mode} with {options}

Mobile Web Switch Mode

To switch in mobile mode, option should be any of the supported devices.

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to "1200" and "800"
    Given that I set mode to "mobile" with "iPad Pro"

Desktop Switch Mode

To use desktop mode, option should be widht,height format, see example below.

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to "1200" and "800"
    Given that I set mode to "desktop" with "1200,800"

Mocking or Intercepting API Calls

Given that I mock API with

This can be used if you are mocking API calls within the web application and would expect that the API responding with JSON format.

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to "1200" and "800"
    Given that I mock API with
    ```
    {
        "method": "GET",
        "url": "/hello-world",
        "status": 200,
        "body": {
            "message": "hello"
        }
    }
    ```

Given that I mock URL with

This can be used if you are mocking loading of images.

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to "1200" and "800"
    Given that I mock URL with
    ```
    {
        "method": "GET",
        "url": "/images/logo.png",
        "status": 200,
        "image": "./folder/mocked-image.png"
    }
    ```

If there is a loading of image during the web application processing, we can mock it. In the above example, if logo.png is retrieve, instead of getting from the source location, we will intercept and replace that image with file specified in image attribute.

Given that I mock API with {json file}

We can also have pre-written mock definition in file, and we can reference using this step

Scenario: Autokin Web
    Given that an application is hosted at "https://www.autokinjs.com"
    Given that I set the browser window size to "1200" and "800"
    Given that I mock API with "./mocks/login.json"