Slide 1

Slide 1 text

Production E2E test with ProxyServer

Slide 2

Slide 2 text

せ⵸: @brn (ꫬꅿ⨳ⵃa.k.a ـٕ٦ظ) 耵噟: ؿٗٝزؒٝسؒٝآص،٥iOSؒٝآص، ⠓爡: Cyberagent ،سذؙأةآؔRightSegment٥AI Messenger ـؚٗ: http://abcdef.gets.b6n.ch/ Twitter: https://twitter.com/brn227 GitHub: https://github.com/brn

Slide 3

Slide 3 text

Why test against production? 猘ך⫴ְגְ׷،سذؙأةآؔדכBtoBָً؎ٝחז׶תׅկ ًر؍،瘝ךBtoCךؿٗٝزؒٝس׾㹋鄲ׅ׷堣⠓כ婁ו֮׶תׇ׿կ ׉ך׋׭ծE2Eذأزחꟼ׃ג׮㼰ղ暴婊ז✲䞔ָ㢳ְדׅկ

Slide 4

Slide 4 text

Why test against production? ׉׿ז鏬ד➙㔐כ剑׮㹋鄲ׅ׷ֿהָ㢳ְծ javascript SDKךE2Eذأزך׀稱➜׾׃׋ְה䙼ְתׅկ

Slide 5

Slide 5 text

Why is javascript SDK? ׉ך⵸חjavascript SDKהכו׿ז׮ך׾䭷׃גְ׷ַ׾׀铡僇׃תׅկ javascript SDKהכ⚺חծscriptה㼰׃ךةؚךإحزד䲿⣘ׁ׸׷html ػ٦خדׅկ Ⱗ⡤⢽ד鎉ֲהGoogle Analyticsךأصلحز瘝ךֿהדׅկ

Slide 6

Slide 6 text

Special E2E test ׁגծֿךjavascript SDKךE2Eذأزָ暴婊ַהְֲהծ 㛇劤涸חؙٓ؎،ٝزךWebل٦آח㙵׭鴥ת׸׷ֿה׾⵸䲿ה׃גְ ׷׋׭ծ涯秵ך橆㞮דE2Eذأز׾׃׋הֿ׹דծ㹋ꥷךذأزחז׵ז ְֿהָ㢳ְךדׅկ ׉ך׋׭…

Slide 7

Slide 7 text

Solution ؙٓ؎،ٝزךWEBل٦آ♳ד 㹋ꥷחذأز׾׃תׅ

Slide 8

Slide 8 text

How? ֿ׸׾װ׵זְה… ⟃⵸厤طحزغؙٝךؚٗ؎ٝل٦آ׾ォֹ굲ל׃׋ֿהָ… ⾱㔓כؙٓ؎،ٝزךل٦آח֮׏׋document.writeָChromeחـٗح ׁؙ׸גְ׋ךדָׅծJSSDKך⚥דdocument.open׃גְ׋׋׭ծ㹋 遤ׁ׸ג׃ת׏גل٦آָ涯秵חז׏ג׃ת׏גְ׋ַ׵דׅկ

Slide 9

Slide 9 text

How? ֲֿז׵זְ׋׭חذأز׾׃׹

Slide 10

Slide 10 text

How? ׃ַ׃ؙٓ؎،ٝزךWEBل٦آחכ㹋ꥷח劤殢ךةָؚ㙵ת׏גֶ׶ծ ذأزׅ׷חכֿךةؚ׾رفٗ؎⵸ךdev橆㞮ך׮ךח縧ֹ䳔ִ׷䗳銲 ָ֮׶תׅկ

Slide 11

Slide 11 text

ProxyServer ׉ֿדـٓؐؠהWEBل٦آך꟦חProxyServer׾䮠׫ծ Man in the middle(⚥꟦罏余䷼)הְֲ䩛岀׾欽ְג WEBل٦آ׾何ׂ׿׃תׅw

Slide 12

Slide 12 text

ProxyServer ➙㔐כNodejs׌׏׋ךדծ node-mitm-proxyהְֲ׉ך׮ך׆ל׶זnpmٌآُ٦ٕ׾崞欽׃תׅկ

Slide 13

Slide 13 text

node-mitm-proxy ֿךٌآُ٦ٕכוֲװ׵ծ client => proxy proxy => server server => proxy proxy => client ךぐ穗騟ד剅ֹ䳔ִָ〳腉ז״ֲדׅկזךדծ➙㔐כծ server => proxy client => proxy ך穗騟׾剅ֹ䳔ִגծ劤殢؟٦غפךؙٔؒأز׾Ꟛ涪؟٦غח崧׃ծ ؟٦غַ׵ךٖأهٝأ׾何甑׃גرغحؚ䞔㜠׾㙵׭鴥׫תׅկ

Slide 14

Slide 14 text

Nightwatch.js E2Eذأز荈⡤כNightwatch.js׾ⵃ欽׃ג遤ְתׅկ Nightwatch.jsהכSelenium׾⢪׏׋E2Eذأزח暴⻉׃׋ٓ؎ـٓٔדׅկ 湫חSeleniumח鍗׷״׶ַז׶嚂דֹתׅկ ׁ׵חぐـٓؐؠכselenium-docker׾ⵃ欽׃גⴓ侔橆㞮ד遤ְתׅկ

Slide 15

Slide 15 text

Images Nightwatch selenium-hub Browser Browser Browser Proxy Proxy Proxy jsךURL剅ֹ䳔ִהWEBل٦آך何甑 Development Contents Server Production Contents Server 剅ֹ䳔ִ׵׸׋URLד،ؙإأ WEB WEBل٦آ׾《䖤

Slide 16

Slide 16 text

E2E Test ֿ׸ד劤殢橆㞮פך،ؙإأד֮׶זָ׵ծ Ꟛ涪橆㞮ךjsؿ؋؎ٕדE2Eذأز׾㹋遤ׅ׷ֿהָדֹתׅկ

Slide 17

Slide 17 text

Problems Nightwatch.jsדFirefoxחProxy׾鏣㹀ׅ׷ְְ倯岀ָזְ׋׭ծ Firefoxדذأزָדֹגְתׇ׿կ 湫䱸Selenium׾⢪ִל〳腉זךדָׅ… ֮הٌغ؎ٕ׮…

Slide 18

Slide 18 text

Summary 穠㽷荈⹛ذأز׌ֽדؕغ٦דֹ׷眔㔲חכꣲ歲ָ֮׶תׅկ זךדծ➂⸂ד׮嫣鹈ذأزث٦يָذأز׃גְתׅկ 暴חٌغ؎ٕ橆㞮ך劤殢E2Eذأزָ穠圓⿑׃ְךדծז׿ הַז׷傈׾㣄鋅גְתׅ…

Slide 19

Slide 19 text

Summary ׀幠耮֮׶ָהֲ׀ְׂת׃׋կ