A testing framework for Wikipedia mobile apps.
This is a testing framework with a test suite of acceptance tests for Wikipedia mobile app. Written in Ruby, powered by Appium and Watir WebDriver, run by RSpec.
Note: currently it supports only Android system run on emulator.
- rvm
- Android SDK >=25.0.2
- gradle
- apk from the official Wikipedia repo: https://github.com/wikimedia/apps-android-wikipedia
On macOS:
- node:
brew install node
- ant:
brew install ant
- appium:
npm install -g appium
- ruby 2.3.0:
rvm install 2.3.0
- bundler:
gem install bundler
When in main directory /wikipedia-mobile-tests
- Build gems dependencies:
bundle install
- Start Appium server
$> appium
- Start Android emulator
$> emulator @android
- To run the tests:
APP_PATH=/Absolute/Path/To/The/App/File
PLATFORM=[ANDROID|IOS]
VERSION=[Platform version, i.e. ”7.0”]
DEVICE=[Device name, i.e. "Nexus 7"]
rspec spec/main_spec.rb
Framework bases on well-known Page Object pattern that allows to extract into classes the attributes and action-performing functions on defined pages. Written in Behaviour-Driven Development approach with RSpec allows to validate functionality with acceptance tests. Powered by widely supported open-source Appium dedicated for mobile apps testing that handles multiple platforms basing on Selenium WebDriver. Finally, dyniamically-typed Ruby language helps with rapid prototyping and greatly integrates with other frameworks.
- using accessors by name (accessibility_id) is never a good idea - for example this may easily break on language change
- PageObject (v1.2.2) gem used in the solution is not the newest one as v2+ caused a lot of compatibility problems between Appium and PageObject due to different WebDriver approach (Selenium vs. Watir)
- in current approach responsibilities are not much encapsulated among where the test makes an action and where it verifies the result
- drop Page Object pattern in favour of Journey/Screenplay to separate responsibilities of tasks from actions and validations (aim, act, verify)
- implement iOS testing framework
- add support for running on real devices