[thong nguyen & trong bui] behavior driven development (bdd) and automation testing with...

22
Behavior-Driven Development (BDD) And Automation Testing With Cucumber TRONG BUI & THONG NGUYEN STC 2014

Upload: ho-chi-minh-city-software-testing-club

Post on 10-May-2015

421 views

Category:

Software


2 download

DESCRIPTION

“How are business users assured that all features are built and tested?”. “Test cases written by the test teams are too technical for business users”. If you find yourself in the above situations, Behavior-Driven Development (BDD) may be a good choice for your team. In this presentation, we will discuss BDD as an agile development practice, automation testing using Cucumber as well as the advantages and disadvantages of BDD/Cucumber.

TRANSCRIPT

Page 1: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Behavior-Driven Development (BDD) And Automation Testing With

Cucumber

TRONG BUI amp THONG NGUYEN

STC 2014

Sample Requirement

Feature login to the system

As a user

I want to login into the system when I provide username and password

Scenario login successfully

Given the login page is opening

When I input username into the username textbox

And I input valid password into the password textbox

And I click Login button

Then I am on the Home page

2

Automation Test

Test

public void fb_login_test() throws Exception driverget(httpswwwfacebookcom)

driverfindElement(Byid(email))clear()

driverfindElement(Byid(email))sendKeys(bddtestyahoocom)

driverfindElement(Byid(pass))clear()

driverfindElement(Byid(pass))sendKeys()

driverfindElement(Byid(u_0_e))click()

3

Automation Test

Feature login to the system

As a user

I want to login into the system when I provide username and password

Scenario login successfully

Given the login page is opening

When I input username into the username textbox

And I input valid password into the password textbox

And I click Login button

Then I am on the Home page

4

Behavior-Driven Development (BDD)

And Automation Testing With Cucumber

5

AGENDA

Behavior-driven development

Automation Testing with Cucumber

BDDCucumber ndash Pros amp Cons

QampA

6

7

Behavior-driven development

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 2: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Sample Requirement

Feature login to the system

As a user

I want to login into the system when I provide username and password

Scenario login successfully

Given the login page is opening

When I input username into the username textbox

And I input valid password into the password textbox

And I click Login button

Then I am on the Home page

2

Automation Test

Test

public void fb_login_test() throws Exception driverget(httpswwwfacebookcom)

driverfindElement(Byid(email))clear()

driverfindElement(Byid(email))sendKeys(bddtestyahoocom)

driverfindElement(Byid(pass))clear()

driverfindElement(Byid(pass))sendKeys()

driverfindElement(Byid(u_0_e))click()

3

Automation Test

Feature login to the system

As a user

I want to login into the system when I provide username and password

Scenario login successfully

Given the login page is opening

When I input username into the username textbox

And I input valid password into the password textbox

And I click Login button

Then I am on the Home page

4

Behavior-Driven Development (BDD)

And Automation Testing With Cucumber

5

AGENDA

Behavior-driven development

Automation Testing with Cucumber

BDDCucumber ndash Pros amp Cons

QampA

6

7

Behavior-driven development

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 3: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Automation Test

Test

public void fb_login_test() throws Exception driverget(httpswwwfacebookcom)

driverfindElement(Byid(email))clear()

driverfindElement(Byid(email))sendKeys(bddtestyahoocom)

driverfindElement(Byid(pass))clear()

driverfindElement(Byid(pass))sendKeys()

driverfindElement(Byid(u_0_e))click()

3

Automation Test

Feature login to the system

As a user

I want to login into the system when I provide username and password

Scenario login successfully

Given the login page is opening

When I input username into the username textbox

And I input valid password into the password textbox

And I click Login button

Then I am on the Home page

4

Behavior-Driven Development (BDD)

And Automation Testing With Cucumber

5

AGENDA

Behavior-driven development

Automation Testing with Cucumber

BDDCucumber ndash Pros amp Cons

QampA

6

7

Behavior-driven development

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 4: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Automation Test

Feature login to the system

As a user

I want to login into the system when I provide username and password

Scenario login successfully

Given the login page is opening

When I input username into the username textbox

And I input valid password into the password textbox

And I click Login button

Then I am on the Home page

4

Behavior-Driven Development (BDD)

And Automation Testing With Cucumber

5

AGENDA

Behavior-driven development

Automation Testing with Cucumber

BDDCucumber ndash Pros amp Cons

QampA

6

7

Behavior-driven development

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 5: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Behavior-Driven Development (BDD)

And Automation Testing With Cucumber

5

AGENDA

Behavior-driven development

Automation Testing with Cucumber

BDDCucumber ndash Pros amp Cons

QampA

6

7

Behavior-driven development

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 6: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

AGENDA

Behavior-driven development

Automation Testing with Cucumber

BDDCucumber ndash Pros amp Cons

QampA

6

7

Behavior-driven development

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 7: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

7

Behavior-driven development

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 8: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Behavior-driven development

8

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 9: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Given When Then

9

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 10: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

10

AUTOMATION TESTING WITH CUCUMBER

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 11: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Cucumber Approach

11

Given ^I launch ([^]) page$ do |page| visit(page) End When ^I fill in ([^]) with ([^])$ do |field value| fill_in field with =gt value end

Feature Login to Email system

As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

Given I launch httpsaccountsgooglecom page

When I fill in ldquoEmail with ldquohcmc-stc-12-julgmailcom

And I fill in ldquoPasswd with ldquohcmc-stc-passwd

And I click on signIn button

Then I am on the ldquoHomerdquo page

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 12: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Scenario Example in BDD Format

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that can login gmail Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I am on the ldquoHomerdquo page Scenarios | Email | Password | | hcmc-stc-12-julgmailcom | hcmc-stc2013| | hcmc-stc-usergmailcom | hcmc-stc1234|

12

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 13: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Summary

13

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 14: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Demo

bull Web application Cucumber + Capybara

bull Web services Cucumber + HTTParty + Savon

14

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 15: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Demo Web Application

15

Feature Login to Email system As an employee I want to login into my email system with provided username and password

Scenario Verify that employee could login email system

tag_login_email Scenario Outline Verify that employee could login email system Given I launch httpsaccountsgooglecom page When I fill in ldquoEmail with ldquoltEmail gt And I fill in ldquoPasswd with ltPasswordgt And I click on signIn button Then I should see text ltMessagegtldquo Scenarios | Email | Password | Message | | demo01hcmcstcgmailcom | demo2013 | Primary Email demo01hellip | | demo02hcmcstcgmailcom | demo11234 | Primary Email demo02hellip | | Nonexisthcmcstcgmailcom | demo11234 | Invalid email or password|

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 16: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

Demo Web Services

Feature Get Weather status to display on webpage

As an owner of Traveling Service I want to be able to get weather status of any location based on address of clients request

Scenario Outline Get weather status by address of clients requests

Given The check IP location and weather web services are running

When I send request to get location detail of address ltAddressgt

Then I should have ZIP code and ltCountrygt of that location

And I send request to get weather status of that location by its ZIP code

Then I should receive current Temperature Wind RelativeHumidity and ltCity_Namegt and ltStategt of that location

Scenarios

|Address |Country |City_Name |State |

|wwwgooglecom |United States |Mountain View |California |

16

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 17: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

17

BDDCUCUMBER ndash PROS amp CONS

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 18: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

18

BDDCucumber - Pros

BBD is FRIENDLY and UNDERSTANDABLE by non-

technical users

Great support from RUBY community - Automation

framework based BDD Cucumber is NOT REALLY

HARD to develop and maintenance

Support on MULTIPLE PLATFORM OS and different

browsers

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 19: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

19

BDDCucumber - Cons

Incompatibility among GEM versions

Lacking of tool for managing Features and

Scenarios effectively

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 20: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

20

QampA

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 21: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

References

21

bull All about BDD Cucumber httpcukesinfo

bull BDD cucumber book httpwwwamazoncomThe-Cucumber-

Book-Behaviour-Driven-Developmentdp1934356808

bull Ruby gems httprubygemsorg

bull Ruby programming httpwwwruby-langorg

copy 2014 HCMC Software Testing Club

THANK YOU

Page 22: [Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation Testing with Cucumber

copy 2014 HCMC Software Testing Club

THANK YOU