我的页面在输入字段#graph_start_date 上有一个 jquery ui datepicker
我正在尝试编写以下 Cucumber 步骤
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 datepicker 最初插入到 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;">