WATIR:faker gem不起作用

时间:2015-11-18 10:26:17

标签: cucumber watir faker

我有模块模块FakeText

require 'faker'
require 'xkcd'

module FakeText
  def generate_title
    "Auto Title: #{Faker::Commerce.department} #{get_current_time}"
  end

我用它作为:

require_relative '../../lib/helpers/text_generator'

class TitlePage
include PageObject

  def add_new_title
    $title_text = generate_title
    self.title_element.send_keys($title_text)
  end

但它给出了错误:

NameError:
       undefined local variable or method `generate_title' 

0 个答案:

没有答案