diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..843ca23 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,59 @@ +language: python +sudo: required +python: + - "3.6" + - "2.7" + - "3.5" + - "pypy" + - "pypy3" + - "3.7-dev" + +include: + - os: linux + node_js: '7' + +before_script: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - sleep 3 + - fluxbox >/dev/null 2>&1 & + +cache: + directories: + - $HOME/.cache/pip + +addons: + chrome: stable +# sauce_connect: +# username: "xolanimxoxozi" +# access_key: "xolani1991" + sauce_connect: true + env: + global: + - secure: 3bd6fd59-45ea-4b29-9c9c-6c5b0710caae +before_script: + - python -m SimpleHTTPServer & + - sleep 2 + +install: + - sudo apt-get install xvfb + - sudo apt-get update + - pip show setuptools + + - pip install git+https://github.com/behave/behave + - pip install toolium + - pip install sauceclient + + - wget -N http://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip -P ~/ + - unzip ~/chromedriver_linux64.zip -d ~/ + - sudo rm ~/chromedriver_linux64.zip + - sudo mv -f ~/chromedriver /usr/local/share/ + - sudo chmod +x /usr/local/share/chromedriver + - sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver + +script: + - behave Web\ Testing +# - sleep 10 +# - behave Second_web_demo +# - sleep 10 +# - behave android_behave \ No newline at end of file diff --git a/README.md b/README.md index 7f9f0f3..f449dc7 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,6 @@ -Appium Basic Demo for Behave (BDD) -======================================== +# appium-python-bdd +BDD test with Behave and Appium -These are sample test cases for Testhive workshop and general usage that can get you familiar with Appium. +__To Run Android app__ -BDD framework used is Behave which is an Cucumber clone for Python. - -Mobile Test Automation framework is Appium which is most supported right now. - -Install Behave and Appium: - -```shell -pip install appium-python-client -pip install behave - -# For SauceLabs remote connection -# !! Make sure your environment variables have: SAUCE_USERNAME -# and SAUCE_ACCESS_KEY variables set -pip install sauceclient -``` - -Usage: - -```shell -# In order to select configuration you need to set tags in execution -behave ios_simple.feature -``` - -You may limit the test cases using tags -```shell -behave --tags=current android.feature -``` - -Jenkins Execution: -```shell -# Inside the jenkins shell command -cd {PATH_TO_PROJECT_FOLDER} -# For Mac -/Library/Frameworks/Python.framework/Versions/2.7/bin/behave --junit --tags=current features/android.feature -cp -R reports $WORKSPACE -``` \ No newline at end of file +behave android_behave diff --git a/features/__init__.py b/__init__.py similarity index 100% rename from features/__init__.py rename to __init__.py diff --git a/apps/Imdb/android/com.imdb.mobile.apk b/apps/Imdb/android/com.imdb.mobile.apk deleted file mode 100644 index 80ecda7..0000000 Binary files a/apps/Imdb/android/com.imdb.mobile.apk and /dev/null differ diff --git a/apps/TestApp/.gitignore b/apps/TestApp/.gitignore deleted file mode 100755 index 66da74e..0000000 --- a/apps/TestApp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -xcshareddata diff --git a/apps/TestApp/Default-568h@2x.png b/apps/TestApp/Default-568h@2x.png deleted file mode 100755 index 0891b7a..0000000 Binary files a/apps/TestApp/Default-568h@2x.png and /dev/null differ diff --git a/apps/TestApp/Test App 2/GestureTestViewController.h b/apps/TestApp/Test App 2/GestureTestViewController.h deleted file mode 100755 index 4f42a3e..0000000 --- a/apps/TestApp/Test App 2/GestureTestViewController.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// GestureTestViewController.h -// TestApp -// -// Created by ThinkSys- Amit on 12/07/13. -// -// - -#import -#import - -@interface GestureTestViewController : UIViewController -@property (retain, nonatomic) IBOutlet MKMapView *mapView; - - -- (IBAction)handleRotation:(UIRotationGestureRecognizer*)sender; - -@end diff --git a/apps/TestApp/Test App 2/GestureTestViewController.m b/apps/TestApp/Test App 2/GestureTestViewController.m deleted file mode 100755 index dd7d314..0000000 --- a/apps/TestApp/Test App 2/GestureTestViewController.m +++ /dev/null @@ -1,48 +0,0 @@ -// -// GestureTestViewController.m -// TestApp -// -// Created by ThinkSys- Amit on 12/07/13. -// -// - -#import "GestureTestViewController.h" - -@interface GestureTestViewController () - -@end - -@implementation GestureTestViewController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view from its nib. -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (IBAction)handleRotation:(UIRotationGestureRecognizer*)sender -{ - NSLog(@"Rotation Starts"); - sender.view.transform = CGAffineTransformRotate(sender.view.transform, sender.rotation); - sender.rotation = 0; -} -- (void)dealloc { - [_mapView release]; - [super dealloc]; -} -@end diff --git a/apps/TestApp/Test App 2/GestureTestViewController.xib b/apps/TestApp/Test App 2/GestureTestViewController.xib deleted file mode 100755 index 576fbb3..0000000 --- a/apps/TestApp/Test App 2/GestureTestViewController.xib +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/TestApp/Test App 2/MyViewControllerViewController.h b/apps/TestApp/Test App 2/MyViewControllerViewController.h deleted file mode 100755 index c604443..0000000 --- a/apps/TestApp/Test App 2/MyViewControllerViewController.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright 2012 Appium Committers - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import -#import -#import "GestureTestViewController.h" - -@interface MyViewControllerViewController : UIViewController -@property (retain, nonatomic) IBOutlet UITextField *firstArg; -@property (retain, nonatomic) IBOutlet UITextField *secondArg; -@property (retain, nonatomic) IBOutlet UILabel *answerLabel; -@property (retain, nonatomic) IBOutlet UISwitch *locationStatus; -@property (retain, nonatomic) IBOutlet UIButton *computeSumButton; -@property (nonatomic, retain) CLLocationManager *locationMgr; - -- (IBAction)testGesture:(id)sender; -- (IBAction)computeAction:(id)sender; -- (IBAction)showAlert:(id)sender; -- (IBAction)crashApp:(id)sender; -- (BOOL)textFieldShouldReturn:(UITextField *)textField; -- (void)logLocationAuthFromTimer:(NSTimer *)timer; -- (void)logLocationAuth; - -@end diff --git a/apps/TestApp/Test App 2/MyViewControllerViewController.m b/apps/TestApp/Test App 2/MyViewControllerViewController.m deleted file mode 100755 index 77559d4..0000000 --- a/apps/TestApp/Test App 2/MyViewControllerViewController.m +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Copyright 2012 Appium Committers - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import "MyViewControllerViewController.h" -#import -#import - -@interface MyViewControllerViewController () - -@end - -@implementation MyViewControllerViewController -@synthesize computeSumButton; -@synthesize answerLabel; -@synthesize firstArg; -@synthesize secondArg; -@synthesize locationMgr; -@synthesize locationStatus; - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - self.locationMgr = [[CLLocationManager alloc] init]; - self.locationMgr.desiredAccuracy = kCLLocationAccuracyBest; - self.locationMgr.delegate = self; - [self logLocationAuth]; - } - - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view from its nib. - firstArg.returnKeyType = UIReturnKeyDone; - secondArg.returnKeyType = UIReturnKeyDone; - firstArg.delegate = self; - secondArg.delegate = self; - [NSTimer scheduledTimerWithTimeInterval:0.2 - target:self - selector:@selector(logLocationAuthFromTimer:) - userInfo:nil - repeats:NO]; - - [firstArg setAccessibilityIdentifier:@"IntegerA"]; - [secondArg setAccessibilityIdentifier:@"IntegerB"]; - [computeSumButton setAccessibilityIdentifier:@"ComputeSumButton"]; - [answerLabel setAccessibilityIdentifier:@"Answer"]; - [locationStatus setAccessibilityIdentifier:@"locationStatus"]; - - UISwipeGestureRecognizer * swipe =[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeUp:)]; - swipe.direction = UISwipeGestureRecognizerDirectionUp; - [self.view addGestureRecognizer:swipe]; - [swipe release]; - - computeSumButton.titleLabel.text = NSLocalizedString(@"main.button.computeSum", @"Compute Sum button"); -} - --(void)swipeUp:(UISwipeGestureRecognizer*)gestureRecognizer -{ - [secondArg resignFirstResponder]; -} - - -- (void)logLocationAuthFromTimer:(NSTimer *)timer -{ - [self logLocationAuth]; -} - -- (void)logLocationAuth -{ - CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; - if (status != kCLAuthorizationStatusRestricted && status != kCLAuthorizationStatusDenied) { - locationStatus.on = YES; - } else { - locationStatus.on = NO; - } -} - -- (void)viewDidUnload -{ - [self setFirstArg:nil]; - [self setSecondArg:nil]; - [self setAnswerLabel:nil]; - [self setLocationStatus:nil]; - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -- (BOOL)textFieldShouldReturn:(UITextField *)textField { - [textField resignFirstResponder]; - return YES; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - return (interfaceOrientation == UIInterfaceOrientationPortrait); -} - -- (void)dealloc { - [self.locationMgr release]; - self.locationMgr = nil; - [firstArg release]; - [secondArg release]; - [answerLabel release]; - [computeSumButton release]; - [super dealloc]; -} -- (IBAction)testGesture:(id)sender -{ - GestureTestViewController *test = [[GestureTestViewController alloc] initWithNibName:@"GestureTestViewController" bundle:nil]; - [self presentViewController:test animated:YES completion:NULL]; -} - -- (IBAction)computeAction:(id)sender { - int a = [[firstArg text] intValue]; - int b = [[secondArg text] intValue]; - int sum = a + b; - NSString *newLabelValue = [NSString stringWithFormat:@"%d",sum]; - [answerLabel setText:newLabelValue]; - [answerLabel setAccessibilityLabel:newLabelValue]; -} - -- (IBAction)showAlert:(id)sender { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Cool title" - message:@"this alert is so cool." - delegate:nil - cancelButtonTitle:@"Cancel" - otherButtonTitles:@"OK", nil]; - [alert show]; - [alert release]; -} - -- (IBAction)crashApp:(id)sender { - abort(); -} - -- (void)requestContactsPermission { - ABAddressBookRef book = [MyViewControllerViewController addressBookForPermissionRequest]; - [self popContactsPermissionDialogWithAddressBook:book]; -} - -- (void)popContactsPermissionDialogWithAddressBook:(ABAddressBookRef)book { - ABAddressBookRequestAccessWithCompletion(book, ^(bool granted, CFErrorRef error) { - }); - CFRelease (book); -} - -+ (ABAddressBookRef)addressBookForPermissionRequest { - CFErrorRef error = NULL; - return ABAddressBookCreateWithOptions(NULL, &error); -} - -- (IBAction)accessContactsAlert:(id)sender { - if ([MyViewControllerViewController addressBookAuthorizationStatus] == kABAuthorizationStatusNotDetermined) { - [self requestContactsPermission]; - } -} - -- (IBAction)accessLocationAlert:(id)sender { - CLLocationManager *locationManager = [[CLLocationManager alloc] init]; - - [locationManager startUpdatingLocation]; - [locationManager stopUpdatingLocation]; -} - -+ (ABAuthorizationStatus)addressBookAuthorizationStatus { - return ABAddressBookGetAuthorizationStatus(); -} - -@end diff --git a/apps/TestApp/Test App 2/TA2AppDelegate.h b/apps/TestApp/Test App 2/TA2AppDelegate.h deleted file mode 100755 index e6e1da6..0000000 --- a/apps/TestApp/Test App 2/TA2AppDelegate.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright 2012 Appium Committers - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import - -@interface TA2AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/apps/TestApp/Test App 2/TA2AppDelegate.m b/apps/TestApp/Test App 2/TA2AppDelegate.m deleted file mode 100755 index 704d9b2..0000000 --- a/apps/TestApp/Test App 2/TA2AppDelegate.m +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright 2012 Appium Committers - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import "TA2AppDelegate.h" -#import "MyViewControllerViewController.h" - -@interface TA2AppDelegate () - -@property (nonatomic, retain) UIViewController *myAddVC; -@end - -@implementation TA2AppDelegate - -@synthesize window = _window; -@synthesize myAddVC; - - - - -- (void)dealloc -{ - [_window release]; - [super dealloc]; -} - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; - // Override point for customization after application launch. - self.window.backgroundColor = [UIColor whiteColor]; - [self.window makeKeyAndVisible]; - - self.myAddVC = [[MyViewControllerViewController alloc] init]; - self.myAddVC.view.frame = self.window.bounds; - [self.window setRootViewController:self.myAddVC]; - - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application -{ - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application -{ - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application -{ - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/apps/TestApp/Test App 2/TestApp-Info.plist b/apps/TestApp/Test App 2/TestApp-Info.plist deleted file mode 100755 index 39f46bb..0000000 --- a/apps/TestApp/Test App 2/TestApp-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - io.appium.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UIApplicationExitsOnSuspend - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/apps/TestApp/Test App 2/TestApp-Prefix.pch b/apps/TestApp/Test App 2/TestApp-Prefix.pch deleted file mode 100755 index e5a0412..0000000 --- a/apps/TestApp/Test App 2/TestApp-Prefix.pch +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import - -#ifndef __IPHONE_3_0 -#warning "This project uses features only available in iOS SDK 3.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings b/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings deleted file mode 100755 index 822ae3c..0000000 --- a/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* Localized versions of Info.plist keys */ - diff --git a/apps/TestApp/Test App 2/en.lproj/Localizable.strings b/apps/TestApp/Test App 2/en.lproj/Localizable.strings deleted file mode 100755 index 5e6623d..0000000 Binary files a/apps/TestApp/Test App 2/en.lproj/Localizable.strings and /dev/null differ diff --git a/apps/TestApp/Test App 2/en.lproj/MyViewControllerViewController.xib b/apps/TestApp/Test App 2/en.lproj/MyViewControllerViewController.xib deleted file mode 100755 index ea06b3c..0000000 --- a/apps/TestApp/Test App 2/en.lproj/MyViewControllerViewController.xib +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/TestApp/Test App 2/main.m b/apps/TestApp/Test App 2/main.m deleted file mode 100755 index 76ca620..0000000 --- a/apps/TestApp/Test App 2/main.m +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2012 Appium Committers - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#import - -#import "TA2AppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([TA2AppDelegate class])); - } -} diff --git a/apps/TestApp/TestApp.xcodeproj/project.pbxproj b/apps/TestApp/TestApp.xcodeproj/project.pbxproj deleted file mode 100755 index ffdce2a..0000000 --- a/apps/TestApp/TestApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,336 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0FD861CB19A2933400F753B7 /* MyViewControllerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0FD861CD19A2933400F753B7 /* MyViewControllerViewController.xib */; }; - 1BB2B952189053DC00D0591D /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BB2B951189053DC00D0591D /* CoreLocation.framework */; }; - 255BAFEC1790223300DE7158 /* GestureTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 255BAFEA1790223300DE7158 /* GestureTestViewController.m */; }; - 255BAFED1790223300DE7158 /* GestureTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 255BAFEB1790223300DE7158 /* GestureTestViewController.xib */; }; - 255BAFEF1790249F00DE7158 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 255BAFEE1790249F00DE7158 /* MapKit.framework */; }; - 3647AE1315CA0082006F70D6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3647AE1215CA0082006F70D6 /* UIKit.framework */; }; - 3647AE1515CA0082006F70D6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3647AE1415CA0082006F70D6 /* Foundation.framework */; }; - 3647AE1715CA0082006F70D6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3647AE1615CA0082006F70D6 /* CoreGraphics.framework */; }; - 3647AE1D15CA0082006F70D6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3647AE1B15CA0082006F70D6 /* InfoPlist.strings */; }; - 3647AE1F15CA0082006F70D6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3647AE1E15CA0082006F70D6 /* main.m */; }; - 3647AE2315CA0082006F70D6 /* TA2AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3647AE2215CA0082006F70D6 /* TA2AppDelegate.m */; }; - 3647AE2C15CA00D5006F70D6 /* MyViewControllerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3647AE2A15CA00D5006F70D6 /* MyViewControllerViewController.m */; }; - 36FEEFEE1656DD6000100C04 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 36FEEFED1656DD6000100C04 /* Default-568h@2x.png */; }; - ABB96E8E192ECF150022BE43 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = ABB96E8C192ECF150022BE43 /* Localizable.strings */; }; - EA040B6118D3DF5E00AC02D8 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA040B6018D3DF5E00AC02D8 /* AddressBook.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 0FD861CC19A2933400F753B7 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MyViewControllerViewController.xib; sourceTree = ""; }; - 1BB2B951189053DC00D0591D /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 255BAFE91790223300DE7158 /* GestureTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GestureTestViewController.h; sourceTree = ""; }; - 255BAFEA1790223300DE7158 /* GestureTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GestureTestViewController.m; sourceTree = ""; }; - 255BAFEB1790223300DE7158 /* GestureTestViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GestureTestViewController.xib; sourceTree = ""; }; - 255BAFEE1790249F00DE7158 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; - 3647AE0E15CA0082006F70D6 /* TestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3647AE1215CA0082006F70D6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 3647AE1415CA0082006F70D6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 3647AE1615CA0082006F70D6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 3647AE1A15CA0082006F70D6 /* TestApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestApp-Info.plist"; sourceTree = ""; }; - 3647AE1C15CA0082006F70D6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 3647AE1E15CA0082006F70D6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 3647AE2015CA0082006F70D6 /* TestApp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TestApp-Prefix.pch"; sourceTree = ""; }; - 3647AE2115CA0082006F70D6 /* TA2AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TA2AppDelegate.h; sourceTree = ""; }; - 3647AE2215CA0082006F70D6 /* TA2AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TA2AppDelegate.m; sourceTree = ""; }; - 3647AE2915CA00D5006F70D6 /* MyViewControllerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyViewControllerViewController.h; sourceTree = ""; }; - 3647AE2A15CA00D5006F70D6 /* MyViewControllerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyViewControllerViewController.m; sourceTree = ""; }; - 36FEEFED1656DD6000100C04 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - ABB96E8D192ECF150022BE43 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - EA040B6018D3DF5E00AC02D8 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3647AE0B15CA0082006F70D6 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - EA040B6118D3DF5E00AC02D8 /* AddressBook.framework in Frameworks */, - 1BB2B952189053DC00D0591D /* CoreLocation.framework in Frameworks */, - 255BAFEF1790249F00DE7158 /* MapKit.framework in Frameworks */, - 3647AE1315CA0082006F70D6 /* UIKit.framework in Frameworks */, - 3647AE1515CA0082006F70D6 /* Foundation.framework in Frameworks */, - 3647AE1715CA0082006F70D6 /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3647AE0315CA0082006F70D6 = { - isa = PBXGroup; - children = ( - 255BAFEE1790249F00DE7158 /* MapKit.framework */, - 36FEEFED1656DD6000100C04 /* Default-568h@2x.png */, - 3647AE1815CA0082006F70D6 /* TestApp */, - 3647AE1115CA0082006F70D6 /* Frameworks */, - 3647AE0F15CA0082006F70D6 /* Products */, - ); - sourceTree = ""; - }; - 3647AE0F15CA0082006F70D6 /* Products */ = { - isa = PBXGroup; - children = ( - 3647AE0E15CA0082006F70D6 /* TestApp.app */, - ); - name = Products; - sourceTree = ""; - }; - 3647AE1115CA0082006F70D6 /* Frameworks */ = { - isa = PBXGroup; - children = ( - EA040B6018D3DF5E00AC02D8 /* AddressBook.framework */, - 1BB2B951189053DC00D0591D /* CoreLocation.framework */, - 3647AE1215CA0082006F70D6 /* UIKit.framework */, - 3647AE1415CA0082006F70D6 /* Foundation.framework */, - 3647AE1615CA0082006F70D6 /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 3647AE1815CA0082006F70D6 /* TestApp */ = { - isa = PBXGroup; - children = ( - 3647AE2115CA0082006F70D6 /* TA2AppDelegate.h */, - 3647AE2215CA0082006F70D6 /* TA2AppDelegate.m */, - 3647AE1915CA0082006F70D6 /* Supporting Files */, - 3647AE2915CA00D5006F70D6 /* MyViewControllerViewController.h */, - 3647AE2A15CA00D5006F70D6 /* MyViewControllerViewController.m */, - 0FD861CD19A2933400F753B7 /* MyViewControllerViewController.xib */, - 255BAFE91790223300DE7158 /* GestureTestViewController.h */, - 255BAFEA1790223300DE7158 /* GestureTestViewController.m */, - 255BAFEB1790223300DE7158 /* GestureTestViewController.xib */, - ); - name = TestApp; - path = "Test App 2"; - sourceTree = ""; - }; - 3647AE1915CA0082006F70D6 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 3647AE1A15CA0082006F70D6 /* TestApp-Info.plist */, - ABB96E8C192ECF150022BE43 /* Localizable.strings */, - 3647AE1B15CA0082006F70D6 /* InfoPlist.strings */, - 3647AE1E15CA0082006F70D6 /* main.m */, - 3647AE2015CA0082006F70D6 /* TestApp-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3647AE0D15CA0082006F70D6 /* TestApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3647AE2615CA0082006F70D6 /* Build configuration list for PBXNativeTarget "TestApp" */; - buildPhases = ( - 3647AE0A15CA0082006F70D6 /* Sources */, - 3647AE0B15CA0082006F70D6 /* Frameworks */, - 3647AE0C15CA0082006F70D6 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestApp; - productName = "Test App 2"; - productReference = 3647AE0E15CA0082006F70D6 /* TestApp.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3647AE0515CA0082006F70D6 /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = TA2; - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 3647AE0815CA0082006F70D6 /* Build configuration list for PBXProject "TestApp" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3647AE0315CA0082006F70D6; - productRefGroup = 3647AE0F15CA0082006F70D6 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3647AE0D15CA0082006F70D6 /* TestApp */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 3647AE0C15CA0082006F70D6 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ABB96E8E192ECF150022BE43 /* Localizable.strings in Resources */, - 3647AE1D15CA0082006F70D6 /* InfoPlist.strings in Resources */, - 0FD861CB19A2933400F753B7 /* MyViewControllerViewController.xib in Resources */, - 36FEEFEE1656DD6000100C04 /* Default-568h@2x.png in Resources */, - 255BAFED1790223300DE7158 /* GestureTestViewController.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 3647AE0A15CA0082006F70D6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3647AE1F15CA0082006F70D6 /* main.m in Sources */, - 3647AE2315CA0082006F70D6 /* TA2AppDelegate.m in Sources */, - 3647AE2C15CA00D5006F70D6 /* MyViewControllerViewController.m in Sources */, - 255BAFEC1790223300DE7158 /* GestureTestViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 0FD861CD19A2933400F753B7 /* MyViewControllerViewController.xib */ = { - isa = PBXVariantGroup; - children = ( - 0FD861CC19A2933400F753B7 /* en */, - ); - name = MyViewControllerViewController.xib; - sourceTree = ""; - }; - 3647AE1B15CA0082006F70D6 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 3647AE1C15CA0082006F70D6 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - ABB96E8C192ECF150022BE43 /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - ABB96E8D192ECF150022BE43 /* en */, - ); - name = Localizable.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 3647AE2415CA0082006F70D6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 3647AE2515CA0082006F70D6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3647AE2715CA0082006F70D6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Test App 2/TestApp-Prefix.pch"; - INFOPLIST_FILE = "Test App 2/TestApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - PRODUCT_NAME = TestApp; - PROVISIONING_PROFILE = ""; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 3647AE2815CA0082006F70D6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Test App 2/TestApp-Prefix.pch"; - INFOPLIST_FILE = "Test App 2/TestApp-Info.plist"; - INSTALL_PATH = "${LOCAL_APPS_DIR}"; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - PRODUCT_NAME = TestApp; - PROVISIONING_PROFILE = ""; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3647AE0815CA0082006F70D6 /* Build configuration list for PBXProject "TestApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3647AE2415CA0082006F70D6 /* Debug */, - 3647AE2515CA0082006F70D6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3647AE2615CA0082006F70D6 /* Build configuration list for PBXNativeTarget "TestApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3647AE2715CA0082006F70D6 /* Debug */, - 3647AE2815CA0082006F70D6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3647AE0515CA0082006F70D6 /* Project object */; -} diff --git a/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 7f42fe4..0000000 --- a/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/apps/TestApp/build/release-iphone/TestApp.app/Default-568h@2x.png b/apps/TestApp/build/release-iphone/TestApp.app/Default-568h@2x.png deleted file mode 100644 index 1b82a51..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/Default-568h@2x.png and /dev/null differ diff --git a/apps/TestApp/build/release-iphone/TestApp.app/GestureTestViewController.nib b/apps/TestApp/build/release-iphone/TestApp.app/GestureTestViewController.nib deleted file mode 100644 index 64aa934..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/GestureTestViewController.nib and /dev/null differ diff --git a/apps/TestApp/build/release-iphone/TestApp.app/Info.plist b/apps/TestApp/build/release-iphone/TestApp.app/Info.plist deleted file mode 100644 index 4ccf1cc..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/Info.plist and /dev/null differ diff --git a/apps/TestApp/build/release-iphone/TestApp.app/PkgInfo b/apps/TestApp/build/release-iphone/TestApp.app/PkgInfo deleted file mode 100644 index bd04210..0000000 --- a/apps/TestApp/build/release-iphone/TestApp.app/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -APPL???? \ No newline at end of file diff --git a/apps/TestApp/build/release-iphone/TestApp.app/TestApp b/apps/TestApp/build/release-iphone/TestApp.app/TestApp deleted file mode 100755 index 2357c4c..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/TestApp and /dev/null differ diff --git a/apps/TestApp/build/release-iphone/TestApp.app/_CodeSignature/CodeResources b/apps/TestApp/build/release-iphone/TestApp.app/_CodeSignature/CodeResources deleted file mode 100644 index 3fdb978..0000000 --- a/apps/TestApp/build/release-iphone/TestApp.app/_CodeSignature/CodeResources +++ /dev/null @@ -1,193 +0,0 @@ - - - - - files - - Default-568h@2x.png - - D8STS3mHDv2ya6HKCvP6jrq8eig= - - GestureTestViewController.nib - - kUlRqXwULkaOT+2N8nI2qIO7Tnk= - - Info.plist - - CD+0gpp5HBQj/+nG2en/+rJiGk0= - - PkgInfo - - n57qDP4tZfLD1rCS43W0B4LQjzE= - - embedded.mobileprovision - - AcZltcL17ojrTUokrcd9Jsr4vcU= - - en.lproj/InfoPlist.strings - - hash - - zmV6UqBSo6r1NOz798vd5O4zTBA= - - optional - - - en.lproj/Localizable.strings - - hash - - i5FCNEf4Khf5CMab7k9hsO+vWJ0= - - optional - - - en.lproj/MyViewControllerViewController.nib - - hash - - pXc6oYuRg3UUs9pWmQN3g+FW1+E= - - optional - - - - files2 - - Default-568h@2x.png - - D8STS3mHDv2ya6HKCvP6jrq8eig= - - GestureTestViewController.nib - - kUlRqXwULkaOT+2N8nI2qIO7Tnk= - - embedded.mobileprovision - - AcZltcL17ojrTUokrcd9Jsr4vcU= - - en.lproj/InfoPlist.strings - - hash - - zmV6UqBSo6r1NOz798vd5O4zTBA= - - optional - - - en.lproj/Localizable.strings - - hash - - i5FCNEf4Khf5CMab7k9hsO+vWJ0= - - optional - - - en.lproj/MyViewControllerViewController.nib - - hash - - pXc6oYuRg3UUs9pWmQN3g+FW1+E= - - optional - - - - rules - - ^ - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^ - - weight - 20 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/apps/TestApp/build/release-iphone/TestApp.app/embedded.mobileprovision b/apps/TestApp/build/release-iphone/TestApp.app/embedded.mobileprovision deleted file mode 100644 index df99bcd..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/embedded.mobileprovision and /dev/null differ diff --git a/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/InfoPlist.strings b/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/InfoPlist.strings deleted file mode 100644 index 3967e06..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/InfoPlist.strings and /dev/null differ diff --git a/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/Localizable.strings b/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/Localizable.strings deleted file mode 100644 index ed5825b..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/Localizable.strings and /dev/null differ diff --git a/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/MyViewControllerViewController.nib b/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/MyViewControllerViewController.nib deleted file mode 100644 index d0c8471..0000000 Binary files a/apps/TestApp/build/release-iphone/TestApp.app/en.lproj/MyViewControllerViewController.nib and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/Default-568h@2x.png b/apps/TestApp/build/release-iphonesimulator/TestApp.app/Default-568h@2x.png deleted file mode 100755 index 0891b7a..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/Default-568h@2x.png and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/objects-8.0+.nib b/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/objects-8.0+.nib deleted file mode 100755 index f6249fb..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/objects-8.0+.nib and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/objects.nib b/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/objects.nib deleted file mode 100755 index e14f21e..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/objects.nib and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/runtime.nib b/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/runtime.nib deleted file mode 100755 index 96afed0..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/GestureTestViewController.nib/runtime.nib and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/Info.plist b/apps/TestApp/build/release-iphonesimulator/TestApp.app/Info.plist deleted file mode 100755 index 1e75c23..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/Info.plist and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/PkgInfo b/apps/TestApp/build/release-iphonesimulator/TestApp.app/PkgInfo deleted file mode 100755 index bd04210..0000000 --- a/apps/TestApp/build/release-iphonesimulator/TestApp.app/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -APPL???? \ No newline at end of file diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/TestApp b/apps/TestApp/build/release-iphonesimulator/TestApp.app/TestApp deleted file mode 100755 index 5453507..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/TestApp and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/InfoPlist.strings b/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/InfoPlist.strings deleted file mode 100755 index 3967e06..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/InfoPlist.strings and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/Localizable.strings b/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/Localizable.strings deleted file mode 100755 index ed5825b..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/Localizable.strings and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects-8.0+.nib b/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects-8.0+.nib deleted file mode 100755 index 596cf7e..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects-8.0+.nib and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects.nib b/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects.nib deleted file mode 100755 index a84929e..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/objects.nib and /dev/null differ diff --git a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/runtime.nib b/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/runtime.nib deleted file mode 100755 index b76ac00..0000000 Binary files a/apps/TestApp/build/release-iphonesimulator/TestApp.app/en.lproj/MyViewControllerViewController.nib/runtime.nib and /dev/null differ diff --git a/behave.ini b/behave.ini new file mode 100644 index 0000000..be9253e --- /dev/null +++ b/behave.ini @@ -0,0 +1,2 @@ +[behave] +logging_level = DEBUG \ No newline at end of file diff --git a/conf/android-properties.cfg b/conf/android-properties.cfg new file mode 100644 index 0000000..87c8bfb --- /dev/null +++ b/conf/android-properties.cfg @@ -0,0 +1,14 @@ +[Driver] +type: android +appium_app_strings: true + +[AppiumCapabilities] +automationName: Appium +platformName: Android +deviceName: Android Emulator +browserName: +app: https://github.com/appium/javascript-workshop/blob/master/apps/ApiDemos.apk?raw=true&fake=.apk +appWaitActivity: + +[VisualTests] +baseline_name: {Driver_type}-{PlatformVersion} diff --git a/conf/logging.conf b/conf/logging.conf new file mode 100644 index 0000000..fd94f2f --- /dev/null +++ b/conf/logging.conf @@ -0,0 +1,46 @@ +[loggers] +keys=root,toolium,remote_connection,pil + +[handlers] +keys=consoleHandler,fileHandler + +[formatters] +keys=simpleFormatter + +[logger_root] +level=DEBUG +handlers=fileHandler + +[logger_toolium] +level=DEBUG +handlers=fileHandler +qualname=toolium +propagate=0 + +[logger_remote_connection] +level=INFO +handlers=fileHandler +qualname=selenium.webdriver.remote.remote_connection +propagate=0 + +[logger_pil] +level=INFO +handlers=fileHandler +qualname=PIL +propagate=0 + +[handler_consoleHandler] +class=StreamHandler +level=DEBUG +formatter=simpleFormatter +args=(sys.stdout,) + +[handler_fileHandler] +class=handlers.RotatingFileHandler +level=DEBUG +formatter=simpleFormatter +args=('%(logfilename)s','a',2000000,10) + +[formatter_simpleFormatter] +format=%(levelname)-7s %(asctime)s [%(module)s] %(message)s +datefmt= \ No newline at end of file diff --git a/conf/properties.cfg b/conf/properties.cfg new file mode 100644 index 0000000..49d69e5 --- /dev/null +++ b/conf/properties.cfg @@ -0,0 +1,56 @@ +[Driver] +# Valid driver types: firefox, chrome, iexplore, edge, safari, opera, phantomjs, ios, android +type: chrome +# Configure local driver paths +gecko_driver_path: +chrome_driver_path: +explorer_driver_path: +edge_driver_path: +opera_driver_path: +phantomjs_driver_path: +# Browser size and bounds +window_width: +window_height: +monitor: +bounds_x: +bounds_y: +# Driver options +implicitly_wait: 5 +explicitly_wait: 10 +reuse_driver: false +reuse_driver_session: false +restart_driver_after_failure: true +save_web_element: true +appium_app_strings: false +headless: false + +[Server] +enabled: false +host: +port: +video_enabled: false +logs_enabled: false + +[Capabilities] +#Selenium capabilities: https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities + +[AppiumCapabilities] +Appium capabilities: http://appium.io/slate/en/master/?ruby#appium-server-capabilities + +[VisualTests] +enabled: true +fail: false +save: false +complete_report: true +baseline_name: {Driver_type} +engine: pil + +[Jira] +enabled: false +execution_url: +onlyifchanges: true +summary_prefix: +fixversion: +labels: +comments: +build: diff --git a/environment.py b/environment.py new file mode 100644 index 0000000..7295a4f --- /dev/null +++ b/environment.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +from toolium.behave.environment import (before_all as toolium_before_all, before_feature as toolium_before_feature, + before_scenario as toolium_before_scenario, + after_scenario as toolium_after_scenario, + after_feature as toolium_after_feature, after_all as toolium_after_all) + + +def before_all(context): + """Initialization method that will be executed before the test execution + + :param context: behave context + """ + # Set Android as default environment + context.config.userdata.setdefault('Config_environment', 'android') + toolium_before_all(context) + + +def before_feature(context, feature): + """Feature initialization + + :param context: behave context + :param feature: running feature + """ + toolium_before_feature(context, feature) + + +def before_scenario(context, scenario): + """Scenario initialization + + :param context: behave context + :param scenario: running scenario + """ + toolium_before_scenario(context, scenario) + + +def after_scenario(context, scenario): + """Clean method that will be executed after each scenario + + :param context: behave context + :param scenario: running scenario + """ + toolium_after_scenario(context, scenario) + + +def after_feature(context, feature): + """Clean method that will be executed after each feature + + :param context: behave context + :param feature: running feature + """ + toolium_after_feature(context, feature) + + +def after_all(context): + """Clean method that will be executed after all features are finished + + :param context: behave context + """ + toolium_after_all(context) diff --git a/features/.idea/.name b/features/.idea/.name deleted file mode 100644 index 0194542..0000000 --- a/features/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -features \ No newline at end of file diff --git a/features/.idea/encodings.xml b/features/.idea/encodings.xml deleted file mode 100644 index d821048..0000000 --- a/features/.idea/encodings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/features/.idea/features.iml b/features/.idea/features.iml deleted file mode 100644 index d0876a7..0000000 --- a/features/.idea/features.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/features/.idea/misc.xml b/features/.idea/misc.xml deleted file mode 100644 index 0fe173e..0000000 --- a/features/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/features/.idea/modules.xml b/features/.idea/modules.xml deleted file mode 100644 index ae3ebe6..0000000 --- a/features/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/features/.idea/scopes/scope_settings.xml b/features/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/features/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/features/.idea/vcs.xml b/features/.idea/vcs.xml deleted file mode 100644 index 6564d52..0000000 --- a/features/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/features/.idea/workspace.xml b/features/.idea/workspace.xml deleted file mode 100644 index 0d12585..0000000 --- a/features/.idea/workspace.xml +++ /dev/null @@ -1,524 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $USER_HOME$/.subversion - - - - - 1430737405276 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/alarmServices.feature b/features/alarmServices.feature new file mode 100644 index 0000000..4dac2e7 --- /dev/null +++ b/features/alarmServices.feature @@ -0,0 +1,10 @@ +@StartAlarm +Feature: Alarm Services + + Scenario: Start and stop alarm services + Given the menu is open + When the user goes to Alarm Services + And the user starts the alarm service + Then the user stops the alarm service + + #Then the user clicks back button \ No newline at end of file diff --git a/features/android.feature b/features/android.feature deleted file mode 100644 index bd9a689..0000000 --- a/features/android.feature +++ /dev/null @@ -1,16 +0,0 @@ -@android -Feature: Imdb basic tests - @current - Scenario: login test for IMDb - Given user is logged in with correct credientials - When user clone ad banner - Then capture screenshot - Then menu should be present - Then user should be able to logout - Then page should have sign-in button - - Scenario: Share a movie with Email - When user search for movie: "Matrix" - And user clone ad banner - Then movie: "Matrix" should be in the results - Then user should be able to send email to: "devicelab@qualifylabs.com" \ No newline at end of file diff --git a/features/behave.ini b/features/behave.ini deleted file mode 100644 index 644dcc4..0000000 --- a/features/behave.ini +++ /dev/null @@ -1,5 +0,0 @@ -[behave] -stderr_capture=False -stdout_capture=False - -logging-level=ERROR \ No newline at end of file diff --git a/features/butcele.feature b/features/butcele.feature deleted file mode 100644 index d913511..0000000 --- a/features/butcele.feature +++ /dev/null @@ -1,8 +0,0 @@ -@ios -@butcele -Feature: Butcele test cases - - Scenario: Login and create monthly budget expenses - Given phone and pin info "7997991111" "456123" - When new budget named "2014 May" created and the budget is "1100" - Then should be able to add an expense diff --git a/features/dragAndDrop.feature b/features/dragAndDrop.feature new file mode 100644 index 0000000..247b2d3 --- /dev/null +++ b/features/dragAndDrop.feature @@ -0,0 +1,10 @@ +@dragAndDrop +Feature: Drag and drop + + Scenario: Drag and drop element + Given that the menu is open + When the user opens Views tab + Then the user clicks on drag and drop button + + Given the user drags and drops the bubble + diff --git a/features/environment.py b/features/environment.py deleted file mode 100644 index 21db02b..0000000 --- a/features/environment.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -from time import sleep - -from appium import webdriver - - -def before_all(context): - # context.config.setup_logging() - pass - -def before_feature(context, feature): - if 'android' in feature.tags: - app = os.path.join(os.path.dirname(__file__), - '../apps/Imdb/android', - 'com.imdb.mobile.apk') - app = os.path.abspath(app) - context.driver = webdriver.Remote( - command_executor='http://127.0.0.1:4723/wd/hub', - desired_capabilities={ - 'app' : app, - 'platformName' : 'Android', - 'platformVersion' : '4.4', - 'deviceName' : None, - 'udid' : '01a135891395669f', - 'appActivity' : '.HomeActivity', - 'appPackage' : 'com.imdb.mobile' - } - ) - elif 'ios' in feature.tags and 'simple' in feature.tags: - app = os.path.join(os.path.dirname(__file__), - '../apps/TestApp/build/Release-iphonesimulator', - 'TestApp.app') - app = os.path.abspath(app) - context.driver = webdriver.Remote( - command_executor='http://127.0.0.1:4723/wd/hub', - desired_capabilities={ - 'app': app, - 'platformName': 'iOS', - 'platformVersion': '8.3', - # 'udid' : '03ecba20f42e7fef25632d9b30cd0c8a5b447e92', - # 'deviceName' : None - 'deviceName': "iPhone 6" # Force device to run on simulator such as : iPhone 6 - }) - elif 'ios' in feature.tags and 'butcele' in feature.tags: - app = os.path.join(os.path.dirname(__file__), - '../apps/Butcele', - 'butcele.app') - app = os.path.abspath(app) - context.driver = webdriver.Remote( - command_executor='http://127.0.0.1:4723/wd/hub', - desired_capabilities={ - 'app': app, - 'platformName': 'iOS', - 'platformVersion': '8.3', - 'deviceName': "iPhone 6" # Force device to run on simulator such as : iPhone 6 - }) - -def after_feature(context, feature): - sleep(1) - context.driver.save_screenshot("features/reports/screen_final.png") - context.driver.quit() \ No newline at end of file diff --git a/features/ios_simple.feature b/features/ios_simple.feature deleted file mode 100644 index d18651e..0000000 --- a/features/ios_simple.feature +++ /dev/null @@ -1,9 +0,0 @@ -@ios -@simple -Feature: iOS Simple Tests for Swipe - - Scenario: run simple ios test - Given button found - When popup does not appear - Then should be able to swipe - diff --git a/features/otherexamples/__init__.pyc b/features/otherexamples/__init__.pyc deleted file mode 100644 index 8a9628a..0000000 Binary files a/features/otherexamples/__init__.pyc and /dev/null differ diff --git a/features/otherexamples/android_sauce.py b/features/otherexamples/android_sauce.py deleted file mode 100644 index 02841c4..0000000 --- a/features/otherexamples/android_sauce.py +++ /dev/null @@ -1,31 +0,0 @@ -# from appium import webdriver -from appium import SauceTestCase, on_platforms - -app = "http://appium.s3.amazonaws.com/NotesList.apk" -platforms = [{ - "platformName": "Android", - "platformVersion": "4.4", - "deviceName": "Android Emulator", - "appPackage": "com.example.android.notepad", - "appActivity": ".NotesList", - "app": app, - "appiumVersion": "1.3.4" - }] - -@on_platforms(platforms) -class SimpleAndroidSauceTests(SauceTestCase): - - def test_create_note(self): - el = self.driver.find_element_by_accessibility_id("New note") - el.click() - - el = self.driver.find_element_by_class_name("android.widget.EditText") - el.send_keys("This is a new note!") - - el = self.driver.find_element_by_accessibility_id("Save") - el.click() - - els = self.driver.find_elements_by_class_name("android.widget.TextView") - self.assertEqual(els[2].text, "This is a new note!") - - els[2].click() \ No newline at end of file diff --git a/features/otherexamples/android_simple.py b/features/otherexamples/android_simple.py deleted file mode 100644 index 2fe1a42..0000000 --- a/features/otherexamples/android_simple.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -from time import sleep - -import unittest - -from appium import webdriver - -# Returns abs path relative to this file and not cwd -PATH = lambda p: os.path.abspath( - os.path.join(os.path.dirname(__file__), p) -) - -class SimpleAndroidTests(unittest.TestCase): - def setUp(self): - desired_caps = {} - desired_caps['platformName'] = 'Android' - desired_caps['platformVersion'] = '4.2' - desired_caps['deviceName'] = 'Android Emulator' - desired_caps['app'] = PATH( - '../../../sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk' - ) - - self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) - - def tearDown(self): - # end the session - self.driver.quit() - - def test_find_elements(self): - el = self.driver.find_element_by_accessibility_id('Graphics') - el.click() - el = self.driver.find_element_by_accessibility_id('Arcs') - self.assertIsNotNone(el) - - self.driver.back() - - el = self.driver.find_element_by_accessibility_id("App") - self.assertIsNotNone(el) - - els = self.driver.find_elements_by_android_uiautomator("new UiSelector().clickable(true)") - self.assertGreaterEqual(12, len(els)) - - self.driver.find_element_by_android_uiautomator('text("API Demos")') - - - def test_simple_actions(self): - el = self.driver.find_element_by_accessibility_id('Graphics') - el.click() - - el = self.driver.find_element_by_accessibility_id('Arcs') - el.click() - - self.driver.find_element_by_android_uiautomator('new UiSelector().text("Graphics/Arcs")') - - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(SimpleAndroidTests) - unittest.TextTestRunner(verbosity=2).run(suite) \ No newline at end of file diff --git a/features/otherexamples/ios_simple.py b/features/otherexamples/ios_simple.py deleted file mode 100644 index 5d2ca42..0000000 --- a/features/otherexamples/ios_simple.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -Simple iOS tests, showing accessing elements and getting/setting text from them. -""" -import unittest -import os -from random import randint -from appium import webdriver -from time import sleep - -class SimpleIOSTests(unittest.TestCase): - - def setUp(self): - # set up appium - app = os.path.join(os.path.dirname(__file__), - '../../apps/TestApp/build/Release-iphone', - 'TestApp.app') - app = os.path.abspath(app) - self.driver = webdriver.Remote( - command_executor='http://127.0.0.1:4723/wd/hub', - desired_capabilities={ - 'app': app, - 'platformName': 'iOS', - 'platformVersion': '8.3', - 'deviceName': 'iPhone 6' - # 'deviceName' : None, - # 'udid' : '03ecba20f42e7fef25632d9b30cd0c8a5b447e92' - }) - - def tearDown(self): - self.driver.quit() - - def _populate(self): - # populate text fields with two random numbers - # els = self.driver.find_elements_by_ios_uiautomation('elements()') - els = [self.driver.find_element_by_name('TextField1'), - self.driver.find_element_by_name('TextField2')] - - self._sum = 0 - for i in range(2): - rnd = randint(0, 10) - els[i].send_keys(rnd) - self._sum += rnd - - def test_ui_computation(self): - # populate text fields with values - self._populate() - - # trigger computation by using the button - self.driver.find_element_by_accessibility_id('ComputeSumButton').click() - - # is sum equal ? - # sauce does not handle class name, so get fourth element - sum = self.driver.find_element_by_name('Answer').text - self.assertEqual(int(sum), self._sum) - - def test_scroll(self): - els = self.driver.find_elements_by_class_name('UIAButton') - els[5].click() - - - sleep(2) - try: - el = self.driver.find_element_by_accessibility_id('OK') - el.click() - sleep(2) - except: - pass - - el = self.driver.find_element_by_xpath('//UIAMapView[1]') - - location = el.location - self.driver.swipe(start_x=location['x'], start_y=location['y'], end_x=0.5, end_y=location['y'], duration=800) - - - - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(SimpleIOSTests) - unittest.TextTestRunner(verbosity=2).run(suite) diff --git a/features/steps/butcele_steps.py b/features/steps/butcele_steps.py deleted file mode 100644 index dad8db8..0000000 --- a/features/steps/butcele_steps.py +++ /dev/null @@ -1,93 +0,0 @@ -from behave import * -from time import sleep -from appium import webdriver - -""" BDD """ -""" BUTCELE """ -""" Scenario """ -x_path = "//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/" - - - -""" LOGIN """ -""" In login section all the elements - assigned to a variable to send - click & send_key actions """ - -@given('phone and pin info "{phone}" "{pin}"') -def login_section(context, phone, pin): - sleep(3) - try: - Notify = context.driver.find_element_by_xpath('//UIAApplication[1]/UIAWindow[6]/UIAAlert[1]/UIACollectionView[1]/UIACollectionCell[2]') - Notify.click() - except: - pass - finally: - sleep(1) - - """ enter phone number """ - t_phone = context.driver.find_element_by_xpath(x_path+'UIATextField[1]') - t_phone.click() - sleep(2) - t_phone.send_keys(phone) - - t_button = context.driver.find_element_by_xpath(x_path+'UIAButton[1]') - t_button.click() - sleep(1) - - """ enter pin number """ - t_pin = context.driver.find_element_by_xpath(x_path+'UIATextField[1]') - t_pin.click() - t_pin.send_keys(pin) - - """" login """ - pin_button = context.driver.find_element_by_xpath(x_path+'UIAButton[1]') - pin_button.click() - sleep(1) - - -""" NEW BUDGET """ -""" In create budget section - actions directly send from - find element method """ - -@when('new budget named "{b_name}" created and the budget is "{budget}"') -def bugdet_section(context, b_name, budget): - - context.driver.find_element_by_xpath(x_path+'UIAStaticText[5]').click() - context.driver.find_element_by_xpath(x_path+'UIAStaticText[3]').click() - context.driver.find_element_by_xpath(x_path+'UIATextField[1]').click() - context.driver.find_element_by_xpath(x_path+'UIATextField[1]').send_keys(b_name) - context.driver.find_element_by_xpath(x_path+'UIAButton[2]').click() - context.driver.find_element_by_xpath(x_path+'UIATextField[1]').click() - context.driver.find_element_by_xpath(x_path+'UIATextField[1]').send_keys(budget) - context.driver.find_element_by_xpath(x_path+'UIAButton[2]').click() - context.driver.find_element_by_xpath(x_path+'UIAButton[2]').click() - sleep(1) - - """ enters expense menu """ - context.driver.tap([(314, 602)], 1) - sleep(1) - - -"""" NEW EXPENSE """ -""" In add budget expense section - actions send from - find element method. - also appium's driver.tap action - used for unvisible elements """ -@then('should be able to add an expense') -def expense_section(context): - - context.driver.tap([(10, 103)], 1) - sleep(1) - context.driver.find_element_by_xpath(x_path+'UIATextField[1]').send_keys('330') - sleep(1) - context.driver.find_element_by_xpath(x_path+'UIAButton[3]').click() - sleep(1) - context.driver.find_element_by_xpath(x_path+'UIALink[1]/UIALink[1]/UIALink[2]/UIAStaticText[1]').click() - sleep(10) - - -if __name__ == '__main__': - context.driver = webdriver.Remote() diff --git a/features/steps/steps.py b/features/steps/steps.py deleted file mode 100644 index 4b133ae..0000000 --- a/features/steps/steps.py +++ /dev/null @@ -1,107 +0,0 @@ -from behave import * -from time import sleep -from appium import webdriver - - -@given('button found') -def button_found(context): - els = context.driver.find_elements_by_class_name('UIAButton') - els[5].click() - -@when('popup does not appear') -def popup_appear(context): - try: - el = context.driver.find_element_by_accessibility_id('OK') - el.click() - except: - pass - finally: - sleep(3) - -@then('should be able to swipe') -def swipe_should(context): - el = context.driver.find_element_by_xpath('//UIAMapView[1]') - - location = el.location - context.driver.swipe(start_x=location['x'], start_y=location['y'], - end_x=0.5, end_y=location['y'], duration=800) - - - -@given("user is logged in with correct credientials") -def step_impl(context): - sleep(5) - context.driver.find_element_by_xpath('//*[@text="Sign In"]').click() - sleep(2) - context.driver.find_element_by_xpath('//*[@text="IMDb"]').click() - context.driver.find_element_by_xpath('//*[@text="Email"]').send_keys('devicelab@qualifylabs.com') - context.driver.find_element_by_xpath('//*/android.widget.EditText[2]').send_keys('12345678') - context.driver.find_element_by_xpath('//*[@text="Sign In"]').click() - -@then("capture screenshot") -def step_impl(context): - sleep(1) - context.driver.save_screenshot("features/reports/screen_after_login.png") - -@then("menu should be present") -def step_impl(context): - context.driver.find_element_by_id('android:id/up').click() - output = context.driver.page_source - assert "nav_drawer_list_user_item_gradient" in output - - -@then("user should be able to logout") -def step_impl(context): - context.driver.find_element_by_xpath('//*/android.widget.ImageButton[1]').click() - context.driver.find_element_by_xpath('//*[@text="Sign Out"]').click() - - -@then("page should have sign-in button") -def step_impl(context): - try: - context.driver.find_element_by_id('android:id/up').click() - except: - pass - elem = context.driver.find_element_by_xpath('//*[@text="Sign In"]') - # print elem.is_displayed() - assert elem.is_displayed() is True - - - -@when('user search for movie: "{movie}"') -def step_impl(context, movie): - sleep(2) - context.driver.find_element_by_id('com.imdb.mobile:id/search').click() - sleep(2) - context.driver.find_element_by_id('android:id/search_src_text').send_keys(movie.lower()) - context.driver.keyevent(66) - sleep(2) - - -@step("user clone ad banner") -def step_impl(context): - sleep(2) - try: - context.driver.find_element_by_id('com.imdb.mobile:id/ad_banner_close_button').click() - except: - pass - -@then('movie: "{movie_result}" should be in the results') -def step_impl(context,movie_result): - movie_result = '//*[contains(@text,"{}")]'.format(movie_result) - context.driver.find_element_by_xpath(movie_result).click() - sleep(5) - elem = context.driver.find_element_by_xpath(movie_result) - assert elem.is_displayed() is True - -@then('user should be able to send email to: "{email}"') -def step_impl(context, email): - context.driver.find_element_by_id('com.imdb.mobile:id/menu_share').click() - context.driver.find_element_by_xpath('//*[@text="E-posta"]').click() - context.driver.find_element_by_id('com.android.email:id/to').send_keys(email) - context.driver.find_element_by_id('com.android.email:id/send').click() - - - -if __name__ == '__main__': - context.driver = webdriver.Remote() \ No newline at end of file diff --git a/features/otherexamples/__init__.py b/pageobjects/__init__.py similarity index 100% rename from features/otherexamples/__init__.py rename to pageobjects/__init__.py diff --git a/pageobjects/alarmServices.py b/pageobjects/alarmServices.py new file mode 100644 index 0000000..c68511f --- /dev/null +++ b/pageobjects/alarmServices.py @@ -0,0 +1,144 @@ +# -*- coding: utf-8 -*- + +from toolium.pageobjects.page_object import PageObject +from selenium.common.exceptions import NoSuchElementException + +from toolium.pageelements import * +from selenium.webdriver.common.action_chains import ActionChains +from selenium.webdriver.support.select import Select +import selenium.webdriver.support.expected_conditions as WAITCON +from selenium.webdriver.common.keys import Keys +from selenium.common.exceptions import TimeoutException +from selenium.common.exceptions import WebDriverException +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException +from toolium.pageelements import InputText, Button +from android_behave.pageobjects.synchronization import Synchronization + +import random +import string +import time + +from selenium.webdriver.common.by import By + + +class TabsPageObject(PageObject): + sync = Synchronization.get() + + def init_page_elements(self): + self.start = self.driver.find_element_by_xpath('//*[@text="Start Alarm Service"]') + tab_xpath = '(//android.widget.TabWidget//android.widget.TextView)[{}]' + + def startAlarm(self): + try: + + self.logger.info("\n===============================Start Alarm Services=================================") + self.logger.debug("\n-----------------------------------------------------------------------------------") + self.logger.debug("Atempting to start the alarm services ") + self.logger.debug("Checking if the button is present : %s",self.start) + self.logger.debug("Clicking alarm services : %s",self.start) + self.logger.debug("\n-----------------------------------------------------------------------------------") + + self.sync_element(self.start) + self.start.click() + time.sleep(5) + + return True + except NoSuchElementException: + self.logger.debug("error", "Element {} does not exist".format(self.start)) + return None + + def stopAlarm(self): + try: + self.logger.info("\n===============================Stop Alarm Services==================================") + self.logger.debug("\n-----------------------------------------------------------------------------------") + self.logger.debug("Atempting to click the Stop Alarm ") + self.logger.debug("Checking if the button is present : Stop Alarm") + self.logger.debug("Clicking Stop Alarm : Stop Alarm") + self.logger.debug("\n-----------------------------------------------------------------------------------") + time.sleep(3) + + self.driver.find_element_by_xpath('//*[@text="Stop Alarm Service"]').click() + time.sleep(3) + self.logger.debug("\n The user goes back to main screen") + self.driver.back() + time.sleep(3) + self.driver.back() + time.sleep(3) + self.driver.back() + + return True + except NoSuchElementException: + self.logger.debug("error", "Element {} does not exist: Stop Alarm") + return None + + def click_element(self, element = None): + try: + if (element == None): + errorMsg = "Neither element or elementName can be None: element = {}; elementName = {}".format(str(element), elementName) + self.auto_log("error", errorMsg) + raise WebDriverException(errorMsg) + return None + else: + self.auto_log("debug", "Clicking the " + str(element)) + # element.wait_until_visible(int(self.config.get('Test', 'wait'))) + # element.wait_until_clickable(int(self.config.get('Test', 'wait'))) + + elementType = type(element) + if "PageElement" in str(elementType): + + element.web_element.click() + else: + + element.click() + return self + except NoSuchElementException: + self.auto_log("error", "Element {} does not exist".format(element)) + return None + except TimeoutException: + self.auto_log("error", "Element {} not come into existence within {} seconds".format(element, int(self.config.get('Test', 'wait')))) + return None + + def sync_element(self,element): + try: + if (element == None): + errorMsg = "Neither element or elementName can be None: element = {}; elementName = {}".format(str(element), str(element)) + self.auto_log("error", errorMsg) + raise WebDriverException(errorMsg) + return None + else: + # element.wait_until_visible(int(self.config.get('Test', 'wait'))) + return self + except NoSuchElementException: + self.auto_log("error", "Element {} does not exist".format(element)) + return None + except TimeoutException: + self.auto_log("error", "Element {} not come into existence within {} seconds".format(element, int(self.config.get('Test', 'wait')))) + return None + + def auto_log(self, level, message): + func = inspect.currentframe().f_back.f_code + if level.lower() == "debug": + self.logger.debug("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) + + if level.lower() == "error": + self.logger.error("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) + + if level.lower() == "info": + self.logger.info("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) + diff --git a/pageobjects/dragAndDrop.py b/pageobjects/dragAndDrop.py new file mode 100644 index 0000000..26ef6f2 --- /dev/null +++ b/pageobjects/dragAndDrop.py @@ -0,0 +1,172 @@ +# -*- coding: utf-8 -*- + +from random import randint + +# from pageobjects.synchronization import Synchronization +# from android_behave.pageobjects.synchronization import Synchronization +from android_behave.pageobjects.synchronization import Synchronization + +from appium.webdriver.common.touch_action import TouchAction + +from toolium.pageobjects.page_object import PageObject +from selenium.common.exceptions import NoSuchElementException + +from selenium.webdriver.common.by import By +from toolium.pageelements import * +from selenium.webdriver.common.action_chains import ActionChains +from selenium.webdriver.support.select import Select +import selenium.webdriver.support.expected_conditions as WAITCON +from selenium.webdriver.common.keys import Keys +from selenium.common.exceptions import TimeoutException +from selenium.common.exceptions import WebDriverException +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException +from toolium.pageelements import InputText, Button +from selenium.webdriver.support.ui import WebDriverWait as wait +from selenium.webdriver.support import expected_conditions as EC + +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions +from selenium.webdriver.remote.command import Command + +from actions import action, Action, Actions + +import random +import string +import time + +import inspect + + +class TabsPageObject(PageObject): + + sync = Synchronization.get() + + def viewsTab(self): + try: + self.logger.info("\n===============================Views Button=========================================") + self.logger.debug("\n-----------------------------------------------------------------------------------") + self.logger.debug("Atempting to click the Views button ") + self.logger.debug("Checking if the button is present : viewsButton") + self.logger.debug("Clicking Views : viewsButton") + self.logger.debug("\n-----------------------------------------------------------------------------------") + + self.logger.debug("Scrolling Views into view.") + + time.sleep(3) + self.driver.find_element_by_xpath('//*[@text="Views"]').click() + return True + + except NoSuchElementException: + self.logger.debug("error", "Element {} does not exist") + return None + + def viewsDragAndDrop(self): + try: + self.logger.info("\n===============================Drag and Drop Button=================================") + self.logger.debug("\n-----------------------------------------------------------------------------------") + self.logger.debug("Atempting to click the Drag and Drop button ") + self.logger.debug("Checking if the button is present : Drag and Drop") + self.logger.debug("Clicking Drag and Drop : Drag and Drop") + self.logger.debug("\n-----------------------------------------------------------------------------------") + time.sleep(5) + + self.driver.find_element_by_xpath('//*[@text="Drag and Drop"]').click() + time.sleep(5) + return True + + except NoSuchElementException: + self.logger.debug("error", "Element {} does not exist: Drag and Drop") + return None + + def dragAndDropElement(self): + try: + self.logger.info("\n===============================Drag and Drop Button=================================") + self.logger.debug("\n-----------------------------------------------------------------------------------") + self.logger.debug("Atempting to Drag and Drop bubble ") + self.logger.debug("Checking if the bubble is present : Drag and Drop") + self.logger.debug("Drag and Drop : Dragging bubble") + self.logger.debug("\n-----------------------------------------------------------------------------------") + time.sleep(5) + + self.actions = TouchAction(self.driver) + + self.dragabble = self.driver.find_element_by_id("io.appium.android.apis:id/drag_dot_1") + self.droppabble = self.driver.find_element_by_id("io.appium.android.apis:id/drag_dot_2") + + self.actions.long_press(self.dragabble).move_to(self.droppabble).release().perform() + return True + + except NoSuchElementException: + self.logger.debug("error", "Element {} does not exist: droppable bubble") + return None + + def click_element(self, element = None): + try: + if (element == None): + errorMsg = "Neither element or elementName can be None: element = {}; elementName = {}".format(str(element), elementName) + self.auto_log("error", errorMsg) + raise WebDriverException(errorMsg) + return None + else: + self.auto_log("debug", "Clicking the " + str(element)) + # element.wait_until_visible(int(self.config.get('Test', 'wait'))) + # element.wait_until_clickable(int(self.config.get('Test', 'wait'))) + + elementType = type(element) + if "PageElement" in str(elementType): + + element.web_element.click() + else: + + element.click() + return self + except NoSuchElementException: + self.auto_log("error", "Element {} does not exist".format(element)) + return None + except TimeoutException: + self.auto_log("error", "Element {} not come into existence within {} seconds".format(element, int(self.config.get('Test', 'wait')))) + return None + + def sync_element(self,element): + try: + if (element == None): + errorMsg = "Neither element or elementName can be None: element = {}; elementName = {}".format(str(element), str(element)) + self.auto_log("error", errorMsg) + raise WebDriverException(errorMsg) + return None + else: + # element.wait_until_visible(int(self.config.get('Test', 'wait'))) + return self + except NoSuchElementException: + self.auto_log("error", "Element {} does not exist".format(element)) + return None + except TimeoutException: + self.auto_log("error", "Element {} not come into existence within {} seconds".format(element, int(self.config.get('Test', 'wait')))) + return None + + def auto_log(self, level, message): + func = inspect.currentframe().f_back.f_code + if level.lower() == "debug": + self.logger.debug("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) + + if level.lower() == "error": + self.logger.error("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) + + if level.lower() == "info": + self.logger.info("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) \ No newline at end of file diff --git a/pageobjects/menu.py b/pageobjects/menu.py new file mode 100644 index 0000000..1729a4b --- /dev/null +++ b/pageobjects/menu.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +from toolium.pageobjects.page_object import PageObject +from selenium.common.exceptions import NoSuchElementException + +from toolium.pageelements import * +from selenium.webdriver.common.by import By +from selenium.webdriver.common.action_chains import ActionChains +from selenium.webdriver.support.select import Select +from appium.webdriver.common.mobileby import MobileBy +from selenium.webdriver.support import expected_conditions as EC +import selenium.webdriver.support.expected_conditions as WAITCON +from selenium.webdriver.common.keys import Keys +from selenium.common.exceptions import TimeoutException +from selenium.common.exceptions import WebDriverException +from selenium import webdriver +from toolium.pageelements import InputText, Button +from selenium.webdriver.support.ui import WebDriverWait + +import random +import string +import time + + + + +class MenuPageObject(PageObject): + option_locator = 'new UiScrollable(new UiSelector().scrollable(true).instance(0))' \ + '.scrollIntoView(new UiSelector().text("{}").instance(0));' + + def open_option(self, option): + """Search a menu option and click on it + + :param option: str with menu option + :returns: this page object instance + """ + self.driver.find_element(MobileBy.ANDROID_UIAUTOMATOR, self.option_locator.format(option)).click() + return self + diff --git a/pageobjects/synchronization.py b/pageobjects/synchronization.py new file mode 100644 index 0000000..eab984b --- /dev/null +++ b/pageobjects/synchronization.py @@ -0,0 +1,198 @@ +from toolium.pageobjects.page_object import PageObject +from toolium.pageelements import * + +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +from selenium.common.exceptions import TimeoutException +from selenium.common.exceptions import NoSuchElementException +from selenium.common.exceptions import WebDriverException + +import time + +class Synchronization(): + + instance = None + + @classmethod + def get(cls): + if cls.instance is None: + cls.instance = cls() + return cls.instance + + def __init__(self): + driver = None + waitPeriod = 0 + wait = None + + def set_driver(self, driver): + self.driver = driver + + def set_web_driver_wait(self, driver, wait, logger): + self.waitPeriod = wait + self.wait = WebDriverWait(driver, wait) + self.driver = driver + self.logger = logger + + def wait_for_page_to_load(self, page_name, page_title): + try: + self.logger.debug("Loading Page {} with page title {} ".format(page_name, page_title)) + return self.wait.until(lambda driver:driver.title.lower() == (page_title.lower())) + except TimeoutException: + self.logger.debug("Failed to load Page {} with page title {} within the specified wait time of {} seconds".format(page_name, page_title, self.waitPeriod)) + return False + + def wait_on_element_text(self, by_type, by_value, text): + try: + self.logger.debug("Waiting for the text value of webelement defined by attribute {} = {} to change to {}".format(by_type, by_value, text)) + return self.wait.until(EC.text_to_be_present_in_element((by_type, by_value), text)) + except TimeoutException: + self.logger.debug("The text value of webelement defined by attribute {} = {} did not change to {} within the specified wait time of {} seconds".format(by_type, by_value, text, self.waitPeriod)) + return False + + def is_attribute_value_equal_to(self, element, attribute_name, expected_value, wait): + count = 0 + flag = False + actual_value = element + #actual_value = element.get_attribute(attribute_name) + while (flag == False) and (count < wait): + if (actual_value.strip() == expected_value.strip()): + flag = True + else: + actual_value = element + #actual_value = element.get_attribute(attribute_name) + self.logger.debug('Synchronization.is_attribute_value.{}_{} = {}'.format(count, attribute_name, actual_value)) + time.sleep(1) + count+=1 + return flag + + def wait_for_element_located(self, find_by, find_by_value): + try: + return self.wait.until(EC.presence_of_element_located((find_by, find_by_value))) + except NoSuchElementException: + self.logger.debug("Element was not present within {} seconds".format(self.config.get('Test', 'wait'))) + + def wait_on_element_visibility(self, find_by, find_by_value): + try: + return self.wait.until(EC.visibility_of_element_located((find_by, find_by_value))) + except NoSuchElementException: + self.logger.debug("Element was not visible within {} seconds".format(self.waitPeriod)) + + def wait_for_element_to_clickable(self, find_by, find_by_value, find_by_id, wait): + try: + return self.wait.until(EC.element_to_be_clickable((find_by, find_by_value, find_by_id, wait))) + except NoSuchElementException: + self.logger.debug("Search element did not come into existence within {} seconds".format(self.waitPeriod)) + + def is_attribute_modal_title_equal_to(self, element, expected_value, wait): + count = 0 + flag = False + #actual_value = element.get_attribute("textContent") + actual_value = element + while (flag == False) and (count < wait): + if expected_value.strip().lower() in actual_value.strip().lower(): + flag = True + else: + actual_value = element + #actual_value = element.get_attribute("textContent") + self.logger.debug('Title of modal does not contain text {}'.format(expected_value)) + time.sleep(1) + count+=1 + return flag + + def wait_for_page_title_to_equal(self, page_name, page_title): + try: + self.logger.debug("Loading Page {} with page title {} ".format(page_name, page_title)) + if (self.wait.until(lambda driver:driver.title.lower() == (page_title.lower()))): + self.logger.debug("Successfully loaded Page {} with page title {} ".format(page_name, page_title)) + return True + else: + self.logger.error("Failed to load Page {} with page title {} ".format(page_name, page_title)) + self.logger.error("Expected page title is {} and the actual page title is {} ".format(page_title, (self.driver.title).lower())) + return False + except TimeoutException as e: + self.logger.error("Toolium threw a timeout exception: {}".format(e.__str__())) + return False + except WebDriverException as e: + self.logger.error("Webdriver threw an execption {}".format(e.__str__())) + return False + + def wait_ajax(self): + try: + return self.wait.until(lambda driver: driver.execute_script("return jQuery.active == 0")) + except WebDriverException: + self.logger.debug("wait_ajax threw a Webdriver Execption with in {} seconds".format(self.waitPeriod)) + return False + + + def click_element(self, element = None): + try: + if (element == None): + errorMsg = "Neither element or elementName can be None: element = {}; elementName = {}".format(str(element), elementName) + self.auto_log("error", errorMsg) + raise WebDriverException(errorMsg) + return None + else: + self.auto_log("debug", "Clicking the " + str(element)) + element.wait_until_visible(int(self.config.get('Test', 'wait'))) + element.wait_until_clickable(int(self.config.get('Test', 'wait'))) + + + elementType = type(element) + if "PageElement" in str(elementType): + + element.web_element.click() + else: + + element.click() + return self + except NoSuchElementException: + self.auto_log("error", "Element {} does not exist".format(element)) + return None + except TimeoutException: + self.auto_log("error", "Element {} not come into existence within {} seconds".format(element, int(self.config.get('Test', 'wait')))) + return None + + def sync_element(self,element): + try: + if (element == None): + errorMsg = "Neither element or elementName can be None: element = {}; elementName = {}".format(str(element), str(element)) + self.auto_log("error", errorMsg) + raise WebDriverException(errorMsg) + return None + else: + # element.wait_until_visible(int(self.config.get('Test', 'wait'))) + return self + except NoSuchElementException: + self.auto_log("error", "Element {} does not exist".format(element)) + return None + except TimeoutException: + self.auto_log("error", "Element {} not come into existence within {} seconds".format(element, int(self.config.get('Test', 'wait')))) + return None + + + def auto_log(self, level, message): + func = inspect.currentframe().f_back.f_code + if level.lower() == "debug": + self.logger.debug("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) + + if level.lower() == "error": + self.logger.error("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) + + if level.lower() == "info": + self.logger.info("%s: %s in %s:%i" % ( + message, + func.co_name, + func.co_filename, + func.co_firstlineno + )) \ No newline at end of file diff --git a/steps/__init__.py b/steps/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/steps/alarmServices_steps.py b/steps/alarmServices_steps.py new file mode 100644 index 0000000..c6829ef --- /dev/null +++ b/steps/alarmServices_steps.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +u""" +Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +This file is part of Toolium. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +from toolium.pageobjects.page_object import PageObject +from selenium.common.exceptions import NoSuchElementException + +from toolium.pageelements import * +from selenium.webdriver.common.action_chains import ActionChains +from selenium.webdriver.support.select import Select +import selenium.webdriver.support.expected_conditions as WAITCON +from selenium.webdriver.common.keys import Keys +from selenium.common.exceptions import TimeoutException +from selenium.common.exceptions import WebDriverException +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException +from toolium.pageelements import InputText, Button + +import random +import string +import time + +from selenium.webdriver.common.by import By +from behave import given, when, then +from android_behave.pageobjects.menu import MenuPageObject +from android_behave.pageobjects.alarmServices import TabsPageObject + + +@given('the menu is open') +def step_impl(context): + context.current_page = MenuPageObject() + +@when('the user goes to Alarm Services') +def step_impl(context): + context.current_page.open_option('App').open_option('Alarm').open_option('Alarm Service') + context.current_page = TabsPageObject() + +@when('the user starts the alarm service') +def step_impl(context): + context.current_page = TabsPageObject() + context.current_page.startAlarm() + +@when('the user stops the alarm service') +def step_impl(context): + context.current_page = TabsPageObject() + context.current_page.stopAlarm() + +@then('the second tab contains "{message}"') +def step_impl(context, message): + assert message in context.current_page.content2.text diff --git a/steps/dragAndDrop_steps.py b/steps/dragAndDrop_steps.py new file mode 100644 index 0000000..447e54d --- /dev/null +++ b/steps/dragAndDrop_steps.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +u""" +Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. +This file is part of Toolium. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +from toolium.pageobjects.page_object import PageObject +from selenium.common.exceptions import NoSuchElementException + +from toolium.pageelements import * +from selenium.webdriver.common.action_chains import ActionChains +from selenium.webdriver.support.select import Select +import selenium.webdriver.support.expected_conditions as WAITCON +from selenium.webdriver.common.keys import Keys +from selenium.common.exceptions import TimeoutException +from selenium.common.exceptions import WebDriverException +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException +from toolium.pageelements import InputText, Button + +import random +import string +import time + +from selenium.webdriver.common.by import By +from behave import given, when, then +from android_behave.pageobjects.menu import MenuPageObject +from android_behave.pageobjects.dragAndDrop import TabsPageObject + + +@given('that the menu is open') +def step_impl(context): + context.current_page = MenuPageObject() + +@when('the user opens Views tab') +def step_impl(context): + context.current_page.open_option('Views') + context.current_page = TabsPageObject() + context.current_page.viewsTab() + +@then('the user clicks on drag and drop button') +def step_impl(context): + # context.current_page.open_option('Drag and Drop') + context.current_page = TabsPageObject() + context.current_page.viewsDragAndDrop() + +@given('the user drags and drops the bubble') +def step_impl(context): + context.current_page = TabsPageObject() + context.current_page.dragAndDropElement() \ No newline at end of file diff --git a/testhive/features/environment.py b/testhive/features/environment.py deleted file mode 100644 index 8447996..0000000 --- a/testhive/features/environment.py +++ /dev/null @@ -1,24 +0,0 @@ -import os -from appium import webdriver - -def before_feature(context,feature): - app = os.path.join(os.path.dirname(__file__), - '../../apps/TestApp/build/Release-iphonesimulator', - 'TestApp.app') - app = os.path.abspath(app) - context.driver = webdriver.Remote( - command_executor='http://127.0.0.1:4723/wd/hub', - desired_capabilities={ - 'app': app, - 'platformName': 'iOS', - 'platformVersion': '8.3', - 'deviceName': 'iPhone 6' - # 'deviceName' : None, - # 'udid' : '03ecba20f42e7fef25632d9b30cd0c8a5b447e92' - }) - - -def after_feature(context,feature): - context.driver.quit() - - diff --git a/testhive/features/myfeatures.feature b/testhive/features/myfeatures.feature deleted file mode 100644 index 2114bcd..0000000 --- a/testhive/features/myfeatures.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Test hive ios simple application test - - Scenario: simple ios test for scroll test - Given ios application is opened - When move to maps - Then I should be able to scroll diff --git a/testhive/features/steps/steps.py b/testhive/features/steps/steps.py deleted file mode 100644 index a72ef0c..0000000 --- a/testhive/features/steps/steps.py +++ /dev/null @@ -1,35 +0,0 @@ -from time import sleep -from behave import * - -use_step_matcher("re") - -@given("ios application is opened") -def step_impl(context): - pass - - -@when("move to maps") -def step_impl(context): - - els = context.driver.find_elements_by_class_name('UIAButton') - els[5].click() - - - sleep(2) - try: - el = context.driver.find_element_by_accessibility_id('OK') - el.click() - sleep(2) - except: - pass - - -@then("I should be able to scroll") -def step_impl(context): - el = context.driver.find_element_by_xpath('//UIAMapView[1]') - location = el.location - context.driver.swipe(start_x=location['x'], start_y=location['y'], end_x=0.5, end_y=location['y'], duration=800) - - - -