85
You don’t need Automation Engineer! @yashaka

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

Embed Size (px)

Citation preview

Page 1: You do not need automation engineer  - Sqa Days - 2015 - EN

You don’t need Automation Engineer!

@yashaka

Page 2: You do not need automation engineer  - Sqa Days - 2015 - EN

Automation is hard, isn’t it?

Page 3: You do not need automation engineer  - Sqa Days - 2015 - EN

It isn’t:p

Page 4: You do not need automation engineer  - Sqa Days - 2015 - EN

It isn’t:p

(at least WEB UI)

Page 5: You do not need automation engineer  - Sqa Days - 2015 - EN

if you know how to “cook” it ;)It isn’t:p

Page 6: You do not need automation engineer  - Sqa Days - 2015 - EN

But no rush:)

Page 7: You do not need automation engineer  - Sqa Days - 2015 - EN

Let’s start from beginning…

Page 8: You do not need automation engineer  - Sqa Days - 2015 - EN

Product

Page 9: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 10: You do not need automation engineer  - Sqa Days - 2015 - EN

Use cases (draft)Tree

shleep

eat

run

hang

Holes

shleep

eat

run

During All activities:

sh-shispering

Special Cases:

GIVEN shleepingWHEN 2 meters to somebody

THEN become invisible

Transitions:

tree > holes

tree < holes

Page 11: You do not need automation engineer  - Sqa Days - 2015 - EN

Choosing high priority functionalityTree

shleep *

eat *

run *

hang *

Holes

shleep *

eat *

run *

During All activities:

sh-shispering

Special Cases: *

GIVEN shleepingWHEN 2 meters to somebody

THEN become invisible

Transitions:

tree > holes *

tree < holes *

Page 12: You do not need automation engineer  - Sqa Days - 2015 - EN

To implement first & fastTree

shleep *

eat *

run *

hang *

Holes

shleep *

eat *

run *

Transitions:

tree > holes *

tree < holes *

Page 13: You do not need automation engineer  - Sqa Days - 2015 - EN

Scenario (End to End)go to hole

run

go to tree

hang

eat

go to hole

shleep

Page 14: You do not need automation engineer  - Sqa Days - 2015 - EN

Tracking coverageTree

shleep

eat e

run

hang e

Holes

shleep e

eat

run e

During All activities:

sh-shispering

Special Cases:

GIVEN shleepingWHEN 2 meters to somebody

THEN become invisible

Transitions:

holes > tree e

holes < tree e

Page 15: You do not need automation engineer  - Sqa Days - 2015 - EN

A bit messy?

Page 16: You do not need automation engineer  - Sqa Days - 2015 - EN

be DRY ;)

Improve visibility

Page 17: You do not need automation engineer  - Sqa Days - 2015 - EN

Actions\Context Holes Tree sh-shispering?

run !!e ! !

hang - !!e !

eat !! !!e !

shleep !!e !! !

- shleep invisible ? !! !

Transitions: holes > trees e holes < trees e

Page 18: You do not need automation engineer  - Sqa Days - 2015 - EN

Actions\Context Holes Tree sh-shispering?

run !!e ! !

hang - !!e !

eat !! !!e !

shleep !!e !! !

- shleep invisible ? !! !

Transitions: holes > trees e holes < trees e

hole in coverage

Page 19: You do not need automation engineer  - Sqa Days - 2015 - EN

E2Ego to hole

run

go to tree

hang

eat

go to hole

shleep

1-Feature test

go to tree

shleep invisible

Finalise smoke coverage

Page 20: You do not need automation engineer  - Sqa Days - 2015 - EN

E2Ego 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

Page 21: You do not need automation engineer  - Sqa Days - 2015 - EN

Actions\Context Holes Tree sh-shispering?

run !!e ! !

hang - !!e !

eat !! !!e !

shleep !!e !! !

- shleep invisible ? !!f !f

Transitions: holes > trees e holes < trees e

Page 22: You do not need automation engineer  - Sqa Days - 2015 - EN

Done with Smoke? - Proceed to Full Acceptance with FT

Actions\Context Holes Tree sh-shispering?

run !!e !f !f

hang - !!e !e

eat !!f !!e !f

shleep !!e !!f !f

- shleep invisible ? !!f !f

Page 23: You do not need automation engineer  - Sqa Days - 2015 - EN

Coverage tips: Yes

Functional Use Cases

High priority,

(user will definitely do on regular basis)

Page 24: You do not need automation engineer  - Sqa Days - 2015 - EN

Coverage tips: No

low-priority checks

“different values” checks

Page 25: You do not need automation engineer  - Sqa Days - 2015 - EN

Actions\Context Holes Tree sh-shispering?

run !!e ! !

hang - !!e !

eat !! !!e !

shleep !!e !! !

- shleep invisible ? !!e !

Transitions: holes > trees e holes < trees e

Page 26: You do not need automation engineer  - Sqa Days - 2015 - EN

No low-priority checksActions\Context Holes Tree sh-shispering?

run !!e ! !

hang - !!e !

eat !! !!e !

shleep !!e !! !

- shleep invisible ? !!e !

Page 27: You do not need automation engineer  - Sqa Days - 2015 - EN

Actions\Context 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

Page 28: You do not need automation engineer  - Sqa Days - 2015 - EN

Actions\Context Holes Tree sh-shispering?

run !!e ! !- fast

- slowhang - !!e !

- low- high

eat !! !!e !- much

- a bitshleep !!e !! !

- shleep invisible ? !!e !

No “different values” checks

different variations of same “function”

Page 29: You do not need automation engineer  - Sqa Days - 2015 - EN

Should be covered on “unit testing” level

different variations of same “function”

- fast- slow

- low- high

- much- a bit

(giving the same “user flow”)

Page 30: You do not need automation engineer  - Sqa Days - 2015 - EN

We are here => => Only:functional

high priority use cases

different variations

of same “function”Here =>

Page 31: You do not need automation engineer  - Sqa Days - 2015 - EN

Avoid =>move

additional requirements, like “different kind of names

for entities”, “function variations”, etc…

<= to

=> from

Page 32: You do not need automation engineer  - Sqa Days - 2015 - EN

Where is code ?

Page 33: You do not need automation engineer  - Sqa Days - 2015 - EN

Keep calm:)

Page 34: You do not need automation engineer  - Sqa Days - 2015 - EN

From

Page 35: You do not need automation engineer  - Sqa Days - 2015 - EN

To

Page 36: You do not need automation engineer  - Sqa Days - 2015 - EN

Actions

run, hang, eat, sleep create, edit, delete, toggle, toggle all

Contexts

holes, treesfitlers:

all, active, completed

Page 37: You do not need automation engineer  - Sqa Days - 2015 - EN

The same ;)

Page 38: You do not need automation engineer  - Sqa Days - 2015 - EN

go to hole

run

go to tree

hang

eat

go to hole

shleep

Scenario (End to End)

Page 39: You do not need automation engineer  - Sqa Days - 2015 - EN

Scenario (End to End)given at todomvc

add "a"

toggle "a"

filter active

filter completed

edit "a" to "a edited"

toggle "a edited"

Page 40: You do not need automation engineer  - Sqa Days - 2015 - EN

Add expected resultsgiven at todomvc

add "a"

toggle "a"

filter active assert no tasks

filter completed

edit "a" to "a edited"

toggle "a edited" assert no tasks

Page 41: You do not need automation engineer  - Sqa Days - 2015 - EN

Implicit checks are ok in “nearest steps”given at todomvc

add "a"

toggle "a"

filter activeassert no tasks

filter completed

edit "a" to "a edited"

toggle "a edited"assert no tasks

Page 42: You do not need automation engineer  - Sqa Days - 2015 - EN

Demo

Page 43: You do not need automation engineer  - Sqa Days - 2015 - EN

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

Page 44: You do not need automation engineer  - Sqa Days - 2015 - EN

Help computer to read it in JavagivenAtTodoMVC();

add("a");

toggle("a");

filterActive(); assertNoTasks();

filterCompleted();

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

toggle("a edited"); assertNoTasks();

//…

Page 45: You do not need automation engineer  - Sqa Days - 2015 - EN

public class TodoMVCTest {

@Test public void testTasksLifeCycle(){ givenAtTodoMVC(); add("a"); toggle("a"); filterActive(); assertNoTasks(); filterCompleted(); edit("a", "a edited"); toggle("a edited"); assertNoTasks(); //... }}

Page 46: You do not need automation engineer  - Sqa Days - 2015 - EN

public class TodoMVCTest {

@Test public void testTasksLifeCycle(){ givenAtTodoMVC(); add("a"); toggle("a"); filterActive(); assertNoTasks(); filterCompleted(); edit("a", "a edited"); toggle("a edited"); assertNoTasks(); //... }}

?

Page 47: You do not need automation engineer  - Sqa Days - 2015 - EN

public static void givenAtTodoMVC(){ open("https://todomvc4tasj.herokuapp.com/"); newTask.shouldBe(enabled);}

givenAtTodoMVC();

Page 48: You do not need automation engineer  - Sqa Days - 2015 - EN

public static SelenideElement newTask = $("#new-todo");

newTask

CSS Selector

Page 49: You do not need automation engineer  - Sqa Days - 2015 - EN

CSS Selector ?

Page 50: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 51: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 52: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 53: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 54: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 55: You do not need automation engineer  - Sqa Days - 2015 - EN

[id=“new-todo"] = #new-todo

Page 56: You do not need automation engineer  - Sqa Days - 2015 - EN

public static SelenideElement newTask = $("#new-todo");

newTask

[id=“new-todo"] <=> #new-todo

Page 57: You do not need automation engineer  - Sqa Days - 2015 - EN

public static void add(String taskText) { newTask.setValue(taskText).pressEnter();}

add("a");

Page 58: You do not need automation engineer  - Sqa Days - 2015 - EN

public static void toggle(String taskText) { tasks.findBy(exactText(taskText)).$(".toggle").click();}

toggle("a");

Page 59: You do not need automation engineer  - Sqa Days - 2015 - EN

public static void toggle(String taskText) { tasks.findBy(exactText(taskText)).$(".toggle").click();}

toggle("a");

Page 60: You do not need automation engineer  - Sqa Days - 2015 - EN

public static ElementsCollection tasks = $$("#todo-list>li");

tasks

Page 61: You do not need automation engineer  - Sqa Days - 2015 - EN

public static ElementsCollection tasks = $$("#todo-list>li");

tasks

Page 62: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 63: You do not need automation engineer  - Sqa Days - 2015 - EN

public static void toggle(String taskText) { tasks.findBy(exactText(taskText)).$(".toggle").click();}

toggle("a");

Page 64: You do not need automation engineer  - Sqa Days - 2015 - EN
Page 65: You do not need automation engineer  - Sqa Days - 2015 - EN

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

filterActive();

Page 66: You do not need automation engineer  - Sqa Days - 2015 - EN

By.linkText("Active")

Page 67: You do not need automation engineer  - Sqa Days - 2015 - EN

public static void assertNoTasks() { tasks.filterBy(visible).shouldBe(empty);}

assertNoTasks();

Page 68: You do not need automation engineer  - Sqa Days - 2015 - EN

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

Page 69: You do not need automation engineer  - Sqa Days - 2015 - EN

public class TodoMVCTest {

@Test public void testTasksLifeCycle(){ givenAtTodoMVC(); add("a"); toggle("a"); filterActive(); assertNoTasks(); filterCompleted(); edit("a", "a edited"); toggle("a edited"); assertNoTasks(); //... }}

Page 70: You do not need automation engineer  - Sqa Days - 2015 - EN

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);

Page 71: You do not need automation engineer  - Sqa Days - 2015 - EN

Easy?

Page 72: You do not need automation engineer  - Sqa Days - 2015 - EN

End to Endgo to hole

run

go to tree

hang

eat

go to hole

shleep

Unit/1-feature-per-test

go to tree

shleep invisible

Coverage Style

Page 73: You do not need automation engineer  - Sqa Days - 2015 - EN

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();}

Page 74: You do not need automation engineer  - Sqa Days - 2015 - EN

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

Page 75: You do not need automation engineer  - Sqa Days - 2015 - EN

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

Page 76: You do not need automation engineer  - Sqa Days - 2015 - EN

Wasn’t it easy? :)

Page 77: You do not need automation engineer  - Sqa Days - 2015 - EN

Easy tools?

Page 78: You do not need automation engineer  - Sqa Days - 2015 - EN

Java: Selenide

Python: Selene is coming…

C#: NSelene is coming…

Ruby: Capybara

? JavaScript: Protractor

? PHP: Codeception

Page 79: You do not need automation engineer  - Sqa Days - 2015 - EN

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 :)

Page 80: You do not need automation engineer  - Sqa Days - 2015 - EN

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

Page 81: You do not need automation engineer  - Sqa Days - 2015 - EN

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

Page 82: You do not need automation engineer  - Sqa Days - 2015 - EN

AfterwordsThere are good practices in context,

but there are no best practices. (c) Cem Kaner, James Bach

Page 83: You do not need automation engineer  - Sqa Days - 2015 - EN

Q&A

Page 84: You do not need automation engineer  - Sqa Days - 2015 - EN

github.com/yashaka

youtube.com/c/ItlabsNetUa

gitter.im/yashaka/start-selenium

slideshare.net/yashaka

[email protected] @yashaka

Page 85: You do not need automation engineer  - Sqa Days - 2015 - EN

www.itlabs.net.ua

[email protected]

+38 (073) 467-61-12

Thank you!