Multiple Elements Example - Instructions

This is a simple web page use for basic automated execution examples. Choose a role, click the button and the request is sent to the server.

Functionality

  • A spinner is shown when the request is submitted
  • There is a random delay in the server response time
  • A message should be shown on successful submission e.g. Successfully submitted: programmer
  • Hover over a role button and see a description of the role on screen
  • Uses an internal API call to submit a role too

UI Automating

  • Every element should have enough attributes to be uniquely selectable.
  • Check the text on various elements
  • automate a check for hover text
  • submit the different values to the server
  • check that spinner is displayed during submission and removed when response comes back
  • check that you can’t submit without selecting a role

API Testing

The API endpoint is available at /internalapi/choose-a-role it accepts only POST. There is less validation on this API because it is viewed as ‘internal’ and would not be used by other people.

The payload should be content-type of application/json and the format is simple:

{
    "role": "tester"
}

The API will respond with a JSON payload when the accept header is set to application/json

  • check message format validation

  • check for role type validation

  • check for invalid json format or message headers

  • can you test the API without any additional tooling just by amending the DOM or using existing browser functionality?

  • try using the API in multiple tools

  • is it a valid assumption that an internal API would not be used by other people? If not, then what risks does this view expose the application to?

This same API is used by the CSS Example Form. Would you need to test at an API level again if you had already tested the API with that form?

API Automating

  • add coverage for the API directly