Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
E2E test with TestCafe @LT Thursday Vol.20
Search
piro_deno
April 06, 2017
Programming
0
1k
E2E test with TestCafe @LT Thursday Vol.20
社内勉強会で使ったTestCafeの紹介資料
piro_deno
April 06, 2017
Tweet
Share
Other Decks in Programming
See All in Programming
Patterns of Patterns
denyspoltorak
0
1.4k
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
6.6k
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
AgentCoreとHuman in the Loop
har1101
5
220
CSC307 Lecture 09
javiergs
PRO
1
830
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
CSC307 Lecture 01
javiergs
PRO
0
680
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
CSC307 Lecture 03
javiergs
PRO
1
490
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
120
CSC307 Lecture 05
javiergs
PRO
0
490
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
Test your architecture with Archunit
thirion
1
2.1k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Exploring anti-patterns in Rails
aemeredith
2
250
Prompt Engineering for Job Search
mfonobong
0
160
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Between Models and Reality
mayunak
1
180
Transcript
E2E test with LT Thursday Vol.20
.me { name: ԕ౻ a.k.a. piro; age : 34;
.CA::before { career: Web࡞ձࣾ, Πϕϯτ੍࡞ձࣾ; } .CA::after { career: Android Market, SP Ameba Platform, Ameba OWND, AWA, MDH; } }
Index • About TestCafe • API • Debug • Page
Object Model • ॴײ
About TestCafe
None
Demo
Features • ES2016Ͱॻ͚ΔͷͰbabelෆཁ • Browser pluginෆཁ • ͍ΖΜͳૢ࡞ΛࣗಈͰͬͯ͘ΕΔ • TouchσόΠεରԠ
• RemoteͰςετ͕࣮ߦͰ͖Δ
API
None
Demo
Fixtures / Tests • ςετͷྨͱςετ໊ͷొ • લޙͷॲཧͷొ • ͜ͷྨ໊લΛࢦఆͯ͠ςετΛ࣮ߦ͢Δ ͜ͱͰ͖Δ
None
Selectors • ཁૉऔಘؔ࿈ͷAPI • Query SelectorͬΆ͘ॻ͚Δʢͱ͍͏ΑΓjQueryͷ$తͳײ͡ʣ • snapshotͳͷͰऔಘޙʹԆͯ͠มߋ͞Εͨ উखʹมΘͬͯ͘Εͳ͍ •
औಘͰ͖Δ·Ͱͬͯ͘ΕΔ
None
Test Controller • Πϕϯτૢ࡞ʢclick / d&d etcʣ • ը໘ॲཧʢwindow resize
/ ը໘Ωϟϓνϟ etcʣ • Assertion
None
Assertion • expectܗࣜ • Deep Equal (Not Deep Equal) •
Ok (Not Ok) • Contains (Not Contains) • Type of (Not Type of) • Great than (Great than or Equal to) • Less than (Less than or Equal to) • Within (Not Within) • Match (Not Match)
None
Client Function • Clientσʔλͷऔಘؔ࿈ • URLͷऔಘͱ͔ɺlocalStorageͷૢ࡞ͱ͔
None
Debug
Debug • t.debug() ࣮ߦڥͷdebug • --inspect --debug-brk chrome dev toolsΛͬͨdebug
None
Demo
Page Object Pattern
Page Object Pattern • ը໘ΛҰͭͷObjectͱͯ͠ѻ͏ • Page Class ը໘ͷཁૉΛఆٛ •
Operator Class Page ClassͷAPIΛݺΜͰૢ࡞͢ΔΑ͏ͳAPIΛఆٛ • Features OperatorΛݺΜͰςετΛఆٛ
খωλ
খωλ • --qr-code εϚϗͷϒϥβ֬ೝ༻ʹQRίʔυੜ • --fixture<name> / --fixture-grep <pattern>
--test <name> / --test-grep <pattern> fixturetestͷ໊લࢦఆgrepͰࢦఆͨ͠testͷ࣮ߦ • --screenshots-on-fails ςετΤϥʔ࣌ʹεΫϦʔϯγϣοτΛࡱΔ
ॴײ
ॴײ • ಋೖ؆୯ • ॻָ͍͍ͯͯ͠ • requestrenderͷͪΛ΄΅ߟྀͤͣʹ͔͚Δͷָ • ϦϞʔτͷςετศར •
ςετҎ֎ʹπʔϧͱͯ͑ͦ͠͏
Demo
͓͠·͍
Links • TestCafe http://devexpress.github.io/testcafe/ • Example https://github.com/DevExpress/testcafe/ tree/master/examples