Skip to content

Commit

Permalink
cucumber: stabilize tests by waiting for keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoody committed Sep 27, 2019
1 parent 5f41f37 commit 2e1f9d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
31 changes: 17 additions & 14 deletions cucumber/features/query.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
9 changes: 2 additions & 7 deletions cucumber/features/steps/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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

0 comments on commit 2e1f9d9

Please sign in to comment.