forked from ModusCreateOrg/cucumber-watir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for appium to test ios & android native apps
- Loading branch information
Showing
7 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Feature: Movies App | ||
In order to revolutionize Movie ticketing | ||
As an iOS developer | ||
I want to be able to automate testing React native apps | ||
|
||
@appium | ||
Scenario: As a user I should be able to view movie listing and search for movies | ||
Given I type "creed" into the search text field | ||
And I tap " Creed 2015 • Critics 93%" | ||
Then the result should be displayed as "Creed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Given(/^I type "([^"]*)" into the search text field$/) do |arg1| | ||
find_element(:xpath, "//UIAApplication[1]/UIAWindow[1]/UIATextField[1]").send_keys arg1 | ||
find_element(:name, "Return").click | ||
end | ||
|
||
Given(/^I tap "([^"]*)"$/) do |arg1| | ||
find_element(:name,arg1).click | ||
end | ||
|
||
Then(/^the result should be displayed as "(.*?)"$/) do |expected| | ||
assert_includes(first_text.value,expected) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'rspec/expectations' | ||
require 'appium_lib' | ||
require 'cucumber/ast' | ||
|
||
class AppiumWorld | ||
end | ||
|
||
caps = Appium.load_appium_txt file: File.expand_path('./', __FILE__), verbose: true | ||
|
||
Appium::Driver.new(caps) | ||
Appium.promote_appium_methods AppiumWorld | ||
|
||
World do | ||
AppiumWorld.new | ||
end | ||
|
||
|
||
Before ('@appium'){ $driver.start_driver } | ||
After ('@appium'){ $driver.driver_quit } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[caps] | ||
platformName = "ios" | ||
deviceName = "iPhone 6" | ||
platformVersion = "9.2" | ||
waitForAppScript = true | ||
app = "apps/Movies.app" | ||
|
||
[appium_lib] | ||
sauce_username = false | ||
sauce_access_key = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ def get_browser | |
end | ||
end | ||
|
||
After do | ||
After ('~@appium')do | ||
@browser.close | ||
end | ||
|
||
|