我一直在终端上运行测试一段时间没有任何问题:
黄瓜创造\新\ Game.feature
其中包含以下内容:
Feature: Create New Game
Background:
Given I am logged in
Scenario: Cleanup & New Game 01
Then I Delete all test Games
Run Code Online (Sandbox Code Playgroud)
而红宝石:
Given(/^I am logged in$/) do
el = first("button[ttag='account_dropdown_btn']", :visible => true)
if el.nil?
logMeIn("user@user1.com","pa55w0rd")
end
end
Run Code Online (Sandbox Code Playgroud)
logMeIn定义为:
# Logs the user in with given credentials
def logMeIn(username, password)
page.driver.browser.manage.window.maximize
visit ENV['BASE_URL']
fill_in 'j_username', :with => username
fill_in 'j_password', :with => password
click_button 'Login'
end
Run Code Online (Sandbox Code Playgroud)
从测试工作到现在,上述情况都没有改变.今天,当我开始测试时,一旦Firefox打开,我立即得到:
Background: # features/Create New Game.feature:4
Given I am …Run Code Online (Sandbox Code Playgroud)