我的页面上输入字段#graph_start_dateXPath的选择
我想写以下步骤黄瓜一个jQuery UI的日期选择器
When I click the graph start date
Then I should see a datepicker
下面是我对步骤定义:
When /I click the graph start date/ do
find(".//*[@id='graph_start_date']").click
end
Then /^I should see a datepicker$/ do
page.should have_xpath(".//div[@id='ui-datepicker-div' and ?????????]")
end
的jQuery UI的日期选择器最初插入到DOM
<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" id="ui-datepicker-div"></div>
当它弹出的DOM包含
<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" id="ui-datepicker-div" style="position: absolute; top: 523px; left: 167.5px; z-index: 1;">
其驳回DOM包含
<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" id="ui-datepicker-div" style="position: absolute; top: 523px; left: 167.5px; z-index: 1; display: none;">
毫无疑问问。 ??? – 2010-11-11 20:39:02
我试过page.should have_xpath(“// div [@ id ='ui-datepicker-div'并包含(@ style,'display:block')]”),但page.body甚至不包含js生成的代码,所以我如何写断言? – linojon 2010-11-11 21:10:09
实际上这也失败了(将表明选择器是或弹出过)page.should have_xpath(“// div [contains(@ style,'position:absolute')]”) 所以也许点击没有真正的工作?但是当我在调试器中暂停时,我可以在Webdriver Firefox窗口中看到日期选择器。 – linojon 2010-11-11 21:24:54