2. UkrainQA #7
Got an interesting expertise in testing of complex web
and mobile applications, REST services.
---
Hands-on experience with performance testing, creating
CI/CD pipelines, Docker, creating mobile farms, etc.
Senior Test Automation Engineer @ Cogniance
2
VITALII
TATARYNOV
3. Agenda
Part 1: Acquaintance
Introduction to mobile testing, overview of tools and approaches
Part 2: KISS your code
How to write simple and good tests
Part 3: Infrastructure
Introduction to mobile testing, overview of tools
Part 4: Cooperation with your team
Introduction to mobile testing, overview of tools
3
5. UkrainQA #7
Except of comprehensive automation planning
process, maintenance of your test-cases, manual
testing with all possible design technics, there are
three parts of go
Write
good
code
Collaborate
with your
team
Make a robust
scalable
infrastructure
5
THREE PARTS
OF SUCCESSFUL
AUTOMATION
7. UkrainQA #7
Code is compiled,
tested and works
as expected
Code is
commented and
documented
Code is readable
understandable,
for other team
members
Code is scalable,
reusable
7
WHAT IS
GOOD AUTOTEST?
9. UkrainQA #7
It’s not silver bullet, but could help in
particular situations
Don’t reinvent the wheel.
Reuse already written code if it is from
reliable sources
Patterns External Libraries New language features
9
HOW TO DO IT?
Don’t forget to learn new
17. UkrainQA #7 17
EXTERNAL
LIBRARIES
A library is a collection of class definitions and its implementations.
The main benefits of creating library is simply code reuse.
18. UkrainQA #7 18
My personal choice
AssertJ
Fluent assertions for java
Selenide
Allows you to simplify your tests
Allure
An open-source framework designed to create test execution reports that are clear to everyone in the team
Slf4j
Simple Logging Facade for Java
REST-Assured
REST Assured is a Java library that provides a domain-specific language (DSL) for writing powerful, maintainable tests for RESTful APIs
LOMBOK, OKHTTP/RETFROFIT, GSON, APACHE COMMONS POOL, GOOGLE AUTOVALUE, ETC.
There are a lot of other cool libraries...
29. UkrainQA #7 29
JAVA 11:
Local
Variable Type
Inference
Java 10 has introduced a new language
keyword var which optionally replaces the
type information when declaring local
variables (local means variable declarations
inside method bodies)
30. UkrainQA #7 30
JAVA 11:
HTTP Client
Java 9 introduced a new incubating HttpClient
API for dealing with HTTP requests. As of Java
11 this API is now final and available in the
standard libraries package java.net.
31. UkrainQA #7 31
JAVA 11:
Collections
Collections such as List, Set and Map have
been extended with new methods.
32. UkrainQA #7 32
JAVA 11:
New features
in streams
The methods dropWhile and takeWhile both
accept a predicate to determine which
elements to abandon from the stream
33. UkrainQA #7 33
JAVA 11:
New features
in Strings
One of the most basic classes String gets a
few helper methods for trimming or checking
whitespace and for streaming the lines of a
string
35. UkrainQA #7
To keep a finger on the pulse of our quality:
● We’ve got the testing results after each build
● We’ve got the results of regression testing
every night
● Data generation is automated as well
35
OUR PIPELINE
OVERVIEW 1. New app
build 2. Unit testing
3. Integration
testing
4. UI tests
smoke
after each build
5. Regression
every night
6. Report
by Allure
37. UkrainQA #7
Repository
We use Bitbucket as a
main repository
Unit &
Integration
Espresso and JUnit, classic
:)
UI tests
Appium + TestNG +
STF + Allure
37
OUR TOOLS
CI
We use Jenkins as our
Continuous integration
tool with multi branch
approach
38. UkrainQA #7 38
INFRA:
Jenkins
Blue Ocean
One of the most basic classes String gets a
few helper methods for trimming or checking
whitespace and for streaming the lines of a
string
39. UkrainQA #7 39
INFRA:
A branch for
an each issue
you work on
Then do all the implementation and testing
work on that branch. When that's complete,
submit a pull request, merge up, and release
whenever you're ready.
41. UkrainQA #7 41
INSTALL JENKINS
1. Go to https://jenkins.io/download/ and download
latest version
2. Install it
3. Proceed with wizard to finish the installation
process
4. Choose default plugins
5. Set credentials
6. Install BlueOcean plugin
42. UkrainQA #7
This is a sample text.
Insert your desired text here.
Lorem Ipsum
42
Creating
Blue Ocean Pipeline Jenkins
installed
01 Free configuration job for your unit tests
Create step for unit tests of
your mobile application
02Free configuration job for your unit tests
Create step for integration tests
for the mobile application
43. Your Company Name
03 It could be smoke tests package
Create UI tests step/job
04Connect your Git repository by creating
Merge it using BlueOcean plugin
05 It could be done by BlueOcean plugin in
Jenkins
Add Jenkinsfile to your main
branch
06Applicable for Android devices only
Install OpenSTF to control
devices
43
44. Your Company Name
Profit
07 To get nice reports
Add Allure
08This is a sample text.
Insert your desired text here.
Set scanning interval for your
multibranch job
44
45. UkrainQA #7 45
HOW TO INSTALL
OPEN STF
Requirements:
Node.js >= 6.9 (latest stable version I found node@8)
ADB properly set up ($ANDROID_HOME is set for your system)
RethinkDB >= 2.2
GraphicsMagick (for resizing screenshots)
ZeroMQ libraries installed
Protocol Buffers libraries installed
yasm installed (for compiling embedded libjpeg-turbo)
pkg-config so that Node.js can find the libraries
Note that you need these dependencies even if you've installed STF
directly from NPM, because they can't be included in the package.
On Mac OS, you can use homebrew to install most of the
dependencies:
brew install rethinkdb graphicsmagick zeromq protobuf yasm
pkg-config
As mentioned earlier, you must have all of the requirements installed
first. Then you can simply install via NPM:
npm install -g stf
46. UkrainQA #7 46
HOW TO RUN
OPENSTF
Launch database:
rethinkdb --http-port=8081
Launch stf:
stf local
48. UkrainQA #7 48
INSTALL JENKINS
Install docker, and then run command:
docker run
--rm
-u root
-p 8080:8080
-v jenkins-data:/var/jenkins_home
-v /var/run/docker.sock:/var/run/docker.sock
-v "$HOME":/home
jenkinsci/blueocean
After that, proceed with wizard to complete installation
process
49. UkrainQA #7 49
HOW TO INSTALL
OPEN STF
clone https://github.com/nikosch86/stf-poc
Then change public ip in .env file
And run command:
docker-compose up -d —build
51. UkrainQA #7 51
PLAN YOUR
AUTOMATION COVERAGE
SPRINT 1
SPRINT 2
2%
4%
SPRINT 3
SPRINT 4
SPRINT 5
SPRINT 6
SPRINT 7
8%
18%
13%
25%
38%
Work closely with your team to plan an automation
coverage, to involve team into automation process
and you’ll get good results