diff --git a/cucumber/features/query.feature b/cucumber/features/query.feature index 50a1547c..de656b77 100644 --- a/cucumber/features/query.feature +++ b/cucumber/features/query.feature @@ -60,18 +60,21 @@ Scenario: Time queries And I am looking at the Query page Then I time how long it takes to make a bunch of queries -Scenario: Query return right ui element's value +@query +Scenario: Query returns the correct 'value' for element And I am looking at the Text Input with placeholder -Then I get Text Field by "type" query with string "TextField" and check value "Schreib!" -Then I get Text Field by "id" query with string "text field" and check value "Schreib!" -Then I get Text Field by "marked" query with string "text field" and check value "Schreib!" -Then I get Text Field by "marked" query with string "Schreib!" and check value "Schreib!" -Then I get Text Field by "text" query with string "Schreib!" and check value "Schreib!" -And I enter text "Hello!" -Then I get Text Field by "type" query with string "TextField" and check value "Hello!" -Then I get Text Field by "id" query with string "text field" and check value "Hello!" -Then I get Text Field by "marked" query with string "text field" and check value "Hello!" -Then I get Text Field by "marked" query with string "Schreib!" and check value "Hello!" -Then I get Text Field by "marked" query with string "Hello!" and check value "Hello!" -Then I get Text Field by "text" query with string "Schreib!" and check value "Hello!" -Then I get Text Field by "text" query with string "Hello!" and check value "Hello!" +Then I query the text field using "type" with string "TextField" and see value "Schreib!" +Then I query the text field using "id" with string "text field" and see value "Schreib!" +Then I query the text field using "marked" with string "text field" and see value "Schreib!" +Then I query the text field using "marked" with string "Schreib!" and see value "Schreib!" +Then I query the text field using "text" with string "Schreib!" and see value "Schreib!" +Then I touch the text field +When the keyboard is visible +And I type "Hello!" +Then I query the text field using "type" with string "TextField" and see value "Hello!" +Then I query the text field using "id" with string "text field" and see value "Hello!" +Then I query the text field using "marked" with string "text field" and see value "Hello!" +Then I query the text field using "marked" with string "Schreib!" and see value "Hello!" +Then I query the text field using "marked" with string "Hello!" and see value "Hello!" +Then I query the text field using "text" with string "Schreib!" and see value "Hello!" +Then I query the text field using "text" with string "Hello!" and see value "Hello!" diff --git a/cucumber/features/steps/query.rb b/cucumber/features/steps/query.rb index 9a58bc98..e0af34a7 100644 --- a/cucumber/features/steps/query.rb +++ b/cucumber/features/steps/query.rb @@ -302,7 +302,7 @@ def newlines_in_queries_supported? wait_for_animations end -Then(/^I get Text Field by \"(.+)\" query with string \"(.+)\" and check value \"(.+)\"$/) do |type_query, string_query, value| +Then(/^I query the text field using \"(.+)\" with string \"(.+)\" and see value \"(.+)\"$/) do |type_query, string_query, value| case type_query when "type" actual = wait_for_view({type: string_query}) @@ -313,11 +313,6 @@ def newlines_in_queries_supported? when "text" actual = wait_for_view({text: string_query}) end - - expect(actual["value"]).to be == value -end -And (/^I enter text "Hello!"$/) do - touch({marked: "text field"}) - enter_text("Hello!") + expect(actual["value"]).to be == value end