rufus 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +11 -7
- data/RufusApp/RufusApp/DisplayedPageViewController.h +15 -0
- data/RufusApp/RufusApp/DisplayedPageViewController.m +44 -0
- data/RufusApp/RufusApp/DisplayedPageViewController.xib +37 -0
- data/RufusApp/RufusApp/EnabledPageViewController.h +13 -0
- data/RufusApp/RufusApp/EnabledPageViewController.m +38 -0
- data/RufusApp/RufusApp/EnabledPageViewController.xib +20 -0
- data/RufusApp/RufusApp/ExistsPageViewController.h +13 -0
- data/RufusApp/RufusApp/ExistsPageViewController.m +48 -0
- data/RufusApp/RufusApp/ExistsPageViewController.xib +20 -0
- data/RufusApp/RufusApp/RUViewController.h +5 -0
- data/RufusApp/RufusApp/RUViewController.m +15 -0
- data/RufusApp/RufusApp/RufusPageViewController.m +5 -1
- data/RufusApp/RufusApp/en.lproj/RUViewController.xib +34 -2
- data/RufusApp/RufusApp.xcodeproj/project.pbxproj +41 -3
- data/features/alert.feature +4 -3
- data/features/driver.feature +11 -0
- data/features/step_definitions/alert_steps.rb.rb +9 -0
- data/features/step_definitions/driver_steps.rb +11 -8
- data/features/step_definitions/view_steps.rb +14 -3
- data/features/support/env.rb +2 -1
- data/features/support/hooks.rb +8 -1
- data/features/support/routes.rb +12 -0
- data/features/support/screens/displayed_page.rb +12 -0
- data/features/support/screens/exists_page.rb +16 -0
- data/features/support/screens/home_page.rb +7 -1
- data/features/view.feature +23 -0
- data/lib/rufus/accessors/view.rb +1 -2
- data/lib/rufus/driver.rb +21 -2
- data/lib/rufus/drivers/iOS_device.rb +0 -1
- data/lib/rufus/drivers/iOS_simulator.rb +2 -2
- data/lib/rufus.rb +33 -1
- data/rufus.gemspec +1 -1
- data/spec/drivers_specs/driver_spec.rb +72 -20
- data/spec/drivers_specs/iOS_device_spec.rb +19 -0
- data/spec/drivers_specs/iOS_simulator_spec.rb +21 -0
- data/spec/rufus_spec.rb +88 -0
- metadata +15 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWEwMjYzOGIxOTIzNTk2MGQ5ZTZiZGM2ZWJhNzA4ZDA3ZjhmN2E0MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTRjZWViZGRlMWQ4ODc0MWI0NWYzOTU3ZTk5MDgwNTE2NDkzM2JhYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGQxNTEzZDRiNTRmYWI1YTdmMGFhYTJmMmJmMmU0NmM3Mjg3MGRkY2E3YjQx
|
10
|
+
MGIzNGU0NTYzOTViZWMwY2I2M2QxZmRhOWE2ZmNiMzNmNmRkOWQwOWJkZDFm
|
11
|
+
OTFmNWU3NDA1YzkwOWU5NDg0MjE2ZTljN2UwYTc5ZmI5YzEzYTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWVlYTUxNDM1MDRlY2JjMTE4ZTMzYWFjNzA3NjI4ZGM4YWJmZTRhOTg1ZDE3
|
14
|
+
ZTY2NGYzYWQyNmRkZmMxMzg2NmJiY2M2N2VhYThkZjIyZTczOTI0NzAzNTU3
|
15
|
+
M2I3MTA3MDJmODZhMGFlZDM0ZTBmZDk4NzFmYzliOTcyNGJhNDQ=
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Last Updated:
|
1
|
+
Last Updated: 10-03-2013
|
2
2
|
|
3
|
-
This project is intended to facilitate automated testing on iOS devices using cucumber and the Page Object pattern.
|
3
|
+
This project is intended to facilitate automated testing on iOS devices using cucumber, appium and the Page Object pattern.
|
4
4
|
|
5
5
|
PREREQUISITES
|
6
6
|
--------------------------
|
@@ -31,17 +31,21 @@ QUICK START GUIDE
|
|
31
31
|
- require 'rufus' in your Gemfile
|
32
32
|
- Create a config.yml in project directory (the one with .xcodeproj in it) with the following information:
|
33
33
|
|
34
|
+
|
34
35
|
````YAML
|
35
36
|
browser: iOS
|
36
37
|
platform: Mac
|
37
38
|
version: 7.0
|
38
39
|
app:$HOME/Library/Developer/Xcode/DerivedData/<UNIQUE>/Build/Products/Debug-iphoneos/YourApp.app
|
40
|
+
use_physical: true #run on physical device?
|
41
|
+
sim_app_path: $HOME/Library/Developer/Xcode/DerivedData/<UNIQUE>/Build/Products/Debug-iphonesimulator/YourApp.app
|
42
|
+
device: iPhoneSimulator
|
39
43
|
````
|
40
44
|
- Start appium server in new terminal window
|
41
45
|
|
42
|
-
>appium -U DEVICE_UDID --app YourApp.app
|
46
|
+
>appium -U DEVICE_UDID --app YourApp.app --native-instruments-lib #omit -U option for simulator
|
43
47
|
|
44
|
-
- Deploy to iOS device using XCode or libimobiledevice. Libimobiledevice repo located at: https://github.com/benvium/libimobiledevice-macosx
|
48
|
+
- Deploy to iOS device or simulator using XCode or libimobiledevice. Libimobiledevice repo located at: https://github.com/benvium/libimobiledevice-macosx
|
45
49
|
|
46
50
|
- Run tests
|
47
51
|
|
@@ -49,11 +53,11 @@ QUICK START GUIDE
|
|
49
53
|
|
50
54
|
USING THE RUFUS IRB DRIVER
|
51
55
|
--------------------------
|
52
|
-
After installing the gem, open an irb session from the same directory as your config.yml.
|
56
|
+
After installing the gem and starting the appium server, open an irb session from the same directory as your config.yml.
|
53
57
|
|
54
58
|
````ruby
|
55
59
|
require 'rufus/driver'
|
56
|
-
driver = Rufus.new
|
60
|
+
driver = Rufus::Driver.new
|
57
61
|
driver.start (starts the app)
|
58
62
|
````
|
59
63
|
|
@@ -90,7 +94,7 @@ Enter 'Hello' into text field
|
|
90
94
|
DEPLOYING TO DEVICE WITHOUT USING XCODE
|
91
95
|
----------------------------------------------------------------------
|
92
96
|
|
93
|
-
|
97
|
+
I found the most consistent method to be through libimobiledevice. That project also is included as a submodule to this one. The original repository is https://github.com/benvium/libimobiledevice-macosx. Look at the libimobiledevice Readme in order to configure the environment variables your system needs to use this deployment mechanism.
|
94
98
|
|
95
99
|
The only gotcha I ran into was generating the .ipa archive that libimobiledevice uses. Take the following steps to generate the .ipa archive.
|
96
100
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//
|
2
|
+
// DisplayedPageViewController.h
|
3
|
+
// RufusApp
|
4
|
+
//
|
5
|
+
// Created by Jeremy Stewart on 10/7/13.
|
6
|
+
// Copyright (c) 2013 Northwoods. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
|
11
|
+
@interface DisplayedPageViewController : UIViewController
|
12
|
+
@property (weak, nonatomic) IBOutlet UILabel *mysteryLabel;
|
13
|
+
@property (weak, nonatomic) IBOutlet UILabel *invisibleLabel;
|
14
|
+
|
15
|
+
@end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
//
|
2
|
+
// DisplayedPageViewController.m
|
3
|
+
// RufusApp
|
4
|
+
//
|
5
|
+
// Created by Jeremy Stewart on 10/7/13.
|
6
|
+
// Copyright (c) 2013 Northwoods. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "DisplayedPageViewController.h"
|
10
|
+
|
11
|
+
@interface DisplayedPageViewController ()
|
12
|
+
|
13
|
+
@end
|
14
|
+
|
15
|
+
@implementation DisplayedPageViewController
|
16
|
+
@synthesize mysteryLabel;
|
17
|
+
|
18
|
+
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
19
|
+
{
|
20
|
+
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
21
|
+
if (self) {
|
22
|
+
[self performSelector:@selector(showMysteryLabel) withObject:nil afterDelay:6];
|
23
|
+
}
|
24
|
+
return self;
|
25
|
+
}
|
26
|
+
|
27
|
+
- (void)viewDidLoad
|
28
|
+
{
|
29
|
+
[super viewDidLoad];
|
30
|
+
// Do any additional setup after loading the view from its nib.
|
31
|
+
}
|
32
|
+
|
33
|
+
- (void)didReceiveMemoryWarning
|
34
|
+
{
|
35
|
+
[super didReceiveMemoryWarning];
|
36
|
+
// Dispose of any resources that can be recreated.
|
37
|
+
}
|
38
|
+
|
39
|
+
-(void)showMysteryLabel
|
40
|
+
{
|
41
|
+
[mysteryLabel setHidden:NO];
|
42
|
+
}
|
43
|
+
|
44
|
+
@end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
|
5
|
+
</dependencies>
|
6
|
+
<objects>
|
7
|
+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DisplayedPageViewController">
|
8
|
+
<connections>
|
9
|
+
<outlet property="invisibleLabel" destination="tyd-e4-1BH" id="KzR-kb-c2M"/>
|
10
|
+
<outlet property="mysteryLabel" destination="AtA-jq-fhv" id="OEv-tM-Evn"/>
|
11
|
+
<outlet property="view" destination="2" id="3"/>
|
12
|
+
</connections>
|
13
|
+
</placeholder>
|
14
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
15
|
+
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="2">
|
16
|
+
<rect key="frame" x="0.0" y="0.0" width="768" height="1004"/>
|
17
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
18
|
+
<subviews>
|
19
|
+
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Mystery Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AtA-jq-fhv">
|
20
|
+
<rect key="frame" x="236" y="309" width="251" height="21"/>
|
21
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
22
|
+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
23
|
+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
24
|
+
<nil key="highlightedColor"/>
|
25
|
+
</label>
|
26
|
+
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Invisible Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tyd-e4-1BH">
|
27
|
+
<rect key="frame" x="263" y="409" width="109" height="21"/>
|
28
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
29
|
+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
30
|
+
<nil key="highlightedColor"/>
|
31
|
+
</label>
|
32
|
+
</subviews>
|
33
|
+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
34
|
+
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
|
35
|
+
</view>
|
36
|
+
</objects>
|
37
|
+
</document>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// EnabledPageViewController.h
|
3
|
+
// RufusApp
|
4
|
+
//
|
5
|
+
// Created by Jeremy Stewart on 10/7/13.
|
6
|
+
// Copyright (c) 2013 Northwoods. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
|
11
|
+
@interface EnabledPageViewController : UIViewController
|
12
|
+
|
13
|
+
@end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
//
|
2
|
+
// EnabledPageViewController.m
|
3
|
+
// RufusApp
|
4
|
+
//
|
5
|
+
// Created by Jeremy Stewart on 10/7/13.
|
6
|
+
// Copyright (c) 2013 Northwoods. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "EnabledPageViewController.h"
|
10
|
+
|
11
|
+
@interface EnabledPageViewController ()
|
12
|
+
|
13
|
+
@end
|
14
|
+
|
15
|
+
@implementation EnabledPageViewController
|
16
|
+
|
17
|
+
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
18
|
+
{
|
19
|
+
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
20
|
+
if (self) {
|
21
|
+
// Custom initialization
|
22
|
+
}
|
23
|
+
return self;
|
24
|
+
}
|
25
|
+
|
26
|
+
- (void)viewDidLoad
|
27
|
+
{
|
28
|
+
[super viewDidLoad];
|
29
|
+
// Do any additional setup after loading the view from its nib.
|
30
|
+
}
|
31
|
+
|
32
|
+
- (void)didReceiveMemoryWarning
|
33
|
+
{
|
34
|
+
[super didReceiveMemoryWarning];
|
35
|
+
// Dispose of any resources that can be recreated.
|
36
|
+
}
|
37
|
+
|
38
|
+
@end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4437" systemVersion="13A451" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3662"/>
|
5
|
+
</dependencies>
|
6
|
+
<objects>
|
7
|
+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="EnabledPageViewController">
|
8
|
+
<connections>
|
9
|
+
<outlet property="view" destination="2" id="3"/>
|
10
|
+
</connections>
|
11
|
+
</placeholder>
|
12
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
13
|
+
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="2">
|
14
|
+
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
|
15
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
16
|
+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
17
|
+
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="blackTranslucent"/>
|
18
|
+
</view>
|
19
|
+
</objects>
|
20
|
+
</document>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// ExistsViewController.h
|
3
|
+
// RufusApp
|
4
|
+
//
|
5
|
+
// Created by Jeremy Stewart on 10/6/13.
|
6
|
+
// Copyright (c) 2013 Northwoods. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
|
11
|
+
@interface ExistsPageViewController : UIViewController <UIAlertViewDelegate>
|
12
|
+
|
13
|
+
@end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
//
|
2
|
+
// ExistsViewController.m
|
3
|
+
// RufusApp
|
4
|
+
//
|
5
|
+
// Created by Jeremy Stewart on 10/6/13.
|
6
|
+
// Copyright (c) 2013 Northwoods. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "ExistsPageViewController.h"
|
10
|
+
|
11
|
+
@interface ExistsPageViewController ()
|
12
|
+
|
13
|
+
@end
|
14
|
+
|
15
|
+
@implementation ExistsPageViewController
|
16
|
+
|
17
|
+
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
18
|
+
{
|
19
|
+
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
20
|
+
if (self) {
|
21
|
+
[self performSelector:@selector(showAlert) withObject:nil afterDelay:5];
|
22
|
+
}
|
23
|
+
return self;
|
24
|
+
}
|
25
|
+
|
26
|
+
- (void)viewDidLoad
|
27
|
+
{
|
28
|
+
[super viewDidLoad];
|
29
|
+
// Do any additional setup after loading the view from its nib.
|
30
|
+
}
|
31
|
+
|
32
|
+
- (void)didReceiveMemoryWarning
|
33
|
+
{
|
34
|
+
[super didReceiveMemoryWarning];
|
35
|
+
// Dispose of any resources that can be recreated.
|
36
|
+
}
|
37
|
+
|
38
|
+
-(void) showAlert
|
39
|
+
{
|
40
|
+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"This Alert Exists" message:@"Once this alert exists, :active? can return true on the page object." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
|
41
|
+
|
42
|
+
[alert show];
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
@end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
|
5
|
+
</dependencies>
|
6
|
+
<objects>
|
7
|
+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ExistsPageViewController">
|
8
|
+
<connections>
|
9
|
+
<outlet property="view" destination="2" id="3"/>
|
10
|
+
</connections>
|
11
|
+
</placeholder>
|
12
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
13
|
+
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="2">
|
14
|
+
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
|
15
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
16
|
+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
17
|
+
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
|
18
|
+
</view>
|
19
|
+
</objects>
|
20
|
+
</document>
|
@@ -9,11 +9,16 @@
|
|
9
9
|
#import <UIKit/UIKit.h>
|
10
10
|
|
11
11
|
@interface RUViewController : UIViewController <UIAlertViewDelegate>
|
12
|
+
@property (weak, nonatomic) IBOutlet UIButton *displayedPageButton;
|
12
13
|
|
14
|
+
@property (weak, nonatomic) IBOutlet UIButton *existsPageButton;
|
13
15
|
@property (weak, nonatomic) IBOutlet UIButton *showAlertButton;
|
14
16
|
@property (weak, nonatomic) IBOutlet UIButton *rufusButton;
|
17
|
+
|
15
18
|
- (IBAction)toRufusPage:(id)sender;
|
16
19
|
- (IBAction)showAlert:(id)sender;
|
20
|
+
- (IBAction)toExistsPage:(id)sender;
|
21
|
+
- (IBAction)toDisplayedPage:(id)sender;
|
17
22
|
|
18
23
|
|
19
24
|
@end
|
@@ -8,6 +8,8 @@
|
|
8
8
|
|
9
9
|
#import "RUViewController.h"
|
10
10
|
#import "RufusPageViewController.h"
|
11
|
+
#import "ExistsPageViewController.h"
|
12
|
+
#import "DisplayedPageViewController.h"
|
11
13
|
|
12
14
|
@interface RUViewController ()
|
13
15
|
|
@@ -39,6 +41,19 @@
|
|
39
41
|
[alert show];
|
40
42
|
}
|
41
43
|
|
44
|
+
- (IBAction)toExistsPage:(id)sender {
|
45
|
+
|
46
|
+
ExistsPageViewController *existsPageViewController = [[ExistsPageViewController alloc] init];
|
47
|
+
[[self navigationController] pushViewController:existsPageViewController animated:YES];
|
48
|
+
|
49
|
+
|
50
|
+
}
|
51
|
+
|
52
|
+
- (IBAction)toDisplayedPage:(id)sender {
|
53
|
+
DisplayedPageViewController *displayedPageViewController = [[DisplayedPageViewController alloc] init];
|
54
|
+
[[self navigationController] pushViewController:displayedPageViewController animated:YES];
|
55
|
+
}
|
56
|
+
|
42
57
|
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
|
43
58
|
{
|
44
59
|
if (buttonIndex == [alertView cancelButtonIndex])
|
@@ -19,7 +19,9 @@
|
|
19
19
|
{
|
20
20
|
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
21
21
|
if (self) {
|
22
|
-
|
22
|
+
|
23
|
+
[self performSelector:@selector(addLabelToScreen) withObject:nil afterDelay:3];
|
24
|
+
|
23
25
|
}
|
24
26
|
return self;
|
25
27
|
}
|
@@ -42,4 +44,6 @@
|
|
42
44
|
[[self navigationController] pushViewController:ruViewController animated:YES];
|
43
45
|
}
|
44
46
|
|
47
|
+
|
48
|
+
|
45
49
|
@end
|
@@ -6,6 +6,8 @@
|
|
6
6
|
<objects>
|
7
7
|
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RUViewController">
|
8
8
|
<connections>
|
9
|
+
<outlet property="displayedPageButton" destination="cx3-SH-qUq" id="ntd-NP-UTK"/>
|
10
|
+
<outlet property="existsPageButton" destination="ptK-30-J0y" id="eem-Ie-lJP"/>
|
9
11
|
<outlet property="rufusButton" destination="4" id="11"/>
|
10
12
|
<outlet property="showAlertButton" destination="VTc-fX-2Iw" id="ndi-Zu-qSy"/>
|
11
13
|
<outlet property="view" destination="2" id="3"/>
|
@@ -34,8 +36,8 @@
|
|
34
36
|
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
35
37
|
<textInputTraits key="textInputTraits"/>
|
36
38
|
</textField>
|
37
|
-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Rufus Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="24">
|
38
|
-
<rect key="frame" x="
|
39
|
+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" text="Rufus Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="24">
|
40
|
+
<rect key="frame" x="333" y="174" width="219" height="21"/>
|
39
41
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
40
42
|
<accessibility key="accessibilityConfiguration" label="rufusLabel"/>
|
41
43
|
<constraints>
|
@@ -57,6 +59,36 @@
|
|
57
59
|
<action selector="showAlert:" destination="-1" eventType="touchUpInside" id="gcv-9i-0IY"/>
|
58
60
|
</connections>
|
59
61
|
</button>
|
62
|
+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ptK-30-J0y">
|
63
|
+
<rect key="frame" x="314" y="350" width="131" height="30"/>
|
64
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
65
|
+
<accessibility key="accessibilityConfiguration" label="existsButton"/>
|
66
|
+
<state key="normal" title="Exists Page Button">
|
67
|
+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
68
|
+
</state>
|
69
|
+
<connections>
|
70
|
+
<action selector="toExistsPage:" destination="-1" eventType="touchUpInside" id="Sk4-Kl-m6A"/>
|
71
|
+
</connections>
|
72
|
+
</button>
|
73
|
+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Xe-wy-gw2">
|
74
|
+
<rect key="frame" x="306" y="388" width="146" height="30"/>
|
75
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
76
|
+
<accessibility key="accessibilityConfiguration" label="enabledPageButon"/>
|
77
|
+
<state key="normal" title="Enabled Page Button">
|
78
|
+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
79
|
+
</state>
|
80
|
+
</button>
|
81
|
+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cx3-SH-qUq">
|
82
|
+
<rect key="frame" x="300" y="434" width="158" height="30"/>
|
83
|
+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
84
|
+
<accessibility key="accessibilityConfiguration" label="displayedPageButton"/>
|
85
|
+
<state key="normal" title="Displayed Page Button">
|
86
|
+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
87
|
+
</state>
|
88
|
+
<connections>
|
89
|
+
<action selector="toDisplayedPage:" destination="-1" eventType="touchUpInside" id="hho-oP-47b"/>
|
90
|
+
</connections>
|
91
|
+
</button>
|
60
92
|
</subviews>
|
61
93
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
62
94
|
<constraints>
|
@@ -25,6 +25,12 @@
|
|
25
25
|
B88C120F17BD550E00A62E9D /* RufusAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B88C120E17BD550E00A62E9D /* RufusAppTests.m */; };
|
26
26
|
B88C121B17BD55BB00A62E9D /* RufusPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B88C121917BD55BB00A62E9D /* RufusPageViewController.m */; };
|
27
27
|
B88C121C17BD55BB00A62E9D /* RufusPageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B88C121A17BD55BB00A62E9D /* RufusPageViewController.xib */; };
|
28
|
+
B8F2F16B180255FE0037AD69 /* ExistsPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B8F2F169180255FE0037AD69 /* ExistsPageViewController.m */; };
|
29
|
+
B8F2F16C180255FE0037AD69 /* ExistsPageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8F2F16A180255FE0037AD69 /* ExistsPageViewController.xib */; };
|
30
|
+
B8F2F171180270290037AD69 /* EnabledPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B8F2F16F180270290037AD69 /* EnabledPageViewController.m */; };
|
31
|
+
B8F2F172180270290037AD69 /* EnabledPageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8F2F170180270290037AD69 /* EnabledPageViewController.xib */; };
|
32
|
+
B8F2F1761802703D0037AD69 /* DisplayedPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B8F2F1741802703D0037AD69 /* DisplayedPageViewController.m */; };
|
33
|
+
B8F2F1771802703D0037AD69 /* DisplayedPageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B8F2F1751802703D0037AD69 /* DisplayedPageViewController.xib */; };
|
28
34
|
/* End PBXBuildFile section */
|
29
35
|
|
30
36
|
/* Begin PBXContainerItemProxy section */
|
@@ -63,6 +69,15 @@
|
|
63
69
|
B88C121817BD55BB00A62E9D /* RufusPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RufusPageViewController.h; sourceTree = "<group>"; };
|
64
70
|
B88C121917BD55BB00A62E9D /* RufusPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RufusPageViewController.m; sourceTree = "<group>"; };
|
65
71
|
B88C121A17BD55BB00A62E9D /* RufusPageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RufusPageViewController.xib; sourceTree = "<group>"; };
|
72
|
+
B8F2F168180255FE0037AD69 /* ExistsPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExistsPageViewController.h; sourceTree = "<group>"; };
|
73
|
+
B8F2F169180255FE0037AD69 /* ExistsPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExistsPageViewController.m; sourceTree = "<group>"; };
|
74
|
+
B8F2F16A180255FE0037AD69 /* ExistsPageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ExistsPageViewController.xib; sourceTree = "<group>"; };
|
75
|
+
B8F2F16E180270290037AD69 /* EnabledPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnabledPageViewController.h; sourceTree = "<group>"; };
|
76
|
+
B8F2F16F180270290037AD69 /* EnabledPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EnabledPageViewController.m; sourceTree = "<group>"; };
|
77
|
+
B8F2F170180270290037AD69 /* EnabledPageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EnabledPageViewController.xib; sourceTree = "<group>"; };
|
78
|
+
B8F2F1731802703D0037AD69 /* DisplayedPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayedPageViewController.h; sourceTree = "<group>"; };
|
79
|
+
B8F2F1741802703D0037AD69 /* DisplayedPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DisplayedPageViewController.m; sourceTree = "<group>"; };
|
80
|
+
B8F2F1751802703D0037AD69 /* DisplayedPageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DisplayedPageViewController.xib; sourceTree = "<group>"; };
|
66
81
|
/* End PBXFileReference section */
|
67
82
|
|
68
83
|
/* Begin PBXFrameworksBuildPhase section */
|
@@ -122,11 +137,9 @@
|
|
122
137
|
B88C11E317BD550E00A62E9D /* RufusApp */ = {
|
123
138
|
isa = PBXGroup;
|
124
139
|
children = (
|
140
|
+
B8F2F16D18026FA00037AD69 /* PageObjectControllers */,
|
125
141
|
B88C11EC17BD550E00A62E9D /* RUAppDelegate.h */,
|
126
142
|
B88C11ED17BD550E00A62E9D /* RUAppDelegate.m */,
|
127
|
-
B88C121817BD55BB00A62E9D /* RufusPageViewController.h */,
|
128
|
-
B88C121917BD55BB00A62E9D /* RufusPageViewController.m */,
|
129
|
-
B88C121A17BD55BB00A62E9D /* RufusPageViewController.xib */,
|
130
143
|
B88C11F517BD550E00A62E9D /* RUViewController.h */,
|
131
144
|
B88C11F617BD550E00A62E9D /* RUViewController.m */,
|
132
145
|
B88C11F817BD550E00A62E9D /* RUViewController.xib */,
|
@@ -168,6 +181,25 @@
|
|
168
181
|
name = "Supporting Files";
|
169
182
|
sourceTree = "<group>";
|
170
183
|
};
|
184
|
+
B8F2F16D18026FA00037AD69 /* PageObjectControllers */ = {
|
185
|
+
isa = PBXGroup;
|
186
|
+
children = (
|
187
|
+
B8F2F1731802703D0037AD69 /* DisplayedPageViewController.h */,
|
188
|
+
B8F2F1741802703D0037AD69 /* DisplayedPageViewController.m */,
|
189
|
+
B8F2F1751802703D0037AD69 /* DisplayedPageViewController.xib */,
|
190
|
+
B8F2F16E180270290037AD69 /* EnabledPageViewController.h */,
|
191
|
+
B8F2F16F180270290037AD69 /* EnabledPageViewController.m */,
|
192
|
+
B8F2F170180270290037AD69 /* EnabledPageViewController.xib */,
|
193
|
+
B8F2F168180255FE0037AD69 /* ExistsPageViewController.h */,
|
194
|
+
B8F2F169180255FE0037AD69 /* ExistsPageViewController.m */,
|
195
|
+
B8F2F16A180255FE0037AD69 /* ExistsPageViewController.xib */,
|
196
|
+
B88C121817BD55BB00A62E9D /* RufusPageViewController.h */,
|
197
|
+
B88C121917BD55BB00A62E9D /* RufusPageViewController.m */,
|
198
|
+
B88C121A17BD55BB00A62E9D /* RufusPageViewController.xib */,
|
199
|
+
);
|
200
|
+
name = PageObjectControllers;
|
201
|
+
sourceTree = "<group>";
|
202
|
+
};
|
171
203
|
/* End PBXGroup section */
|
172
204
|
|
173
205
|
/* Begin PBXNativeTarget section */
|
@@ -245,6 +277,9 @@
|
|
245
277
|
B88C11F217BD550E00A62E9D /* Default@2x.png in Resources */,
|
246
278
|
B88C11F417BD550E00A62E9D /* Default-568h@2x.png in Resources */,
|
247
279
|
B88C11FA17BD550E00A62E9D /* RUViewController.xib in Resources */,
|
280
|
+
B8F2F172180270290037AD69 /* EnabledPageViewController.xib in Resources */,
|
281
|
+
B8F2F1771802703D0037AD69 /* DisplayedPageViewController.xib in Resources */,
|
282
|
+
B8F2F16C180255FE0037AD69 /* ExistsPageViewController.xib in Resources */,
|
248
283
|
B88C121C17BD55BB00A62E9D /* RufusPageViewController.xib in Resources */,
|
249
284
|
);
|
250
285
|
runOnlyForDeploymentPostprocessing = 0;
|
@@ -284,6 +319,9 @@
|
|
284
319
|
B88C11EE17BD550E00A62E9D /* RUAppDelegate.m in Sources */,
|
285
320
|
B88C11F717BD550E00A62E9D /* RUViewController.m in Sources */,
|
286
321
|
B88C121B17BD55BB00A62E9D /* RufusPageViewController.m in Sources */,
|
322
|
+
B8F2F16B180255FE0037AD69 /* ExistsPageViewController.m in Sources */,
|
323
|
+
B8F2F171180270290037AD69 /* EnabledPageViewController.m in Sources */,
|
324
|
+
B8F2F1761802703D0037AD69 /* DisplayedPageViewController.m in Sources */,
|
287
325
|
);
|
288
326
|
runOnlyForDeploymentPostprocessing = 0;
|
289
327
|
};
|
data/features/alert.feature
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
@alert
|
1
2
|
Feature: Interacting with alerts
|
2
3
|
|
3
4
|
Background:
|
@@ -5,12 +6,12 @@ Feature: Interacting with alerts
|
|
5
6
|
When I click the view defined "show_alert"
|
6
7
|
|
7
8
|
Scenario: Getting the title of an alert view
|
8
|
-
Then I see the
|
9
|
+
Then I see the Rufus Alert is displayed
|
9
10
|
|
10
11
|
Scenario: Selecting action button in alert view
|
11
|
-
And I select the "Ok" button on the alert
|
12
|
+
And I select the "Ok" button on the alert
|
12
13
|
Then I am on the "RufusPage"
|
13
14
|
|
14
15
|
Scenario: Selecting cancel button in alert view
|
15
|
-
And I select the "Cancel" button on the alert
|
16
|
+
And I select the "Cancel" button on the alert
|
16
17
|
Then I am on the "HomePage"
|
data/features/driver.feature
CHANGED
@@ -4,3 +4,14 @@ Feature: Interacting with a view
|
|
4
4
|
Scenario: Configuring for iOS
|
5
5
|
Given I have created a valid appium driver for iOS
|
6
6
|
|
7
|
+
Scenario: Rotating the orientation of device to landscape
|
8
|
+
Given the app is in the "landscape" orientation
|
9
|
+
When I rotate the app to "portrait"
|
10
|
+
Then the app is in the "portrait" orientation
|
11
|
+
|
12
|
+
Scenario: Rotating the orientation twice
|
13
|
+
Given the app is in the "landscape" orientation
|
14
|
+
When I rotate the app to "portrait"
|
15
|
+
And I rotate the app to "landscape"
|
16
|
+
Then the app is in the "landscape" orientation
|
17
|
+
|
@@ -1,4 +1,13 @@
|
|
1
1
|
|
2
2
|
When(/^I select the "([^"]*)" button on the alert defined "([^"]*)"$/) do |button, alert|
|
3
3
|
on(HomePage).send("#{alert}_view").click button
|
4
|
+
end
|
5
|
+
When(/^I select the "([^"]*)" button on the alert$/) do |button|
|
6
|
+
on(HomePage).send("alert_#{button}")
|
7
|
+
end
|
8
|
+
Then(/^I see the alert defined "([^"]*)" is displayed$/) do |which|
|
9
|
+
on(HomePage).send("alert_#{which}_view").displayed?.should be_true
|
10
|
+
end
|
11
|
+
Then(/^I see the Rufus Alert is displayed$/) do
|
12
|
+
on(HomePage).alert_rufus_view.should_not be_nil
|
4
13
|
end
|
@@ -1,16 +1,19 @@
|
|
1
1
|
require 'rufus/driver'
|
2
2
|
|
3
3
|
Given(/^I have created a valid appium driver for iOS$/) do
|
4
|
-
|
5
4
|
app_path = '/Users/jstewart/Library/Developer/Xcode/DerivedData/RufusApp-bseyccodcsszzhcwbshowgsppecs/Build/Products/Debug-iphoneos/RufusApp.app'
|
6
|
-
|
7
|
-
driver = Rufus::Driver.new
|
8
|
-
config = driver.config
|
9
|
-
|
5
|
+
config = $driver.config
|
10
6
|
config["browser"].should eq "iOS"
|
11
7
|
config["platform"].should eq "Mac"
|
12
|
-
config["version"].should eq
|
8
|
+
config["version"].should eq 7.0
|
13
9
|
config["app"].should eq app_path
|
14
|
-
|
15
10
|
end
|
16
|
-
|
11
|
+
Given(/^the app is in the "([^"]*)" orientation/) do |orient|
|
12
|
+
orientation = $driver.orientation
|
13
|
+
orientation.should eq orient
|
14
|
+
end
|
15
|
+
When(/^I rotate the app to "([^"]*)"$/) do |orient|
|
16
|
+
orientation = :portrait
|
17
|
+
orientation = :landscape if orient.eql?('landscape')
|
18
|
+
$driver.rotate orientation
|
19
|
+
end
|