LogoLogo
  • Hello Autokin
  • Get started
  • Your First Autokin Test
  • Features
    • Tags
    • Chaining
    • JSON Schema Comparison
    • Variables
    • Autokin Generators
  • Autokin REST
    • Given Steps
    • When Steps
    • Then Steps
  • Autokin Web
    • Given Steps
    • When Steps
    • Then Steps
    • Supported Emulated Devices
  • Autokin Mobile
    • Give Steps
    • When Steps
    • Then Steps
  • Development Tools
    • VS Code Extension
  • Resources
    • Autokin Github
    • Contributors
    • Frequently Asked Questions
Powered by GitBook
On this page
  • Given that an application is hosted at {url}
  • Given that I reload the page
  • Given that I set the browser window size to {width} and {height}
  • Given that I emulate as {device name} device
  • Given that I set mode to {mode} with {options}
  • Mocking or Intercepting API Calls

Was this helpful?

  1. Autokin Web

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

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

Mobile Web Switch Mode

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"
PreviousThen StepsNextWhen Steps

Last updated 4 years ago

Was this helpful?

For device list, see

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

Supported Emulated Devices
supported devices