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
Electron + WebDriver = Spectron
Search
Linda_pp
June 09, 2016
Technology
1
1.8k
Electron + WebDriver = Spectron
Introduction to Spectron; a E2E testing framework for Electron apps
Linda_pp
June 09, 2016
Tweet
Share
More Decks by Linda_pp
See All by Linda_pp
actionlint の Linter 設計
rhysd
6
3.6k
ripgrep をライブラリとして使う
rhysd
0
410
port-monolith-to-wasm-for-chrome-extension
rhysd
0
450
Fuzzing Rust Text Editor
rhysd
1
2.9k
Vim compiled to WebAssembly
rhysd
5
2.1k
about-neovim-0.4.0-floating-window
rhysd
3
2.2k
reply.vim
rhysd
0
1.2k
Vim ported to WebAssembly (VimConf 2018)
rhysd
4
3.3k
go-selfupdate-github で ツールを自己アップデートする
rhysd
5
4.3k
Other Decks in Technology
See All in Technology
20241220_S3 tablesの使い方を検証してみた
handy
3
240
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
2
2.1k
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
120
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
180
OpenShift Virtualizationのネットワーク構成を真剣に考えてみた/OpenShift Virtualization's Network Configuration
tnk4on
0
130
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
160
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
470
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
260
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
420
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
What's in a price? How to price your products and services
michaelherold
243
12k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Site-Speed That Sticks
csswizardry
2
190
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
GraphQLとの向き合い方2022年版
quramy
44
13k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
For a Future-Friendly Web
brad_frost
175
9.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Transcript
&MFDUSPO 8FC%SJWFS 4QFDUSPO .PEFSO8FC"QQ-5 @Linda_pp @rhysd
&MFDUSPO w σεΫτοϓΞϓϦϑϨʔϜϫʔΫGSPN(JU)VC w $ISPNJVNϕʔε /PEFKT
&MFDUSPOΞϓϦ։ൃ༻ΞϓϦ 4QFDUSPO &OEUP&OEςετ ༻ͷςεςΟϯάɹ ϑϨʔϜϫʔΫ $ISPNFESJWFS XFCESJWFSJP %FWUSPO *1$ΠϕϯτΛ
ࢹͰ͖Δ%FW5PPMT ֦ு "1*%FNP"QQ &MFDUSPOͷ֤छ"1* ΛࢼͤΔσϞΞϓϦ
&MFDUSPOΞϓϦ։ൃ༻ΞϓϦ 4QFDUSPO &OEUP&OEςετ ༻ͷςεςΟϯάɹ ϑϨʔϜϫʔΫ $ISPNFESJWFS XFCESJWFSJP %FWUSPO *1$ΠϕϯτΛ
ࢹͰ͖Δ %FW5PPMT֦ு "1*%FNP"QQ &MFDUSPOͷ֤छ"1* ΛࢼͤΔσϞΞϓϦ
&MFDUSPOΞϓϦͷςετ w ୯ମςετʢ&MFDUSPO"1*ͷґଘແ͠ʣ w ϩʔΧϧͷ/PEFKTͰςετʢ߹ʹΑͬͯ KTEPNʣ w ୯ମςετʢ&MFDUSPO"1*ͷґଘ༗Γʣ w FMFDUSPONPDIBΛͬͯ&MFDUSPOͷϓϩηε্ͰςετΛΒͤΔ
w IUUQTHJUIVCDPNKQSJDIBSETPOFMFDUSPONPDIB w &OEUP&OEςετ w 4QFDUSPOΛ࣮ͬͯࡍͷΞϓϦΛಈ͔͢ w IUUQTHJUIVCDPNFMFDUSPOTQFDUSPO
σϞʂ w IUUQTHJUIVCDPNSIZTE:PVS'VLVSPV w πΠολʔΫϥΠΞϯτ w 5ZQF4DSJQU BWBKT BTZODBXBJU
4QFDUSPO w 4QFDUSPODISPNFESJWFS XFCESJWFSJP w DISPNFESJWFSͷηοτΞοϓΞϓϦଆͷ &MFDUSPO"1*Λୟͨ͘Ίͷϔϧύʔ w ΞϓϦͷQBUIΛࢦఆ͢Δ͚ͩͰ͙͢ςετ͕࢝Ί ΒΕΔ
w 5SBWJT$*"QQ7FZPSSFBEZ
XFCESJWFSJP w 4FMFOJVN8FC%SJWFSͷ+BWB4DSJQUόΠϯσΟϯ άɽ8FC%SJWFS"1*ܦ༝ͰϒϥβΛૢ࡞͢Δϥ ΠϒϥϦ w ඪ४ͷ+4όΠϯσΟϯάʹൺͯ؆ܿʹॻ͚Δ
&MFDUSPO $ISPNJVN 4QFDUSPO XFCESJWFSJP :PVS5FTU $PEF :PVS"QQ w DBQBCJMJUZࣗಈࢦఆ w
ESJWFSΦϒδΣΫ τ֦ு w 8FC%SJWFS"1* WJBDISPNFESJWFS w NPDIBBWBͳͲ Ͱςετ w &MFDUSPO"1*ͷϦ Ϟʔτ࣮ߦ
import test from 'ava'; import {Application} from 'spectron'; test.beforeEach(async t
=> { t.context.app = new Application({ path: '/Applications/MyApp.app/Contents/MacOS/MyApp' }); await t.context.app.start(); }); test.afterEach.always(async t => { await t.context.app.stop(); }); test(async t => { const app = t.context.app; const client = app.client; await client.waitUntilWindowLoaded(); // Electron API (BrowserWindow) const win = app.browserWindow; t.true(await win.isVisible()); // Operate app via WebDriver await client.element('#name-input').keys('my name'); await client.click('#submit-btn'); t.true(await client.waitForExist('#login-success')); });
FMFDUSPOQSFCVJMU ύοέʔδΛ͍͍ͨ࣌ import {Application} from 'spectron'; import * as electron
from 'electron-prebuilt'; test.beforeEach(async t => { t.context.app = new Application({ path: electron, args: ['/path/to/your/repository'], env: process.env, }); });
HPUP'"*- w ςετ͕GBJMͨ͠ͱ͖ w NBJOϓϩηεSFOEFSFSϓϩηεͷϩάΛऩूͯ͠อ ଘ w DMJFOUHFU.BJO1SPDFTT-PHT w
DMJFOUHFU3FOEFS1SPDFTT-PHT w DMJFOUDBQUVSF1BHF ͰεΫϦʔϯγϣοτอଘ w DMJFOUTBWF1BHF Ͱϖʔδͷ)5.-ςΩετΛอଘ
ࠓͯ͠ͳ͍͜ͱ w ςετέʔεઃܭ w 1BHF0CKFDUύλʔϯʹΑΔ6*ૢ࡞ͷϥΠϒϥϦ Խ w ςετεΫϦϓτͷϝϯςφϯε w ༷มߋʹڧ͍&&ςετεΫϦϓτઃܭ
·ͱΊ w &MFDUSPOΞϓϦͷ&OEUP&OEςετ 4QFDUSPOͰ؆୯ʹͰ͖Δ @Linda_pp @rhysd