lib/spreewald/web_steps.rb in spreewald-2.9.0 vs lib/spreewald/web_steps.rb in spreewald-2.99.0

- old
+ new

@@ -395,10 +395,11 @@ expect(page).send(expectation, have_css(".field_with_errors ##{field[:id]}")) end end.overridable Then /^the "([^"]*)" field should have no error$/ do |field| + warn 'The step /^the "([^"]*)" field should have no error$/ is deprecated and scheduled for removal. Use the step /^the "([^\"]*)" field should( not)? have an error$/ instead.' patiently do element = find_field(field) classes = element.find(:xpath, '..')[:class].split(' ') expect(classes).not_to include('field_with_errors') expect(classes).not_to include('error') @@ -406,10 +407,14 @@ end.overridable Then /^the "([^"]*)" checkbox should( not)? be checked( and disabled)?$/ do |label, negate, disabled| expectation = negate ? :not_to : :to + if disabled + warn 'The step /^the "([^"]*)" checkbox should( not)? be checked( and disabled)?$/ will lose the `and disabled` modifier in Spreewald 3. In that version, the step will find a checkbox regardless of whether it is disabled.' + end + patiently do field = if Spreewald::Comparison.compare_versions(Capybara::VERSION, :<, "2.1") find_field(label) else find_field(label, :disabled => !!disabled) @@ -616,10 +621,11 @@ end end.overridable # Checks that the result has content type `text/plain` Then /^I should get a text response$/ do + warn 'The step /^I should get a text response$/ is deprecated and scheduled for removal. Use `I should get a response with content-type "text/plain"` instead.' step 'I should get a response with content-type "text/plain"' end.overridable # Click a link within an element matching the given selector. Will try to be clever # and disregard elements that don't contain a matching link. @@ -707,9 +713,10 @@ # Waits for the page to finish loading and AJAX requests to finish. # # More details [here](https://makandracards.com/makandra/12139-waiting-for-page-loads-and-ajax-requests-to-finish-with-capybara). When /^I wait for the page to load$/ do + warn 'The step /^I wait for the page to load$/ is deprecated and scheduled for removal. Please see https://github.com/makandra/spreewald/issues/136' if javascript_capable? patiently do # when no jQuery is loaded, we assume there are no pending AJAX requests page.execute_script("return typeof jQuery === 'undefined' || $.active == 0;").should == true end