English 中文(简体)
FixtureReplace with Cucumber
原标题:FixtureReplacement with Cucumber
  • 时间:2009-10-21 09:05:58
  •  标签:

我正在使用Cucumber with Selenium, FixtureReplacement and DatabaseCleaner。

我在FixtureReplacement中创建的我的数据,从我的测验中无法获得。

I have added an own rails environment for selenium and I am using an own profile for my enhanced selenium features. My cucumber setup for the selenium profile is:

Webrat.configure do |config|
  config.mode = :selenium
  config.application_environment = :selenium
end

Cucumber::Rails::World.use_transactional_fixtures = false

require "database_cleaner"

# Clean the database once when starting
DatabaseCleaner.clean_with :truncation
DatabaseCleaner.strategy = :truncation

Before do
  DatabaseCleaner.start
  include FixtureReplacement
end

After do
  DatabaseCleaner.clean
end

# this is necessary to have webrat "wait_for" the response body to be available
# when writing steps that match against the response body returned by selenium
World(Webrat::Selenium::Matchers)

溶解功能良好,我已在铁路网进行了检测。

我的ium特征是:

RAILS_ENV=selenium cucumber -p selenium features/enhanced/test.feature

没有人知道这个问题的解决办法?

最佳做法

最佳回答

这与图象无关。 我认为我无法获得我的数据,因为我可以 t。

The following fixed it: Cucumber + selenium fails randomly

问题回答

我想知道,你是否正确使用数据库清洁器? 在我的发言中,我喜欢这样做:

Before do
  require  database_cleaner 
  require  database_cleaner/cucumber 
  DatabaseCleaner.strategy = :truncation
end

这对我使用“工厂女童”的工作很有帮助。





相关问题
热门标签