Skip to content
sameer49 edited this page Nov 8, 2014 · 1 revision

Feature

 Feature: Gmail Login
        As a user I should able to login into Gmail.
 
 Scenario: I login with valid credential
        Given I navigate to "http://www.gmail.com"
        And I enter "abc@gmail.com" into input field having id "Email"
        And I enter "123456" into input field having id "Passwd"
        When I click on element having id "signIn"
        And I wait for 15 sec
        Then I should logged in

Step Definitions

require 'selenium-cucumber'
# Do Not Remove This File
# Add your custom steps here

Then(/^I should logged in$/)do
          # Your Ruby Code
end

def method_name param1 param2 ...
          # Your Ruby Code
end

Reusing Steps

Given(/^I open "(.*?)"$/) do |arg1|
    step %[I navigate to "#{arg1}"]
end

And(/^I enter username "(.*?)"$/) do |arg1|
    step %[I enter "#{arg1}" into input field having id "Email"]
end

And(/^I enter password "(.*?)"$/) do |arg1|
    step %[I enter "#{arg1}" into input field having id "Passwd"]
end

When(/^I click signin button$/) do
    step %[I click on element with id "signIn"]
end

Then(/^this is my another custom step$/) do
    # write your own ruby code here.
end
Clone this wiki locally