20

Click here to load reader

Cucumber - Maria Machlowska

Embed Size (px)

Citation preview

Page 1: Cucumber - Maria Machlowska

Cucumber Wait...What?

Page 2: Cucumber - Maria Machlowska

1. Test Automation in Mobile

2. BDD - what is that?

3. Anatomy of calabash framework.

4. Gherkin.

5. Demo.

Agenda

Page 3: Cucumber - Maria Machlowska

Hi!

I am here because I would love to inspire you and give you some new insights about testing :)

You can find me at:about.me/mmachlowska

I’m Maria Machlowska

Page 4: Cucumber - Maria Machlowska

1.Test automation in mobile

How does it work for me?

Page 5: Cucumber - Maria Machlowska

“Quality should be on the value for all.

Not only for QA’s or developers.

Page 6: Cucumber - Maria Machlowska

2. BDD

What is that?

Page 7: Cucumber - Maria Machlowska

➔ Outside-in Development

➔ conceptually similar to TDD

➔ create and run functional specifications➔ every person is weigh in to create a common understanding

of what is to be built

BDD - philosophy

Page 8: Cucumber - Maria Machlowska

The right software is buildIn the opposite to software being build right (TDD)

Language understandable for everyoneEven non technical person can interprets those.

Helps to make an intelligent testing decisionsIt’s not necessary to follow the BDD methodology in order to use Calabash effectively, but having a basic understanding of it goes a long way in making intelligent testing decisions.

BDD - main approaches

Page 9: Cucumber - Maria Machlowska

3. Calabash framework

How it works?

Page 10: Cucumber - Maria Machlowska

Communication between your application and Calabash

Calabash provides a bridge that allows Cucumber tests to run and validate on iOS and Android.

Page 11: Cucumber - Maria Machlowska

4. Gherkin

how to create a specification?

Page 12: Cucumber - Maria Machlowska

Feature definitions

Scenarios Step definitions

Gherkin

Page 13: Cucumber - Maria Machlowska

Gherkin

Feautures➔ a group of

logically groupped scenarios

Scenarios➔ a single behaviour

of the use case➔ comprised of

steps➔ every step begins

with the words: Given, When, And, Then

➔ language hint: cause and effect

Steps definitions➔ glue code:

translates Gherkin into runnable actions

➔ code-behind the scenarios to make them runnable in the application

➔ use methods touch and query in Cucumber API

Page 14: Cucumber - Maria Machlowska

F1

S2

SD 1

Cucumber power

S1 SD 2

SD 3

SD 1

SD 3

SD 4

SD 5

SD 3S3

SD 6

Page 15: Cucumber - Maria Machlowska

5. Demo

Time for DEMO

Is it really working?

Page 16: Cucumber - Maria Machlowska

Console output Action is performed on device/emulator

source: https://s3-us-west-1.amazonaws.com/testmunk-public/blog/terminal_and_android_looped_1-5s_delay.gif

Page 17: Cucumber - Maria Machlowska

Summary

Well...

Whoa! Is it so simple?

Page 18: Cucumber - Maria Machlowska

Presentation Review/Sumup

CostsHigh. You need to invest with the time, good developers to build a test architecture, some trainings from experts, and then the scale time to deply this framework into your organization.

Quick Start?Should be easy, but it’s not.You can’t just download the sample project and run it. There are too many configuration setups.It’s more complicated than embedded iOS and Android Testing Frameworks.

What could go wrong?You should design your tests and Testing infrastructure very carefully - otherwise the tests wouldn’t be reusable.

Knowledge baseThere are many good articles you can learn from, but there is a lack of Calabash Wiki.StackOverflow is pretty good, but there could be some problems it wouldn’t cover.

Who use it?Base CRM - a Cracow’s startup based their Testing Infrastructure on Cucumber, and Calabash.They have some experts working with this framework.

Outside-boxYou don’t have to modify the code of your application. All you need is to run this app on emulator or real Mobile Device.

Page 19: Cucumber - Maria Machlowska

Bibliography■ Code resources:

o https://github.com/calabash/calabash-ioso https://github.com/calabash/calabash-ios

■ First Tutorial: http://blog.testmunk.com/tutorial-for-automated-mobile-app-testing-calabash

■ templates in ruby for Steps Definitions: http://docs.testmunk.com/en/latest/steps.html

■ Demo link: https://s3-us-west-1.amazonaws.com/testmunk-public/blog/terminal_and_android_looped_1-5s_delay.gif

■ Theory, what is BDD and Cucumber: http://developer.xamarin.com/guides/testcloud/calabash/introduction-to-calabash/

Page 20: Cucumber - Maria Machlowska

Thanks!Any questions?

You can find me at:about.me/mmachlowska