Ma page a une jquery ui datepicker sur un champ d'entrée #graph_start_datesélecteur de XPath de jquery ui datepicker
Je suis en train d'écrire les étapes Concombre suivant
When I click the graph start date
Then I should see a datepicker
Voici ce que j'ai pour l'étape définitions:
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
le jquery ui datepicker insère d'abord dans le 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>
Lorsque le son sauté dom contient
<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;">
Après son rejeté le dom contient
<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;">
Il n'y a pas question posée. ??? –
J'ai essayé la page. Je devrais has_xpath ("// div [@ id = 'ui-datepicker-div' et contient (@ style, 'display: block')]") mais page.body ne contient même pas le code généré js, alors comment puis-je écrire l'assertion? – linojon
effectivement cela échoue également (indiquerait que le sélecteur est ou a été surgi) page.tould has_xpath ("// div [contient (@ style, 'position: absolute')]") alors peut-être que le clic ne fonctionne pas vraiment? mais quand je fais une pause dans le débogueur, je peux voir le "datepicker" dans la fenêtre Webdriver Firefox. – linojon