I'm working on website test automation using Cucumber/Ruby/Selenium-Webdriver/Capybara. I want to switch to Watir-Webdriver in combination with Cucumber and Ruby, but I'm struggling with the following:
Every time I run my cucumber test, Watir opens two browser windows, a blank screen to the site I configurated as default, plus another in which the actual test steps are executed.
My 'Support/env.rb' file has:
require 'allure-cucumber'
require 'rspec'
require 'watir-webdriver'
AllureCucumber.configure do |c|
c.output_dir = 'D:\Test\result'
c.clean_dir = true
c.tms_prefix = '@PRACTEST--'
c.issue_prefix = '@JIRA++'
c.severity_prefix = '@URGENCY:'
c.tms_prefix = ''
end
My steps file begins with:
require 'watir-webdriver'
require 'cucumber'
require 'rspec'
require_relative 'D:\EntelTest\src\PageObject\home_page.rb'
Before do
@test = AbstractPage.new(Watir::Browser.new :ff)
@test.full_size
end
After do
@test.quit
end
home_page = nil
When(/^Go to home page$/) do
home_page = @test.goToHomePage
end
before doandafter doin hooks.rb? In the steps.rb file, just mention the code for your cucumber steps, and before that declarebrowser = Watir::Browser.new :ff- Emjeyhooks.rb.env.rbusually should consist the desired capabilities plus server environment codes. :) I have updated the answer. Please accept the answer, if it had helped you in resolving your bug :) Thanks - Emjey