You don’t need
Automation Engineer!
@yashaka
Automation is hard, isn’t it?
It isn’t:p
It isn’t:p
(at least WEB UI)
if you know how to “cook” it ;)
It isn’t:p
But no rush:)
Let’s start
from beginning…
Product
Use cases (draft)
Tree
shleep
eat
run
hang
Holes
shleep
eat
run
During All activities:
sh-shispering
Special Cases:
GIVEN shleeping

WHEN 2 meters to somebody
THEN become invisible
Transitions:
tree > holes
tree < holes
Choosing high priority functionality
Tree
shleep *
eat *
run *
hang *
Holes
shleep *
eat *
run *
During All activities:
sh-shispering
Special Cases: *
GIVEN shleeping

WHEN 2 meters to somebody
THEN become invisible
Transitions:
tree > holes *
tree < holes *
To implement first & fast
Tree
shleep *
eat *
run *
hang *
Holes
shleep *
eat *
run *
Transitions:
tree > holes *
tree < holes *
Scenario (End to End)
go to hole
run
go to tree
hang
eat
go to hole
shleep
Tracking coverage
Tree
shleep
eat e
run
hang e
Holes
shleep e
eat
run e
During All activities:
sh-shispering
Special Cases:
GIVEN shleeping

WHEN 2 meters to somebody
THEN become invisible
Transitions:
holes > tree e
holes < tree e
A bit messy?
be DRY ;)
Improve visibility
ActionsContext Holes Tree sh-shispering?
run !!e ! !
hang - !!e !
eat !! !!e !
shleep !!e !! !
- shleep invisible ? !! !
Transitions:
holes > trees e
holes < trees e
ActionsContext Holes Tree sh-shispering?
run !!e ! !
hang - !!e !
eat !! !!e !
shleep !!e !! !
- shleep invisible ? !! !
Transitions:
holes > trees e
holes < trees e
hole in coverage
E2E
go to hole
run
go to tree
hang
eat
go to hole
shleep
1-Feature test
go to tree
shleep invisible
Finalise smoke coverage
E2E
go to hole
run
go to tree
hang
eat
go to hole
shleep
1-Feature test
go to tree
shleep invisible
assert shispering
Use possibilities to improve coverage
ActionsContext Holes Tree sh-shispering?
run !!e ! !
hang - !!e !
eat !! !!e !
shleep !!e !! !
- shleep invisible ? !!f !f
Transitions:
holes > trees e
holes < trees e
Done with Smoke? - Proceed to Full Acceptance with FT
ActionsContext Holes Tree sh-shispering?
run !!e !f !f
hang - !!e !e
eat !!f !!e !f
shleep !!e !!f !f
- shleep invisible ? !!f !f
Coverage tips: Yes
Functional Use Cases
High priority,
(user will definitely do on regular basis)
Coverage tips: No
low-priority checks
“different values” checks
ActionsContext Holes Tree sh-shispering?
run !!e ! !
hang - !!e !
eat !! !!e !
shleep !!e !! !
- shleep invisible ? !!e !
Transitions:
holes > trees e
holes < trees e
No low-priority checks
ActionsContext Holes Tree sh-shispering?
run !!e ! !
hang - !!e !
eat !! !!e !
shleep !!e !! !
- shleep invisible ? !!e !
ActionsContext Holes Tree sh-shispering?
run !!e ! !
- fast
- slow
? ?
hang - !!e !
- low
- high
? ?
eat !! !!e !
- much
- a bit
? ?
shleep !!e !! !
- shleep invisible ? !!e !
No “different values” checks
ActionsContext Holes Tree sh-shispering?
run !!e ! !
- fast
- slow
hang - !!e !
- low
- high
eat !! !!e !
- much
- a bit
shleep !!e !! !
- shleep invisible ? !!e !
No “different values” checks
different variations
of same “function”
Should be covered
on “unit testing” level
different variations
of same “function”
- fast
- slow
- low
- high
- much
- a bit
(giving the same
“user flow”)
We are here => => Only:
functional
high priority
use cases
different variations
of same “function”
Here =>
Avoid =>
move
additional requirements,
like “different kind of names
for entities”,
“function variations”, etc…
<= to
=> from
Where is code ?
Keep calm:)
From
To
Actions
run, hang, eat, sleep
create, edit, delete, toggle,
toggle all
Contexts
holes, trees
fitlers:
all, active, completed
The same ;)
go to hole
run
go to tree
hang
eat
go to hole
shleep
Scenario (End to End)
Scenario (End to End)
given at todomvc
add "a"
toggle "a"
filter active
filter completed
edit "a" to "a edited"
toggle "a edited"
…
Add expected results
given at todomvc
add "a"
toggle "a"
filter active
assert no tasks
filter completed
edit "a" to "a edited"
toggle "a edited"
assert no tasks
…
Implicit checks are ok in “nearest steps”
given at todomvc
add "a"
toggle "a"
filter active
assert no tasks
filter completed
edit "a" to "a edited"
toggle "a edited"
assert no tasks
…
Demo
Let’s start coding ;)
given at todomvc
add "a"
toggle "a"
filter active
assert no tasks
filter completed
edit "a" to "a edited"
toggle "a edited"
assert no tasks
…
Help computer to read it in Java
givenAtTodoMVC();
add("a");
toggle("a");
filterActive();
assertNoTasks();
filterCompleted();
edit("a", "a edited");
toggle("a edited");
assertNoTasks();
//…
public class TodoMVCTest {



@Test

public void testTasksLifeCycle(){

givenAtTodoMVC();

add("a");

toggle("a");

filterActive();

assertNoTasks();

filterCompleted();

edit("a", "a edited");

toggle("a edited");

assertNoTasks();

//...

}

}
public class TodoMVCTest {



@Test

public void testTasksLifeCycle(){

givenAtTodoMVC();

add("a");

toggle("a");

filterActive();

assertNoTasks();

filterCompleted();

edit("a", "a edited");

toggle("a edited");

assertNoTasks();

//...

}

}
?
public static void givenAtTodoMVC(){

open("https://todomvc4tasj.herokuapp.com/");

newTask.shouldBe(enabled);

}
givenAtTodoMVC();
public static SelenideElement newTask = $("#new-todo");
newTask
CSS Selector
CSS Selector ?
[id=“new-todo"] = #new-todo
public static SelenideElement newTask = $("#new-todo");
newTask
[id=“new-todo"] <=> #new-todo
public static void add(String taskText) {

newTask.setValue(taskText).pressEnter();

}
add("a");
public static void toggle(String taskText) {

tasks.findBy(exactText(taskText)).$(".toggle").click();

}
toggle("a");
public static void toggle(String taskText) {

tasks.findBy(exactText(taskText)).$(".toggle").click();

}
toggle("a");
public static ElementsCollection tasks = $$("#todo-list>li");
tasks
public static ElementsCollection tasks = $$("#todo-list>li");
tasks
public static void toggle(String taskText) {

tasks.findBy(exactText(taskText)).$(".toggle").click();

}
toggle("a");
public static void filterActive(){

$(By.linkText("Active")).click();

}
filterActive();
By.linkText("Active")
public static void assertNoTasks() {

tasks.filterBy(visible).shouldBe(empty);

}
assertNoTasks();
tasks.filterBy(visible).shouldBe(empty);
public class TodoMVCTest {



@Test

public void testTasksLifeCycle(){

givenAtTodoMVC();

add("a");

toggle("a");

filterActive();

assertNoTasks();

filterCompleted();

edit("a", "a edited");

toggle("a edited");

assertNoTasks();

//...

}

}
open("https://todomvc4tasj.herokuapp.com/");

newTask.shouldBe(enabled);
newTask = $("#new-todo");
tasks = $$("#todo-list>li");
newTask.setValue("a").pressEnter();
tasks.findBy(exactText("a")).$(".toggle").click();
$(By.linkText("Active")).click();
tasks.filterBy(visible).shouldBe(empty);
Easy?
End to End
go to hole
run
go to tree
hang
eat
go to hole
shleep
Unit/1-feature-per-test
go to tree
shleep invisible
Coverage Style
End to End Unit/1-feature-per-test
Coverage Style
public void testFiltering(){

givenAtTodoMVC();

add("a");

toggle("a");

filterActive();

assertNoTasks();

filterCompleted();

edit("a", "a edited");

toggle("a edited");

assertNoTasks();

//...

}
public void testDelete(){

givenAtTodoMVC();

add("a");

delete("a");

assertNoTasks();

}
End to End Unit/1-feature-per-test
Advantages
+ more coverage in
less time with less
efforts during POC
implementation
+ integration
coverage
+ in case of bugs, gives
more complete report
+ easier to identify
reason from the report
=>
+ less time and efforts in
support
End to End Unit/1-feature-per-test
When to use?
+ when start, during
POC for framework
+ in a rush to cover a
lot of existed features
+ for integration
coverage
+ for new features
+ after POC is
approved, on regular
basis
Wasn’t it easy? :)
Easy tools?
Java: Selenide
Python: Selene is coming…
C#: NSelene is coming…
Ruby: Capybara
? JavaScript: Protractor
? PHP: Codeception
How to start?
Choose language
Learn language (books, interactive tutorials,
koans, exercism.io, google.com, etc.)
Choose Easy Tools
Find a mentor (friend, dev on your project, it-chats,
forums, etc…)
Go :)
Choose language?
Have project?
=> choose language of project’s developers
Have no project but want to find work fast?
=> choose one of the most popular language
Have no project but want to code in your style, and it
does not matter how long will you seek for the job?
=> choose language that fits you
No ready easy tool for your
language?
Lack of knowledge?
=> ask project’s developers to write it for you
Brave?
=> implement it by your own
Afterwords
There are good practices in context,
but there are no best practices.
(c) Cem Kaner, James Bach
Q&A
github.com/yashaka
youtube.com/c/ItlabsNetUa
gitter.im/yashaka/start-selenium
slideshare.net/yashaka
yashaka@gmail.com@yashaka
www.itlabs.net.ua
contact@itlabs.net.ua
+38 (073) 467-61-12
Thank you!

You do not need automation engineer - Sqa Days - 2015 - EN

  • 1.
    You don’t need AutomationEngineer! @yashaka
  • 2.
  • 3.
  • 4.
  • 5.
    if you knowhow to “cook” it ;) It isn’t:p
  • 6.
  • 7.
  • 8.
  • 10.
    Use cases (draft) Tree shleep eat run hang Holes shleep eat run DuringAll activities: sh-shispering Special Cases: GIVEN shleeping
 WHEN 2 meters to somebody THEN become invisible Transitions: tree > holes tree < holes
  • 11.
    Choosing high priorityfunctionality Tree shleep * eat * run * hang * Holes shleep * eat * run * During All activities: sh-shispering Special Cases: * GIVEN shleeping
 WHEN 2 meters to somebody THEN become invisible Transitions: tree > holes * tree < holes *
  • 12.
    To implement first& fast Tree shleep * eat * run * hang * Holes shleep * eat * run * Transitions: tree > holes * tree < holes *
  • 13.
    Scenario (End toEnd) go to hole run go to tree hang eat go to hole shleep
  • 14.
    Tracking coverage Tree shleep eat e run hange Holes shleep e eat run e During All activities: sh-shispering Special Cases: GIVEN shleeping
 WHEN 2 meters to somebody THEN become invisible Transitions: holes > tree e holes < tree e
  • 15.
  • 16.
  • 17.
    ActionsContext Holes Treesh-shispering? run !!e ! ! hang - !!e ! eat !! !!e ! shleep !!e !! ! - shleep invisible ? !! ! Transitions: holes > trees e holes < trees e
  • 18.
    ActionsContext Holes Treesh-shispering? run !!e ! ! hang - !!e ! eat !! !!e ! shleep !!e !! ! - shleep invisible ? !! ! Transitions: holes > trees e holes < trees e hole in coverage
  • 19.
    E2E go to hole run goto tree hang eat go to hole shleep 1-Feature test go to tree shleep invisible Finalise smoke coverage
  • 20.
    E2E go to hole run goto tree hang eat go to hole shleep 1-Feature test go to tree shleep invisible assert shispering Use possibilities to improve coverage
  • 21.
    ActionsContext Holes Treesh-shispering? run !!e ! ! hang - !!e ! eat !! !!e ! shleep !!e !! ! - shleep invisible ? !!f !f Transitions: holes > trees e holes < trees e
  • 22.
    Done with Smoke?- Proceed to Full Acceptance with FT ActionsContext Holes Tree sh-shispering? run !!e !f !f hang - !!e !e eat !!f !!e !f shleep !!e !!f !f - shleep invisible ? !!f !f
  • 23.
    Coverage tips: Yes FunctionalUse Cases High priority, (user will definitely do on regular basis)
  • 24.
    Coverage tips: No low-prioritychecks “different values” checks
  • 25.
    ActionsContext Holes Treesh-shispering? run !!e ! ! hang - !!e ! eat !! !!e ! shleep !!e !! ! - shleep invisible ? !!e ! Transitions: holes > trees e holes < trees e
  • 26.
    No low-priority checks ActionsContextHoles Tree sh-shispering? run !!e ! ! hang - !!e ! eat !! !!e ! shleep !!e !! ! - shleep invisible ? !!e !
  • 27.
    ActionsContext Holes Treesh-shispering? run !!e ! ! - fast - slow ? ? hang - !!e ! - low - high ? ? eat !! !!e ! - much - a bit ? ? shleep !!e !! ! - shleep invisible ? !!e ! No “different values” checks
  • 28.
    ActionsContext Holes Treesh-shispering? run !!e ! ! - fast - slow hang - !!e ! - low - high eat !! !!e ! - much - a bit shleep !!e !! ! - shleep invisible ? !!e ! No “different values” checks different variations of same “function”
  • 29.
    Should be covered on“unit testing” level different variations of same “function” - fast - slow - low - high - much - a bit (giving the same “user flow”)
  • 30.
    We are here=> => Only: functional high priority use cases different variations of same “function” Here =>
  • 31.
    Avoid => move additional requirements, like“different kind of names for entities”, “function variations”, etc… <= to => from
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
    Actions run, hang, eat,sleep create, edit, delete, toggle, toggle all Contexts holes, trees fitlers: all, active, completed
  • 37.
  • 38.
    go to hole run goto tree hang eat go to hole shleep Scenario (End to End)
  • 39.
    Scenario (End toEnd) given at todomvc add "a" toggle "a" filter active filter completed edit "a" to "a edited" toggle "a edited" …
  • 40.
    Add expected results givenat todomvc add "a" toggle "a" filter active assert no tasks filter completed edit "a" to "a edited" toggle "a edited" assert no tasks …
  • 41.
    Implicit checks areok in “nearest steps” given at todomvc add "a" toggle "a" filter active assert no tasks filter completed edit "a" to "a edited" toggle "a edited" assert no tasks …
  • 42.
  • 43.
    Let’s start coding;) given at todomvc add "a" toggle "a" filter active assert no tasks filter completed edit "a" to "a edited" toggle "a edited" assert no tasks …
  • 44.
    Help computer toread it in Java givenAtTodoMVC(); add("a"); toggle("a"); filterActive(); assertNoTasks(); filterCompleted(); edit("a", "a edited"); toggle("a edited"); assertNoTasks(); //…
  • 45.
    public class TodoMVCTest{
 
 @Test
 public void testTasksLifeCycle(){
 givenAtTodoMVC();
 add("a");
 toggle("a");
 filterActive();
 assertNoTasks();
 filterCompleted();
 edit("a", "a edited");
 toggle("a edited");
 assertNoTasks();
 //...
 }
 }
  • 46.
    public class TodoMVCTest{
 
 @Test
 public void testTasksLifeCycle(){
 givenAtTodoMVC();
 add("a");
 toggle("a");
 filterActive();
 assertNoTasks();
 filterCompleted();
 edit("a", "a edited");
 toggle("a edited");
 assertNoTasks();
 //...
 }
 } ?
  • 47.
    public static voidgivenAtTodoMVC(){
 open("https://todomvc4tasj.herokuapp.com/");
 newTask.shouldBe(enabled);
 } givenAtTodoMVC();
  • 48.
    public static SelenideElementnewTask = $("#new-todo"); newTask CSS Selector
  • 49.
  • 55.
  • 56.
    public static SelenideElementnewTask = $("#new-todo"); newTask [id=“new-todo"] <=> #new-todo
  • 57.
    public static voidadd(String taskText) {
 newTask.setValue(taskText).pressEnter();
 } add("a");
  • 58.
    public static voidtoggle(String taskText) {
 tasks.findBy(exactText(taskText)).$(".toggle").click();
 } toggle("a");
  • 59.
    public static voidtoggle(String taskText) {
 tasks.findBy(exactText(taskText)).$(".toggle").click();
 } toggle("a");
  • 60.
    public static ElementsCollectiontasks = $$("#todo-list>li"); tasks
  • 61.
    public static ElementsCollectiontasks = $$("#todo-list>li"); tasks
  • 63.
    public static voidtoggle(String taskText) {
 tasks.findBy(exactText(taskText)).$(".toggle").click();
 } toggle("a");
  • 65.
    public static voidfilterActive(){
 $(By.linkText("Active")).click();
 } filterActive();
  • 66.
  • 67.
    public static voidassertNoTasks() {
 tasks.filterBy(visible).shouldBe(empty);
 } assertNoTasks();
  • 68.
  • 69.
    public class TodoMVCTest{
 
 @Test
 public void testTasksLifeCycle(){
 givenAtTodoMVC();
 add("a");
 toggle("a");
 filterActive();
 assertNoTasks();
 filterCompleted();
 edit("a", "a edited");
 toggle("a edited");
 assertNoTasks();
 //...
 }
 }
  • 70.
    open("https://todomvc4tasj.herokuapp.com/");
 newTask.shouldBe(enabled); newTask = $("#new-todo"); tasks= $$("#todo-list>li"); newTask.setValue("a").pressEnter(); tasks.findBy(exactText("a")).$(".toggle").click(); $(By.linkText("Active")).click(); tasks.filterBy(visible).shouldBe(empty);
  • 71.
  • 72.
    End to End goto hole run go to tree hang eat go to hole shleep Unit/1-feature-per-test go to tree shleep invisible Coverage Style
  • 73.
    End to EndUnit/1-feature-per-test Coverage Style public void testFiltering(){
 givenAtTodoMVC();
 add("a");
 toggle("a");
 filterActive();
 assertNoTasks();
 filterCompleted();
 edit("a", "a edited");
 toggle("a edited");
 assertNoTasks();
 //...
 } public void testDelete(){
 givenAtTodoMVC();
 add("a");
 delete("a");
 assertNoTasks();
 }
  • 74.
    End to EndUnit/1-feature-per-test Advantages + more coverage in less time with less efforts during POC implementation + integration coverage + in case of bugs, gives more complete report + easier to identify reason from the report => + less time and efforts in support
  • 75.
    End to EndUnit/1-feature-per-test When to use? + when start, during POC for framework + in a rush to cover a lot of existed features + for integration coverage + for new features + after POC is approved, on regular basis
  • 76.
  • 77.
  • 78.
    Java: Selenide Python: Seleneis coming… C#: NSelene is coming… Ruby: Capybara ? JavaScript: Protractor ? PHP: Codeception
  • 79.
    How to start? Chooselanguage Learn language (books, interactive tutorials, koans, exercism.io, google.com, etc.) Choose Easy Tools Find a mentor (friend, dev on your project, it-chats, forums, etc…) Go :)
  • 80.
    Choose language? Have project? =>choose language of project’s developers Have no project but want to find work fast? => choose one of the most popular language Have no project but want to code in your style, and it does not matter how long will you seek for the job? => choose language that fits you
  • 81.
    No ready easytool for your language? Lack of knowledge? => ask project’s developers to write it for you Brave? => implement it by your own
  • 82.
    Afterwords There are goodpractices in context, but there are no best practices. (c) Cem Kaner, James Bach
  • 83.
  • 84.
  • 85.