1.11M
Категория: ПрограммированиеПрограммирование

Step Object

1.

Step Object

2.

Tim Sukhachev
passive
developer
of active tests
6+ years in industry
Step Object Demo:
https://github.com/tsuhachev/steppy

3.

Agenda
•Intro
•Step Object Layer
•Thucydides
•Generic steps
•Step and Data Logistics
•Step manifesto

4.

BDD / TDD
WebDriver
Page Object
Looks like happiness, eh?

5.

My first test ...
It's like .. too detailed DSL
Each ''step” is locked in its “page space”

6.

Yes, that's page object

7.

And finally … stuck
ending up with 600+ rows
of similar code

8.

Step Object is already not a page object …
And not
behavior yet …
Behavior / Tests
Step Object
Page Object
Element Object
Step Object is in between!

9.

Behavior
Given, When, Then
Step Object
Act and Verify
Set and GetPage Object
Standard/Custom Elements API
Element Object

10.

Passenger calls taxi
Departure, Epic Feature
Passenger pays driver
Given I arrived to airport
Passenger passes luggage control
Passenger passes gate contol
When I pass luggage and ticket control
Passenger gets the place
Passenger enjoys the flight
Then I’m on board

11.

passenger.atTaxi().paysForShuttle()
Airport
Taxi
Local Steps
Departure
Global Leaps
passenger.departs()
Board

12.

13.

Actor package
All Steps Package

14.

Steps
Step Factory
Step Group

15.

Generic Steps

16.

populate(WHAT, WHERE)
WHAT: E extends Entity
WHERE: P extends PageObject

17.

Generic steps requires:

Generic way of getting / setting
element regardless of a tag Basic HTML or any custom

Business object (entity)

Reflection / BeanUtils

18.

Data Estafette

19.

No need to know ticket number …
Just hand it over!
I don't need to remember passport details
I just show it!

20.

Data hand over principles

21.

Step Manifesto
•Act on behalf
•Align local steps across feature, and global
- across application
•Be generic
•Let your steps operate data
English     Русский Правила