forked from soffes/cheddar-ios
-
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.
Merge pull request soffes#59 from moredip/pr/frankified-again
Frankified again - Pull Request soffes#52 remix
- Loading branch information
Showing
19 changed files
with
233 additions
and
0 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
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,15 @@ | ||
Feature: High-level flow through the application | ||
|
||
Background: | ||
Given I launch the app | ||
|
||
Scenario: list creation flow | ||
Given I am on the Lists screen | ||
When I choose to add a list called "Monkeys" | ||
Then I should be on the Tasks screen for the "Monkeys" list | ||
And I should be prompted for my first task | ||
|
||
When I enter a task name of "Bonobo" | ||
And I tap out of task entry mode | ||
Then I should see a tasks list of: | ||
|Bonobo| |
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,20 @@ | ||
def app_path | ||
ENV['APP_BUNDLE_PATH'] || (defined?(APP_BUNDLE_PATH) && APP_BUNDLE_PATH) | ||
end | ||
|
||
Given /^I launch the app$/ do | ||
# latest sdk and iphone by default | ||
launch_app app_path | ||
end | ||
|
||
Given /^I launch the app using iOS (\d\.\d)$/ do |sdk| | ||
# You can grab a list of the installed SDK with sim_launcher | ||
# > run sim_launcher from the command line | ||
# > open a browser to http://localhost:8881/showsdks | ||
# > use one of the sdk you see in parenthesis (e.g. 4.2) | ||
launch_app app_path, sdk | ||
end | ||
|
||
Given /^I launch the app using iOS (\d\.\d) and the (iphone|ipad) simulator$/ do |sdk, version| | ||
launch_app app_path, sdk, version | ||
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,7 @@ | ||
Given /^I am on the Lists screen$/ do | ||
ListScreen.new.wait_to_be_on_screen | ||
end | ||
|
||
When /^I choose to add a list called "(.*?)"$/ do |list_name| | ||
ListScreen.new.choose_to_add_a_list( list_name ) | ||
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,18 @@ | ||
class ListScreen | ||
include Frank::Cucumber::FrankHelper | ||
|
||
def wait_to_be_on_screen | ||
# kind of a crappy way to tell if we're on the right screen, but it'll do for now | ||
wait_for_element_to_exist( "view:'UINavigationBar' view marked:'Cheddar'" ) | ||
end | ||
|
||
def choose_to_add_a_list(list_name = false) | ||
touch "view:'UINavigationButton' marked:'plus'" | ||
type_new_list_name(list_name) if list_name | ||
end | ||
|
||
def type_new_list_name( list_name ) | ||
type_into_keyboard( list_name ) | ||
end | ||
|
||
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,37 @@ | ||
class TasksScreen | ||
include Frank::Cucumber::FrankHelper | ||
|
||
def self.with | ||
screen = self.new | ||
screen.wait_to_be_on_screen | ||
yield screen if block_given? | ||
screen | ||
end | ||
|
||
def wait_to_be_on_screen | ||
wait_for_element_to_exist( "view:'UINavigationItemButtonView' marked:'Lists'" ) | ||
end | ||
|
||
def list_name_is(list_name) | ||
element_exists( "view:'UINavigationItemView' marked:'#{list_name}'" ) | ||
end | ||
|
||
def task_text_field_is_first_responder | ||
results = frankly_map( "view:'CDIAddTaskView' view:'SSTextField'", 'isFirstResponder' ) | ||
results.length == 1 && results.first == true | ||
end | ||
|
||
def has_task_list_of expected_task_list | ||
actual_task_list = frankly_map( "view:'CDITaskTableViewCell' view:'CDIAttributedLabel'", "text" ) | ||
actual_task_list.sort == expected_task_list.sort | ||
end | ||
|
||
def task_text_field_resign_first_responder | ||
touch 'tableView' | ||
end | ||
|
||
def type_new_task_name( task_name ) | ||
type_into_keyboard( task_name ) | ||
end | ||
|
||
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,33 @@ | ||
Then /^I should be on the Tasks screen for the "(.*?)" list$/ do |list_name| | ||
TasksScreen.with do |screen| | ||
wait_until{ screen.list_name_is(list_name) } | ||
end | ||
end | ||
|
||
Then /^I should be prompted for my first task$/ do | ||
TasksScreen.with do |screen| | ||
wait_until{ screen.task_text_field_is_first_responder } | ||
end | ||
end | ||
|
||
Then /^I should see a tasks list of:$/ do |table| | ||
expected_task_list = table.raw.flatten | ||
TasksScreen.with do |screen| | ||
wait_until{ screen.has_task_list_of( expected_task_list ) } | ||
end | ||
end | ||
|
||
When /^I enter a task name of "(.*?)"$/ do |task_name| | ||
TasksScreen.with do |screen| | ||
wait_until{ screen.task_text_field_is_first_responder } | ||
screen.type_new_task_name( task_name ) | ||
end | ||
end | ||
|
||
When /^I tap out of task entry mode$/ do | ||
TasksScreen.with do |screen| | ||
if screen.task_text_field_is_first_responder | ||
screen.task_text_field_resign_first_responder | ||
end | ||
end | ||
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,8 @@ | ||
require 'frank-cucumber' | ||
|
||
# UIQuery is deprecated. Please use the shelley selector engine. | ||
Frank::Cucumber::FrankHelper.use_shelley_from_now_on | ||
|
||
# This constant must be set to the full, absolute path for your Frankified target's app bundle. | ||
# See the "Given I launch the app" step definition in launch_steps.rb for more details | ||
APP_BUNDLE_PATH = File.expand_path( '../../../frankified_build/Frankified.app', __FILE__ ) |
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 @@ | ||
../Vendor/symbiote/ |
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,4 @@ | ||
INSTALL_PATH = /./ | ||
|
||
FRANK_LDFLAGS = -all_load -ObjC -framework CFNetwork -framework Security -lShelley -lCocoaHTTPServer -lFrank | ||
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = FRANKIFIED |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,5 @@ | ||
source "https://rubygems.org" | ||
|
||
group :test do | ||
gem "frank-cucumber", "~> 0.9.5.pre7" | ||
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,57 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
activesupport (3.2.7) | ||
i18n (~> 0.6) | ||
multi_json (~> 1.0) | ||
builder (3.0.0) | ||
cucumber (1.2.1) | ||
builder (>= 2.1.2) | ||
diff-lcs (>= 1.1.3) | ||
gherkin (~> 2.11.0) | ||
json (>= 1.4.6) | ||
diff-lcs (1.1.3) | ||
dnssd (2.0) | ||
frank-cucumber (0.9.5.pre7) | ||
cucumber | ||
dnssd | ||
i18n | ||
json | ||
plist | ||
rspec (>= 2.0) | ||
sim_launcher (= 0.3.8) | ||
thor | ||
xcodeproj | ||
gherkin (2.11.1) | ||
json (>= 1.4.6) | ||
i18n (0.6.0) | ||
json (1.7.4) | ||
multi_json (1.3.6) | ||
plist (3.1.0) | ||
rack (1.4.1) | ||
rack-protection (1.2.0) | ||
rack | ||
rspec (2.11.0) | ||
rspec-core (~> 2.11.0) | ||
rspec-expectations (~> 2.11.0) | ||
rspec-mocks (~> 2.11.0) | ||
rspec-core (2.11.1) | ||
rspec-expectations (2.11.2) | ||
diff-lcs (~> 1.1.3) | ||
rspec-mocks (2.11.1) | ||
sim_launcher (0.3.8) | ||
sinatra | ||
sinatra (1.3.2) | ||
rack (~> 1.3, >= 1.3.6) | ||
rack-protection (~> 1.2) | ||
tilt (~> 1.3, >= 1.3.3) | ||
thor (0.15.4) | ||
tilt (1.3.3) | ||
xcodeproj (0.3.1) | ||
activesupport (~> 3.2.6) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
frank-cucumber (~> 0.9.5.pre7) |
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