adil-hussain-84 / Shock-experiment

A simple Xcode application which demonstrates how to use the Shock library to mock the server in UI tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

This Xcode workspace demonstrates how to use JustEat's Shock library to mock out the server for faster, more reliable UI tests.

The workspace contains an application target (ShockExperiment) and a UI testing target (ShockExperimentUITests). The application is super simple such that all it does it fire a network request on load to fetch a list of Star Wars characters and then updates a label to say how many characters were fetched (if successful) or that something went wrong (if unsuccessful). The UI testing target contains a number of tests which each:

  1. Mock the server to return a particular response;
  2. Launch the application; and then
  3. Assert that the application displays the expected text based on the server response.

Setup

  1. Clone this repository.
  2. Open the ShockExperiment.xcworkspace file in Xcode.
  3. Build the project.
  4. Run the tests.

This workspace assumes that you have a GitHub source control account added to your Xcode preferences. Xcode uses your GitHub account to fetch this workspace's Swift package dependencies.

About

A simple Xcode application which demonstrates how to use the Shock library to mock the server in UI tests.


Languages

Language:Swift 99.7%Language:Mustache 0.3%