Posts

Showing posts with the label Ruby/Cucumber

Controlling Cucumber Tests By Driver Script

I will Show you how to  filter and run the cucumber tests by using the master driver script.We will use the following components for this as below: 1).YML based Configuration File ************************************************************** env_1:   Priority : p1 ############## ApplicationData:       ResultsPath : "D:\\TestProject\\Results"       FeaturesFolderPath : "D:\\TestProject"       ResultFormat : "html" *********************************************************************** This file will help us in providing the following info: a).Tag Filter "p1" by which we can execute only high priority test scenarios. b).Results Path Folder c).Features folder path d).Desired Result Format 2).Master Driver Script(Driver.rb) ******************************************************************************** #Importing the required libraries require 'yaml' require 'FileUtils' #R...

Cucumber With Ruby & Capybara

Feature File: Feature: Automate Flipkart website Scenario: Login for Flipkart   Given I open browser and navigate to flipkart website   Then I click on login Link  Then I enter Email Id  Then  I enter Password   Then I click on Login Button   Then I mouse over the user   Then I click on Logout Step Definition File Given(/^I open browser and navigate to flipkart website$/) do   visit 'http://www.flipkart.com' end Then(/^I click on login Link$/) do     find(:xpath, "//a[@href='https://www.flipkart.com/account/login?from=header']").click end Then(/^I enter Email Id$/) do      fill_in 'login_email_id', :with => 'xxx@gmail.com' end Then(/^I enter Password$/) do   fill_in 'login_password', :with => 'password' end Then(/^I click on Login Button$/) do   click_button 'Login'   sleep(10) end Then(/^I mouse over the user$/) do  element...