Slide 1

Slide 1 text

#FIBUΛ࢖ͬͯ
 8PSE1SFTTͷߏ੒ͷςετΛ
 ࣗಈԽ͢Δ QIQDPO 5BLBZVLJ.JZBVDIJ UXJUUFS!NJZB

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

#FIBUʹ͍ͭͯ

Slide 7

Slide 7 text

IUUQCFIBUPSH

Slide 8

Slide 8 text

w #FIBUͱͷग़ձ͍͸81$-*΁ͷߩݙ͕͖͔͚ͬ w 81$-*Ͱ͸ɺ๲େͳόϦΤʔγϣϯͷίϚϯυ ͷ૊Έ߹ΘͤΛ#FIBUͰ࣮ࡍʹ࣮ߦ͠ɺͦͷग़ྗ ΛνΣοΫ͢Δ͜ͱͰςετ͍ͯ͠·͢ɻ

Slide 9

Slide 9 text

Scenario: wp say 
 When I run `wp say hello` Then STDOUT should be: ``` Success: hello ``` 81$-*ίϚϯυͷςετίʔυͷྫ

Slide 10

Slide 10 text

8PSE1SFTTΛ #FIBUͰςετ͢Δ

Slide 11

Slide 11 text

͜ͷςετͷΰʔϧ w $44΍+BWB4DSJQUͳͲ΋ؚΊͨ8PSE1SFTTαΠ τશମʹର͢Δཁٻ࢓༷ʹج͍ͮͨςετΛߦ͏ɻ

Slide 12

Slide 12 text

ඞཁͳ΋ͷ $PNQPTFS ໨త CFIBUCFIBU #%%ςετ༻ϑϨʔϜϫʔΫ CFIBUNJOLFYUFOTJPO ϒϥ΢βͱ#FIBUΛڮ౉͠ CFIBUNJOLTFMFOJVNESJWFS .JOLͱϒϥ΢βΛ઀ଓ͢ΔυϥΠό

Slide 13

Slide 13 text

8PSE1SFTT༻ͷΤΫεςϯγϣϯΛ։ൃத IUUQTHJUIVCDPNWDDXUFBNXPSEQSFTTFYUFOTJPO

Slide 14

Slide 14 text

σϞͷιʔε https://github.com/miya0001/phpcon2016-demo

Slide 15

Slide 15 text

CFIBUZNM͸ઃఆϑΝΠϧ

Slide 16

Slide 16 text

features/ !"" 01-login.feature !"" 02-responsive.feature !"" 03-session.feature !"" 04-mouseover.feature !"" 05-screenshot.feature !"" 06-form.feature GFBUVSFͱ͍͏ϑΝΠϧ͸ςετɻ

Slide 17

Slide 17 text

ςετͷجຊతͳจ๏ Feature: Button Tests Scenario: I should see "Hello" Given I am on "/" When I press "#button" Then I should see "Hello" Scenario: ... ...

Slide 18

Slide 18 text

Scenario: Showing the Homepage When I am on "/" Then I should see "Welcome" ΋͠ 8IFO ͳΒ 5IFO Ͱ͋Δ΂͖

Slide 19

Slide 19 text

Scenario: Click a button Given I am on "/" When I push ".button" Then I should see "Welcome" (JWFO͸લఏͱͳΔ৚݅

Slide 20

Slide 20 text

bin/behat -di --lang=en ҎԼͷίϚϯυͰఆٛࡁΈͷ
 $POUFYUͷϦετΛݟΔ͜ͱ͕Ͱ͖·͢ɻ ࣮͸೔ຊޠͰ΋ॻ͚·͕͢ࠓ೔͸লུ͠·͢ɻɻɻ

Slide 21

Slide 21 text

Scenario: Showing the Homepage When I am on "/" And I push ".button" Then I should see "Welcome" And I should see "Hello World" "OEͰෳ਺ࢦఆ͕ՄೳͰ͢ɻ

Slide 22

Slide 22 text

͞Βʹ۩ମతʹ Ҏ߱ͷྫͰ͸8PSE1SFTT&YUFOTJPOͷ ػೳ΋ؚ·Ε·͢ɻ

Slide 23

Slide 23 text

@javascript Scenario: Login as Administrator When I login as the "administrator" role And I am on "/" Then I should see "Howdy, admin" When I logout And I am on "/" Then I should not see "Howdy, admin" ϩάΠϯϢʔβʔʹରͯ͠؅ཧόʔ͕දࣔ͞Ε͍ͯΔ͔ʁ ϩάΞ΢τͨ࣌͠ʹඇදࣔʹͳ͍ͬͯΔ͔ʁ

Slide 24

Slide 24 text

@javascript Scenario: PC and Mobile Given I login as the "administrator" role And I am on "/wp-admin/" When the screen size is 1440x900 Then I should see "Dashboard" \
 in the "#adminmenu" element When the screen size is 320x400 Then I should not see "Dashboard" \
 in the "#adminmenu" element ϞόΠϧͰ؅ཧը໘ͷϝχϡʔ͕ඇදࣔʹͳ͍ͬͯΔ͔ʁ

Slide 25

Slide 25 text

@javascript Scenario: PC and Mobile Given I login as the "administrator" role And I am on "/wp-admin/" When I am on "/" Then I should see "Welcome" When I am on "/wp-admin/plugins.php" Then I should see "Contact Form 7" ηογϣϯΛ࣋ͬͯา͘͜ͱ΋Ͱ͖·͢ɻ

Slide 26

Slide 26 text

@javascript Scenario: I hover over the specific element Given the screen size is 1440x900 And I login as the "administrator" role And I am on "/" When I hover over the \ "#wp-admin-bar-my-account" element And I wait for 3 seconds Then I should see "Edit My Profile" +BWB4DSJQUͷNPVTFPWFSͷςετ

Slide 27

Slide 27 text

@javascript Scenario: I hover over the specific element Given the screen size is 1440x900 And I login as the "administrator" role And I am on "/" When I hover over the \ "#wp-admin-bar-my-account" element And I wait for 3 seconds Then I should see "Edit My Profile" And take a screenshot and save it to \ "~/Desktop/screenshot-1.png" εΫϦʔϯγϣοτ΋ࡱΕ·͢ɻ

Slide 28

Slide 28 text

@javascript Scenario: Send message from contact form Given I am on "/contact" When I fill in the following: | your-name | miya | | your-email | [email protected] | | your-subject | Hello | | your-message | ͜Μʹͪ͸ʂ | And I press "Send" And I wait for 3 seconds Then I should see "Thank you" ϑΥʔϜͷςετ΋؆୯

Slide 29

Slide 29 text

https://github.com/vccw-team/wordpress- extension/tree/master/features ͦͷଞͷྫ͸ҎԼͷ63-Ͱʂ

Slide 30

Slide 30 text

Ϣʔεέʔε

Slide 31

Slide 31 text

w ೲ඼௚લͷςετ w 8PSE1SFTTຊମ΍ϓϥάΠϯͷΞοϓσʔτʹ൐ ͏֬ೝ࡞ۀͷࣗಈԽ w ಛఆͷΠϯϑϥͰͷಈ࡞֬ೝ w ςʔϚϨϏϡʔ

Slide 32

Slide 32 text

ࢀߟ

Slide 33

Slide 33 text

• https://blog.hanhans.net/2015/06/26/ behat-extension-create/ • https://pantheon.io/docs/guides/ wordpress-automated-testing/ • https://github.com/jhedstrom/ drupalextension

Slide 34

Slide 34 text

5IBOLT