繁体   English   中英

黄瓜Page对象PageObject.default_element_wait = 10给出错误

Cucumber Page object PageObject.default_element_wait = 10 giving error

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文繁体   英文版本   中英对照 版本,有任何建议请联系yoyou2525@163.com。

我正在尝试通过将PageObject.default_element_wait = 10添加到env.rb页面来将默认元素超时更改为10秒,但是保存后收到错误消息。

env.rb页面

require 'rspec'
require 'page-object/page_factory'

PageObject.default_element_wait = 10
PageObject.default_page_wait = 10

World(PageObject::PageFactory)

错误

Dimitris-MacBook-Pro:Cucumber_Automation dimitri$ cucumber features/element_validation.feature
undefined method `default_element_wait=' for PageObject:Module (NoMethodError)
/Users/dimitri/git/Cucumber_Automation/features/support/env.rb:4:in `<top (required)>'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/rb_support/rb_language.rb:95:in `load'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/rb_support/rb_language.rb:95:in `load_code_file'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/runtime/support_code.rb:180:in `load_file'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/runtime/support_code.rb:82:in `each'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/runtime.rb:184:in `load_step_definitions'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/runtime.rb:42:in `run!'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/lib/cucumber/cli/main.rb:47:in `execute!'
/Users/dimitri/.rvm/gems/ruby-2.1.5/gems/cucumber-1.3.17/bin/cucumber:13:in `<top (required)>'
/Users/dimitri/.rvm/gems/ruby-2.1.5/bin/cucumber:23:in `load'
/Users/dimitri/.rvm/gems/ruby-2.1.5/bin/cucumber:23:in `<main>'
/Users/dimitri/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/Users/dimitri/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'

我做错了什么导致此错误吗?

谢谢

1 个回复

我找到了答案。 轮到您需要“ page-object”和“ page-object / page_factory”

require 'rspec'
require 'page-object/page_factory'
require 'page-object'

PageObject.default_element_wait=(10)


World(PageObject::PageFactory)
5 Rails,current_page?(user_path)给出错误

我有我想要隐藏在特定页面上的元素巫婆,例如位于app/views/users/ (我有new.html.erb ; edit.html.erb ; show.html.erb 。我还有div in我的layouts/application.html.erb它将显示在所有页面上,因此我想将其隐藏。 ...

7 量角器-黄瓜:PageObject

我定义了`loginpage.js': 然后我在spec.js调用spec.js 但是当我运行测试时,显示以下错误: 此时,浏览器已打开,但未在地址栏中打开任何URL。 在定义pageobject并从loginpage调用navigate功能时,我做错什么了吗? 我在 ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM