Sha256: 16cc31300f8f07d5de7d78849b0e6fa1436fff21c295a12d700d83016fd1d72d
Contents?: true
Size: 1.64 KB
Versions: 2
Compression:
Stored size: 1.64 KB
Contents
When /^I expand combobox "([^"]*)"$/ do |combo_label| page.driver.browser.execute_script <<-JS var combo = Ext.ComponentQuery.query("combobox[fieldLabel='#{combo_label}']")[0]; combo = combo || Ext.ComponentQuery.query("combobox[name='#{combo_label}']")[0]; combo.onTriggerClick(); JS step "I wait for the response from the server" end When /^I select "([^"]*)" from combobox "([^"]*)"$/ do |value, combo_label| page.driver.browser.execute_script <<-JS var combo = Ext.ComponentQuery.query("combobox[fieldLabel='#{combo_label}']")[0]; combo = combo || Ext.ComponentQuery.query("combobox[name='#{combo_label}']")[0]; var rec = combo.findRecordByDisplay('#{value}'); combo.select(rec); combo.fireEvent('select', combo, rec ); JS end Then /the form should show #{capture_fields}$/ do |fields| page.driver.browser.execute_script(<<-JS).should == true var form = Ext.ComponentQuery.query('form')[0].getForm(); var values = {#{fields}}; for (var fieldName in values) { var field = form.findField(fieldName); if (field.getXType() == 'xdatetime') { // Treat xdatetime specially var oldValue = field.getValue(); field.setValue(values[fieldName]); return oldValue == field.getValue(); } else { return (field.getValue() == values[fieldName] || field.getRawValue() == values[fieldName]); } } return true; JS end Then /^I fill in Ext field "([^"]*)" with "([^"]*)"$/ do |field_label, value| page.driver.browser.execute_script <<-JS var field = Ext.ComponentQuery.query("[fieldLabel='#{field_label}']")[0]; field.setValue("#{value}"); JS end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
netzke-basepack-0.7.7 | test/basepack_test_app/features/step_definitions/form_panel_steps.rb |
netzke-basepack-zh-0.7.6 | test/basepack_test_app/features/step_definitions/form_panel_steps.rb |