Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Functional layout testing with Gemini
Search
Sergey Belov
May 21, 2014
Programming
140
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Functional layout testing with Gemini
Sergey Belov
May 21, 2014
Other Decks in Programming
See All in Programming
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
contenteditable と日本語入力に向き合う
colorful12
0
200
AmebaブログはKMPから卒業します
kmars0605
0
190
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
570
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.7k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
920
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
433
67k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
Technical Leadership for Architectural Decision Making
baasie
3
600
GitHub's CSS Performance
jonrohan
1033
470k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
The SEO identity crisis: Don't let AI make you average
varn
0
590
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Transcript
Functional layout testing with Gemini Sergey Belov, Yandex Open Mic
Night, Oslo, 21.05.2014
2 www.yandex.com
Block, Element, Modifier bem.info / @bem_en
4 bem-components github.com/bem/bem-components
Code QA JS code style ⟶ jscs JS code static
analysis ⟶ JSHint JS code regression testing ⟶ Unit Testing Frameworks (mocha, jasmine) HTML and CSS regression testing ⟶ ??? 5
6
We want to Test blocks in different browsers (Chrome, Firefox,
IE, Opera, iOS and Android) Take shots of small parts of the page Test blocks in different states Compare with reference images kept in a repository Write tests in JavaScript using convenient test API 7
8 HTML and CSS QA dpxdt casper + phantom.css huxley
Many different browsers ✘ ✘ ✘ Page fragment comparison ✘ ✘ Reference images ✘ Many different states ✘ Tests in JavaScript ✘ ✘
gemini Utility for regression testing of web pages using screenshots
♊
10 Test Suite State 1 Actions State 2 Actions State
N Actions
11
12 button plain hovered Move mouse over button pressed Press
left mouse button focused Release left mouse button
Let’s code!
Test suite var gemini = require('gemini'); ! gemini.suite('button', function(suite) {
// test code goes here }); 14
Set page URL suite.setUrl('/some/page.html'); 15
Elements to capture suite.setCaptureElements('.button'); 16
button plain state suite.capture('plain'); 17
button hovered state suite.capture('hovered', function(actions, find) { actions.mouseMove(find('.button')); }); 18
button pressed state suite.capture('pressed', function(actions, find) { actions.mouseDown(find('.button')); }); 19
button focused state suite.capture('clicked', function(actions, find) { actions.mouseUp(find('.button')); }); 20
before() hook suite.before(function(actions, find) { this.button = find('.button'); }); 21
button.gemimi.js var gemini = require('gemini'); ! gemini.suite('button', function() { suite.setUrl('/some/page.html')
.setCaptureElements('.button') .before(function(actions, find) { this.button = find('.button'); }) .capture('plain') .capture('hovered', function(actions) { actions.mouseMove(this.button); }) .capture('pressed', function(actions) { actions.mouseDown(this.button); }) .capture('clicked', function(actions) { actions.mouseUp(this.button); }); }); 22
button.gemimi.js var gemini = require('gemini'); ! gemini.suite('button', function() { suite.setUrl('/some/page.html')
.setCaptureElements('.button') .before(function(actions, find) { this.button = find('.button'); }) .capture('plain') .capture('hovered', function(actions) { actions.mouseMove(this.button); }) .capture('pressed', function(actions) { actions.mouseDown(this.button); }) .capture('clicked', function(actions) { actions.mouseUp(this.button); }); }); 23
.gemini.yml rootUrl: http://example.com/ gridUrl: http://localhost:4444/wd/hub ! browsers: - {name: chrome,
version: '33.0'} - {name: opera, version: '12.16'} - {name: firefox, version: '25.0'} - {name: ie, version: ’10.0'} 24
Demo
Pro Tips Gemini is not a replacement for your JS
unit-tests Use static data to render your HTML Optimize reference images before commit 26
Gemini + Travis CI + SauceLabs = ὑ
.travis.yml env: global: # WARNING! use `travis encrypt` to encrypt
this vars - SAUCE_USERNAME=<your-username> - SAUCE_ACCESS_KEY=<your-access-key> ! addons: sauce_connect: true ! before_script: - sudo apt-get update -qq - sudo apt-get install -y graphicsmagick - npm install http-server - node_modules/.bin/http-server -s -p 8000 & 28
.gemini.yml rootUrl: http://localhost:8000/ gridUrl: http://ondemand.saucelabs.com/wd/hub ! browsers: - {name: chrome,
version: 33} - {name: opera, version: 12} - {name: firefox, version: 29} - {name: internet explorer, version: 9} 29
package.json { "devDependencies": { "gemini": "~0.3.3" }, "scripts": { "test":
"gemini test" } } 30
31 Docs docs.travis-ci.com saucelabs.com/opensource/travis
32 ♊ github.com/bem/gemini github.com/bem/gemini-demo
33
[email protected]
@arik0n arikon Sergey Belov ! Yandex