Upgrade to Pro — share decks privately, control downloads, hide ads and more …

cucumber-maochao

Mao Chao
October 10, 2015

 cucumber-maochao

2015 rubyconf china maochao presentation

Mao Chao

October 10, 2015
Tweet

Other Decks in Technology

Transcript

  1. R u b y C o n f C h

    i n a 2 0 1 5 ᯯᯯމ੝ଙѺ CUCUMBERӧᚆᦏ֦፥ྋBDD ྷ᩻
  2.   አ ᕍ ෈ ๜ ൈ ᬿ ᤈ ԅ

      አ R u b y ਫ ሿ s t e p   ᬩ ᤈ ଚ Ӭ ஑ ک Კ ᧏   ᖫ ٟ դ Ꮁ ֵ s t e p ᭗ ᬦ   ᬩ ᤈ ଚ ᥡ ੊ s t e p ᭗ ᬦ   ᯿ ॔  a  ྍ ፗ ک ق ᮱ ᭗ ᬦ
  3. ASLAKጱݺབ ࣁ B D D ڊ ሿ ጱ  ଙ

    ݸ ҅ ׁ ᆐ ํ ӧ ੝ ࢫ ᴚ ࣁ ֵ አ B D D ෸ ڊ ሿ ᳯ ᷌ ŏ ŏ B D D ׁ ᆐ ᕪ ଉ ᤩ Ո ᧏ ᥴ ౮ ܔ ᕍ ጱ ၥ ᦶ ҅ ౲ ᘏ ฎ Ӟ ӻ ݢ զ ᤩ ӥ ᫹ ጱ ૡ ٍ ŏ ŏ ੪ ࣁ ๋ ᬪ ҅ C u c u m b e r ૪ ᕪ ᤩ ӥ ᫹ ԧ ᩻ ᬦ    ӡ ེ ҅ ౯ உ ṛ ي ਙ ই ྌ ݑ ཻ ᬨ ҅ ݶ ෸ Ԟ ԅ ਙ ᤩ ଠ ာ ጱ ᧏ አ ᘒ ఽ ک ० ๕ ŏ ŏ ਙ ํ ෸ ׁ ᆐ ᤩ Კ ᧏ ጱ ୮ ౮ ԧ ᛔ ۖ ۸ ၥ ᦶ ૡ ٍ ҅ ᘒ ӧ ฎ ౯ ୮ ෸ ڠ ୌ ጱ ӳ ᥜ ̶  A s l a k H e l l e s ø y, C u c u m b e r ֢ ᘏ
  4. DANጱਧԎ B D D ฎ ᒫ ԫ դ ጱ ̵

    ኧ क़ ݊ ٖ ጱ ̵ च ԭ ೉ p u l l ጱ ̵ ग़ ො ڥ ፅ ፘ ى ᘏ ጱ s t a k e h o l d e r ̵ ग़ ᐿ ݢ ಘ ઀ ጱ ̵ ṛ ᛔ ۖ ۸ ጱ භ ഠ ො ဩ ̶ ਙ ൈ ᬿ ԧ Ӟ ӻ Ի ԰ ஗ ሾ ҅ ݢ զ ٍ ํ ଃ ํ ᜉ অ ਧ Ԏ ጱ ᬌ ڊ ҁ ܨ ૡ ֢ Ӿ Ի ՞ ጱ ᕮ ຎ ҂ ғ ૪ ၥ ᦶ ᬦ ጱ ᫫ կ ̶ D a n N o r t h , B D D ݎ ก Ո
  5. MATT ጱਧԎ B D D ጱ ਫ ᪢ ᘏ ժ

    ᭗ ᬦ ဋ ᭗ Ի ၞ ҅ ٍ ֛ ጱ ᐏ ֺ ޾ ᛔ ۖ ۸ ၥ ᦶ ଆ ۗ ՜ ժ ๅ অ ࣈ റ ᔱ ҅ ݎ ሿ ҅ ਧ Ԏ ଚ ḝ ۖ ڊ Ո ժ ፥ ྋ మ አ ጱ ᫫ կ ̶ M a t t W y n n e C u c u m b e r ֢ ᘏ
  6. ӧىဳӱۓ Scenario: Detect agent type based on contract number
 


    Given I am on the 'Find me' page
 And I have entered a contract number
 When I click 'Continue' button
 And a contact number match is found
 Then the "Back" button will be displayed
  7. ᯿॔ጱStep # A feature Given there is student Harry
 And

    there is professor Snape
 And student Harry joins class of professor Snape # B feature, use 1 new step instead of 3 Given student Harry in class of professor Snape
  8. Step્ॺ᧣አ # ֵአVWHSොဩ᧣አ૪ᕪਂࣁጱVWHS
 Given /^student (.*) in class of professor

    (.*)/ do |stu, pro|
 step "there is student #{stu}"
 step "there is professor #{pro}"
 step "student #{stu} joins class of professor #{pro}"
 end Given /^there is student (.*)/ do |student| user = User.create(student) …… end Given /^there is student come from (.*)/ do |country| …… end
  9. ۱රӧ۱տ ᜉ ᬜ ๕ ֦  ӣ ௏ ᘒ ݸ

    ᤈ ெ  ໏  ኮ  Ḙ
  10. ᵙ ᭲ C u c u m b e r

     ፥ ጱ ӧ অ አ Ҙ
  11. ىဳӱۓ Scenario: Detect agent type based on contract number
 Given

    I am on the 'Find me' page
 And I have entered a contract number
 When I click 'Continue' button
 And a contact number match is found
 Then the "Back" button will be displayed Scenario: Detect agent type based on contract number
 Given I have a "TiedAgent" policy
 When I submit my contract number
 Then I should be asked for my last name
  12. ᯿຅StepਫሿդᎱ 
 Given /^there is student (.*)/ do |student|
 ModelFactory.create_user(student)


    end Given /^there is student (.*)/ do |student| user = User.create(student) …… end
  13. ᯿አStepਫሿդᎱ Given /^student (.*) in class of professor (.*)/ do

    |student, professor|
 ModelFactory.create_user(student, professor)
 ModelFactory.join_class(student, professor)
 end Given /^student (.*) in class of professor (.*)/ do |stu, pro|
 step "there is student #{stu}"
 step "there is professor #{pro}"
 step "student #{stu} joins class of professor #{pro}"
 end
  14. ಘ઀Cucumber @active-doc
 Scenario: Detect agent type based on contract number


    Given I have a "TiedAgent" policy
 When I submit my contract number
 Then I should be asked for my last name
  15. Ⴒےൈᬿ෈կ ===================== Given I have a "TiedAgent" policy ===================== ##Detail

    Information** **In this step, you are assigned a "TieAgent" policy.** ![screenshot-1](./i-have-a-tied-agent-policy.png) You can click [here](http://example.com) for more information ===================== @active-doc
 Scenario: Detect agent type based on contract number
 Given I have a "TiedAgent" policy
 When I submit my contract number
 Then I should be asked for my last name