write selenide in python 15 min

19
Write Selenide in Python “in 15 minutes”

Upload: yasha-kramarenko

Post on 16-Apr-2017

1.828 views

Category:

Software


0 download

TRANSCRIPT

Write Selenide in Python

in 15 minutes

Write Selenide in 15 minutes

by Iakiv Kramarenko

Life is Hard:)SPA Ajax Everywhere.

1. Selenium waits are bulky2. raw PageObjects elements are static2.1. PageFactory is bulky and not flexible enough

?

1. Implicit waiting for elements2. Element is re-found each time it is asked for 2.1 ElementFactory over PageFactoryfor Dynamic Lazy WebElement Proxying

Selenide Harlem Shake video

ReasonAcceptance UI tests still worksbecauseare easy to write, easy to maintain, in a small suite

open("http://google.com/ncr");$(By.name("q")).val("selenide").pressEnter();$$("#ires li.g").shouldHave(size(10));$("#ires li.g").shouldBe(visible).shouldHave( text("Selenide: concise UI tests in Java"), text("selenide.org"));Like this:)

Cool, no?but only in Java

ruby has Capybara + SitePrism :)You did not here this.

Can we do the same?Lets try with python :)

Demo

SourcesVersion with waiting implemented from scratch and conditions implemented as lambdas

Version based on Selenium explicit waiters and expected conditions

Cons for True TestersI do not use implicit smart waits!I will control everything with waitUntilAjax()!

Pros for True SlackersI will write straightforward, readable, maintainable, user oriented tests with less time to provide faster feedback for Devs

Test Coverageby QA QC Automationvs Less Bugsby DevsDevs write tests?parallelised4 threads:) < 1.5h~ 5-10 mins

AfterwordsSelene is coming for Python

Q&A

[email protected]: yashaolintwitter: @yashakahttp://github.com/yashaka/

Thank you!

[email protected]+38 (073) 467-61-12