第1步和第2步让我回到“登陆页面”。我想使用 @current_page . 这是“LandingPage.rb”中定义的元素。
@current_page
我试过了,但没有运气。缺少什么?
Step1 Step2 1. fail if not @current_page.(on(LandingPage.cart_box.present?)) 2. fail if not @current_page.(on(LandingPage.cart_box)).present? 3. fail if not @current_page.(on(LandingPage.cart_box_element)).present?
假设 @current_page 已设置为 Step1 或 Step2 ,它将是 LandingPage 。您不应该拨打 on 方法
Step1
Step2
LandingPage
on
根据您的目标,您可以执行以下任一操作:
@current_page.cart_box?
或
@current_page.cart_box_element.visible?
注意,如果您希望检查未通过测试,则需要在测试框架的断言库中使用结果。