SlidePub
Home
Categories
Login
Register
Home
General
Selenide
Selenide
ISsoft
1,186 views
27 slides
Dec 27, 2013
Slide
1
of 27
Previous
Next
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
About This Presentation
No description available for this slideshow.
Size:
730.13 KB
Language:
ru
Added:
Dec 27, 2013
Slides:
27 pages
Slide Content
Slide 1
SELENIDE Andrei Solntsev
Slide 2
ОБО МНЕ Программер Codeborne DevClub.eu организатор Selenide.org автор
Slide 3
ОБО МНЕ
Slide 4
О НАС TDD Парное программирование Чистый код KISS Прогеры пишут и код, и тесты
Slide 5
Selenide Проблемы UI тестов Примеры Selenide АГЕНДА
Slide 6
Selenide = лаконичные и стабильные тесты (на Selenium WebDriver )
Slide 7
Лаконичные Читаемые Без мусора SELENIDE Сконцентрируйся на бизнес-логике!
Slide 8
selenide.org @Test public void userCanLogin () { open ( "/login" ); $ ( "# username" ). setValue ( " john" ); $ ( by( "type", "submit" )).click(); $ ( ". menu" ). shouldHave ( text ( "Hello, John!" )); } SELENIUM+API=SELENIDE
Slide 9
Нестабильные (Чёртов Ajax!) StaleElementException ElementNotFoundException Поддержка Архитектура SELENIDE ПОМОЖЕТ! Типичные проблемы UI- тестов
Slide 10
$ ( ". loading_progress " ). shouldBe ( visible ); $ ( "#menu" ). shouldHave (text ( "Hello, John!" )); $ (By.name( "sex" )). shouldNotBe ( selected ); FORGET THE AJAX! Решения : Ajax Все should- методы ЖДУТ при необходимости .
Slide 11
Ищите элементы по тексту import static com.codeborne.selenide.Selectors .*; $( byText ( "Hello, braza !" )). shouldBe (visible ); $( withText ( " raza " )) . shouldHave (text( "Hello, braza !" )); ДУМАЙ КАК ЮЗЕР! РЕШЕНИЯ: ПОДДЕРЖКА
Slide 12
РЕШЕНИЯ:АРХИТЕКТУРА ПАЦАН НАКОДИЛ --- ПАЦАН ПРОТЕСТИЛ!
Slide 13
Юнит-тесты Быстрые & стабильные -- МНОГО ЗАЛОГ УСПЕХА ant test ant uitest UI тесты Медленные & капризные -- МАЛО
Slide 14
SELENIDE VS SELENIUM WEBDRIVER
Slide 15
firefox chrome htmlunit phantomjs ie open( "/my-application/login" ); WEBDRIVER DesiredCapabilities cap = htmlUnit (); cap.setCapability (INVALIDSELECTIONERROR, true ); cap.setCapability (INVALIDXPATHERROR, false ); cap.setJavascriptEnabled ( true ); WebDriver driver = new HtmlUnitDriver (cap);
Slide 16
WebElement customer = WebElement customer = $( "# customerContainer " ); FIND ELEMENT driver.findElement (By.id( " customerContainer " ));
Slide 17
TEXT CHECK assertEquals ( "Customer profile" , driver.findElement ( By.id ( " customerContainer " )). getText ()); $( "# customerContainer " ). shouldHave ( text ( "Customer profile" ));
Slide 18
$( "# customerContainer " ). shouldHave ( text( "Customer profile" ), text( "John" ), cssClass ( "active-profile" )); MULTIPLE CHECKS
Slide 19
FluentWait <By> fluentWait = new FluentWait <By>( By.tagName ( "TEXTAREA" )); fluentWait.pollingEvery ( 100 , TimeUnit.MILLISECONDS ); fluentWait.withTimeout ( 1000 , TimeUnit.MILLISECONDS ); fluentWait.until ( new Predicate<By>() { public boolean apply(By by ) { try { return browser.findElement (by). isDisplayed (); } catch ( NoSuchElementException ex) { return false ; } } }); assertEquals ( "John" , browser.findElement ( By.tagName ( "TEXTAREA" )). getAttribute ( "value" )); AJAX SUPPORT
Slide 20
$( " TEXTAREA" ). shouldHave (value( "John" )); $( "#location" ). shouldHave (text( "Riga" )); $( ".logout" ). shouldNotBe (visible); $( ". logout" ).should(disappear); YEAH, IT WAITS! AJAX SUPPORT
Slide 21
$( "# customerContainer " ). shouldHave ( text( "Customer profile" ), attribute( "title" , "Profile" ), attribute( " readonly " ), cssClass ( "active-profile" )); MORE CHECKS
Slide 22
COLLECTIONS $$( "#boys tr " ). shouldHave (size( 1 )); $$( "#girls tbody tr " ). shouldHave ( texts( "Angelina" , " Veronika " , "Darlene" ));
Slide 23
SCREENSHOTS public class MyTest { @Rule public ScreenShooter photographer = ScreenShooter . failedTests () . succeededTests (); }
Slide 24
SCALA class CampaignsListSpec extends BeforeAndAfter { "User" can "see existing campaigns" in { $( ".header" ). shouldHave ( text( Labels.get ( " campaigns.title " ))) $$( "# existingCampaignsList tbody tr " ) . shouldHaveSize ( 2 ) } }
Slide 25
GROOVY
Slide 26
ДЕМО http://github.com/codeborne/selenide_examples
Slide 27
ПОЖАЛУЙСТА! Q & A http:// selenide.org
[email protected]
Tags
Categories
General
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
1,186
Slides
27
Favorites
1
Age
4357 days
Related Slideshows
22
Pray For The Peace Of Jerusalem and You Will Prosper
RodolfoMoralesMarcuc
30 views
26
Don_t_Waste_Your_Life_God.....powerpoint
chalobrido8
32 views
31
VILLASUR_FACTORS_TO_CONSIDER_IN_PLATING_SALAD_10-13.pdf
JaiJai148317
30 views
14
Fertility awareness methods for women in the society
Isaiah47
29 views
35
Chapter 5 Arithmetic Functions Computer Organisation and Architecture
RitikSharma297999
26 views
5
syakira bhasa inggris (1) (1).pptx.......
ourcommunity56
28 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-27)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better