owncloud / owncloud/ios-app

[QA] UI testing

Open
#58 25 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

discussion Epic QA
Dominant language
Swift
Stars
251
Forks
142
Avg merge
2d 17h
Merged PRs (30d)
3

Description

This issue is intended to be an epic to discuss about automatic testing.

Earlgrey is the chosen tool to develop UI tests. The branch earlgrey-login contains a first draft of a couple of tests.

We can face two different targets using Earlgrey:

  • UI testing: check how the app reacts to the SDK's responses. Abstracting dependencies from SDK and mocking responses make posible to isolate the app. This kind of testing complements the unit test in the SDK to have a greater coverage through the full stack of the app.

  • E2E testing: the scope is the whole app, by using the SDK itself. In this case the whole stack is tested, but is more difficult to abstract tests, and positive results will not give the accurate point of the issue/bug. By using a real server, network/core performance issues can happen causing wrong positives and making the tests flaky.

The point is that we need to abstract dependencies in the app for UI testing, by making testable code.
Currently, the app calls directly the SDK interfaces to get info. We should be able to use the same calls with mocked objects, in a way similar to the following one:

  1. Create mocked object(s)
  2. Set the mocked object(s) with the desired response
  3. Perform actions
  4. The mocked SDK answers with the canned response in 2.
  5. Check and assert what happens in UI

for each test. Options to achieve it:

  • Put all dependencies as parameters. Therefore, by subclassing we can call the functions with mocks. Of course, this point has code design/structure implications.
  • Use the SDK dependency as a mock.
  • ... (more ideas here).

All additional and related ideas are welcome.

@felix-schwarz @javiergonzper @pablocarmu @michaelstingl

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the feature/earlgrey_login branch and its first draft of EarlGrey tests, then read the issue's discussion about isolating SDK dependencies. Done is not defined yet; the project needs an agreed approach for mockable app dependencies and a scoped plan for UI testing before implementation can begin.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.