|
1 | | -When /^I try to login using WordPress App/ do |
2 | | - $wait.until { $driver.find_element(:accessibility_id, "Log In").displayed? } |
3 | | - $driver.find_element(:accessibility_id, "Log In").click |
| 1 | +When /^I try to find Text Button in Sample App/ do |
| 2 | + $wait.until { $driver.find_element(:accessibility_id, "Text Button").displayed? } |
| 3 | + $driver.find_element(:accessibility_id, "Text Button").click |
4 | 4 | end |
5 | 5 |
|
6 | | -When("I type in {string} in the email field") do |search_keyword| |
7 | | - $wait.until { $driver.find_element(:accessibility_id, "Email address").displayed? } |
8 | | - search_box = $driver.find_element(:accessibility_id, "Email address") |
9 | | - search_box.send_keys(search_keyword) |
10 | | - |
11 | | - $wait.until { $driver.find_element(:accessibility_id, "Next").displayed? } |
12 | | - $driver.find_element(:accessibility_id, "Next").click |
| 6 | +When("I type in {string} in the Text Input field") do |text| |
| 7 | + puts "Received #{text}" |
| 8 | + $wait.until { $driver.find_element(:accessibility_id, "Text Input").displayed? } |
| 9 | + text_input = $driver.find_element(:accessibility_id, "Text Input") |
| 10 | + text_input.send_keys(text+"\n") |
| 11 | + sleep 5 |
13 | 12 | end |
14 | 13 |
|
15 | | -Then /^I should get a registration error$/ do |
| 14 | +Then /^I should get the entered text in the Text Output field$/ do |
16 | 15 | sleep 5 |
17 | | - text_elements = $driver.find_elements(:xpath, "//XCUIElementTypeStaticText") |
18 | | - text_elements.size.should > 0 |
19 | | - |
20 | | - error_element = text_elements.select { |element| !element.nil? && element.text.match(/not registered/) }.first |
21 | | - error_element.text.should include("not registered on WordPress.com") |
| 16 | + text_output = $driver.find_element(:accessibility_id, "Text Output") |
| 17 | + text_output.text.should eq("[email protected]") |
22 | 18 | end |
0 commit comments