diff --git a/sample-code/apps/ContactManager/ContactManager.apk b/sample-code/apps/ContactManager/ContactManager.apk deleted file mode 100644 index 418f504bd..000000000 Binary files a/sample-code/apps/ContactManager/ContactManager.apk and /dev/null differ diff --git a/sample-code/apps/RobotCalibration/RobotCalibration.xcodeproj/project.pbxproj b/sample-code/apps/RobotCalibration/RobotCalibration.xcodeproj/project.pbxproj deleted file mode 100644 index b00164515..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration.xcodeproj/project.pbxproj +++ /dev/null @@ -1,487 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3E166C6B1683954A008893AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E166C6A1683954A008893AA /* UIKit.framework */; }; - 3E166C6D1683954A008893AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E166C6C1683954A008893AA /* Foundation.framework */; }; - 3E166C6F1683954A008893AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E166C6E1683954A008893AA /* CoreGraphics.framework */; }; - 3E166C751683954A008893AA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3E166C731683954A008893AA /* InfoPlist.strings */; }; - 3E166C771683954A008893AA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E166C761683954A008893AA /* main.m */; }; - 3E166C7B1683954A008893AA /* RCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E166C7A1683954A008893AA /* RCAppDelegate.m */; }; - 3E166C7D1683954A008893AA /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E166C7C1683954A008893AA /* Default.png */; }; - 3E166C7F1683954A008893AA /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E166C7E1683954A008893AA /* Default@2x.png */; }; - 3E166C811683954A008893AA /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3E166C801683954A008893AA /* Default-568h@2x.png */; }; - 3E166C841683954A008893AA /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E166C821683954A008893AA /* MainStoryboard_iPhone.storyboard */; }; - 3E166C871683954A008893AA /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E166C851683954A008893AA /* MainStoryboard_iPad.storyboard */; }; - 3E166C8A1683954A008893AA /* RCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E166C891683954A008893AA /* RCViewController.m */; }; - 3E166C921683954A008893AA /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E166C911683954A008893AA /* SenTestingKit.framework */; }; - 3E166C931683954A008893AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E166C6A1683954A008893AA /* UIKit.framework */; }; - 3E166C941683954A008893AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E166C6C1683954A008893AA /* Foundation.framework */; }; - 3E166C9C1683954A008893AA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3E166C9A1683954A008893AA /* InfoPlist.strings */; }; - 3E166C9F1683954A008893AA /* RobotCalibrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E166C9E1683954A008893AA /* RobotCalibrationTests.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 3E166C951683954A008893AA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 3E166C5F1683954A008893AA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 3E166C661683954A008893AA; - remoteInfo = RobotCalibration; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 3E166C671683954A008893AA /* RobotCalibration.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RobotCalibration.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3E166C6A1683954A008893AA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 3E166C6C1683954A008893AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 3E166C6E1683954A008893AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 3E166C721683954A008893AA /* RobotCalibration-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RobotCalibration-Info.plist"; sourceTree = ""; }; - 3E166C741683954A008893AA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 3E166C761683954A008893AA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 3E166C781683954A008893AA /* RobotCalibration-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RobotCalibration-Prefix.pch"; sourceTree = ""; }; - 3E166C791683954A008893AA /* RCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCAppDelegate.h; sourceTree = ""; }; - 3E166C7A1683954A008893AA /* RCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCAppDelegate.m; sourceTree = ""; }; - 3E166C7C1683954A008893AA /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 3E166C7E1683954A008893AA /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; - 3E166C801683954A008893AA /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - 3E166C831683954A008893AA /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; - 3E166C861683954A008893AA /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; - 3E166C881683954A008893AA /* RCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCViewController.h; sourceTree = ""; }; - 3E166C891683954A008893AA /* RCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCViewController.m; sourceTree = ""; }; - 3E166C901683954A008893AA /* RobotCalibrationTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RobotCalibrationTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3E166C911683954A008893AA /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; - 3E166C991683954A008893AA /* RobotCalibrationTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RobotCalibrationTests-Info.plist"; sourceTree = ""; }; - 3E166C9B1683954A008893AA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 3E166C9D1683954A008893AA /* RobotCalibrationTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RobotCalibrationTests.h; sourceTree = ""; }; - 3E166C9E1683954A008893AA /* RobotCalibrationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RobotCalibrationTests.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3E166C641683954A008893AA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3E166C6B1683954A008893AA /* UIKit.framework in Frameworks */, - 3E166C6D1683954A008893AA /* Foundation.framework in Frameworks */, - 3E166C6F1683954A008893AA /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3E166C8C1683954A008893AA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3E166C921683954A008893AA /* SenTestingKit.framework in Frameworks */, - 3E166C931683954A008893AA /* UIKit.framework in Frameworks */, - 3E166C941683954A008893AA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3E166C5E1683954A008893AA = { - isa = PBXGroup; - children = ( - 3E166C701683954A008893AA /* RobotCalibration */, - 3E166C971683954A008893AA /* RobotCalibrationTests */, - 3E166C691683954A008893AA /* Frameworks */, - 3E166C681683954A008893AA /* Products */, - ); - sourceTree = ""; - }; - 3E166C681683954A008893AA /* Products */ = { - isa = PBXGroup; - children = ( - 3E166C671683954A008893AA /* RobotCalibration.app */, - 3E166C901683954A008893AA /* RobotCalibrationTests.octest */, - ); - name = Products; - sourceTree = ""; - }; - 3E166C691683954A008893AA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3E166C6A1683954A008893AA /* UIKit.framework */, - 3E166C6C1683954A008893AA /* Foundation.framework */, - 3E166C6E1683954A008893AA /* CoreGraphics.framework */, - 3E166C911683954A008893AA /* SenTestingKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 3E166C701683954A008893AA /* RobotCalibration */ = { - isa = PBXGroup; - children = ( - 3E166C791683954A008893AA /* RCAppDelegate.h */, - 3E166C7A1683954A008893AA /* RCAppDelegate.m */, - 3E166C821683954A008893AA /* MainStoryboard_iPhone.storyboard */, - 3E166C851683954A008893AA /* MainStoryboard_iPad.storyboard */, - 3E166C881683954A008893AA /* RCViewController.h */, - 3E166C891683954A008893AA /* RCViewController.m */, - 3E166C711683954A008893AA /* Supporting Files */, - ); - path = RobotCalibration; - sourceTree = ""; - }; - 3E166C711683954A008893AA /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 3E166C721683954A008893AA /* RobotCalibration-Info.plist */, - 3E166C731683954A008893AA /* InfoPlist.strings */, - 3E166C761683954A008893AA /* main.m */, - 3E166C781683954A008893AA /* RobotCalibration-Prefix.pch */, - 3E166C7C1683954A008893AA /* Default.png */, - 3E166C7E1683954A008893AA /* Default@2x.png */, - 3E166C801683954A008893AA /* Default-568h@2x.png */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 3E166C971683954A008893AA /* RobotCalibrationTests */ = { - isa = PBXGroup; - children = ( - 3E166C9D1683954A008893AA /* RobotCalibrationTests.h */, - 3E166C9E1683954A008893AA /* RobotCalibrationTests.m */, - 3E166C981683954A008893AA /* Supporting Files */, - ); - path = RobotCalibrationTests; - sourceTree = ""; - }; - 3E166C981683954A008893AA /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 3E166C991683954A008893AA /* RobotCalibrationTests-Info.plist */, - 3E166C9A1683954A008893AA /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3E166C661683954A008893AA /* RobotCalibration */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3E166CA21683954A008893AA /* Build configuration list for PBXNativeTarget "RobotCalibration" */; - buildPhases = ( - 3E166C631683954A008893AA /* Sources */, - 3E166C641683954A008893AA /* Frameworks */, - 3E166C651683954A008893AA /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = RobotCalibration; - productName = RobotCalibration; - productReference = 3E166C671683954A008893AA /* RobotCalibration.app */; - productType = "com.apple.product-type.application"; - }; - 3E166C8F1683954A008893AA /* RobotCalibrationTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3E166CA51683954A008893AA /* Build configuration list for PBXNativeTarget "RobotCalibrationTests" */; - buildPhases = ( - 3E166C8B1683954A008893AA /* Sources */, - 3E166C8C1683954A008893AA /* Frameworks */, - 3E166C8D1683954A008893AA /* Resources */, - 3E166C8E1683954A008893AA /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 3E166C961683954A008893AA /* PBXTargetDependency */, - ); - name = RobotCalibrationTests; - productName = RobotCalibrationTests; - productReference = 3E166C901683954A008893AA /* RobotCalibrationTests.octest */; - productType = "com.apple.product-type.bundle"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3E166C5F1683954A008893AA /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = RC; - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = "Appium Contributors"; - }; - buildConfigurationList = 3E166C621683954A008893AA /* Build configuration list for PBXProject "RobotCalibration" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3E166C5E1683954A008893AA; - productRefGroup = 3E166C681683954A008893AA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3E166C661683954A008893AA /* RobotCalibration */, - 3E166C8F1683954A008893AA /* RobotCalibrationTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 3E166C651683954A008893AA /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3E166C751683954A008893AA /* InfoPlist.strings in Resources */, - 3E166C7D1683954A008893AA /* Default.png in Resources */, - 3E166C7F1683954A008893AA /* Default@2x.png in Resources */, - 3E166C811683954A008893AA /* Default-568h@2x.png in Resources */, - 3E166C841683954A008893AA /* MainStoryboard_iPhone.storyboard in Resources */, - 3E166C871683954A008893AA /* MainStoryboard_iPad.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3E166C8D1683954A008893AA /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3E166C9C1683954A008893AA /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3E166C8E1683954A008893AA /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 3E166C631683954A008893AA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3E166C771683954A008893AA /* main.m in Sources */, - 3E166C7B1683954A008893AA /* RCAppDelegate.m in Sources */, - 3E166C8A1683954A008893AA /* RCViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3E166C8B1683954A008893AA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3E166C9F1683954A008893AA /* RobotCalibrationTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 3E166C961683954A008893AA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 3E166C661683954A008893AA /* RobotCalibration */; - targetProxy = 3E166C951683954A008893AA /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 3E166C731683954A008893AA /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 3E166C741683954A008893AA /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 3E166C821683954A008893AA /* MainStoryboard_iPhone.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 3E166C831683954A008893AA /* en */, - ); - name = MainStoryboard_iPhone.storyboard; - sourceTree = ""; - }; - 3E166C851683954A008893AA /* MainStoryboard_iPad.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 3E166C861683954A008893AA /* en */, - ); - name = MainStoryboard_iPad.storyboard; - sourceTree = ""; - }; - 3E166C9A1683954A008893AA /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 3E166C9B1683954A008893AA /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 3E166CA01683954A008893AA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = 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_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 3E166CA11683954A008893AA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = 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 = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3E166CA31683954A008893AA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "RobotCalibration/RobotCalibration-Prefix.pch"; - INFOPLIST_FILE = "RobotCalibration/RobotCalibration-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 3E166CA41683954A008893AA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "RobotCalibration/RobotCalibration-Prefix.pch"; - INFOPLIST_FILE = "RobotCalibration/RobotCalibration-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - 3E166CA61683954A008893AA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RobotCalibration.app/RobotCalibration"; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SDKROOT)/Developer/Library/Frameworks\"", - "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "RobotCalibration/RobotCalibration-Prefix.pch"; - INFOPLIST_FILE = "RobotCalibrationTests/RobotCalibrationTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = octest; - }; - name = Debug; - }; - 3E166CA71683954A008893AA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/RobotCalibration.app/RobotCalibration"; - FRAMEWORK_SEARCH_PATHS = ( - "\"$(SDKROOT)/Developer/Library/Frameworks\"", - "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "RobotCalibration/RobotCalibration-Prefix.pch"; - INFOPLIST_FILE = "RobotCalibrationTests/RobotCalibrationTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUNDLE_LOADER)"; - WRAPPER_EXTENSION = octest; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3E166C621683954A008893AA /* Build configuration list for PBXProject "RobotCalibration" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3E166CA01683954A008893AA /* Debug */, - 3E166CA11683954A008893AA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3E166CA21683954A008893AA /* Build configuration list for PBXNativeTarget "RobotCalibration" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3E166CA31683954A008893AA /* Debug */, - 3E166CA41683954A008893AA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3E166CA51683954A008893AA /* Build configuration list for PBXNativeTarget "RobotCalibrationTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3E166CA61683954A008893AA /* Debug */, - 3E166CA71683954A008893AA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3E166C5F1683954A008893AA /* Project object */; -} diff --git a/sample-code/apps/RobotCalibration/RobotCalibration.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/sample-code/apps/RobotCalibration/RobotCalibration.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index f51919ac6..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/Default-568h@2x.png b/sample-code/apps/RobotCalibration/RobotCalibration/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/sample-code/apps/RobotCalibration/RobotCalibration/Default-568h@2x.png and /dev/null differ diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/Default.png b/sample-code/apps/RobotCalibration/RobotCalibration/Default.png deleted file mode 100644 index 4c8ca6f69..000000000 Binary files a/sample-code/apps/RobotCalibration/RobotCalibration/Default.png and /dev/null differ diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/Default@2x.png b/sample-code/apps/RobotCalibration/RobotCalibration/Default@2x.png deleted file mode 100644 index 35b84cffe..000000000 Binary files a/sample-code/apps/RobotCalibration/RobotCalibration/Default@2x.png and /dev/null differ diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/RCAppDelegate.h b/sample-code/apps/RobotCalibration/RobotCalibration/RCAppDelegate.h deleted file mode 100644 index eef56611a..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/RCAppDelegate.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 RCAppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/RCAppDelegate.m b/sample-code/apps/RobotCalibration/RobotCalibration/RCAppDelegate.m deleted file mode 100644 index a29502d60..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/RCAppDelegate.m +++ /dev/null @@ -1,59 +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 "RCAppDelegate.h" - -@implementation RCAppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - // Override point for customization after application launch. - 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/sample-code/apps/RobotCalibration/RobotCalibration/RCViewController.h b/sample-code/apps/RobotCalibration/RobotCalibration/RCViewController.h deleted file mode 100644 index 03d166d5c..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/RCViewController.h +++ /dev/null @@ -1,29 +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 RCViewController : UIViewController -@property (strong, nonatomic) IBOutlet UITapGestureRecognizer *tapRecognizer; -@property (strong, nonatomic) IBOutlet UILabel *coordinateLabel; -@property (strong, nonatomic) IBOutlet UISwipeGestureRecognizer *swipeRecognizer; - -@end diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/RCViewController.m b/sample-code/apps/RobotCalibration/RobotCalibration/RCViewController.m deleted file mode 100644 index e6cff7d65..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/RCViewController.m +++ /dev/null @@ -1,117 +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 "RCViewController.h" - -@interface RCViewController () - -@end - -@implementation RCViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. - [self becomeFirstResponder]; - -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (NSUInteger)supportedInterfaceOrientations -{ - return UIInterfaceOrientationMaskAllButUpsideDown; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation -{ - if ((orientation == UIInterfaceOrientationPortrait) || - (orientation == UIInterfaceOrientationLandscapeLeft) || - (orientation == UIInterfaceOrientationLandscapeRight)) - return YES; - - return NO; -} - -- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { - [self.view setNeedsLayout]; - [self.view setNeedsDisplay]; -} - - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - //UITouch *touch = [touches anyObject]; - for (UIView *view in self.view.subviews) { - [view removeFromSuperview]; - } - for (UITouch *touch in [[event allTouches] allObjects]) { - [self displayCoordinatesForTouch:touch]; - } -} - -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - //UITouch *touch = [touches anyObject]; - for (UIView *view in self.view.subviews) { - [view removeFromSuperview]; - } - for (UITouch *touch in [[event allTouches] allObjects]) { - [self displayCoordinatesForTouch:touch]; - } - -} - -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - for (UIView *view in self.view.subviews) { - [view removeFromSuperview]; - } -} - -- (void)displayCoordinatesForTouch:(UITouch *)touch { - CGPoint locationInView = [touch locationInView:self.view]; - int viewWidth = self.view.frame.size.width; - int viewHeight = self.view.frame.size.height; - - if (([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeLeft) || - ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeRight)) { - viewWidth = self.view.frame.size.height; - viewHeight = self.view.frame.size.width; - } - // Calculate the Coordinate Label Frame - CGRect coordinateLabelFrame = CGRectMake(0, 0, 0, 0); - coordinateLabelFrame.size.height = 20; - coordinateLabelFrame.size.width = 100; - // We want the label to stay 40pts from the edges - coordinateLabelFrame.origin.x = MIN(MAX(locationInView.x - 40, 40), viewWidth - coordinateLabelFrame.size.width - 40); - coordinateLabelFrame.origin.y = MIN(MAX(locationInView.y - 30, 40), viewHeight - coordinateLabelFrame.size.height - 40); - - // Set the frame and test of the label - UILabel *coordinateLabel = [[UILabel alloc] initWithFrame:coordinateLabelFrame]; - coordinateLabel.text = [NSString stringWithFormat:@"(%d, %d)", (int)locationInView.x, (int)locationInView.y]; - coordinateLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:18.0f]; - [self.view addSubview:coordinateLabel]; -} - -@end diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/RobotCalibration-Info.plist b/sample-code/apps/RobotCalibration/RobotCalibration/RobotCalibration-Info.plist deleted file mode 100644 index 80cf6a75a..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/RobotCalibration-Info.plist +++ /dev/null @@ -1,50 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - Appium.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIMainStoryboardFile - MainStoryboard_iPhone - UIMainStoryboardFile~ipad - MainStoryboard_iPad - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortraitUpsideDown - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/RobotCalibration-Prefix.pch b/sample-code/apps/RobotCalibration/RobotCalibration/RobotCalibration-Prefix.pch deleted file mode 100644 index 4f4657944..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/RobotCalibration-Prefix.pch +++ /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 - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/InfoPlist.strings b/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/MainStoryboard_iPad.storyboard b/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/MainStoryboard_iPad.storyboard deleted file mode 100644 index 32c7a99b6..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/MainStoryboard_iPad.storyboard +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/MainStoryboard_iPhone.storyboard b/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/MainStoryboard_iPhone.storyboard deleted file mode 100644 index 08a095fcc..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/en.lproj/MainStoryboard_iPhone.storyboard +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample-code/apps/RobotCalibration/RobotCalibration/main.m b/sample-code/apps/RobotCalibration/RobotCalibration/main.m deleted file mode 100644 index 33de82e5f..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibration/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 "RCAppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([RCAppDelegate class])); - } -} diff --git a/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests-Info.plist b/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests-Info.plist deleted file mode 100644 index da3868c88..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests-Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - Appium.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests.h b/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests.h deleted file mode 100644 index 4e12eccfb..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests.h +++ /dev/null @@ -1,26 +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 RobotCalibrationTests : SenTestCase - -@end diff --git a/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests.m b/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests.m deleted file mode 100644 index 5b04c65ec..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibrationTests/RobotCalibrationTests.m +++ /dev/null @@ -1,45 +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 "RobotCalibrationTests.h" - -@implementation RobotCalibrationTests - -- (void)setUp -{ - [super setUp]; - - // Set-up code here. -} - -- (void)tearDown -{ - // Tear-down code here. - - [super tearDown]; -} - -- (void)testExample -{ - STFail(@"Unit tests are not implemented yet in RobotCalibrationTests"); -} - -@end diff --git a/sample-code/apps/RobotCalibration/RobotCalibrationTests/en.lproj/InfoPlist.strings b/sample-code/apps/RobotCalibration/RobotCalibrationTests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8..000000000 --- a/sample-code/apps/RobotCalibration/RobotCalibrationTests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/sample-code/apps/TestApp/.gitignore b/sample-code/apps/TestApp/.gitignore deleted file mode 100644 index 66da74e80..000000000 --- a/sample-code/apps/TestApp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -xcshareddata diff --git a/sample-code/apps/TestApp/Default-568h@2x.png b/sample-code/apps/TestApp/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/sample-code/apps/TestApp/Default-568h@2x.png and /dev/null differ diff --git a/sample-code/apps/TestApp/Test App 2/GestureTestViewController.h b/sample-code/apps/TestApp/Test App 2/GestureTestViewController.h deleted file mode 100644 index 4f42a3efc..000000000 --- a/sample-code/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/sample-code/apps/TestApp/Test App 2/GestureTestViewController.m b/sample-code/apps/TestApp/Test App 2/GestureTestViewController.m deleted file mode 100644 index dd7d314a4..000000000 --- a/sample-code/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/sample-code/apps/TestApp/Test App 2/GestureTestViewController.xib b/sample-code/apps/TestApp/Test App 2/GestureTestViewController.xib deleted file mode 100644 index 576fbb329..000000000 --- a/sample-code/apps/TestApp/Test App 2/GestureTestViewController.xib +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.h b/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.h deleted file mode 100644 index ee81ea12d..000000000 --- a/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.h +++ /dev/null @@ -1,41 +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; -- (BOOL)textFieldShouldReturn:(UITextField *)textField; -- (void)logLocationAuthFromTimer:(NSTimer *)timer; -- (void)logLocationAuth; - -@end diff --git a/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.m b/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.m deleted file mode 100644 index fa1e9733e..000000000 --- a/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.m +++ /dev/null @@ -1,178 +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.1 - target:self - selector:@selector(logLocationAuthFromTimer:) - userInfo:nil - repeats:NO]; - - [firstArg setAccessibilityIdentifier:@"IntegerA"]; - [secondArg setAccessibilityIdentifier:@"IntegerB"]; - [computeSumButton setAccessibilityIdentifier:@"ComputeSumButton"]; - [answerLabel setAccessibilityIdentifier:@"Answer"]; - [locationStatus setAccessibilityIdentifier:@"locationStatus"]; - - computeSumButton.titleLabel.text = NSLocalizedString(@"main.button.computeSum", @"Compute Sum button"); -} - -- (void)logLocationAuthFromTimer:(NSTimer *)timer -{ - [self logLocationAuth]; -} - -- (void)logLocationAuth -{ - CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; - if (status == kCLAuthorizationStatusAuthorized) { - 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]; -} - -- (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/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.xib b/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.xib deleted file mode 100644 index d70b5b00e..000000000 --- a/sample-code/apps/TestApp/Test App 2/MyViewControllerViewController.xib +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sample-code/apps/TestApp/Test App 2/TA2AppDelegate.h b/sample-code/apps/TestApp/Test App 2/TA2AppDelegate.h deleted file mode 100644 index e6e1da6ae..000000000 --- a/sample-code/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/sample-code/apps/TestApp/Test App 2/TA2AppDelegate.m b/sample-code/apps/TestApp/Test App 2/TA2AppDelegate.m deleted file mode 100644 index 704d9b28f..000000000 --- a/sample-code/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/sample-code/apps/TestApp/Test App 2/TestApp-Info.plist b/sample-code/apps/TestApp/Test App 2/TestApp-Info.plist deleted file mode 100644 index 39f46bb4d..000000000 --- a/sample-code/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/sample-code/apps/TestApp/Test App 2/TestApp-Prefix.pch b/sample-code/apps/TestApp/Test App 2/TestApp-Prefix.pch deleted file mode 100644 index e5a041225..000000000 --- a/sample-code/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/sample-code/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings b/sample-code/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings deleted file mode 100644 index 822ae3c9f..000000000 --- a/sample-code/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/sample-code/apps/TestApp/Test App 2/en.lproj/Localizable.strings b/sample-code/apps/TestApp/Test App 2/en.lproj/Localizable.strings deleted file mode 100644 index 5e6623d64..000000000 Binary files a/sample-code/apps/TestApp/Test App 2/en.lproj/Localizable.strings and /dev/null differ diff --git a/sample-code/apps/TestApp/Test App 2/main.m b/sample-code/apps/TestApp/Test App 2/main.m deleted file mode 100644 index 76ca62072..000000000 --- a/sample-code/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/sample-code/apps/TestApp/TestApp.xcodeproj/project.pbxproj b/sample-code/apps/TestApp/TestApp.xcodeproj/project.pbxproj deleted file mode 100644 index 8c31f8f7f..000000000 --- a/sample-code/apps/TestApp/TestApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,328 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 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 */; }; - 3647AE2D15CA00D5006F70D6 /* MyViewControllerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3647AE2B15CA00D5006F70D6 /* MyViewControllerViewController.xib */; }; - 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 */ - 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 = ""; }; - 3647AE2B15CA00D5006F70D6 /* MyViewControllerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyViewControllerViewController.xib; 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 */, - 3647AE2B15CA00D5006F70D6 /* 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 */, - 3647AE2D15CA00D5006F70D6 /* 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 */ - 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/sample-code/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/sample-code/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7f42fe438..000000000 --- a/sample-code/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/sample-code/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/xcuserdata/danc.xcuserdatad/UserInterfaceState.xcuserstate b/sample-code/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/xcuserdata/danc.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 0718cd461..000000000 Binary files a/sample-code/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/xcuserdata/danc.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/sample-code/apps/TestApp/TestApp.xcodeproj/xcuserdata/danc.xcuserdatad/xcschemes/TestApp.xcscheme b/sample-code/apps/TestApp/TestApp.xcodeproj/xcuserdata/danc.xcuserdatad/xcschemes/TestApp.xcscheme deleted file mode 100644 index a2f5aebca..000000000 --- a/sample-code/apps/TestApp/TestApp.xcodeproj/xcuserdata/danc.xcuserdatad/xcschemes/TestApp.xcscheme +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sample-code/apps/TestApp/TestApp.xcodeproj/xcuserdata/danc.xcuserdatad/xcschemes/xcschememanagement.plist b/sample-code/apps/TestApp/TestApp.xcodeproj/xcuserdata/danc.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index a9c71e427..000000000 --- a/sample-code/apps/TestApp/TestApp.xcodeproj/xcuserdata/danc.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - TestApp.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 3647AE0D15CA0082006F70D6 - - primary - - - - - diff --git a/sample-code/apps/ToggleTest/.classpath b/sample-code/apps/ToggleTest/.classpath deleted file mode 100644 index 7bc01d9a9..000000000 --- a/sample-code/apps/ToggleTest/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/sample-code/apps/ToggleTest/.gitignore b/sample-code/apps/ToggleTest/.gitignore deleted file mode 100644 index 48d54d91e..000000000 --- a/sample-code/apps/ToggleTest/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -ant.properties -bin -build.xml -gen -local.properties -proguard-project.txt -project.properties -tests/ant.properties -tests/build.xml -tests/local.properties -tests/proguard-project.txt -tests/project.properties -out -.settings/ -*.apk -lint.xml -.idea/* \ No newline at end of file diff --git a/sample-code/apps/ToggleTest/.project b/sample-code/apps/ToggleTest/.project deleted file mode 100644 index 9d1b251e6..000000000 --- a/sample-code/apps/ToggleTest/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - ToggleTest - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/sample-code/apps/ToggleTest/AndroidManifest.xml b/sample-code/apps/ToggleTest/AndroidManifest.xml deleted file mode 100644 index a79d9ad61..000000000 --- a/sample-code/apps/ToggleTest/AndroidManifest.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/sample-code/apps/ToggleTest/ic_launcher-web.png b/sample-code/apps/ToggleTest/ic_launcher-web.png deleted file mode 100644 index a18cbb48c..000000000 Binary files a/sample-code/apps/ToggleTest/ic_launcher-web.png and /dev/null differ diff --git a/sample-code/apps/ToggleTest/libs/android-support-v4.jar b/sample-code/apps/ToggleTest/libs/android-support-v4.jar deleted file mode 100644 index 96644edbe..000000000 Binary files a/sample-code/apps/ToggleTest/libs/android-support-v4.jar and /dev/null differ diff --git a/sample-code/apps/ToggleTest/res/drawable-hdpi/ic_launcher.png b/sample-code/apps/ToggleTest/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 288b66551..000000000 Binary files a/sample-code/apps/ToggleTest/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/sample-code/apps/ToggleTest/res/drawable-mdpi/ic_launcher.png b/sample-code/apps/ToggleTest/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 6ae570b4d..000000000 Binary files a/sample-code/apps/ToggleTest/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/sample-code/apps/ToggleTest/res/drawable-xhdpi/ic_launcher.png b/sample-code/apps/ToggleTest/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index d4fb7cd9d..000000000 Binary files a/sample-code/apps/ToggleTest/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/sample-code/apps/ToggleTest/res/drawable-xxhdpi/ic_launcher.png b/sample-code/apps/ToggleTest/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index 85a608158..000000000 Binary files a/sample-code/apps/ToggleTest/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/sample-code/apps/ToggleTest/res/layout/activity_main.xml b/sample-code/apps/ToggleTest/res/layout/activity_main.xml deleted file mode 100644 index bc8f0a25c..000000000 --- a/sample-code/apps/ToggleTest/res/layout/activity_main.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample-code/apps/ToggleTest/res/menu/main.xml b/sample-code/apps/ToggleTest/res/menu/main.xml deleted file mode 100644 index c00202823..000000000 --- a/sample-code/apps/ToggleTest/res/menu/main.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/sample-code/apps/ToggleTest/res/values-sw600dp/dimens.xml b/sample-code/apps/ToggleTest/res/values-sw600dp/dimens.xml deleted file mode 100644 index 44f01db75..000000000 --- a/sample-code/apps/ToggleTest/res/values-sw600dp/dimens.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/sample-code/apps/ToggleTest/res/values-sw720dp-land/dimens.xml b/sample-code/apps/ToggleTest/res/values-sw720dp-land/dimens.xml deleted file mode 100644 index 61e3fa8fb..000000000 --- a/sample-code/apps/ToggleTest/res/values-sw720dp-land/dimens.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - 128dp - - diff --git a/sample-code/apps/ToggleTest/res/values-v11/styles.xml b/sample-code/apps/ToggleTest/res/values-v11/styles.xml deleted file mode 100644 index 3c02242ad..000000000 --- a/sample-code/apps/ToggleTest/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/sample-code/apps/ToggleTest/res/values-v14/styles.xml b/sample-code/apps/ToggleTest/res/values-v14/styles.xml deleted file mode 100644 index a91fd0372..000000000 --- a/sample-code/apps/ToggleTest/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/sample-code/apps/ToggleTest/res/values/dimens.xml b/sample-code/apps/ToggleTest/res/values/dimens.xml deleted file mode 100644 index 55c1e5908..000000000 --- a/sample-code/apps/ToggleTest/res/values/dimens.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - 16dp - 16dp - - diff --git a/sample-code/apps/ToggleTest/res/values/strings.xml b/sample-code/apps/ToggleTest/res/values/strings.xml deleted file mode 100644 index fb6e387fb..000000000 --- a/sample-code/apps/ToggleTest/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - ToggleTest - Settings - Hello world! - - diff --git a/sample-code/apps/ToggleTest/res/values/styles.xml b/sample-code/apps/ToggleTest/res/values/styles.xml deleted file mode 100644 index 6ce89c7ba..000000000 --- a/sample-code/apps/ToggleTest/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/sample-code/apps/ToggleTest/src/com/example/toggletest/MainActivity.java b/sample-code/apps/ToggleTest/src/com/example/toggletest/MainActivity.java deleted file mode 100644 index 1fc0174ce..000000000 --- a/sample-code/apps/ToggleTest/src/com/example/toggletest/MainActivity.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.example.toggletest; - -import android.annotation.TargetApi; -import android.app.Activity; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.location.LocationManager; -import android.net.wifi.WifiManager; -import android.os.Build; -import android.os.Bundle; -import android.provider.Settings; -import android.provider.Settings.SettingNotFoundException; -import android.telephony.TelephonyManager; -import android.util.Log; -import android.widget.ToggleButton; - - -public class MainActivity extends Activity { - private static final String TAG = "Toggle Test"; - private ToggleButton mWifiToggle; - private ToggleButton mDataToggle; - private ToggleButton mFlightModeToggle; - private ToggleButton mGPSToggle; - private TelephonyManager mTelephonyManager; - private LocationManager mLocationManager; - private NetworkReceiver receiver; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - mTelephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); - mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); - - mWifiToggle = (ToggleButton)findViewById(R.id.wifi_toggle); - mDataToggle = (ToggleButton)findViewById(R.id.data_toggle); - mFlightModeToggle = (ToggleButton)findViewById(R.id.flight_toggle); - mGPSToggle = (ToggleButton)findViewById(R.id.gps_toggle); - } - - @Override - protected void onPause() { - super.onPause(); - this.unregisterReceiver(receiver); - } - - @Override - protected void onResume() { - super.onResume(); - this.addReceiver(); - this.refresh(); - } - - private void addReceiver() { - IntentFilter filters = new IntentFilter(); - filters.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION); - filters.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); - filters.addAction("android.intent.action.ANY_DATA_STATE"); - filters.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); - - this.receiver = new NetworkReceiver(this); - registerReceiver(this.receiver, filters); - } - - protected void refresh() { - try { - // the WifiManager is flakey on emulators - // it is faster and more reliable to get the read-only setting for wifi_on - int wifiOn = Settings.Global.getInt(getContentResolver(), Settings.Global.WIFI_ON); - mWifiToggle.setChecked(wifiOn != 0); - } catch (SettingNotFoundException e) { - // fall through - Log.d(TAG, "Unable to find Setting 'wifi_on': " + e.getMessage()); - } - try { - int dataOn = Settings.Global.getInt(getContentResolver(), "mobile_data"); - mDataToggle.setChecked(dataOn != 0); - } catch (SettingNotFoundException e) { - Log.d(TAG, "Unable to find Setting 'mobile_data': " + e.getMessage()); - } - boolean fMode = FlightMode.getInstance().isEnabled(this); - mFlightModeToggle.setChecked(fMode); - if (fMode) { - // data in particular sometimes still says it's on when there is airplane mode - mWifiToggle.setChecked(false); - mDataToggle.setChecked(false); - } - mGPSToggle.setChecked(mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) - || mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)); - } - - static class NetworkReceiver extends BroadcastReceiver { - private MainActivity activity; - - public NetworkReceiver(MainActivity activity) { - this.activity = activity; - } - - @Override - public void onReceive(Context context, Intent intent) { - activity.refresh(); - } - } - - static class FlightMode { - public static FlightMode getInstance() { - if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { - return new FlightMode(); - } else { - return new FlightModeJBMR1(); - } - } - - public boolean isEnabled(Context context) { - return Settings.System.getInt(context.getContentResolver(), - Settings.System.AIRPLANE_MODE_ON, 0) != 0; - } - } - - @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) - static class FlightModeJBMR1 extends FlightMode { - @Override - public boolean isEnabled(Context context) { - return Settings.Global.getInt(context.getContentResolver(), - Settings.Global.AIRPLANE_MODE_ON, 0) != 0; - } - } -} diff --git a/sample-code/apps/WebViewApp/WebViewApp.xcodeproj/project.pbxproj b/sample-code/apps/WebViewApp/WebViewApp.xcodeproj/project.pbxproj deleted file mode 100644 index 504af8398..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,325 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1B08D24C1844279400752049 /* cybervillainsCA.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1B08D24B1844279400752049 /* cybervillainsCA.cer */; }; - 1B316481183696AA00E66A8A /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1B31647F183696AA00E66A8A /* MainStoryboard_iPad.storyboard */; }; - 1BD41A8916C10EAB009D6B32 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BD41A8816C10EAB009D6B32 /* UIKit.framework */; }; - 1BD41A8B16C10EAB009D6B32 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BD41A8A16C10EAB009D6B32 /* Foundation.framework */; }; - 1BD41A8D16C10EAB009D6B32 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1BD41A8C16C10EAB009D6B32 /* CoreGraphics.framework */; }; - 1BD41A9316C10EAB009D6B32 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1BD41A9116C10EAB009D6B32 /* InfoPlist.strings */; }; - 1BD41A9516C10EAB009D6B32 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BD41A9416C10EAB009D6B32 /* main.m */; }; - 1BD41A9916C10EAB009D6B32 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BD41A9816C10EAB009D6B32 /* AppDelegate.m */; }; - 1BD41A9B16C10EAB009D6B32 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1BD41A9A16C10EAB009D6B32 /* Default.png */; }; - 1BD41A9D16C10EAB009D6B32 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1BD41A9C16C10EAB009D6B32 /* Default@2x.png */; }; - 1BD41A9F16C10EAB009D6B32 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1BD41A9E16C10EAB009D6B32 /* Default-568h@2x.png */; }; - 1BD41AA216C10EAB009D6B32 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1BD41AA016C10EAB009D6B32 /* MainStoryboard_iPhone.storyboard */; }; - 1BD41AA816C10EAB009D6B32 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BD41AA716C10EAB009D6B32 /* ViewController.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 1B08D24B1844279400752049 /* cybervillainsCA.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = cybervillainsCA.cer; sourceTree = ""; }; - 1B316480183696AA00E66A8A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; - 1BD41A8516C10EAB009D6B32 /* WebViewApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebViewApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1BD41A8816C10EAB009D6B32 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 1BD41A8A16C10EAB009D6B32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1BD41A8C16C10EAB009D6B32 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 1BD41A9016C10EAB009D6B32 /* WebViewApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "WebViewApp-Info.plist"; sourceTree = ""; }; - 1BD41A9216C10EAB009D6B32 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 1BD41A9416C10EAB009D6B32 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 1BD41A9616C10EAB009D6B32 /* WebViewApp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WebViewApp-Prefix.pch"; sourceTree = ""; }; - 1BD41A9716C10EAB009D6B32 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 1BD41A9816C10EAB009D6B32 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 1BD41A9A16C10EAB009D6B32 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 1BD41A9C16C10EAB009D6B32 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; - 1BD41A9E16C10EAB009D6B32 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - 1BD41AA116C10EAB009D6B32 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; - 1BD41AA616C10EAB009D6B32 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 1BD41AA716C10EAB009D6B32 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1BD41A8216C10EAB009D6B32 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1BD41A8916C10EAB009D6B32 /* UIKit.framework in Frameworks */, - 1BD41A8B16C10EAB009D6B32 /* Foundation.framework in Frameworks */, - 1BD41A8D16C10EAB009D6B32 /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1BD41A7C16C10EAB009D6B32 = { - isa = PBXGroup; - children = ( - 1BD41A8E16C10EAB009D6B32 /* WebViewApp */, - 1BD41A8716C10EAB009D6B32 /* Frameworks */, - 1BD41A8616C10EAB009D6B32 /* Products */, - ); - sourceTree = ""; - }; - 1BD41A8616C10EAB009D6B32 /* Products */ = { - isa = PBXGroup; - children = ( - 1BD41A8516C10EAB009D6B32 /* WebViewApp.app */, - ); - name = Products; - sourceTree = ""; - }; - 1BD41A8716C10EAB009D6B32 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1BD41A8816C10EAB009D6B32 /* UIKit.framework */, - 1BD41A8A16C10EAB009D6B32 /* Foundation.framework */, - 1BD41A8C16C10EAB009D6B32 /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1BD41A8E16C10EAB009D6B32 /* WebViewApp */ = { - isa = PBXGroup; - children = ( - 1BD41A9716C10EAB009D6B32 /* AppDelegate.h */, - 1BD41A9816C10EAB009D6B32 /* AppDelegate.m */, - 1BD41AA016C10EAB009D6B32 /* MainStoryboard_iPhone.storyboard */, - 1B31647F183696AA00E66A8A /* MainStoryboard_iPad.storyboard */, - 1BD41AA616C10EAB009D6B32 /* ViewController.h */, - 1BD41AA716C10EAB009D6B32 /* ViewController.m */, - 1BD41A8F16C10EAB009D6B32 /* Supporting Files */, - ); - path = WebViewApp; - sourceTree = ""; - }; - 1BD41A8F16C10EAB009D6B32 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 1B08D24B1844279400752049 /* cybervillainsCA.cer */, - 1BD41A9016C10EAB009D6B32 /* WebViewApp-Info.plist */, - 1BD41A9116C10EAB009D6B32 /* InfoPlist.strings */, - 1BD41A9416C10EAB009D6B32 /* main.m */, - 1BD41A9616C10EAB009D6B32 /* WebViewApp-Prefix.pch */, - 1BD41A9A16C10EAB009D6B32 /* Default.png */, - 1BD41A9C16C10EAB009D6B32 /* Default@2x.png */, - 1BD41A9E16C10EAB009D6B32 /* Default-568h@2x.png */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1BD41A8416C10EAB009D6B32 /* WebViewApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1BD41AAB16C10EAB009D6B32 /* Build configuration list for PBXNativeTarget "WebViewApp" */; - buildPhases = ( - 1BD41A8116C10EAB009D6B32 /* Sources */, - 1BD41A8216C10EAB009D6B32 /* Frameworks */, - 1BD41A8316C10EAB009D6B32 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = WebViewApp; - productName = WebViewApp; - productReference = 1BD41A8516C10EAB009D6B32 /* WebViewApp.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 1BD41A7D16C10EAB009D6B32 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0500; - ORGANIZATIONNAME = "Appium Committers"; - }; - buildConfigurationList = 1BD41A8016C10EAB009D6B32 /* Build configuration list for PBXProject "WebViewApp" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 1BD41A7C16C10EAB009D6B32; - productRefGroup = 1BD41A8616C10EAB009D6B32 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 1BD41A8416C10EAB009D6B32 /* WebViewApp */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 1BD41A8316C10EAB009D6B32 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B316481183696AA00E66A8A /* MainStoryboard_iPad.storyboard in Resources */, - 1BD41A9316C10EAB009D6B32 /* InfoPlist.strings in Resources */, - 1BD41A9B16C10EAB009D6B32 /* Default.png in Resources */, - 1BD41A9D16C10EAB009D6B32 /* Default@2x.png in Resources */, - 1BD41A9F16C10EAB009D6B32 /* Default-568h@2x.png in Resources */, - 1BD41AA216C10EAB009D6B32 /* MainStoryboard_iPhone.storyboard in Resources */, - 1B08D24C1844279400752049 /* cybervillainsCA.cer in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1BD41A8116C10EAB009D6B32 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1BD41A9516C10EAB009D6B32 /* main.m in Sources */, - 1BD41A9916C10EAB009D6B32 /* AppDelegate.m in Sources */, - 1BD41AA816C10EAB009D6B32 /* ViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 1B31647F183696AA00E66A8A /* MainStoryboard_iPad.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 1B316480183696AA00E66A8A /* en */, - ); - name = MainStoryboard_iPad.storyboard; - sourceTree = ""; - }; - 1BD41A9116C10EAB009D6B32 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 1BD41A9216C10EAB009D6B32 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 1BD41AA016C10EAB009D6B32 /* MainStoryboard_iPhone.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 1BD41AA116C10EAB009D6B32 /* en */, - ); - name = MainStoryboard_iPhone.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 1BD41AA916C10EAB009D6B32 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = 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_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1BD41AAA16C10EAB009D6B32 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = 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 = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1BD41AAC16C10EAB009D6B32 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "WebViewApp/WebViewApp-Prefix.pch"; - INFOPLIST_FILE = "WebViewApp/WebViewApp-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 1BD41AAD16C10EAB009D6B32 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "WebViewApp/WebViewApp-Prefix.pch"; - INFOPLIST_FILE = "WebViewApp/WebViewApp-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1BD41A8016C10EAB009D6B32 /* Build configuration list for PBXProject "WebViewApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1BD41AA916C10EAB009D6B32 /* Debug */, - 1BD41AAA16C10EAB009D6B32 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1BD41AAB16C10EAB009D6B32 /* Build configuration list for PBXNativeTarget "WebViewApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1BD41AAC16C10EAB009D6B32 /* Debug */, - 1BD41AAD16C10EAB009D6B32 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 1BD41A7D16C10EAB009D6B32 /* Project object */; -} diff --git a/sample-code/apps/WebViewApp/WebViewApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/sample-code/apps/WebViewApp/WebViewApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 0ca482886..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/sample-code/apps/WebViewApp/WebViewApp/AppDelegate.h b/sample-code/apps/WebViewApp/WebViewApp/AppDelegate.h deleted file mode 100644 index a986c4ab9..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// AppDelegate.h -// WebViewApp -// -// Created by Jonathan Lipps on 2/5/13. -// Copyright (c) 2013 Appium Committers. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/sample-code/apps/WebViewApp/WebViewApp/AppDelegate.m b/sample-code/apps/WebViewApp/WebViewApp/AppDelegate.m deleted file mode 100644 index d0545b45a..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/AppDelegate.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.m -// WebViewApp -// -// Created by Jonathan Lipps on 2/5/13. -// Copyright (c) 2013 Appium Committers. All rights reserved. -// - -#import "AppDelegate.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - // Override point for customization after application launch. - 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/sample-code/apps/WebViewApp/WebViewApp/Default-568h@2x.png b/sample-code/apps/WebViewApp/WebViewApp/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/sample-code/apps/WebViewApp/WebViewApp/Default-568h@2x.png and /dev/null differ diff --git a/sample-code/apps/WebViewApp/WebViewApp/Default.png b/sample-code/apps/WebViewApp/WebViewApp/Default.png deleted file mode 100644 index 4c8ca6f69..000000000 Binary files a/sample-code/apps/WebViewApp/WebViewApp/Default.png and /dev/null differ diff --git a/sample-code/apps/WebViewApp/WebViewApp/Default@2x.png b/sample-code/apps/WebViewApp/WebViewApp/Default@2x.png deleted file mode 100644 index 35b84cffe..000000000 Binary files a/sample-code/apps/WebViewApp/WebViewApp/Default@2x.png and /dev/null differ diff --git a/sample-code/apps/WebViewApp/WebViewApp/ViewController.h b/sample-code/apps/WebViewApp/WebViewApp/ViewController.h deleted file mode 100644 index 1b3fa766c..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/ViewController.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// ViewController.h -// WebViewApp -// -// Created by Jonathan Lipps on 2/5/13. -// Copyright (c) 2013 Appium Committers. All rights reserved. -// - -#import - -@interface ViewController : UIViewController -@property (weak, nonatomic) IBOutlet UITextField *urlField; -@property (weak, nonatomic) IBOutlet UIWebView *mainWebView; -@property UIActivityIndicatorView *pageLoadingIndicator; -- (IBAction)navBtnClicked:(id)sender; -- (IBAction)urlEditBegin:(id)sender; -- (BOOL)textFieldShouldReturn:(UITextField *)textField; -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; -- (void)webViewDidFinishLoad:(UIWebView *)webView; -- (void)webViewDidStartLoad:(UIWebView *)webView; -@end - diff --git a/sample-code/apps/WebViewApp/WebViewApp/ViewController.m b/sample-code/apps/WebViewApp/WebViewApp/ViewController.m deleted file mode 100644 index 78309e261..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/ViewController.m +++ /dev/null @@ -1,81 +0,0 @@ -// -// ViewController.m -// WebViewApp -// -// Created by Jonathan Lipps on 2/5/13. -// Copyright (c) 2013 Appium Committers. All rights reserved. -// - -#import "ViewController.h" - - -@implementation ViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - self.urlField.delegate = self; - self.mainWebView.delegate = self; - self.pageLoadingIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; - self.pageLoadingIndicator.hidesWhenStopped = YES; - self.urlField.rightView = self.pageLoadingIndicator; - self.urlField.rightViewMode = UITextFieldViewModeAlways; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (IBAction)navBtnClicked:(id)sender { - NSLog(@"changing url to %@", self.urlField.text); - [self.mainWebView - loadRequest:[NSURLRequest - requestWithURL: [NSURL - URLWithString: self.urlField.text]]]; -} - -- (IBAction)urlEditBegin:(id)sender { - if ([self.urlField.text isEqualToString:@""]) { - self.urlField.text = @"http://"; - } -} - -- (BOOL)textFieldShouldReturn:(UITextField *)textField { - [textField resignFirstResponder]; - [self navBtnClicked:nil]; - return YES; -} - -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { - NSString *url = [[request URL] absoluteString]; - NSLog(@"URL change request: %@", url); - self.urlField.text = url; - return YES; -} - -- (void)webViewDidFinishLoad:(UIWebView *)webView { - NSLog(@"Webview finished loading %@", [[webView.request URL] absoluteString]); - [self.pageLoadingIndicator stopAnimating]; -} - -- (void)webViewDidStartLoad:(UIWebView *)webView { - NSLog(@"Webview started loading"); - [self.pageLoadingIndicator startAnimating]; -} - -@end - -@implementation NSURLRequest (NSURLRequestWithIgnoreSSL) - -+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host -{ - return YES; -} - -@end diff --git a/sample-code/apps/WebViewApp/WebViewApp/WebViewApp-Info.plist b/sample-code/apps/WebViewApp/WebViewApp/WebViewApp-Info.plist deleted file mode 100644 index ec8c7762e..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/WebViewApp-Info.plist +++ /dev/null @@ -1,48 +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 - - UIMainStoryboardFile - MainStoryboard_iPhone - UIMainStoryboardFile~ipad - MainStoryboard_iPad - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/sample-code/apps/WebViewApp/WebViewApp/WebViewApp-Prefix.pch b/sample-code/apps/WebViewApp/WebViewApp/WebViewApp-Prefix.pch deleted file mode 100644 index 71cc9882b..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/WebViewApp-Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'WebViewApp' target in the 'WebViewApp' project -// - -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/sample-code/apps/WebViewApp/WebViewApp/cybervillainsCA.cer b/sample-code/apps/WebViewApp/WebViewApp/cybervillainsCA.cer deleted file mode 100644 index 945a93de0..000000000 Binary files a/sample-code/apps/WebViewApp/WebViewApp/cybervillainsCA.cer and /dev/null differ diff --git a/sample-code/apps/WebViewApp/WebViewApp/en.lproj/InfoPlist.strings b/sample-code/apps/WebViewApp/WebViewApp/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/sample-code/apps/WebViewApp/WebViewApp/en.lproj/MainStoryboard_iPad.storyboard b/sample-code/apps/WebViewApp/WebViewApp/en.lproj/MainStoryboard_iPad.storyboard deleted file mode 100644 index 3d835e016..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/en.lproj/MainStoryboard_iPad.storyboard +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample-code/apps/WebViewApp/WebViewApp/en.lproj/MainStoryboard_iPhone.storyboard b/sample-code/apps/WebViewApp/WebViewApp/en.lproj/MainStoryboard_iPhone.storyboard deleted file mode 100644 index 609d09ffe..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/en.lproj/MainStoryboard_iPhone.storyboard +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample-code/apps/WebViewApp/WebViewApp/main.m b/sample-code/apps/WebViewApp/WebViewApp/main.m deleted file mode 100644 index da80845f9..000000000 --- a/sample-code/apps/WebViewApp/WebViewApp/main.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// main.m -// WebViewApp -// -// Created by Jonathan Lipps on 2/5/13. -// Copyright (c) 2013 Appium Committers. All rights reserved. -// - -#import - -#import "AppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/sample-code/examples/RobotFramework/test_android_contact_resource.txt b/sample-code/examples/RobotFramework/test_android_contact_resource.txt deleted file mode 100644 index 70d2afe91..000000000 --- a/sample-code/examples/RobotFramework/test_android_contact_resource.txt +++ /dev/null @@ -1,19 +0,0 @@ -*** Settings *** -Library AppiumLibrary - -*** Variables *** -${REMOTE_URL} http://localhost:4723/wd/hub -${PLATFORM_NAME} Android -${PLATFORM_VERSION} 4.2.2 -${DEVICE_NAME} Android Emulator -${APP} ../../../sample-code/apps/ContactManager/ContactManager.apk - -*** Keywords *** -add new contact - [Arguments] ${contact_name} ${contact_phone} ${contact_email} - Open Application ${REMOTE_URL} ${PLATFORM_NAME} ${PLATFORM_VERSION} ${DEVICE_NAME} ${APP} - Click Element accessibility_id=Add Contact - Input Text id=com.example.android.contactmanager:id/contactNameEditText ${contact_name} - Input Text id=com.example.android.contactmanager:id/contactPhoneEditText ${contact_phone} - Input Text id=com.example.android.contactmanager:id/contactEmailEditText ${contact_email} - Click Element accessibility_id=Save diff --git a/sample-code/examples/RobotFramework/test_android_contacts.txt b/sample-code/examples/RobotFramework/test_android_contacts.txt deleted file mode 100644 index 951bf77a4..000000000 --- a/sample-code/examples/RobotFramework/test_android_contacts.txt +++ /dev/null @@ -1,9 +0,0 @@ -*** Settings *** -Resource test_android_contact_resource.txt - -*** Test Cases *** -add_contact - [Documentation] demo for android_contacts(https://github.com/appium/appium/blob/master/sample-code/examples/python/android_contacts.py) - [Tags] demo - add new contact Appium User someone@appium.io 5555555555 - Page Should Contain Text Appium User diff --git a/sample-code/examples/dotnet/.gitignore b/sample-code/examples/dotnet/.gitignore deleted file mode 100644 index c4545640f..000000000 --- a/sample-code/examples/dotnet/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -AppiumDotNetSample/bin -AppiumDotNetSample/obj -AppiumDotNetSample/Obj -AppiumDotNetSample/TestResults -AppiumDotNetSample/test-results -*.csproj.user -*.suo -*.cache -*~ -*.swp -*.userprefs -*.pidb -packages -*.nupkg -AppiumDotNetSample/env.json - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample.sln b/sample-code/examples/dotnet/AppiumDotNetSample.sln deleted file mode 100644 index a3ce51e2f..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppiumDotNetSample", "AppiumDotNetSample\AppiumDotNetSample.csproj", "{7A830071-06AC-4E20-9FBB-CAA395387A7C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7A830071-06AC-4E20-9FBB-CAA395387A7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A830071-06AC-4E20-9FBB-CAA395387A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A830071-06AC-4E20-9FBB-CAA395387A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A830071-06AC-4E20-9FBB-CAA395387A7C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = AppiumDotNetSample\AppiumDotNetSample.csproj - EndGlobalSection -EndGlobal diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidComplexTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/AndroidComplexTest.cs deleted file mode 100644 index 9ed6309c7..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidComplexTest.cs +++ /dev/null @@ -1,188 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; -using System.Collections; -using OpenQA.Selenium.Appium.MultiTouch; -using OpenQA.Selenium.Appium.Interfaces; - -namespace Appium.Samples -{ - [TestFixture ()] - public class AndroidComplexTest - { - private AppiumDriver driver; - private bool allPassed = true; - - [TestFixtureSetUp] - public void BeforeAll(){ - DesiredCapabilities capabilities = Env.isSauce () ? - Caps.getAndroid18Caps (Apps.get ("androidApiDemos")) : - Caps.getAndroid19Caps (Apps.get ("androidApiDemos")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "android - complex"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - [Test ()] - public void FindElementTestCase () - { - driver.FindElementByXPath ("//android.widget.TextView[@text='Animation']"); - Assert.AreEqual( driver.FindElementByXPath ("//android.widget.TextView").Text, - "API Demos"); - IList els = driver.FindElementsByXPath ("//android.widget.TextView[contains(@text, 'Animat')]"); - els = Filters.FilterDisplayed (els); - if (!Env.isSauce ()) { - Assert.AreEqual (els [0].Text, "Animation"); - } - driver.FindElementByName ("App").Click(); - Thread.Sleep (3000); - els = driver.FindElementsByAndroidUIAutomator ("new UiSelector().clickable(true)"); - Assert.GreaterOrEqual (els.Count, 10); - Assert.IsNotNull ( - driver.FindElementByXPath("//android.widget.TextView[@text='Action Bar']")); - els = driver.FindElementsByXPath ("//android.widget.TextView"); - els = Filters.FilterDisplayed (els); - Assert.AreEqual (els[0].Text, "API Demos"); - driver.Navigate ().Back (); - } - - [Test ()] - public void ScrollTestCase () - { - driver.FindElementByXPath ("//android.widget.TextView[@text='Animation']"); - IList els = driver.FindElementsByXPath ("//android.widget.TextView"); - var loc1 = els [7].Location; - var loc2 = els [3].Location; - var swipe = Actions.Swipe (driver, loc1.X, loc1.Y, loc2.X, loc2.Y, 800); - swipe.Perform (); - } - - private IWebElement FindTouchPaint(){ - try { - return driver.FindElementByName ("Touch Paint"); - } catch (NoSuchElementException) { - var els = driver.FindElementsByClassName ("android.widget.TextView"); - var loc1 = els [els.Count - 1].Location; - var loc2 = els [0].Location; - var swipe = Actions.Swipe (driver, loc1.X, loc1.Y, loc2.X, loc2.Y, 800); - swipe.Perform (); - return FindTouchPaint (); - } - } - - [Test ()] - public void DrawSmileyTestCase () - { - driver.FindElementByName ("Graphics").Click (); - var el = FindTouchPaint (); - el.Click (); - Thread.Sleep (5000); - ITouchAction a1 = new TouchAction (); - a1.Press (140, 100).Release (); - ITouchAction a2 = new TouchAction (); - a2.Press (250, 100).Release (); - ITouchAction smile = new TouchAction (); - smile - .Press (110, 200) - .MoveTo(1, 1) - .MoveTo(1, 1) - .MoveTo(1, 1) - .MoveTo(1, 1) - .MoveTo(1, 1) - .MoveTo(2, 1) - .MoveTo(2, 1) - .MoveTo(2, 1) - .MoveTo(2, 1) - .MoveTo(2, 1) - .MoveTo(3, 1) - .MoveTo(3, 1) - .MoveTo(3, 1) - .MoveTo(3, 1) - .MoveTo(3, 1) - .MoveTo(4, 1) - .MoveTo(4, 1) - .MoveTo(4, 1) - .MoveTo(4, 1) - .MoveTo(4, 1) - .MoveTo(5, 1) - .MoveTo(5, 1) - .MoveTo(5, 1) - .MoveTo(5, 1) - .MoveTo(5, 1) - .MoveTo(5, 0) - .MoveTo(5, 0) - .MoveTo(5, 0) - .MoveTo(5, 0) - .MoveTo(5, 0) - .MoveTo(5, 0) - .MoveTo(5, 0) - .MoveTo(5, 0) - .MoveTo(5, -1) - .MoveTo(5, -1) - .MoveTo(5, -1) - .MoveTo(5, -1) - .MoveTo(5, -1) - .MoveTo(4, -1) - .MoveTo(4, -1) - .MoveTo(4, -1) - .MoveTo(4, -1) - .MoveTo(4, -1) - .MoveTo(3, -1) - .MoveTo(3, -1) - .MoveTo(3, -1) - .MoveTo(3, -1) - .MoveTo(3, -1) - .MoveTo(2, -1) - .MoveTo(2, -1) - .MoveTo(2, -1) - .MoveTo(2, -1) - .MoveTo(2, -1) - .MoveTo(1, -1) - .MoveTo(1, -1) - .MoveTo(1, -1) - .MoveTo(1, -1) - .MoveTo(1, -1) - .Release(); - - IMultiAction m = new MultiAction (driver); - m.Add (a1).Add(a2).Add(smile); - m.Perform (); - Thread.Sleep (10000); - driver.Navigate ().Back (); - Thread.Sleep (1000); - driver.Navigate ().Back (); - Thread.Sleep (1000); - } - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidLocalServerTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/AndroidLocalServerTest.cs deleted file mode 100644 index 447742359..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidLocalServerTest.cs +++ /dev/null @@ -1,63 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; - -namespace Appium.Samples -{ - [TestFixture ()] - public class AndroidLocalServerTest - { - private AppiumDriver driver; - private bool allPassed = true; - LocalServer server = new LocalServer (3001); - - [TestFixtureSetUp] - public void BeforeAll(){ - server.Start (); - DesiredCapabilities capabilities = Env.isSauce () ? - Caps.getAndroid18Caps (Apps.get ("androidApiDemosLocal")) : - Caps.getAndroid19Caps (Apps.get ("androidApiDemosLocal")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "android - local server"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - server.Stop (); - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - [Test ()] - public void OpenAppTestCase () - { - Assert.IsNotNull (driver.FindElementByAccessibilityId("Graphics")); - } - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidSimpleTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/AndroidSimpleTest.cs deleted file mode 100644 index c9711d4b4..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidSimpleTest.cs +++ /dev/null @@ -1,68 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; - -namespace Appium.Samples -{ - [TestFixture ()] - public class AndroidSimpleTest - { - private AppiumDriver driver; - private bool allPassed = true; - - [TestFixtureSetUp] - public void BeforeAll(){ - DesiredCapabilities capabilities = Env.isSauce () ? - Caps.getAndroid18Caps (Apps.get ("androidApiDemos")) : - Caps.getAndroid19Caps (Apps.get ("androidApiDemos")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "android - simple"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - [Test ()] - public void FindElementTestCase () - { - driver.FindElementByAccessibilityId ("Graphics").Click (); - Assert.IsNotNull (driver.FindElementByAccessibilityId ("Arcs")); - driver.Navigate ().Back (); - Assert.IsNotNull (driver.FindElementByName ("App")); - var els = driver.FindElementsByAndroidUIAutomator ("new UiSelector().clickable(true)"); - Assert.AreEqual (els.Count, 12); - els = driver.FindElementsByAndroidUIAutomator ("new UiSelector().enabled(true)"); - Assert.GreaterOrEqual (els.Count, 20); - Assert.IsNotNull (driver.FindElementByXPath ("//android.widget.TextView[@text='API Demos']")); - } - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidWebviewTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/AndroidWebviewTest.cs deleted file mode 100644 index 2addf6dae..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/AndroidWebviewTest.cs +++ /dev/null @@ -1,80 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; - -namespace Appium.Samples -{ - [TestFixture ()] - public class AndroidWebviewTest - { - private AppiumDriver driver; - private bool allPassed = true; - - [TestFixtureSetUp] - public void BeforeAll(){ - DesiredCapabilities capabilities = Env.isSauce () ? - Caps.getAndroid18Caps (Apps.get ("selendroidTestApp")) : - Caps.getAndroid19Caps (Apps.get ("selendroidTestApp")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "android - webview"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - [Test ()] - public void FindElementTestCase () - { - driver.FindElementByName ("buttonStartWebviewCD").Click (); - Thread.Sleep (5000); - if (!Env.isSauce ()) { - // Contexts don't work in android 4.3.3 - var contexts = driver.GetContexts (); - string webviewContext = null; - for (int i = 0; i < contexts.Count; i++) { - Console.WriteLine (contexts [i]); - if (contexts [i].Contains ("WEBVIEW")) { - webviewContext = contexts [i]; - } - } - Assert.IsNotNull (webviewContext); - driver.SetContext (webviewContext); - var el = driver.FindElementById ("name_input"); - el.Clear (); - el.SendKeys ("Appium User"); - el.SendKeys (Keys.Return); - Assert.IsTrue (driver.PageSource.Contains ("This is my way of saying hello")); - Assert.IsTrue (driver.PageSource.Contains ("Appium User")); - } - } - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/AppiumDotNetSample.csproj b/sample-code/examples/dotnet/AppiumDotNetSample/AppiumDotNetSample.csproj deleted file mode 100644 index b159e1cc2..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/AppiumDotNetSample.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - - Debug - AnyCPU - {7A830071-06AC-4E20-9FBB-CAA395387A7C} - Library - AppiumDotNetSample - AppiumDotNetSample - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - - - full - true - bin\Release - prompt - 4 - false - - - - - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - ..\packages\Newtonsoft.Json.6.0.3\lib\net40\Newtonsoft.Json.dll - - - ..\packages\Selenium.WebDriver.2.42.0\lib\net40\WebDriver.dll - - - - ..\packages\Appium.WebDriver.1.0.0\lib\net40\appium-dotnet-driver.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/IosActionsTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/IosActionsTest.cs deleted file mode 100644 index 410d9d7ed..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/IosActionsTest.cs +++ /dev/null @@ -1,89 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; -using OpenQA.Selenium.Appium.Interfaces; -using OpenQA.Selenium.Appium.MultiTouch; - -namespace Appium.Samples -{ - [TestFixture ()] - public class IosActionsTest - { - private AppiumDriver driver; - private bool allPassed = true; - - [TestFixtureSetUp] - public void BeforeAll(){ - DesiredCapabilities capabilities = Caps.getIos71Caps (Apps.get("iosTestApp")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "ios - actions"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - [Test ()] - public void SimpleActionTestCase () - { - IWebElement el = driver.FindElementByAccessibilityId ("ComputeSumButton"); - ITouchAction action = new TouchAction(driver); - action.Press(el, 10, 10).Release(); - action.Perform (); - } - - [Test ()] - public void MultiActionTestCase () - { - IWebElement el = driver.FindElementByAccessibilityId ("ComputeSumButton"); - ITouchAction a1 = new TouchAction(driver); - a1.Tap(el, 10, 10); - ITouchAction a2 = new TouchAction(driver); - a2.Tap(el); - IMultiAction m = new MultiAction (driver); - m.Add (a1).Add (a2); - m.Perform (); - } - - [Test ()] - public void SwipeTestCase () - { - driver.FindElementByName ("Test Gesture").Click (); - Thread.Sleep (1000); - - driver.FindElementByName ("OK").Click (); - Thread.Sleep (1000); - - Point loc = driver.FindElementByXPath ("//UIAMapView[1]").Location; - ITouchAction swipe = Actions.Swipe (driver, loc.X, loc.Y, loc.X + 150, loc.Y, 800); - swipe.Perform (); - } - } -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/IosComplexTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/IosComplexTest.cs deleted file mode 100644 index 0208c70f4..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/IosComplexTest.cs +++ /dev/null @@ -1,211 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; -using OpenQA.Selenium.Appium.Interfaces; -using OpenQA.Selenium.Appium.MultiTouch; -using System.Collections.ObjectModel; - -namespace Appium.Samples -{ - [TestFixture ()] - public class IosComplexTest - { - private AppiumDriver driver; - private bool allPassed = true; - - [TestFixtureSetUp] - public void beforeAll(){ - DesiredCapabilities capabilities = Caps.getIos71Caps (Apps.get("iosUICatalogApp")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "ios - complex"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void afterAll(){ - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - private void ClickMenuItem(string name) - { - IWebElement el; - try { - el = driver.FindElementByName (name); - } catch { - var els = driver.FindElementByClassName ("UIATableView") - .FindElements(By.ClassName ("UIATableCell")); - el = Filters.FirstWithName (els, name); - } - el.Click(); - Thread.Sleep (1000); - } - - [Test ()] - public void PrintNameTestCase () - { - var els = driver.FindElementByClassName ("UIATableView") - .FindElements(By.ClassName ("UIATableCell")); - for (int i = 0; i < els.Count; i++) - { - Console.WriteLine (els [i].GetAttribute ("name")); - } - } - - [Test ()] - public void FindElementTestCase () - { - // first view in UICatalog is a table - var el = driver.FindElementByClassName ("UIATableView"); - Assert.IsNotNull (el); - // check the number of cells/rows inside the table - IList els = el.FindElements (By.ClassName ("UIATableCell")); - els = Filters.FilterDisplayed (els); - Assert.Greater (els.Count, 6); - // various checks - Assert.IsNotNull (els[0].GetAttribute("name")); - Assert.IsNotNull (driver.FindElementByClassName ("UIANavigationBar")); - } - - [Test ()] - public void SwitchContextTestCase () - { - ClickMenuItem ("Web View, AAPLWebViewController"); - // get the contexts and switch to webview - Assert.AreEqual(driver.GetContexts(), - new List {"NATIVE_APP", "WEBVIEW_1"}); - driver.SetContext ("WEBVIEW_1"); - // find the store link - Thread.Sleep (1000); - Assert.IsNotNull(driver.FindElementById ("gn-apple")); - // leave the webview - driver.SetContext ("NATIVE_APP"); - //Verify we are out of the webview - Assert.IsNotNull(driver.FindElementByClassName ("UIAScrollView")); - - driver.Navigate().Back (); - } - - [Test ()] - public void LocationTestCase () - { - IList els = driver.FindElementsByClassName ("UIATableCell"); - els = Filters.FilterDisplayed (els); - var loc = els [2].Location; - Assert.AreEqual (loc.X, 0); - Assert.Greater (loc.Y, 100); - } - - [Test ()] - public void ScreenshotTestCase () - { - Screenshot screenshot = driver.GetScreenshot (); - Assert.IsNotNull (screenshot); - } - - [Test ()] - public void EditTextFieldTestCase () - { - ClickMenuItem ("Text Fields, AAPLTextFieldViewController"); - // get the field and the default/empty text - var el = driver.FindElementByClassName ("UIATextField"); - var defaultValue = el.GetAttribute ("value"); - // type something - el.SendKeys ("1234 appium"); - Assert.AreEqual(el.GetAttribute("value"), "1234 appium"); - driver.FindElementByName ("Done").Click(); - Thread.Sleep (1000); - el.Clear (); - Assert.AreEqual(el.GetAttribute("value"), defaultValue); - - driver.Navigate().Back (); - } - - [Test ()] - public void AlertTestCase () - { - ClickMenuItem ("Alert Views, AAPLAlertViewController"); - { - // trigger simple alert - driver.FindElementByName ("Simple").Click (); - IAlert alert = driver.SwitchTo ().Alert (); - Assert.IsTrue (alert.Text.Contains ("A Short Title Is Best")); - alert.Dismiss (); - } - { - // trigger modal alert with cancel & ok buttons - driver.FindElementByName ("Okay / Cancel").Click (); - IAlert alert = driver.SwitchTo ().Alert (); - Assert.IsTrue (alert.Text.Contains ("A Short Title Is Best")); - alert.Accept (); - } - - driver.Navigate().Back (); - } - - [Test ()] - public void SliderTestCase () - { - ClickMenuItem ("Sliders, AAPLSliderViewController"); - // retrieve slider, check initial value - var slider = (AppiumWebElement) driver.FindElementByClassName ("UIASlider"); - Assert.AreEqual (slider.GetAttribute("value"), "42%"); - // change value - slider.SetImmediateValue ("0%"); - Assert.AreEqual (slider.GetAttribute("value"), "0%"); - - driver.Navigate().Back (); - } - - [Test ()] - public void ElementSizeTestCase () - { - var s1 = driver.FindElementByClassName ("UIATableView").Size; - var s2 = driver.FindElementByClassName ("UIATableCell").Size; - Assert.AreEqual (s1.Width, s2.Width); - Assert.AreNotEqual (s1.Height, s2.Height); - } - - [Test ()] - public void SourceTestCase () - { - // main menu source - var mainMenuSource = driver.PageSource; - Assert.IsTrue (mainMenuSource.Contains("UIAStaticText")); - Assert.IsTrue (mainMenuSource.Contains("Text Fields")); - // text fields section source - ClickMenuItem ("Text Fields, AAPLTextFieldViewController"); - var textFieldSectionSource = driver.PageSource; - Assert.IsTrue (textFieldSectionSource.Contains("UIAStaticText")); - Assert.IsTrue (textFieldSectionSource.Contains("Text Fields")); - Assert.AreNotEqual (textFieldSectionSource, mainMenuSource); - - driver.Navigate().Back (); - } - - } -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/IosLocalServerTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/IosLocalServerTest.cs deleted file mode 100644 index 7e236155a..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/IosLocalServerTest.cs +++ /dev/null @@ -1,70 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; -using OpenQA.Selenium.Appium.Interfaces; -using OpenQA.Selenium.Appium.MultiTouch; - -namespace Appium.Samples -{ - [TestFixture ()] - public class IosLocalServerTest - { - private AppiumDriver driver; - private bool allPassed = true; - LocalServer server = new LocalServer (3000); - - [TestFixtureSetUp] - public void BeforeAll(){ - server.Start (); - DesiredCapabilities capabilities = Caps.getIos71Caps (Apps.get("iosWebviewAppLocal")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "ios - local server"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - server.Stop (); - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - [Test ()] - public void GetPageTestCase () - { - driver.FindElementByXPath("//UIATextField[@value='Enter URL']") - .SendKeys("http://localhost:3000/index.html"); - driver.FindElementByName ("Go").Click (); - driver.FindElementByClassName ("UIAWebView").Click (); // dismissing keyboard - Thread.Sleep (3000); - driver.SetContext ("WEBVIEW"); - Thread.Sleep (1000); - var wowEl = driver.FindElementById ("wow"); - Assert.IsTrue (wowEl.Text.Contains("so cool")); - } - } -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/IosSimpleTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/IosSimpleTest.cs deleted file mode 100644 index 24ad57b7e..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/IosSimpleTest.cs +++ /dev/null @@ -1,83 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; - -namespace Appium.Samples -{ - [TestFixture ()] - public class IosSimpleTest - { - private AppiumDriver driver; - private bool allPassed = true; - - private Random rnd = new Random(); - - [TestFixtureSetUp] - public void BeforeAll(){ - DesiredCapabilities capabilities = Caps.getIos71Caps (Apps.get("iosTestApp")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "ios - simple"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - private int Populate() { - IList fields = new List (); - fields.Add ("IntegerA"); - fields.Add ("IntegerB"); - int sum = 0; - for (int i = 0; i < fields.Count; i++) { - IWebElement el = driver.FindElementByName (fields[i]); - int x = rnd.Next (1, 10); - el.SendKeys("" + x); - sum += x; - } - return sum; - } - - [Test ()] - public void ComputeSumTestCase () - { - // fill form with random data - int sumIn = Populate (); - - // compute and check the sum - driver.FindElementByAccessibilityId ("ComputeSumButton").Click (); - Thread.Sleep (1000); - IWebElement sumEl = driver.FindElementByIosUIAutomation ("elements().withName(\"Answer\");"); - int sumOut = Convert.ToInt32 (sumEl.Text); - Assert.AreEqual (sumIn, sumOut); - } - - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/IosWebviewTest.cs b/sample-code/examples/dotnet/AppiumDotNetSample/IosWebviewTest.cs deleted file mode 100644 index 0dcd340a1..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/IosWebviewTest.cs +++ /dev/null @@ -1,69 +0,0 @@ -using NUnit.Framework; -using System; -using Appium.Samples.Helpers; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Remote; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Threading; -using System.Drawing; -using OpenQA.Selenium.Appium.Interfaces; -using OpenQA.Selenium.Appium.MultiTouch; - -namespace Appium.Samples -{ - [TestFixture ()] - public class IosWebviewTest - { - private AppiumDriver driver; - private bool allPassed = true; - - [TestFixtureSetUp] - public void BeforeAll(){ - DesiredCapabilities capabilities = Caps.getIos71Caps (Apps.get("iosWebviewApp")); - if (Env.isSauce ()) { - capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME")); - capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY")); - capabilities.SetCapability("name", "ios - webview"); - capabilities.SetCapability("tags", new string[]{"sample"}); - } - Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.localURI; - driver = new AppiumDriver(serverUri, capabilities, Env.INIT_TIMEOUT_SEC); - driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC); - } - - [TestFixtureTearDown] - public void AfterAll(){ - try - { - if(Env.isSauce()) - ((IJavaScriptExecutor)driver).ExecuteScript("sauce:job-result=" + (allPassed ? "passed" : "failed")); - } - finally - { - driver.Quit(); - } - } - - [TearDown] - public void AfterEach(){ - allPassed = allPassed && (TestContext.CurrentContext.Result.State == TestState.Success); - } - - [Test ()] - public void GetPageTestCase () - { - driver.FindElementByXPath("//UIATextField[@value='Enter URL']") - .SendKeys("https://www.google.com"); - driver.FindElementByName ("Go").Click (); - driver.FindElementByClassName ("UIAWebView").Click (); // dismissing keyboard - driver.SetContext ("WEBVIEW"); - Thread.Sleep (3000); - var el = driver.FindElementByName ("q"); - el.SendKeys ("sauce labs"); - el.SendKeys(Keys.Return); - Thread.Sleep (1000); - Assert.IsTrue (driver.Title.Contains("sauce labs")); - } - } -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/env.json.sample b/sample-code/examples/dotnet/AppiumDotNetSample/env.json.sample deleted file mode 100644 index 0f5b2ab96..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/env.json.sample +++ /dev/null @@ -1,6 +0,0 @@ -{ - "DEV": false, - "SAUCE": false, - "SAUCE_USERNAME": "", - "SAUCE_ACCESS_KEY": "" -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Actions.cs b/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Actions.cs deleted file mode 100644 index 505da024a..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Actions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Appium.MultiTouch; -using OpenQA.Selenium.Appium.Interfaces; - -namespace Appium.Samples.Helpers -{ - public class Actions - { - public static ITouchAction Swipe(AppiumDriver driver, int startX, int startY, int endX, int endY, - int duration) { - ITouchAction touchAction = new TouchAction(driver) - .Press (startX, startY) - .Wait (duration) - .MoveTo (endX, endY) - .Release (); - return touchAction; - } - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/AppiumServers.cs b/sample-code/examples/dotnet/AppiumDotNetSample/helpers/AppiumServers.cs deleted file mode 100644 index 1010ab0d4..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/AppiumServers.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Appium.Samples.Helpers -{ - public class AppiumServers - { - public static Uri localURI = new Uri("http://127.0.0.1:4723/wd/hub"); - public static Uri sauceURI = new Uri("http://ondemand.saucelabs.com:80/wd/hub"); - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Apps.cs b/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Apps.cs deleted file mode 100644 index cf9cd9815..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Apps.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Appium.Samples.Helpers -{ - public class Apps - { - static Dictionary DEV = new Dictionary { - { "iosTestApp", "sample-code/apps/TestApp/build/Release-iphonesimulator/TestApp.app" }, - { "iosWebviewApp", "sample-code/apps/WebViewApp/build/Release-iphonesimulator/WebViewApp.app" }, - { "iosUICatalogApp", "sample-code/apps/UICatalog/build/Release-iphonesimulator/UICatalog.app" }, - { "androidApiDemos", "sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk" }, - { "selendroidTestApp", "sample-code/apps/selendroid-test-app.apk" }, - { "iosWebviewAppLocal", "sample-code/apps/WebViewApp/build/Release-iphonesimulator/WebViewApp.app" }, - { "androidApiDemosLocal", "sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk" } - }; - - static Dictionary DEFAULT = new Dictionary { - { "iosTestApp", "http://appium.github.io/appium/assets/TestApp7.1.app.zip" }, - { "iosWebviewApp", "http://appium.github.io/appium/assets/WebViewApp7.1.app.zip" }, - { "iosUICatalogApp", "http://appium.github.io/appium/assets/UICatalog7.1.app.zip" }, - { "androidApiDemos", "http://appium.github.io/appium/assets/ApiDemos-debug.apk" }, - { "selendroidTestApp", "http://appium.github.io/appium/assets/selendroid-test-app-0.10.0.apk" }, - { "iosWebviewAppLocal", "http://localhost:3000/WebViewApp7.1.app.zip" }, - { "androidApiDemosLocal", "http://localhost:3001/ApiDemos-debug.apk" } - }; - - public static string get(string appKey) { - if (Env.isDev()) { - return DEV[appKey]; - } else { - return DEFAULT[appKey]; - } - } - } -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Caps.cs b/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Caps.cs deleted file mode 100644 index edc5b337f..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Caps.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using OpenQA.Selenium.Remote; - -namespace Appium.Samples.Helpers -{ - public class Caps - { - public static DesiredCapabilities getIos71Caps (string app) { - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.SetCapability("browserName", ""); - capabilities.SetCapability("appium-version", "1.0"); - capabilities.SetCapability("platformName", "iOS"); - capabilities.SetCapability("platformVersion", "7.1"); - capabilities.SetCapability("deviceName", "iPhone Simulator"); - capabilities.SetCapability("app", app); - return capabilities; - } - - public static DesiredCapabilities getAndroid18Caps (string app) { - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.SetCapability("browserName", ""); - capabilities.SetCapability("appium-version", "1.0"); - capabilities.SetCapability("platformName", "Android"); - capabilities.SetCapability("platformVersion", "4.3"); - capabilities.SetCapability("deviceName", "Android Emulator"); - capabilities.SetCapability("app", app); - return capabilities; - } - - public static DesiredCapabilities getAndroid19Caps (string app) { - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.SetCapability("browserName", ""); - capabilities.SetCapability("appium-version", "1.0"); - capabilities.SetCapability("platformName", "Android"); - capabilities.SetCapability("platformVersion", "4.4.2"); - capabilities.SetCapability("deviceName", "Android Emulator"); - capabilities.SetCapability("app", app); - return capabilities; - } - - public static DesiredCapabilities getSelendroid16Caps (string app) { - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.SetCapability("browserName", ""); - capabilities.SetCapability("appium-version", "1.0"); - capabilities.SetCapability("platformName", "Android"); - capabilities.SetCapability("platformVersion", "4.1"); - capabilities.SetCapability("automationName", "selendroid"); - capabilities.SetCapability("deviceName", "Android Emulator"); - capabilities.SetCapability("app", app); - return capabilities; - } - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Env.cs b/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Env.cs deleted file mode 100644 index 06ee0fc8a..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Env.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Appium.MultiTouch; -using OpenQA.Selenium.Appium.Interfaces; -using System.IO; -using System.Reflection; -using System.Web.Script.Serialization; - -namespace Appium.Samples.Helpers -{ - public class Env - { - public static TimeSpan INIT_TIMEOUT_SEC = TimeSpan.FromSeconds(180); - public static TimeSpan IMPLICIT_TIMEOUT_SEC = TimeSpan.FromSeconds(5); - public static string ASSETS_ROOT_DIR = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory + - "../../../assets"); - public static string APPIUM_ASSETS_ROOT_DIR = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory + - "../../../../../../assets"); - - private static Dictionary env; - private static bool initialized = false; - private static void Init() { - try { - if(!initialized) - { - initialized = true; - string path = AppDomain.CurrentDomain.BaseDirectory + "../../"; - StreamReader sr = new StreamReader(path + "env.json"); - string jsonString = sr.ReadToEnd(); - JavaScriptSerializer ser = new JavaScriptSerializer(); - env = ser.Deserialize>(jsonString); - } - } catch { - env = new Dictionary (); - } - } - - private static bool isTrue(string val) { - if (val != null) { - val = val.ToLower ().Trim (); - } - return (val == "true") || (val == "1"); - } - - static public bool isSauce() { - Init (); - return (env.ContainsKey("SAUCE") && isTrue(env["SAUCE"])) || isTrue( Environment.GetEnvironmentVariable ("SAUCE") ); - } - - static public bool isDev() { - Init (); - return (env.ContainsKey("DEV") && isTrue(env["DEV"])) || isTrue( Environment.GetEnvironmentVariable ("DEV") ); - } - - static public string getEnvVar(string name){ - if (env.ContainsKey(name) && (env [name] != null)) { - return env [name]; - } else { - return Environment.GetEnvironmentVariable (name); - } - } - } -} - diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Filters.cs b/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Filters.cs deleted file mode 100644 index 16903b181..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/Filters.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using OpenQA.Selenium; -using System.Collections; - -namespace Appium.Samples.Helpers -{ - public class Filters - { - public static IWebElement FirstWithName(IList els, string name) - { - for (int i = 0; i < els.Count; i++) - { - if (els [i].GetAttribute ("name") == name) { - return els[i]; - } - } - return null; - } - - public static IList FilterWithName(IList els, string name) - { - var res = new List (); - for (int i = 0; i < els.Count; i++) - { - if (els [i].GetAttribute ("name") == name) { - res.Add(els [i]); - } - } - return res; - } - - public static IList FilterDisplayed(IList els) - { - var res = new List (); - for (int i = 0; i < els.Count; i++) - { - IWebElement el = els [i]; - if (els [i].Displayed ) { - res.Add(els [i]); - } - } - return res; - } - - } -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/LocalServer.cs b/sample-code/examples/dotnet/AppiumDotNetSample/helpers/LocalServer.cs deleted file mode 100644 index edf6c6650..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/helpers/LocalServer.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Threading; -using System.IO; -using Appium.Samples.Helpers; - -namespace Appium.Samples.Helpers -{ - public class LocalServer - { - private Thread listenThread; - private HttpListener httpListener; - private bool listening; - private string listenBaseAddress; - - public LocalServer (int port) - { - listenBaseAddress = "http://localhost:" + port; - } - - public void Start() { - httpListener = new HttpListener(); - httpListener.Prefixes.Add(new Uri(listenBaseAddress).ToString()); - httpListener.Start(); - listening = true; - - listenThread = new Thread(Listen); - listenThread.Start(); - listenThread.IsBackground = true; - } - - public void Stop() { - listening = false; - } - - private void Process(HttpListenerContext context) - { - string filename = context.Request.Url.AbsolutePath; - filename = filename.Substring(1); - if (string.IsNullOrEmpty(filename)) - filename = "index.html"; - if(filename == "index.html") { - filename = Path.Combine(Env.ASSETS_ROOT_DIR, filename); - } else { - filename = Path.Combine(Env.APPIUM_ASSETS_ROOT_DIR, filename); - } - - try { - Stream input = new FileStream(filename, FileMode.Open); - byte[] buffer = new byte[1024*16]; - int nbytes; - while ((nbytes = input.Read(buffer, 0, buffer.Length)) > 0) - context.Response.OutputStream.Write(buffer, 0, nbytes); - input.Close(); - - } catch (System.IO.FileNotFoundException) { - } - context.Response.OutputStream.Close(); - } - - private void Listen() { - while (httpListener.IsListening && listening) { - - HttpListenerContext context; - try { - context = httpListener.GetContext(); - string httpMethod = context.Request.HttpMethod; - string rawUrl = context.Request.RawUrl; - Console.WriteLine("Processing call to {0} {1}", httpMethod, rawUrl); - Process (context); - } catch (HttpListenerException e) { - Console.Error.WriteLine(e.Message); - Console.Error.WriteLine(e.StackTrace); - continue; - } - } - } - } -} diff --git a/sample-code/examples/dotnet/AppiumDotNetSample/packages.config b/sample-code/examples/dotnet/AppiumDotNetSample/packages.config deleted file mode 100644 index d353f007e..000000000 --- a/sample-code/examples/dotnet/AppiumDotNetSample/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/sample-code/examples/dotnet/README.md b/sample-code/examples/dotnet/README.md deleted file mode 100644 index 8c888608d..000000000 --- a/sample-code/examples/dotnet/README.md +++ /dev/null @@ -1,22 +0,0 @@ -#Appium DotNet samples - -## Run locally - -### Download apps (default) - -- Start Appium. -- Run the tests in NUnit. - -### Use Appium dev apps - -- Build dev version of appium `./reset.sh --android --ios --dev --hardcore` -- `cp AppiumDotNetSample/env.json.sample AppiumDotNetSample/env.json` -- Update `AppiumDotNetSample/env.json` set DEV=true -- Start appium: `node .` -- Run the tests in NUnit. - -## Run on Sauce Labs - -- `cp AppiumDotNetSample/env.json.sample AppiumDotNetSample/env.json` -- Update `AppiumDotNetSample/env.json` set SAUCE=true, and configure your Sauce credentials. -- Run the tests in NUnit. diff --git a/sample-code/examples/dotnet/assets/index.html b/sample-code/examples/dotnet/assets/index.html deleted file mode 100644 index a891d2cf9..000000000 --- a/sample-code/examples/dotnet/assets/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - Appium Rocks - - - -

Appium Rocks

- -
-

- Wow this is so cool! -

-
- - - diff --git a/sample-code/examples/java/junit/.settings/org.eclipse.jdt.core.prefs b/sample-code/examples/java/junit/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index d4c4413f6..000000000 --- a/sample-code/examples/java/junit/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,292 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=true -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=2 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=80 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/sample-code/examples/java/junit/.settings/org.eclipse.jdt.ui.prefs b/sample-code/examples/java/junit/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index cd5e9444d..000000000 --- a/sample-code/examples/java/junit/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,109 +0,0 @@ -cleanup.add_default_serial_version_id=false -cleanup.add_generated_serial_version_id=true -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=true -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_to_enhanced_for_loop=true -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=true -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=true -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=true -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=true -cleanup.sort_members_all=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup_profile=_appium_cleanup -cleanup_settings_version=2 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_appium_format -formatter_settings_version=12 -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=true -sp_cleanup.correct_indentation=true -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=false -sp_cleanup.make_local_variable_final=true -sp_cleanup.make_parameters_final=true -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=true -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=true -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=true -sp_cleanup.remove_unused_imports=true -sp_cleanup.remove_unused_local_variables=true -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=true -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=true -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=true -sp_cleanup.use_this_for_non_static_field_access=true -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=true -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/sample-code/examples/java/junit/.settings/org.eclipse.m2e.core.prefs b/sample-code/examples/java/junit/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1c..000000000 --- a/sample-code/examples/java/junit/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/sample-code/examples/java/junit/README.md b/sample-code/examples/java/junit/README.md deleted file mode 100644 index 2a10e5de4..000000000 --- a/sample-code/examples/java/junit/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Sample Appium JUnit project ---- - -This contains the source code for running sample [Appium](http://github.com/appium/appium) tests using [JUnit](http://www.junit.org). - -In order to run the tests, you will need to install [Apache Maven](http://maven.apache.org), and Appium (according to the Appium [installation instructions](https://github.com/appium/appium). - -You will then need to start appium, eg: - - appium - -To compile and run all tests, run: - - mvn test - -To run a single test, run: - - mvn -Dtest=com.saucelabs.appium.SimpleTest test diff --git a/sample-code/examples/java/junit/pom.xml b/sample-code/examples/java/junit/pom.xml deleted file mode 100644 index 82b2110c6..000000000 --- a/sample-code/examples/java/junit/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 4.0.0 - com.saucelabs - sauce_appium_junit - 0.0.1-SNAPSHOT - sauce_appium_junit - Sample Appium tests using JUnit - - - junit - junit - 4.11 - test - - - org.seleniumhq.selenium - selenium-java - LATEST - test - - - io.appium - java-client - 1.2.1 - - - com.googlecode.json-simple - json-simple - 1.1 - test - - - commons-lang - commons-lang - 2.6 - test - - - - com.saucelabs - sauce_junit - 1.0.18 - test - - - com.google.code.gson - gson - 2.2.4 - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - maven-compiler-plugin - - 1.5 - 1.5 - - - - - - - - saucelabs-repository - https://repository-saucelabs.forge.cloudbees.com/release - - true - - - true - - - - - - \ No newline at end of file diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidContactsTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidContactsTest.java deleted file mode 100644 index 7957ab3fb..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidContactsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.saucelabs.appium; - -import io.appium.java_client.AppiumDriver; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.CapabilityType; -import org.openqa.selenium.remote.DesiredCapabilities; - -import java.io.File; -import java.net.URL; -import java.util.List; - -public class AndroidContactsTest { - private AppiumDriver driver; - - @Before - public void setUp() throws Exception { - // set up appium - File classpathRoot = new File(System.getProperty("user.dir")); - File appDir = new File(classpathRoot, "../../../apps/ContactManager"); - File app = new File(appDir, "ContactManager.apk"); - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); - capabilities.setCapability("platformName", "Android"); - capabilities.setCapability("deviceName","Android Emulator"); - capabilities.setCapability("platformVersion", "4.4"); - capabilities.setCapability("app", app.getAbsolutePath()); - capabilities.setCapability("appPackage", "com.example.android.contactmanager"); - capabilities.setCapability("appActivity", ".ContactManager"); - driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } - - @Test - public void addContact(){ - WebElement el = driver.findElement(By.name("Add Contact")); - el.click(); - List textFieldsList = driver.findElementsByClassName("android.widget.EditText"); - textFieldsList.get(0).sendKeys("Some Name"); - textFieldsList.get(2).sendKeys("Some@example.com"); - driver.swipe(100, 500, 100, 100, 2); - driver.findElementByName("Save").click(); - } - -} diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidTest.java deleted file mode 100644 index 29afc8eb8..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.saucelabs.appium; - -import io.appium.java_client.AppiumDriver; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.CapabilityType; -import org.openqa.selenium.remote.DesiredCapabilities; - -import java.io.File; -import java.net.URL; -import java.util.List; - -import static org.junit.Assert.assertEquals; - -public class AndroidTest { - - private AppiumDriver driver; - - @Before - public void setUp() throws Exception { - File classpathRoot = new File(System.getProperty("user.dir")); - File appDir = new File(classpathRoot, "../../../apps/ApiDemos/bin"); - File app = new File(appDir, "ApiDemos-debug.apk"); - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); - capabilities.setCapability("deviceName","Android Emulator"); - capabilities.setCapability("platformVersion", "4.4"); - capabilities.setCapability("platformName","Android"); - capabilities.setCapability("app", app.getAbsolutePath()); - capabilities.setCapability("appPackage", "com.example.android.apis"); - capabilities.setCapability("appActivity", ".ApiDemos"); - driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } - - @Test - public void apiDemo(){ - WebElement el = driver.findElement(By.name("Animation")); - assertEquals("Animation", el.getText()); - el = driver.findElementByClassName("android.widget.TextView"); - assertEquals("API Demos", el.getText()); - el = driver.findElement(By.name("App")); - el.click(); - List els = driver.findElementsByClassName("android.widget.TextView"); - assertEquals("Activity", els.get(2).getText()); - } - -} diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidWebViewTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidWebViewTest.java deleted file mode 100644 index ccc1a7b4c..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/AndroidWebViewTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.saucelabs.appium; - -import io.appium.java_client.AppiumDriver; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.CapabilityType; -import org.openqa.selenium.remote.DesiredCapabilities; - -import java.io.File; -import java.net.URL; -import java.util.Set; - -public class AndroidWebViewTest { - private AppiumDriver driver; - - @Before - public void setUp() throws Exception { - // set up appium - File classpathRoot = new File(System.getProperty("user.dir")); - File app = new File(classpathRoot, "../../../apps/selendroid-test-app.apk"); - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); - capabilities.setCapability("automationName","Selendroid"); - capabilities.setCapability("platformName", "Android"); - capabilities.setCapability("app", app.getAbsolutePath()); - capabilities.setCapability("appPackage", "io.selendroid.testapp"); - capabilities.setCapability("appActivity", ".HomeScreenActivity"); - driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); - } - @After - public void tearDown() throws Exception { - driver.quit(); - } - - @Test - public void webView() throws InterruptedException { - WebElement button = driver.findElement(By.id("buttonStartWebview")); - button.click(); - Thread.sleep(6000); - Set contextNames = driver.getContextHandles(); - for (String contextName : contextNames) { - System.out.println(contextName); - if (contextName.contains("WEBVIEW")){ - driver.context(contextName); - } - } - WebElement inputField = driver.findElement(By.id("name_input")); - inputField.sendKeys("Some name"); - inputField.submit(); - } - -} diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/MobileFindJavaTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/MobileFindJavaTest.java deleted file mode 100644 index 3bc8adb40..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/MobileFindJavaTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.saucelabs.appium; - -import com.google.gson.JsonParser; -import io.appium.java_client.AppiumDriver; -import org.apache.http.client.HttpClient; -import org.apache.http.impl.client.HttpClients; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.remote.CapabilityType; -import org.openqa.selenium.remote.DesiredCapabilities; - -import java.net.URL; - -public class MobileFindJavaTest { - - private AppiumDriver driver; - private static final String url = "http://127.0.0.1:4723/wd/hub"; - private static final HttpClient client = HttpClients.createDefault(); - private static final JsonParser parser = new JsonParser(); - - @Test - public void apiDemo() throws Exception { - driver.scrollTo("about phone"); - driver.scrollTo("bluetooth"); - } - - - @Before - public void setUp() throws Exception { - final DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); - capabilities.setCapability("deviceName", "Android Emulator"); - capabilities.setCapability("platformName", "Android"); - capabilities.setCapability("appPackage", "com.android.settings"); - capabilities.setCapability("appActivity", ".Settings"); - driver = new AppiumDriver(new URL(url), capabilities); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } -} \ No newline at end of file diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SafariTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SafariTest.java deleted file mode 100644 index deb046ee3..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SafariTest.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.saucelabs.appium; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.remote.RemoteWebDriver; - -import java.net.URL; - -import static org.junit.Assert.*; - -/** - * - * Simple test which demonstrates how a test can be run against Mobile Safari running on an Appium instance. - * - * The test is based on https://github.com/appium/appium/blob/master/sample-code/examples/node/safari.js - * - * @author Ross Rowe - */ -public class SafariTest { - - private WebDriver driver; - - /** - * Instantiates the {@link #driver} instance by using DesiredCapabilities which specify the - * 'iPhone Simulator' device and 'safari' app. - * @throws Exception - */ - @Before - public void setUp() throws Exception { - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability("deviceName", "iPhone Simulator"); - capabilities.setCapability("platformName", "iOS"); - capabilities.setCapability("platformVersion", "7.1"); - capabilities.setCapability("browserName", "safari"); - driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), - capabilities); - //driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); - } - - /** - * Navigates to http://saucelabs.com/test/guinea-pig and interacts with the browser. - * - * @throws Exception - */ - @Test - public void runTest() throws Exception { - driver.get("http://saucelabs.com/test/guinea-pig"); - Thread.sleep(1000); - WebElement idElement = driver.findElement(By.id("i_am_an_id")); - assertNotNull(idElement); - assertEquals("I am a div", idElement.getText()); - WebElement commentElement = driver.findElement(By.id("comments")); - assertNotNull(commentElement); - commentElement.sendKeys("This is an awesome comment"); - WebElement submitElement = driver.findElement(By.id("submit")); - assertNotNull(submitElement); - submitElement.click(); - Thread.sleep(7000); - WebElement yourCommentsElement = driver.findElement(By.id("your_comments")); - assertNotNull(yourCommentsElement); - assertTrue(driver.findElement(By.id("your_comments")).getText().contains("This is an awesome comment")); - - System.out.println(driver.getCurrentUrl()); - } - - /** - * Closes the {@link #driver} instance. - * - * @throws Exception - */ - @After - public void tearDown() throws Exception { - driver.quit(); - } -} diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SauceTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SauceTest.java deleted file mode 100644 index bcd434a85..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SauceTest.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.saucelabs.appium; - -import com.saucelabs.common.SauceOnDemandAuthentication; -import com.saucelabs.common.SauceOnDemandSessionIdProvider; -import com.saucelabs.junit.SauceOnDemandTestWatcher; -import io.appium.java_client.AppiumDriver; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.CapabilityType; -import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.remote.RemoteWebDriver; - -import java.net.URL; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import static org.junit.Assert.assertEquals; - -/** - * Simple test which demonstrates how to run an Appium - * using Sauce Labs. - * - * This test also includes the Sauce JUnit helper classes, which will use the Sauce REST API to mark the Sauce Job as passed/failed. - * - * In order to use the {@link SauceOnDemandTestWatcher}, the test must implement the {@link SauceOnDemandSessionIdProvider} interface. - * - *

- * The test relies on SAUCE_USER_NAME and SAUCE_ACCESS_KEY environment variables being set which reference - * the Sauce username/access key. - * - * @author Ross Rowe - */ -public class SauceTest implements SauceOnDemandSessionIdProvider { - - private AppiumDriver driver; - - private List values; - - private static final int MINIMUM = 0; - private static final int MAXIMUM = 10; - - private String sessionId; - - /** - * Constructs a {@link SauceOnDemandAuthentication} instance using the supplied user name/access key. To use the authentication - * supplied by environment variables or from an external file, use the no-arg {@link SauceOnDemandAuthentication} constructor. - */ - public SauceOnDemandAuthentication authentication = new SauceOnDemandAuthentication(); - - /** - * JUnit Rule which will mark the Sauce Job as passed/failed when the test succeeds or fails. - */ - public @Rule - SauceOnDemandTestWatcher resultReportingTestWatcher = new SauceOnDemandTestWatcher(this, authentication); - - /** - * Sets up appium. You will need to either explictly set the sauce username/access key variables, or set - * SAUCE_USER_NAME or SAUCE_USER_NAME environment variables to reference your Sauce account details. - * - * @throws Exception - */ - @Before - public void setUp() throws Exception { - String sauceUserName = authentication.getUsername(); - String sauceAccessKey = authentication.getAccessKey(); - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); - capabilities.setCapability("platformVersion", "6.0"); - capabilities.setCapability("deviceName", "iPhone Simulator"); - capabilities.setCapability("platformName", "iOS"); - capabilities.setCapability("appium-version", "1.0.0"); - capabilities.setCapability("app", "http://appium.s3.amazonaws.com/TestApp6.0.app.zip"); - - driver = new AppiumDriver(new URL(MessageFormat.format("http://{0}:{1}@ondemand.saucelabs.com:80/wd/hub", sauceUserName, sauceAccessKey)), - capabilities); - this.sessionId = ((RemoteWebDriver) driver).getSessionId().toString(); - values = new ArrayList(); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } - - private void populate() { - //populate text fields with two random number - List elems = driver.findElementsByClassName("UIATextField"); - Random random = new Random(); - for (WebElement elem : elems) { - int rndNum = random.nextInt(MAXIMUM - MINIMUM + 1) + MINIMUM; - elem.sendKeys(String.valueOf(rndNum)); - values.add(rndNum); - } - } - - @Test - public void testUIComputation() throws Exception { - - // populate text fields with values - populate(); - // trigger computation by using the button - WebElement button = driver.findElementByClassName("UIAButton"); - button.click(); - // is sum equal ? - WebElement texts = driver.findElementByClassName("UIAStaticText"); - assertEquals(String.valueOf(values.get(0) + values.get(1)), texts.getText()); - } - - public String getSessionId() { - return sessionId; - } -} diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SimpleTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SimpleTest.java deleted file mode 100644 index bcde8223c..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/SimpleTest.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.saucelabs.appium; - -import io.appium.java_client.AppiumDriver; -import io.appium.java_client.MobileBy; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.*; -import org.openqa.selenium.remote.CapabilityType; -import org.openqa.selenium.remote.DesiredCapabilities; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -/** - * Simple Appium test which runs against a local Appium instance deployed - * with the 'TestApp' iPhone project which is included in the Appium source distribution. - * - * @author Ross Rowe - */ -public class SimpleTest { - - private AppiumDriver driver; - - private List values; - - private static final int MINIMUM = 0; - private static final int MAXIMUM = 10; - - @Before - public void setUp() throws Exception { - // set up appium - File appDir = new File(System.getProperty("user.dir"), "../../../apps/TestApp/build/Release-iphonesimulator"); - File app = new File(appDir, "TestApp.app"); - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); - capabilities.setCapability("platformVersion", "7.1"); - capabilities.setCapability("platformName", "iOS"); - capabilities.setCapability("deviceName", "iPhone Simulator"); - capabilities.setCapability("app", app.getAbsolutePath()); - driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); - values = new ArrayList(); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } - - private void populate() { - //populate text fields with two random number - List elems = driver.findElements(By.className("UIATextField")); - Random random = new Random(); - for (WebElement elem : elems) { - int rndNum = random.nextInt(MAXIMUM - MINIMUM + 1) + MINIMUM; - elem.sendKeys(String.valueOf(rndNum)); - values.add(rndNum); - } - } - - private Point getCenter(WebElement element) { - - Point upperLeft = element.getLocation(); - Dimension dimensions = element.getSize(); - return new Point(upperLeft.getX() + dimensions.getWidth()/2, upperLeft.getY() + dimensions.getHeight()/2); - } - - @Test - public void testUIComputation() throws Exception { - // populate text fields with values - populate(); - // trigger computation by using the button - WebElement button = driver.findElement(By.className("UIAButton")); - button.click(); - // is sum equal ? - WebElement texts = driver.findElement(By.className("UIAStaticText")); - assertEquals(String.valueOf(values.get(0) + values.get(1)), texts.getText()); - } - - @Test - public void testActive() throws Exception { - WebElement text = driver.findElement(By.xpath("//UIATextField[1]")); - assertTrue(text.isDisplayed()); - - WebElement button = driver.findElement(By.xpath("//UIAButton[1]")); - assertTrue(button.isDisplayed()); - } - - @Test - public void testBasicAlert() throws Exception { - driver.findElement(By.xpath("//UIAButton[2]")).click(); - - Alert alert = driver.switchTo().alert(); - //check if title of alert is correct - assertEquals("Cool title this alert is so cool.", alert.getText()); - alert.accept(); - } - - @Test - public void testBasicButton() throws Exception { - WebElement button = driver.findElement(By.xpath("//UIAButton[1]")); - assertEquals("ComputeSumButton", button.getText()); - } - - @Test - public void testClear() throws Exception { - WebElement text = driver.findElement(By.xpath("//UIATextField[1]")); - text.sendKeys("12"); - text.clear(); - - assertEquals("", text.getText()); - } - - @Test - public void testHideKeyboard() throws Exception { - driver.findElement(By.xpath("//UIATextField[1]")).sendKeys("12"); - - WebElement button = driver.findElement(MobileBy.AccessibilityId("Done")); - assertTrue(button.isDisplayed()); - - button.click(); - } - - @Test - public void testFindElementByClassName() throws Exception { - Random random = new Random(); - - WebElement text = driver.findElementByClassName("UIATextField"); - int number = random.nextInt(MAXIMUM - MINIMUM + 1) + MINIMUM; - text.sendKeys(String.valueOf(number)); - - driver.findElementByClassName("UIAButton").click(); - - // is sum equal ? - WebElement sumLabel = driver.findElementByClassName("UIAStaticText"); - assertEquals(String.valueOf(number), sumLabel.getText()); - } - - @Test - public void testFindElementsByClassName() throws Exception { - Random random = new Random(); - - WebElement text = driver.findElementsByClassName("UIATextField").get(1); - int number = random.nextInt(MAXIMUM - MINIMUM + 1) + MINIMUM; - text.sendKeys(String.valueOf(number)); - - driver.findElementByClassName("UIAButton").click(); - - // is sum equal ? - WebElement sumLabel = driver.findElementsByClassName("UIAStaticText").get(0); - assertEquals(String.valueOf(number), sumLabel.getText()); - } - - @Test - public void testAttribute() throws Exception { - Random random = new Random(); - - WebElement text = driver.findElement(By.xpath("//UIATextField[1]")); - - int number = random.nextInt(MAXIMUM - MINIMUM + 1) + MINIMUM; - text.sendKeys(String.valueOf(number)); - - assertEquals("TextField1", text.getAttribute("name")); - assertEquals("TextField1", text.getAttribute("label")); - assertEquals(String.valueOf(number), text.getAttribute("value")); - } - - @Test - public void testSlider() throws Exception { - //get the slider - WebElement slider = driver.findElement(By.xpath("//UIASlider[1]")); - assertEquals("50%", slider.getAttribute("value")); - Point sliderLocation = getCenter(slider); - driver.swipe(sliderLocation.getX(), sliderLocation.getY(), sliderLocation.getX()-100, sliderLocation.getY(), 1000); - - assertEquals("0%", slider.getAttribute("value")); - } - - @Test - public void testLocation() throws Exception { - WebElement button = driver.findElement(By.xpath("//UIAButton[1]")); - - Point location = button.getLocation(); - - assertEquals(94, location.getX()); - assertEquals(122, location.getY()); - } - - @Test - public void testSessions() throws Exception { - HttpGet request = new HttpGet("http://localhost:4723/wd/hub/sessions"); - HttpClient httpClient = new DefaultHttpClient(); - HttpResponse response = httpClient.execute(request); - HttpEntity entity = response.getEntity(); - JSONObject jsonObject = (JSONObject) new JSONParser().parse(EntityUtils.toString(entity)); - - String sessionId = driver.getSessionId().toString(); - assertEquals(jsonObject.get("sessionId"), sessionId); - } - - @Test - public void testSize() { - Dimension text1 = driver.findElement(By.xpath("//UIATextField[1]")).getSize(); - Dimension text2 = driver.findElement(By.xpath("//UIATextField[2]")).getSize(); - assertEquals(text1.getWidth(), text2.getWidth()); - assertEquals(text1.getHeight(), text2.getHeight()); - } -} diff --git a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/UICatalogTest.java b/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/UICatalogTest.java deleted file mode 100644 index 95c064514..000000000 --- a/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium/UICatalogTest.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.saucelabs.appium; - -import io.appium.java_client.AppiumDriver; -import io.appium.java_client.MobileElement; -import org.apache.commons.lang.RandomStringUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.*; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.remote.Augmenter; -import org.openqa.selenium.remote.CapabilityType; -import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.remote.RemoteWebElement; - -import java.io.File; -import java.net.URL; -import java.util.List; - -import static org.junit.Assert.*; - -/** - * Appium test which runs against a local Appium instance deployed - * with the 'UICatalog' iPhone project which is included in the Appium source distribution. - * - * @author Ross Rowe - */ -public class UICatalogTest { - - private AppiumDriver driver; - - private WebElement row; - - @Before - public void setUp() throws Exception { - // set up appium - File classpathRoot = new File(System.getProperty("user.dir")); - File appDir = new File(classpathRoot, "../../../apps/UICatalog/build/Release-iphonesimulator"); - File app = new File(appDir, "UICatalog.app"); - DesiredCapabilities capabilities = new DesiredCapabilities(); - capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); - capabilities.setCapability("platformVersion", "7.1"); - capabilities.setCapability("platformName", "iOS"); - capabilities.setCapability("deviceName", "iPhone Simulator"); - capabilities.setCapability("app", app.getAbsolutePath()); - driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); - } - - @After - public void tearDown() throws Exception { - driver.quit(); - } - - private void openMenuPosition(int index) { - //populate text fields with two random number - MobileElement table = new MobileElement((RemoteWebElement)driver.findElementByClassName("UIATableView"), driver); - row = table.findElementsByClassName("UIATableCell").get(index); - row.click(); - } - - private Point getCenter(WebElement element) { - - Point upperLeft = element.getLocation(); - Dimension dimensions = element.getSize(); - return new Point(upperLeft.getX() + dimensions.getWidth()/2, upperLeft.getY() + dimensions.getHeight()/2); - } - - @Test - public void testFindElement() throws Exception { - //first view in UICatalog is a table - MobileElement table = new MobileElement((RemoteWebElement)driver.findElementByClassName("UIATableView"), driver); - assertNotNull(table); - //is number of cells/rows inside table correct - List rows = table.findElementsByClassName("UIATableCell"); - assertEquals(12, rows.size()); - //is first one about buttons - assertEquals("Buttons, Various uses of UIButton", rows.get(0).getAttribute("name")); - //navigationBar is not inside table - WebElement nav_bar = null; - try { - nav_bar = table.findElementByClassName("UIANavigationBar"); - } catch (NoSuchElementException e) { - //expected - } - assertNull(nav_bar); - //there is nav bar inside the app - driver.getPageSource(); - nav_bar = driver.findElementByClassName("UIANavigationBar"); - assertNotNull(nav_bar); - } - - - @Test - public void test_location() { - //get third row location - row = driver.findElementsByClassName("UIATableCell").get(2); - assertEquals(0, row.getLocation().getX()); - assertEquals(152, row.getLocation().getY()); - } - - @Test - public void testScreenshot() { - //make screenshot and get is as base64 - WebDriver augmentedDriver = new Augmenter().augment(driver); - String screenshot = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.BASE64); - - assertNotNull(screenshot); - //make screenshot and save it to the local filesystem - File file = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE); - assertNotNull(file); - } - - @Test - public void testTextFieldEdit() { - //go to the text fields section - openMenuPosition(2); - WebElement text_field = driver.findElementsByClassName("UIATextField").get(0); - //get default/empty text - String default_val = text_field.getAttribute("value"); - //write some random text to element - String rnd_string = RandomStringUtils.randomAlphanumeric(6); - text_field.sendKeys(rnd_string); - assertEquals(rnd_string, text_field.getAttribute("value")); - //send some random keys - String rnd_string2 = RandomStringUtils.randomAlphanumeric(6); - Actions swipe = new Actions(driver).sendKeys(rnd_string2); - swipe.perform(); - //check if text is there - assertEquals(rnd_string + rnd_string2, text_field.getAttribute("value")); - //clear - text_field.clear(); - //check if is empty/has default text - assertEquals(default_val, text_field.getAttribute("value")); - } - - @Test - public void testAlertInteraction() { - //go to the alerts section - openMenuPosition(10); - - //trigger modal alert with cancel & ok buttons - List triggerOkCancel = driver.findElementsByAccessibilityId("Show OK-Cancel"); - triggerOkCancel.get(1).click(); - Alert alert = driver.switchTo().alert(); - //check if title of alert is correct - assertEquals("UIAlertView ", alert.getText()); - alert.accept(); - } - - @Test - public void testScroll() { - //scroll menu - //get initial third row location - row = driver.findElementsByClassName("UIATableCell").get(2); - Point location1 = row.getLocation(); - Point center = getCenter(row); - //perform swipe gesture - driver.swipe(center.getX(), center.getY(), center.getX(), center.getY()-20, 1); - //get new row coordinates - Point location2 = row.getLocation(); - assertEquals(location1.getX(), location2.getX()); - assertNotSame(location1.getY(), location2.getY()); - } - - @Test - public void testSlider() { - //go to controls - openMenuPosition(1); - //get the slider - WebElement slider = driver.findElementByClassName("UIASlider"); - assertEquals("50%", slider.getAttribute("value")); - Point sliderLocation = getCenter(slider); - driver.swipe(sliderLocation.getX(), sliderLocation.getY(), sliderLocation.getX()-100, sliderLocation.getY(), 1); - assertEquals("0%", slider.getAttribute("value")); - } - - @Test - public void testSessions() throws Exception { - HttpGet request = new HttpGet("http://localhost:4723/wd/hub/sessions"); - HttpClient httpClient = new DefaultHttpClient(); - HttpResponse response = httpClient.execute(request); - HttpEntity entity = response.getEntity(); - JSONObject jsonObject = (JSONObject) new JSONParser().parse(EntityUtils.toString(entity)); - - String sessionId = driver.getSessionId().toString(); - assertEquals(jsonObject.get("sessionId"), sessionId); - } - - @Test - public void testSize() { - Dimension table = driver.findElementByClassName("UIATableView").getSize(); - Dimension cell = driver.findElementsByClassName("UIATableCell").get(0).getSize(); - assertEquals(table.getWidth(), cell.getWidth()); - assertNotSame(table.getHeight(), cell.getHeight()); - } - - @Test - public void testSource() { - //get main view soruce - String source_main = driver.getPageSource(); - assertTrue(source_main.contains("UIATableView")); - assertTrue(source_main.contains("TextFields, Uses of UITextField")); - - //got to text fields section - openMenuPosition(2); - String source_textfields = driver.getPageSource(); - assertTrue(source_textfields.contains("UIAStaticText")); - assertTrue(source_textfields.contains("TextFields")); - - assertNotSame(source_main, source_textfields); - } -} diff --git a/sample-code/examples/node/.jshintrc b/sample-code/examples/node/.jshintrc deleted file mode 100644 index 6b3b81b39..000000000 --- a/sample-code/examples/node/.jshintrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "laxcomma": true, - "strict": true, - "undef": true, - "unused": true, - "trailing": true, - "node": true, - "eqeqeq": true, - "trailing": true, - "expr": true, - "white": true, - "indent": 2, - "globals": { - "describe": true, - "it": true, - "before": true, - "after": true, - "beforeEach": true, - "afterEach": true - } -} diff --git a/sample-code/examples/node/README.md b/sample-code/examples/node/README.md deleted file mode 100644 index df2443449..000000000 --- a/sample-code/examples/node/README.md +++ /dev/null @@ -1,149 +0,0 @@ -#Node.js samples - -## prerequisites - -Upgrade Mocha to the latest version before running the tests. - -##iOS - -### local - -``` -./reset.sh --hardcore --ios - -mocha sample-code/examples/node/ios-simple.js -mocha sample-code/examples/node/ios-complex.js -mocha sample-code/examples/node/ios-webview.js -mocha sample-code/examples/node/ios-actions.js -mocha sample-code/examples/node/ios-local-server.js -mocha sample-code/examples/node/ios-selenium-webdriver-bridge.js -``` -### dev (run against locally built app) - -``` -./reset.sh --hardcore --ios --dev - -DEV=1 mocha sample-code/examples/node/ios-simple.js -DEV=1 mocha sample-code/examples/node/ios-complex.js -DEV=1 mocha sample-code/examples/node/ios-webview.js -DEV=1 mocha sample-code/examples/node/ios-actions.js -DEV=1 mocha sample-code/examples/node/ios-local-server.js -DEV=1 mocha sample-code/examples/node/ios-selenium-webdriver-bridge.js -``` - -### Sauce Labs - -``` -./reset.sh --hardcore --ios -export SAUCE_USERNAME= -export SAUCE_ACCESS_KEY= - -SAUCE=1 mocha sample-code/examples/node/ios-simple.js -SAUCE=1 mocha sample-code/examples/node/ios-complex.js -SAUCE=1 mocha sample-code/examples/node/ios-webview.js -SAUCE=1 mocha sample-code/examples/node/ios-actions.js -SAUCE=1 mocha sample-code/examples/node/ios-selenium-webdriver-bridge.js -``` - -### Sauce Labs + Sauce Connect - -Install and start Sauce Connect (see [doc here](https://saucelabs.com/docs/connect)) - -``` -./reset.sh --hardcore --ios -export SAUCE_USERNAME= -export SAUCE_ACCESS_KEY= - -SAUCE=1 mocha sample-code/examples/node/ios-local-server.js -``` - -##Android - -### local - -``` -./reset.sh --hardcore --android - -mocha sample-code/examples/node/android-simple.js -mocha sample-code/examples/node/android-complex.js -mocha sample-code/examples/node/android-webview.js -mocha sample-code/examples/node/android-local-server.js -``` - -### dev (run against locally built app) - -``` -./reset.sh --hardcore --android --dev - -DEV=1 mocha sample-code/examples/node/android-simple.js -DEV=1 mocha sample-code/examples/node/android-complex.js -DEV=1 mocha sample-code/examples/node/android-webview.js -DEV=1 mocha sample-code/examples/node/android-local-server.js -``` - -### Sauce Labs - -``` -./reset.sh --hardcore --android -export SAUCE_USERNAME= -export SAUCE_ACCESS_KEY= - -SAUCE=1 mocha sample-code/examples/node/android-simple.js -SAUCE=1 mocha sample-code/examples/node/android-complex.js -SAUCE=1 mocha sample-code/examples/node/android-webview.js -``` - -### Sauce Labs + Sauce Connect - -Install and start Sauce Connect (see [doc here](https://saucelabs.com/docs/connect)) - -``` -./reset.sh --hardcore --android -export SAUCE_USERNAME= -export SAUCE_ACCESS_KEY= - -SAUCE=1 mocha sample-code/examples/node/android-local-server.js -``` - -##Selendroid - -### local - -``` -./reset.sh --hardcore --android --selendroid - -mocha sample-code/examples/node/selendroid-simple.js -``` - -### Sauce Labs - -``` -./reset.sh --hardcore --android --selendroid - -SAUCE=1 mocha sample-code/examples/node/selendroid-simple.js -``` - -##Node.js 0.11 + Generator with Yiewd - -### local - -switch to node > 0.11 - -``` -./reset.sh --hardcore --ios - -mocha --harmony sample-code/examples/node/ios-yiewd.js -``` - -### Sauce Labs - -switch to node > 0.11 - -``` -./reset.sh --hardcore --ios -export SAUCE_USERNAME= -export SAUCE_ACCESS_KEY= - -SAUCE=1 mocha --harmony sample-code/examples/node/ios-yiewd.js -``` - diff --git a/sample-code/examples/node/android-complex.js b/sample-code/examples/node/android-complex.js deleted file mode 100644 index fef89b960..000000000 --- a/sample-code/examples/node/android-complex.js +++ /dev/null @@ -1,197 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - actions = require("./helpers/actions"), - serverConfigs = require('./helpers/appium-servers'), - _p = require('./helpers/promise-utils'), - Q = require('q'); - -wd.addPromiseChainMethod('swipe', actions.swipe); - -describe("android complex", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = process.env.SAUCE ? - _.clone(require("./helpers/caps").android18) : - _.clone(require("./helpers/caps").android19); - desired.app = require("./helpers/apps").androidApiDemos; - if (process.env.SAUCE) { - desired.name = 'android - complex'; - desired.tags = ['sample']; - } - return driver - .init(desired) - .setImplicitWaitTimeout(5000); - }); - - after(function () { - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - it("should find an element", function () { - return driver - .elementByXPath('//android.widget.TextView[@text=\'Animation\']') - .elementByXPath('//android.widget.TextView') - .text().should.become('API Demos') - .elementsByXPath('//android.widget.TextView[contains(@text, "Animat")]') - .then(_p.filterDisplayed).first() - .then(function (el) { - if (!process.env.SAUCE) { - return el.text().should.become('Animation'); - } - }).elementByName('App').click() - .sleep(3000) - .elementsByAndroidUIAutomator('new UiSelector().clickable(true)') - .should.eventually.have.length.above(10) - .elementByXPath('//android.widget.TextView[@text=\'Action Bar\']') - .should.eventually.exist - .elementsByXPath('//android.widget.TextView') - .then(_p.filterDisplayed).first() - .text().should.become('API Demos') - .back().sleep(1000); - }); - - it("should scroll", function () { - return driver - .elementByXPath('//android.widget.TextView[@text=\'Animation\']') - .elementsByXPath('//android.widget.TextView') - .then(function (els) { - return Q.all([ - els[7].getLocation(), - els[3].getLocation() - ]).then(function (locs) { - console.log('locs -->', locs); - return driver.swipe({ - startX: locs[0].x, startY: locs[0].y, - endX: locs[1].x, endY: locs[1].y, - duration: 800 - }); - }); - }); - }); - - it("should draw a smiley", function () { - function findTouchPaint() { - return driver - .elementsByClassName('android.widget.TextView') - .then(function (els) { - return Q.all([ - els[els.length - 1].getLocation(), - els[0].getLocation() - ]).then(function (locs) { - return driver.swipe({ - startX: locs[0].x, startY: locs[0].y, - endX: locs[1].x, endY: locs[1].y, - duration: 800 - }); - }); - }).elementByName('Touch Paint') - .catch(function () { - return findTouchPaint(); - }); - } - - return driver - .elementByName('Graphics').click() - .then(findTouchPaint) - .click() - .sleep(5000) - .then(function () { - var a1 = new wd.TouchAction(); - a1.press({x: 150, y: 100}).release(); - var a2 = new wd.TouchAction(); - a2.press({x: 250, y: 100}).release(); - var smile = new wd.TouchAction(); - smile - .press({x:110, y:200}) - .moveTo({x:1, y:1}) - .moveTo({x:1, y:1}) - .moveTo({x:1, y:1}) - .moveTo({x:1, y:1}) - .moveTo({x:1, y:1}) - .moveTo({x:2, y:1}) - .moveTo({x:2, y:1}) - .moveTo({x:2, y:1}) - .moveTo({x:2, y:1}) - .moveTo({x:2, y:1}) - .moveTo({x:3, y:1}) - .moveTo({x:3, y:1}) - .moveTo({x:3, y:1}) - .moveTo({x:3, y:1}) - .moveTo({x:3, y:1}) - .moveTo({x:4, y:1}) - .moveTo({x:4, y:1}) - .moveTo({x:4, y:1}) - .moveTo({x:4, y:1}) - .moveTo({x:4, y:1}) - .moveTo({x:5, y:1}) - .moveTo({x:5, y:1}) - .moveTo({x:5, y:1}) - .moveTo({x:5, y:1}) - .moveTo({x:5, y:1}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:0}) - .moveTo({x:5, y:-1}) - .moveTo({x:5, y:-1}) - .moveTo({x:5, y:-1}) - .moveTo({x:5, y:-1}) - .moveTo({x:5, y:-1}) - .moveTo({x:4, y:-1}) - .moveTo({x:4, y:-1}) - .moveTo({x:4, y:-1}) - .moveTo({x:4, y:-1}) - .moveTo({x:4, y:-1}) - .moveTo({x:3, y:-1}) - .moveTo({x:3, y:-1}) - .moveTo({x:3, y:-1}) - .moveTo({x:3, y:-1}) - .moveTo({x:3, y:-1}) - .moveTo({x:2, y:-1}) - .moveTo({x:2, y:-1}) - .moveTo({x:2, y:-1}) - .moveTo({x:2, y:-1}) - .moveTo({x:2, y:-1}) - .moveTo({x:1, y:-1}) - .moveTo({x:1, y:-1}) - .moveTo({x:1, y:-1}) - .moveTo({x:1, y:-1}) - .moveTo({x:1, y:-1}) - .release(); - - var ma = new wd.MultiAction().add(a1, a2, smile); - return driver.performMultiAction(ma) - // so you can see it - .sleep(10000) - .back().sleep(1000) - .back().sleep(1000); - }); - }); - -}); diff --git a/sample-code/examples/node/android-local-server.js b/sample-code/examples/node/android-local-server.js deleted file mode 100644 index a0169c7c7..000000000 --- a/sample-code/examples/node/android-local-server.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - serverConfigs = require('./helpers/appium-servers'), - localServer = require('./helpers/local-server'); - -describe("android local server", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - localServer.start(); - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = process.env.SAUCE ? - _.clone(require("./helpers/caps").android18) : - _.clone(require("./helpers/caps").android19); - desired.app = require("./helpers/apps").androidApiDemosLocal; - if (process.env.SAUCE) { - desired.name = 'android - local server'; - desired.tags = ['sample']; - } - return driver.init(desired); - }); - - after(function () { - localServer.stop(); - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - - it("should open the app", function () { - return driver - .elementByAccessibilityId('Graphics') - .should.eventually.exist; - }); - -}); diff --git a/sample-code/examples/node/android-simple.js b/sample-code/examples/node/android-simple.js deleted file mode 100644 index 44c155d42..000000000 --- a/sample-code/examples/node/android-simple.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - serverConfigs = require('./helpers/appium-servers'); - -describe("android simple", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = process.env.SAUCE ? - _.clone(require("./helpers/caps").android18) : - _.clone(require("./helpers/caps").android19); - desired.app = require("./helpers/apps").androidApiDemos; - if (process.env.SAUCE) { - desired.name = 'android - simple'; - desired.tags = ['sample']; - } - return driver - .init(desired) - .setImplicitWaitTimeout(3000); - }); - - after(function () { - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - it("should find an element", function () { - return driver - .elementByAccessibilityId('Graphics') - .click() - .elementByAccessibilityId('Arcs') - .should.eventually.exist - .back() - .elementByName('App') - .should.eventually.exist - .elementsByAndroidUIAutomator('new UiSelector().clickable(true)') - .should.eventually.have.length(12) - .elementsByAndroidUIAutomator('new UiSelector().enabled(true)') - .should.eventually.have.length.above(20) - .elementByXPath('//android.widget.TextView[@text=\'API Demos\']') - .should.exists; - }); -}); diff --git a/sample-code/examples/node/android-webview.js b/sample-code/examples/node/android-webview.js deleted file mode 100644 index 27b2cca11..000000000 --- a/sample-code/examples/node/android-webview.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - serverConfigs = require('./helpers/appium-servers'); - -describe("android webview", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = process.env.SAUCE ? - _.clone(require("./helpers/caps").android18) : - _.clone(require("./helpers/caps").android19); - desired.app = require("./helpers/apps").selendroidTestApp; - if (process.env.SAUCE) { - desired.name = 'android - webview'; - desired.tags = ['sample']; - } - return driver - .init(desired) - .setImplicitWaitTimeout(3000); - }); - - after(function () { - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - it("should switch to webview", function () { - return driver - .elementByName('buttonStartWebviewCD') - .click() - .sleep(5000) - .contexts() - .then(function (ctxs) { - console.log(ctxs); - return driver.context(ctxs[ctxs.length - 1]); - }) - .elementById('name_input') - .clear() - .sendKeys('Appium User') - .sendKeys(wd.SPECIAL_KEYS.Return) - .sleep(1000) - .source().then(function (source) { - source.should.include('This is my way of saying hello'); - source.should.include('Appium User'); - }); - }); -}); diff --git a/sample-code/examples/node/assets/index.html b/sample-code/examples/node/assets/index.html deleted file mode 100644 index a891d2cf9..000000000 --- a/sample-code/examples/node/assets/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - Appium Rocks - - - -

Appium Rocks

- -
-

- Wow this is so cool! -

-
- - - diff --git a/sample-code/examples/node/helpers/actions.js b/sample-code/examples/node/helpers/actions.js deleted file mode 100644 index 8136e8338..000000000 --- a/sample-code/examples/node/helpers/actions.js +++ /dev/null @@ -1,56 +0,0 @@ -"use strict"; - -var wd = require('wd'), - Q = require('q'); - -exports.swipe = function (opts) { - var action = new wd.TouchAction(); - action - .press({x: opts.startX, y: opts.startY}) - .wait(opts.duration) - .moveTo({x: opts.endX, y: opts.endY}) - .release(); - return this.performTouchAction(action); -}; - -exports.pinch = function (el) { - return Q.all([ - el.getSize(), - el.getLocation(), - ]).then(function (res) { - var size = res[0]; - var loc = res[1]; - var center = { - x: loc.x + size.width / 2, - y: loc.y + size.height / 2 - }; - var a1 = new wd.TouchAction(this); - a1.press({el: el, x: center.x, y: center.y - 100}).moveTo({el: el}).release(); - var a2 = new wd.TouchAction(this); - a2.press({el: el, x: center.x, y: center.y + 100}).moveTo({el: el}).release(); - var m = new wd.MultiAction(this); - m.add(a1, a2); - return m.perform(); - }.bind(this)); -}; - -exports.zoom = function (el) { - return Q.all([ - this.getWindowSize(), - this.getLocation(el), - ]).then(function (res) { - var size = res[0]; - var loc = res[1]; - var center = { - x: loc.x + size.width / 2, - y: loc.y + size.height / 2 - }; - var a1 = new wd.TouchAction(this); - a1.press({el: el}).moveTo({el: el, x: center.x, y: center.y - 100}).release(); - var a2 = new wd.TouchAction(this); - a2.press({el: el}).moveTo({el: el, x: center.x, y: center.y + 100}).release(); - var m = new wd.MultiAction(this); - m.add(a1, a2); - return m.perform(); - }.bind(this)); -}; diff --git a/sample-code/examples/node/helpers/appium-servers.js b/sample-code/examples/node/helpers/appium-servers.js deleted file mode 100644 index 38f19bfdf..000000000 --- a/sample-code/examples/node/helpers/appium-servers.js +++ /dev/null @@ -1,12 +0,0 @@ - -exports.local = { - host: 'localhost', - port: 4723 -}; - -exports.sauce = { - host: 'ondemand.saucelabs.com', - port: 80, - username: process.env.SAUCE_USERNAME, - password: process.env.SAUCE_ACCESS_KEY -}; diff --git a/sample-code/examples/node/helpers/apps.js b/sample-code/examples/node/helpers/apps.js deleted file mode 100644 index 3c5e1d06f..000000000 --- a/sample-code/examples/node/helpers/apps.js +++ /dev/null @@ -1,16 +0,0 @@ -if (process.env.DEV) { - exports.iosTestApp = "sample-code/apps/TestApp/build/Release-iphonesimulator/TestApp.app"; - exports.iosWebviewApp = "sample-code/apps/WebViewApp/build/Release-iphonesimulator/WebViewApp.app"; - exports.iosUICatalogApp = "sample-code/apps/UICatalog/build/Release-iphonesimulator/UICatalog.app"; - exports.androidApiDemos = "sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk"; - exports.selendroidTestApp = "sample-code/apps/selendroid-test-app.apk"; -} else { - exports.iosTestApp = "http://appium.github.io/appium/assets/TestApp7.1.app.zip"; - exports.iosWebviewApp = "http://appium.github.io/appium/assets/WebViewApp7.1.app.zip"; - exports.iosUICatalogApp = "http://appium.github.io/appium/assets/UICatalog7.1.app.zip"; - exports.androidApiDemos = "http://appium.github.io/appium/assets/ApiDemos-debug.apk"; - exports.selendroidTestApp = "http://appium.github.io/appium/assets/selendroid-test-app-0.10.0.apk"; - - exports.iosWebviewAppLocal = "http://localhost:3000/WebViewApp7.1.app.zip"; - exports.androidApiDemosLocal = "http://localhost:3000/ApiDemos-debug.apk"; -} diff --git a/sample-code/examples/node/helpers/caps.js b/sample-code/examples/node/helpers/caps.js deleted file mode 100644 index 51aa53901..000000000 --- a/sample-code/examples/node/helpers/caps.js +++ /dev/null @@ -1,37 +0,0 @@ - -exports.ios71 = { - browserName: '', - 'appium-version': '1.0', - platformName: 'iOS', - platformVersion: '7.1', - deviceName: 'iPhone Simulator', - app: undefined // will be set later -}; - -exports.android18 = { - browserName: '', - 'appium-version': '1.0', - platformName: 'Android', - platformVersion: '4.3', - deviceName: 'Android Emulator', - app: undefined // will be set later -}; - -exports.android19 = { - browserName: '', - 'appium-version': '1.0', - platformName: 'Android', - platformVersion: '4.4.2', - deviceName: 'Android Emulator', - app: undefined // will be set later -}; - -exports.selendroid16 = { - browserName: '', - 'appium-version': '1.0', - platformName: 'Android', - platformVersion: '4.1', - automationName: 'selendroid', - deviceName: 'Android Emulator', - app: undefined // will be set later -}; diff --git a/sample-code/examples/node/helpers/local-server.js b/sample-code/examples/node/helpers/local-server.js deleted file mode 100644 index 7c0e90216..000000000 --- a/sample-code/examples/node/helpers/local-server.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -var express = require('express'), - app = express(), - path = require('path'); - -app.use(express.static(__dirname + '/static')); - -app.get('/index.html', function (req, res) { - res.sendfile(path.resolve(__dirname, '../assets/index.html')); -}); - -app.get('/WebViewApp7.1.app.zip', function (req, res) { - res.sendfile(path.resolve(__dirname, '../../../../assets/WebViewApp7.1.app.zip')); -}); - -app.get('/ApiDemos-debug.apk', function (req, res) { - res.sendfile(path.resolve(__dirname, '../../../../assets/ApiDemos-debug.apk')); -}); - -var server; - -exports.start = function () { - server = app.listen(3000); -}; - -exports.stop = function () { - server.close(); -}; diff --git a/sample-code/examples/node/helpers/logging.js b/sample-code/examples/node/helpers/logging.js deleted file mode 100644 index 1a733afb6..000000000 --- a/sample-code/examples/node/helpers/logging.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -exports.configure = function (driver) { - // See whats going on - driver.on('status', function (info) { - console.log(info.cyan); - }); - driver.on('command', function (meth, path, data) { - console.log(' > ' + meth.yellow, path.grey, data || ''); - }); - driver.on('http', function (meth, path, data) { - console.log(' > ' + meth.magenta, path, (data || '').grey); - }); -}; diff --git a/sample-code/examples/node/helpers/promise-utils.js b/sample-code/examples/node/helpers/promise-utils.js deleted file mode 100644 index 0921def9c..000000000 --- a/sample-code/examples/node/helpers/promise-utils.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; - -var Q = require('q'), - _ = require('underscore'); - -exports.each = function (fn) { - return function (els) { - var seq = _(els).map(function (el, i) { - return function () { - return fn(el, i); - }; - }); - // iterating - return seq.reduce(Q.when, new Q()).then(function () { - return els; - }); - }; -}; - -exports.filter = function (fn) { - return function (els) { - var seq = _(els).map(function (el, i) { - return function (filteredEls) { - return fn(el, i).then(function (isOk) { - if (isOk) filteredEls.push(el); - return filteredEls; - }); - }; - }); - // iterating - return seq.reduce(Q.when, new Q([])); - }; -}; - -exports.printNames = exports.each(function (el, i) { - return el.getAttribute('name').print(i + "--> "); -}); - -exports.filterDisplayed = exports.filter(function (el) { - return el.isDisplayed(); -}); - -exports.filterWithName = function (name) { - return exports.filter(function (el) { - return el.getAttribute('name').then(function (_name) { - return _name === name; - }); - }); -}; - diff --git a/sample-code/examples/node/helpers/setup.js b/sample-code/examples/node/helpers/setup.js deleted file mode 100644 index 7275a6853..000000000 --- a/sample-code/examples/node/helpers/setup.js +++ /dev/null @@ -1,10 +0,0 @@ -var wd = require("wd"); - -require('colors'); -var chai = require("chai"); -var chaiAsPromised = require("chai-as-promised"); -chai.use(chaiAsPromised); -var should = chai.should(); -chaiAsPromised.transferPromiseness = wd.transferPromiseness; - -exports.should = should; diff --git a/sample-code/examples/node/ios-actions.js b/sample-code/examples/node/ios-actions.js deleted file mode 100644 index cff68242d..000000000 --- a/sample-code/examples/node/ios-actions.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - actions = require("./helpers/actions"), - serverConfigs = require('./helpers/appium-servers'); - -wd.addPromiseChainMethod('swipe', actions.swipe); -wd.addPromiseChainMethod('pinch', actions.pinch); -wd.addElementPromiseChainMethod('pinch', - function () { return this.browser.pinch(this); }); -wd.addPromiseChainMethod('zoom', actions.zoom); -wd.addElementPromiseChainMethod('zoom', - function () { return this.browser.zoom(this); }); - -describe("ios actions", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = _.clone(require("./helpers/caps").ios71); - desired.app = require("./helpers/apps").iosTestApp; - if (process.env.SAUCE) { - desired.name = 'ios - actions'; - desired.tags = ['sample']; - } - return driver.init(desired); - }); - - after(function () { - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - it("should execute a simple action", function () { - return driver.chain() - .elementByAccessibilityId('ComputeSumButton') - .then(function (el) { - var action = new wd.TouchAction(driver); - action - .tap({el: el, x: 10, y: 10}) - .release(); - return driver.performTouchAction(action); - }) - .elementByAccessibilityId('ComputeSumButton') - .then(function (el) { - var action = new wd.TouchAction(driver); - action - .tap({el: el, x: 10, y: 10}) - .release(); - return action.perform(); - }); - }); - - it("should execute a multi action", function () { - return driver.chain() - .then(function () { - return driver - .elementByAccessibilityId('ComputeSumButton') - .then(function (el) { - var a1 = new wd.TouchAction(); - a1 - .tap({el: el, x: 10, y: 10}); - var a2 = new wd.TouchAction(); - a2 - .tap({el: el}); - var m = new wd.MultiAction(); - m.add(a1, a2); - return driver.performMultiAction(m); - }); - }) - .then(function () { - return driver - .elementByAccessibilityId('ComputeSumButton') - .then(function (el) { - var a1 = new wd.TouchAction(); - a1 - .tap({el: el, x: 10, y: 10}); - var a2 = new wd.TouchAction(); - a2 - .tap({el: el}); - var m = new wd.MultiAction(driver); - m.add(a1, a2); - return m.perform(); - }); - }); - }); - - it("should swipe", function () { - return driver - .waitForElementByName('Test Gesture', 5000).click() - .sleep(1000) - .elementByName('OK').click() - .sleep(1000) - .elementByXPath('//UIAMapView').getLocation() - .then(function (loc) { - return driver.swipe({ startX: loc.x, startY: loc.y, - endX: 0.5, endY: loc.y, duration: 800 }); - }); - }); - - it("should pinch", function () { - return driver - .waitForElementByName('Test Gesture', 5000).click() - .sleep(1000) - .elementByName('OK').click() - .sleep(1000) - .elementByXPath('//UIAMapView') - .then(function (el) { - return driver.pinch(el); - }); - }); - - it("should pinch el", function () { - return driver - .waitForElementByName('Test Gesture', 5000).click() - .sleep(1000) - .elementByName('OK').click() - .sleep(1000) - .elementByXPath('//UIAMapView') - .then(function (el) { - return el.pinch(); - }); - }); - - it("should zoom", function () { - return driver - .waitForElementByName('Test Gesture', 5000).click() - .sleep(1000) - .elementByName('OK').click() - .sleep(1000) - .elementByXPath('//UIAMapView') - .then(function (el) { - return driver.zoom(el); - }); - }); - - it.only("should zoom el", function () { - return driver - .waitForElementByName('Test Gesture', 5000).click() - .sleep(1000) - .elementByName('OK').click() - .sleep(1000) - .elementByXPath('//UIAMapView') - .then(function (el) { - return el.zoom(); - }); - }); - -}); diff --git a/sample-code/examples/node/ios-complex.js b/sample-code/examples/node/ios-complex.js deleted file mode 100644 index b24d4a226..000000000 --- a/sample-code/examples/node/ios-complex.js +++ /dev/null @@ -1,226 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - Q = require('q'), - serverConfigs = require('./helpers/appium-servers'), - _p = require('./helpers/promise-utils'), - fs = require('fs'); - -describe("ios simple", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = _.clone(require("./helpers/caps").ios71); - desired.app = require("./helpers/apps").iosUICatalogApp; - if (process.env.SAUCE) { - desired.name = 'ios - complex'; - desired.tags = ['sample']; - } - return driver.init(desired); - }); - - after(function () { - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - function clickMenuItem(name) { - return driver - .elementByName(name) - .catch(function () { - return driver - .elementByClassName('UIATableView') - .elementsByClassName('>','UIATableCell') - .then(_p.filterWithName(name)).first(); - }).click(); - } - - it("should print every menu item", function () { - return driver - .elementByClassName('UIATableView') - .elementsByClassName('>','UIATableCell') - .then(_p.printNames); - }); - - it("should find an element", function () { - return driver - // first view in UICatalog is a table - .elementByClassName('UIATableView') - .should.eventually.exist - // check the number of cells/rows inside the table - .elementsByClassName('UIATableCell') - .then(_p.filterDisplayed) - .then(function (els) { - els.should.have.length.above(6); - return els; - }) - // various checks - .first().getAttribute('name') - .should.become('Action Sheets, AAPLActionSheetViewController') - .waitForElementByClassName('UIANavigationBar') - .should.eventually.exist; - }); - - it("should switch context", function () { - return clickMenuItem('Web View, AAPLWebViewController') - // get the contexts and switch to webview - .contexts().should.eventually.deep.equal( - ['NATIVE_APP','WEBVIEW_1'] - ).context('WEBVIEW_1') - // find the store link - .sleep(1000) - .waitForElementById('gn-apple') - .should.eventually.exist - // leave the webview - .context('NATIVE_APP').sleep(1000) - //Verify we are out of the webview - .waitForElementByClassName('UIAScrollView') - .should.eventually.exist - // back to main menu - .back(); - }); - - it("should get an element location", function () { - return driver.elementsByClassName("UIATableCell") - .then(_p.filterDisplayed) - .at(2) - .getLocation() - .then(function (loc) { - loc.x.should.equal(0); - loc.y.should.be.above(100); - }); - }); - - it("should take screenshots", function () { - return driver - // base64 screeshot - .takeScreenshot() - .should.eventually.exist - // save screenshot to local file - .then(function () { - try { - fs.unlinkSync('/tmp/foo.png'); - } catch (ign) {} - fs.existsSync('/tmp/foo.png').should.not.be.ok; - }) - .saveScreenshot('/tmp/foo.png') - .then(function () { - fs.existsSync('/tmp/foo.png').should.be.ok; - }); - - }); - - it("should edit a text field", function () { - var el, defaultValue; - return clickMenuItem('Text Fields, AAPLTextFieldViewController') - // get the field and the default/empty text - .elementByClassName('UIATextField') - .then(function (_el) { - el = _el; - return el.getValue(); }) - .then(function (val) { defaultValue = val; }) - // type something - .then(function () { - return el - .sendKeys('1234 appium') - .getValue().should.become('1234 appium') - .elementByName('Done').click().sleep(1000); // dismissing keyboard - }) - // clear the field - .then(function () { return el.clear(); }) - .then(function () { el.getValue().should.become(defaultValue); }) - // back to main menu - .back(); - }); - - it("should trigger/accept/dismiss an alert", function () { - return clickMenuItem('Alert Views, AAPLAlertViewController') - // trigger simple alert - .elementByName('Simple').click() - .alertText().should.eventually.include('A Short Title Is Best') - .dismissAlert() - // trigger modal alert with cancel & ok buttons - .elementByName('Okay / Cancel').click() - .alertText().should.eventually.include('A Short Title Is Best') - .acceptAlert() - // back to main menu - .back(); - }); - - it("should set a slider value", function () { - var slider; - return clickMenuItem('Sliders, AAPLSliderViewController') - // retrieve slider, check initial value - .elementByClassName("UIASlider") - .then(function (_slider) { slider = _slider; }) - .then(function () { - return slider.getValue().should.become('42%'); - }) - // change value - .then(function () { return slider.setImmediateValue("0%"); }) - .then(function () { - return slider.getValue().should.become('0%'); - }) - // back to main menu - .back(); - }); - - if (!process.env.SAUCE) { - it("should retrieve the session list", function () { - driver.sessions() - .then(function (sessions) { - JSON.stringify(sessions).should.include(driver.getSessionId()); - }); - }); - } - - it("should retrieve an element size", function () { - return Q.all([ - driver.elementByClassName('UIATableView').getSize(), - driver.elementByClassName('UIATableCell').getSize(), - ]).then(function (sizes) { - sizes[0].width.should.equal(sizes[1].width); - sizes[0].height.should.not.equal(sizes[1].height); - }); - }); - - it("should get the source", function () { - var mainMenuSource; - // main menu source - return driver - .source().then(function (source) { - mainMenuSource = source; - mainMenuSource.should.include('UIAStaticText'); - mainMenuSource.should.include('Text Fields'); - }) - // text fields section source - .then(function () { - return clickMenuItem("Text Fields, AAPLTextFieldViewController"); - }).source(function (textFieldSectionSource) { - textFieldSectionSource.should.include('UIAStaticText'); - textFieldSectionSource.should.include('Text Fields'); - textFieldSectionSource.should.not.equal(textFieldSectionSource); - }) - // back to main menu - .back(); - }); -}); diff --git a/sample-code/examples/node/ios-local-server.js b/sample-code/examples/node/ios-local-server.js deleted file mode 100644 index b257196ee..000000000 --- a/sample-code/examples/node/ios-local-server.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - serverConfigs = require('./helpers/appium-servers'), - localServer = require('./helpers/local-server'); - -describe("ios local server", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - localServer.start(); - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = _.clone(require("./helpers/caps").ios71); - desired.app = require("./helpers/apps").iosWebviewAppLocal; - if (process.env.SAUCE) { - desired.name = 'ios - local server'; - desired.tags = ['sample']; - } - return driver.init(desired); - }); - - after(function () { - localServer.stop(); - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - - it("should get the url", function () { - return driver - .elementByXPath('//UIATextField[@value=\'Enter URL\']') - .sendKeys('http://localhost:3000/index.html') - .elementByName('Go').click() - .elementByClassName('UIAWebView').click() // dismissing keyboard - .context('WEBVIEW') - .sleep(3000) - .waitForElementById('wow') - .text().should.eventually.include('so cool'); - }); - -}); diff --git a/sample-code/examples/node/ios-selenium-webdriver-bridge.js b/sample-code/examples/node/ios-selenium-webdriver-bridge.js deleted file mode 100644 index 98f56fd22..000000000 --- a/sample-code/examples/node/ios-selenium-webdriver-bridge.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - The appium specific methods are not yet implemented by selenium-webdriver. - However it is possible to attach an existing selenium-webdriver session to - a wd browser instance as below. - - prerequisites: - npm install selenium-webdriver -*/ - -"use strict"; - -require("./helpers/setup"); - -var webdriver = require('selenium-webdriver'), - wd = require("wd"), - wdBridge = require('wd-bridge')(webdriver, wd), - _ = require('underscore'), - Q = require('q'), - chai = require('chai'); -chai.should(); - -describe("ios simple", function () { - this.timeout(300000); - var driver; - var wdDriver; - var allPassed = true; - - before(function () { - var builder; - var caps = new webdriver.Capabilities(); - - _(require("./helpers/caps").ios71).each(function (val, key) { - caps.set(key, val); - }); - caps.set('app', require("./helpers/apps").iosTestApp); - if (process.env.SAUCE) { - caps.set('username', process.env.SAUCE_USERNAME); - caps.set('accessKey', process.env.SAUCE_ACCESS_KEY); - caps.set('name', 'ios - selenium-webdriver bridge'); - caps.set('tags', ['sample']); - builder = new webdriver.Builder() - .usingServer('http://ondemand.saucelabs.com:80/wd/hub') - .withCapabilities(caps); - } else { - builder = new webdriver.Builder() - .usingServer('http://localhost:4723/wd/hub') - .withCapabilities(caps); - } - driver = builder.build(); - return wdBridge - .initFromSeleniumWebdriver(builder, driver) - .then(function (_wdDriver) { - wdDriver = _wdDriver; - require("./helpers/logging").configure(wdDriver); - }); - }); - - after(function () { - return new Q(driver - .quit()) - .finally(function () { - if (process.env.SAUCE) { - return wdDriver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - function populate() { - var sum = 0; - var populateField = function (name) { - return driver.wait(function () { - return driver.findElement(webdriver.By.name(name)); - }, 3000).then(function (el) { - var x = _.random(0,10); - sum += x; - return el.sendKeys('' + x); - }).then(function () { - return driver.findElement(webdriver.By.name('Done')); - }).then(function (el) { - // converting to wd el - return wdDriver.wdEl(el).click(); - }).then(function () { return driver.sleep(1000); }); - }; - return populateField('IntegerA') - .then(function () { return populateField('IntegerB'); }) - .then(function () { return sum; }); - } - - it("should compute the sum", function () { - var sum; - return populate() - .then(function (_sum) { - sum = _sum; - // using appium specific methods to find a click the button - return wdDriver. - elementByAccessibilityId('ComputeSumButton') - .click().sleep(1000); - }).then(function () { - return wdDriver - .elementByIosUIAutomation('elements().withName("Answer");') - .then(function (el) { - // converting from wd el - return wdDriver.swEl(el).getText(); - }); - }).then(function (text) { - text.should.equal("" + sum); - }); - }); - -}); diff --git a/sample-code/examples/node/ios-simple.js b/sample-code/examples/node/ios-simple.js deleted file mode 100644 index 750a4c108..000000000 --- a/sample-code/examples/node/ios-simple.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - Q = require('q'), - serverConfigs = require('./helpers/appium-servers'); - -describe("ios simple", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = _.clone(require("./helpers/caps").ios71); - desired.app = require("./helpers/apps").iosTestApp; - if (process.env.SAUCE) { - desired.name = 'ios - simple'; - desired.tags = ['sample']; - } - return driver.init(desired); - }); - - after(function () { - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - function populate() { - var seq = _(['IntegerA', 'IntegerB']).map(function (name) { - return function (sum) { - return driver.waitForElementByName(name, 3000).then(function (el) { - var x = _.random(0,10); - sum += x; - return el.type('' + x).then(function () { return sum; }) - .elementByName('Done').click().sleep(1000); // dismissing keyboard - }).then(function () { return sum; }); - }; - }); - return seq.reduce(Q.when, new Q(0)); - } - - it("should compute the sum", function () { - return driver - .resolve(populate()).then(function (sum) { - return driver. - elementByAccessibilityId('ComputeSumButton') - .click().sleep(1000) - .elementByIosUIAutomation('elements().withName("Answer");') - .text().should.become("" + sum); - }); - }); - -}); diff --git a/sample-code/examples/node/ios-webview.js b/sample-code/examples/node/ios-webview.js deleted file mode 100644 index f5111a9fa..000000000 --- a/sample-code/examples/node/ios-webview.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -require("./helpers/setup"); - -var wd = require("wd"), - _ = require('underscore'), - serverConfigs = require('./helpers/appium-servers'); - -describe("ios simple", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - before(function () { - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.promiseChainRemote(serverConfig); - require("./helpers/logging").configure(driver); - - var desired = _.clone(require("./helpers/caps").ios71); - desired.app = require("./helpers/apps").iosWebviewApp; - if (process.env.SAUCE) { - desired.name = 'ios - webview'; - desired.tags = ['sample']; - } - return driver.init(desired); - }); - - after(function () { - return driver - .quit() - .finally(function () { - if (process.env.SAUCE) { - return driver.sauceJobStatus(allPassed); - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - - it("should get the url", function () { - return driver - .elementByXPath('//UIATextField[@value=\'Enter URL\']') - .sendKeys('https://www.google.com') - .elementByName('Go').click() - .elementByClassName('UIAWebView').click() // dismissing keyboard - .context('WEBVIEW') - .sleep(1000) - .waitForElementByName('q', 5000) - .sendKeys('sauce labs') - .sendKeys(wd.SPECIAL_KEYS.Return) - .sleep(1000) - .title().should.eventually.include('sauce labs'); - }); - -}); diff --git a/sample-code/examples/node/ios-yiewd.js b/sample-code/examples/node/ios-yiewd.js deleted file mode 100644 index 684156850..000000000 --- a/sample-code/examples/node/ios-yiewd.js +++ /dev/null @@ -1,75 +0,0 @@ -// This requires node 0.11 and harmony - -"use strict"; - -/* jshint esnext: true */ - -require("./helpers/setup"); - -var wd = require("yiewd"), - _ = require('underscore'), - serverConfigs = require('./helpers/appium-servers'); - -describe("ios simple", function () { - this.timeout(300000); - var driver; - var allPassed = true; - - var serverConfig = process.env.SAUCE ? - serverConfigs.sauce : serverConfigs.local; - driver = wd.remote(serverConfig.host,serverConfig.port, - serverConfig.username, serverConfig.password); - require("./helpers/logging").configure(driver); - - before(function (done) { - driver.run(function* () { - var desired = _.clone(require("./helpers/caps").ios71); - desired.app = require("./helpers/apps").iosTestApp; - if (process.env.SAUCE) { - desired.name = 'ios - simple'; - desired.tags = ['sample']; - } - yield driver.init(desired); - done(); - }); - }); - - after(function () { - driver.run(function* () { - try { - yield driver.quit(); - } catch (ign) { - if (process.env.SAUCE) { - yield driver.sauceJobStatus(allPassed); - } - } - }); - }); - - afterEach(function () { - allPassed = allPassed && this.currentTest.state === 'passed'; - }); - - it("should compute the sum", function (done) { - driver.run(function* () { - var inputFieldNames = ['IntegerA', 'IntegerB']; - var sum = 0; - for(var i=0; i abs_path($app), - browserName => "", - deviceName => "iPhone Simulator", - platformName => "iOS", - platformVersion => "7.1" -}; - -my $driver = Selenium::Remote::Driver->new_from_caps( - remote_server_addr => "127.0.0.1", - port => 4723, - desired_capabilities => $caps -); - -ok(defined $driver, 'Instantiated an iOS driver!'); - -my $expected_sum; -foreach (qw/1 2/) { - my $text_field = $driver->find_element('TextField' . $_, 'name'); - my $rand = int(rand(20)); - $expected_sum += $rand; - $text_field->send_keys($rand); -} - -my $compute_button = $driver->find_element('ComputeSumButton', 'name'); -$compute_button->click; - -my $sum_element = $driver->find_element($expected_sum, 'name'); -ok($sum_element->get_text eq $expected_sum, 'We can do addition!'); - -$driver->quit; - -done_testing; diff --git a/sample-code/examples/php/SauceTest.php b/sample-code/examples/php/SauceTest.php deleted file mode 100644 index 889c0ff0e..000000000 --- a/sample-code/examples/php/SauceTest.php +++ /dev/null @@ -1,49 +0,0 @@ - '', - 'seleniumServerRequestsTimeout' => 240, - 'desiredCapabilities' => array( - 'platform' => 'Mac 10.8', - 'device' => 'iPhone Simulator', - 'app' => APP_URL, - 'version' => '6.1', - ) - ) - ); - - public function elemsByTag($tag) - { - return $this->elements($this->using('tag name')->value($tag)); - } - - protected function populate() - { - $elems = $this->elemsByTag('textField'); - foreach ($elems as $elem) { - $randNum = rand(0, 10); - $elem->value($randNum); - $this->numValues[] = $randNum; - } - } - - public function testUiComputation() - { - $this->populate(); - $buttons = $this->elemsByTag('button'); - $buttons[0]->click(); - $texts = $this->elemsByTag('staticText'); - $this->assertEquals(array_sum($this->numValues), (int)($texts[0]->text())); - } -} diff --git a/sample-code/examples/php/SimpleTest.php b/sample-code/examples/php/SimpleTest.php deleted file mode 100644 index 8e5b8d8f0..000000000 --- a/sample-code/examples/php/SimpleTest.php +++ /dev/null @@ -1,54 +0,0 @@ - true, - 'port' => 4723, - 'browserName' => '', - 'desiredCapabilities' => array( - 'device' => 'iPhone Simulator', - 'version' => '6.0', - 'platform' => 'Mac', - 'app' => APP_PATH - ) - ) - ); - - public function elemsByTag($tag) - { - return $this->elements($this->using('tag name')->value($tag)); - } - - protected function populate() - { - $elems = $this->elemsByTag('textField'); - foreach ($elems as $elem) { - $randNum = rand(0, 10); - $elem->value($randNum); - $this->numValues[] = $randNum; - } - } - - public function testUiComputation() - { - $this->populate(); - $buttons = $this->elemsByTag('button'); - $buttons[0]->click(); - $texts = $this->elemsByTag('staticText'); - $this->assertEquals(array_sum($this->numValues), (int)($texts[0]->text())); - } -} diff --git a/sample-code/examples/php/composer.json b/sample-code/examples/php/composer.json deleted file mode 100644 index 832bdaf17..000000000 --- a/sample-code/examples/php/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "sauce/sausage": ">=0.6.0" - } -} \ No newline at end of file diff --git a/sample-code/examples/python/android_complex.py b/sample-code/examples/python/android_complex.py deleted file mode 100644 index 033babf49..000000000 --- a/sample-code/examples/python/android_complex.py +++ /dev/null @@ -1,159 +0,0 @@ -import os -import unittest - -from appium import webdriver -from appium.webdriver.common.touch_action import TouchAction -from appium.webdriver.common.multi_action import MultiAction - -from time import sleep - -# 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 ComplexAndroidTests(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): - self.driver.quit() - - def test_find_elements(self): - # pause a moment, so xml generation can occur - sleep(2) - - els = self.driver.find_elements_by_xpath('//android.widget.TextView') - self.assertEqual('API Demos', els[0].text) - - el = self.driver.find_element_by_xpath('//android.widget.TextView[contains(@text, "Animat")]') - self.assertEqual('Animation', el.text) - - el = self.driver.find_element_by_accessibility_id("App") - el.click() - - els = self.driver.find_elements_by_android_uiautomator('new UiSelector().clickable(true)') - # there are more, but at least 10 visible - self.assertLess(10, len(els)) - # the list includes 2 before the main visible elements - self.assertEqual('Action Bar', els[2].text) - - els = self.driver.find_elements_by_xpath('//android.widget.TextView') - self.assertLess(10, len(els)) - self.assertEqual('Action Bar', els[1].text) - - def test_scroll(self): - sleep(2) - els = self.driver.find_elements_by_xpath('//android.widget.TextView') - self.driver.scroll(els[7], els[3]) - - el = self.driver.find_element_by_accessibility_id('Views') - - def test_smiley_face(self): - # just for the fun of it. - # this doesn't really assert anything. - self.driver.find_element_by_accessibility_id('Graphics').click() - - els = self.driver.find_elements_by_class_name('android.widget.TextView') - self.driver.scroll(els[len(els)-1], els[0]) - - el = None - try: - el = self.driver.find_element_by_accessibility_id('Touch Paint') - except Exception as e: - els = self.driver.find_elements_by_class_name('android.widget.TextView') - self.driver.scroll(els[len(els)-1], els[0]) - - if el is None: - el = self.driver.find_element_by_accessibility_id('Touch Paint') - - el.click() - - # paint - e1 = TouchAction() - e1.press(x=150, y=100).release() - - e2 = TouchAction() - e2.press(x=250, y=100).release() - - smile = TouchAction() - smile.press(x=110, y=200) \ - .move_to(x=1, y=1) \ - .move_to(x=1, y=1) \ - .move_to(x=1, y=1) \ - .move_to(x=1, y=1) \ - .move_to(x=1, y=1) \ - .move_to(x=2, y=1) \ - .move_to(x=2, y=1) \ - .move_to(x=2, y=1) \ - .move_to(x=2, y=1) \ - .move_to(x=2, y=1) \ - .move_to(x=3, y=1) \ - .move_to(x=3, y=1) \ - .move_to(x=3, y=1) \ - .move_to(x=3, y=1) \ - .move_to(x=3, y=1) \ - .move_to(x=4, y=1) \ - .move_to(x=4, y=1) \ - .move_to(x=4, y=1) \ - .move_to(x=4, y=1) \ - .move_to(x=4, y=1) \ - .move_to(x=5, y=1) \ - .move_to(x=5, y=1) \ - .move_to(x=5, y=1) \ - .move_to(x=5, y=1) \ - .move_to(x=5, y=1) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=0) \ - .move_to(x=5, y=-1) \ - .move_to(x=5, y=-1) \ - .move_to(x=5, y=-1) \ - .move_to(x=5, y=-1) \ - .move_to(x=5, y=-1) \ - .move_to(x=4, y=-1) \ - .move_to(x=4, y=-1) \ - .move_to(x=4, y=-1) \ - .move_to(x=4, y=-1) \ - .move_to(x=4, y=-1) \ - .move_to(x=3, y=-1) \ - .move_to(x=3, y=-1) \ - .move_to(x=3, y=-1) \ - .move_to(x=3, y=-1) \ - .move_to(x=3, y=-1) \ - .move_to(x=2, y=-1) \ - .move_to(x=2, y=-1) \ - .move_to(x=2, y=-1) \ - .move_to(x=2, y=-1) \ - .move_to(x=2, y=-1) \ - .move_to(x=1, y=-1) \ - .move_to(x=1, y=-1) \ - .move_to(x=1, y=-1) \ - .move_to(x=1, y=-1) \ - .move_to(x=1, y=-1) - smile.release() - - ma = MultiAction(self.driver) - ma.add(e1, e2, smile) - ma.perform() - - # so you can see it - sleep(10) - - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(ComplexAndroidTests) - unittest.TextTestRunner(verbosity=2).run(suite) diff --git a/sample-code/examples/python/android_contacts.py b/sample-code/examples/python/android_contacts.py deleted file mode 100644 index 152822362..000000000 --- a/sample-code/examples/python/android_contacts.py +++ /dev/null @@ -1,53 +0,0 @@ -import os -import unittest -from appium import webdriver -from time import sleep - -# 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 ContactsAndroidTests(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/ContactManager/ContactManager.apk' - ) - desired_caps['appPackage'] = 'com.example.android.contactmanager' - desired_caps['appActivity'] = '.ContactManager' - - self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) - - def tearDown(self): - self.driver.quit() - - def test_add_contacts(self): - el = self.driver.find_element_by_accessibility_id("Add Contact") - el.click() - - textfields = self.driver.find_elements_by_class_name("android.widget.EditText") - textfields[0].send_keys("Appium User") - textfields[2].send_keys("someone@appium.io") - - self.assertEqual('Appium User', textfields[0].text) - self.assertEqual('someone@appium.io', textfields[2].text) - - self.driver.find_element_by_accessibility_id("Save").click() - - # for some reason "save" breaks things - alert = self.driver.switch_to_alert() - - # no way to handle alerts in Android - self.driver.find_element_by_android_uiautomator('new UiSelector().clickable(true)').click() - - self.driver.press_keycode(3) - - - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(ContactsAndroidTests) - unittest.TextTestRunner(verbosity=2).run(suite) diff --git a/sample-code/examples/python/android_sauce.py b/sample-code/examples/python/android_sauce.py deleted file mode 100644 index 862e2912a..000000000 --- a/sample-code/examples/python/android_sauce.py +++ /dev/null @@ -1,73 +0,0 @@ -import os -import httplib -import base64 -try: - import json -except ImportError: - import simplejson as json - -import unittest - -from appium import webdriver - -SAUCE_USERNAME = os.environ.get('SAUCE_USERNAME') -SAUCE_ACCESS_KEY = os.environ.get('SAUCE_ACCESS_KEY') -base64string = base64.encodestring('%s:%s' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY))[:-1] - -class SimpleAndroidSauceTests(unittest.TestCase): - - def setUp(self): - # set up appium - app = "http://appium.s3.amazonaws.com/NotesList.apk" - self.driver = webdriver.Remote( - command_executor='http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY), - desired_capabilities={ - 'appium-version': '1.0.0-beta.2', - 'platformName': 'Android', - 'deviceName': 'Android Emulator', - 'platformVersion': '4.2', - 'app': app, - 'name': 'Appium Python Android Test', - 'appPackage': 'com.example.android.notepad', - 'appActivity': '.NotesList' - }) - - def tearDown(self): - print("Link to your job: https://saucelabs.com/jobs/%s" % self.driver.session_id) - self.driver.quit() - - def _set_test_status(self, jobid, passed=True): - # Report the status of your test to Sauce - body_content = json.dumps({"passed": passed}) - connection = httplib.HTTPConnection("saucelabs.com") - connection.request('PUT', '/rest/v1/%s/jobs/%s' % (SAUCE_USERNAME, jobid), - body_content, - headers={"Authorization": "Basic %s" % base64string}) - result = connection.getresponse() - return result.status == 200 - - 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") - try: - self.assertEqual(els[2].text, "This is a new note!") - self._set_test_status(self.driver.session_id, True) - except: - self._set_test_status(self.driver.session_id, False) - - els[2].click() - - -if __name__ == '__main__': - if not (SAUCE_USERNAME and SAUCE_ACCESS_KEY): - print "Make sure you have SAUCE_USERNAME and SAUCE_ACCESS_KEY set as environment variables." - else: - unittest.main() diff --git a/sample-code/examples/python/android_simple.py b/sample-code/examples/python/android_simple.py deleted file mode 100644 index b7d3f1b8b..000000000 --- a/sample-code/examples/python/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) diff --git a/sample-code/examples/python/android_webview.py b/sample-code/examples/python/android_webview.py deleted file mode 100644 index 80f025059..000000000 --- a/sample-code/examples/python/android_webview.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -import glob -import unittest -from time import sleep - -from appium import webdriver - -PLATFORM_VERSION = '4.4' - - -class AndroidWebViewTests(unittest.TestCase): - - def setUp(self): - app = os.path.abspath( - os.path.join(os.path.dirname(__file__), - '../../apps/selendroid-test-app.apk')) - desired_caps = { - 'app': app, - 'appPackage': 'io.selendroid.testapp', - 'appActivity': '.HomeScreenActivity', - 'platformName': 'Android', - 'platformVersion': PLATFORM_VERSION, - 'deviceName': 'Android Emulator' - } - - if (PLATFORM_VERSION != '4.4'): - desired_caps['automationName'] = 'selendroid' - - self.driver = webdriver.Remote('http://localhost:4723/wd/hub', - desired_caps) - - def test_webview(self): - if (PLATFORM_VERSION == '4.4'): - button = self.driver.find_element_by_accessibility_id('buttonStartWebviewCD') - else: - button = self.driver.find_element_by_name('buttonStartWebviewCD') - button.click() - - self.driver.switch_to.context('WEBVIEW_0') - - input_field = self.driver.find_element_by_id('name_input') - sleep(1) - input_field.clear() - input_field.send_keys('Appium User') - input_field.submit() - - # test that everything is a-ok - source = self.driver.page_source - self.assertNotEqual(-1, source.find('This is my way of saying hello')) - self.assertNotEqual(-1, source.find('"Appium User"')) - - def tearDown(self): - self.driver.quit() - - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(AndroidWebViewTests) - unittest.TextTestRunner(verbosity=2).run(suite) diff --git a/sample-code/examples/python/ios_complex.py b/sample-code/examples/python/ios_complex.py deleted file mode 100644 index 221ebf371..000000000 --- a/sample-code/examples/python/ios_complex.py +++ /dev/null @@ -1,183 +0,0 @@ -""" -More involved iOS tests, using UICatalog application. -""" -import unittest -import os -import random -import string -from appium import webdriver -from appium.webdriver.common.touch_action import TouchAction -# from selenium.webdriver.common.action_chains import ActionChains -from selenium.webdriver.common.touch_actions import TouchActions -# from selenium.webdriver.common.keys import Keys -import urllib2 -import json -from time import sleep - -def str_generator(size=6, chars=string.ascii_uppercase + string.digits): - return ''.join(random.choice(chars) for x in range(size)) - - -class ComplexIOSTests(unittest.TestCase): - - def setUp(self): - # set up appium - app = os.path.join(os.path.dirname(__file__), - '../../apps/UICatalog/build/Release-iphonesimulator', - 'UICatalog.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': '7.1', - 'deviceName': 'iPhone Simulator' - }) - self._values = [] - - def tearDown(self): - self.driver.quit() - - def _open_menu_position(self, index): - # Opens up the menu at position [index] : starts at 0. - table = self.driver.find_element_by_class_name("UIATableView") - self._row = table.find_elements_by_class_name("UIATableCell")[index] - self._row.click() - - def test_find_element(self): - # first view in UICatalog is a table - table = self.driver.find_element_by_class_name("UIATableView") - self.assertIsNotNone(table) - - # is number of cells/rows inside table correct - rows = table.find_elements_by_class_name("UIATableCell") - self.assertEqual(18, len(rows)) - - # is first one about buttons - self.assertEqual(rows[0].get_attribute("name"), "Action Sheets, AAPLActionSheetViewController") - - # there is nav bar inside the app - nav_bar = self.driver.find_element_by_class_name("UIANavigationBar") - self.assertTrue(nav_bar) - - def test_frames(self): - # go into webview frame - self._open_menu_position(15) - - # get the contexts and switch to webview - contexts = self.driver.contexts - self.assertEqual([u'NATIVE_APP', u'WEBVIEW_1'], contexts) - self.driver.switch_to.context(contexts[1]) - - # Find the store link - sleep(4) # let the page load, perhaps - logo = self.driver.find_element_by_id('gn-apple') - self.assertIsNotNone(logo) - - # leave the webview - self.driver.switch_to.context(contexts[0]) - - # Verify we are out of the webview - scroll_after = self.driver.find_element_by_class_name("UIAScrollView") - self.assertTrue(scroll_after) - - def test_location(self): - # get third row location - row = self.driver.find_elements_by_class_name("UIATableCell")[2] - self.assertEqual(row.location['x'], 0) - self.assertEqual(row.location['y'], 152) - - def test_screenshot(self): - # make screenshot and get is as base64 - screenshot = self.driver.get_screenshot_as_base64() - self.assertTrue(screenshot) - - # make screenshot and save it to the local filesystem - success = self.driver.get_screenshot_as_file("foo.png") - self.assertTrue(success) - self.assertTrue(os.path.isfile("foo.png")) - - # get rid of the file - os.remove("foo.png") - - def test_text_field_edit(self): - # go to the text fields section - self._open_menu_position(13) - - text_field = self.driver.find_elements_by_class_name("UIATextField")[0] - - # get default/empty text - default_val = text_field.get_attribute("value") - - # write some random text to element - rnd_string = str_generator() - text_field.send_keys(rnd_string) - self.assertEqual(text_field.get_attribute("value"), rnd_string) - - # clear and check if is empty/has default text - text_field.clear() - self.assertEqual(text_field.get_attribute("value"), default_val) - - def test_alert_interaction(self): - # go to the alerts section - self.driver.find_element_by_name('Alert Views, AAPLAlertViewController').click() - triggerOk = self.driver.find_element_by_accessibility_id("Simple") - - # TOFIX: Looks like alert object is not proper state - # something to do with UIActionSheet vs. UIAlertView? - # triggerOk = elements[0] - triggerOk.click() - alert = self.driver.switch_to_alert() - - # dismiss alert - alert.accept() - - # trigger modal alert with cancel & ok buttons - triggerOkCancel = self.driver.find_element_by_accessibility_id("Okay / Cancel") - triggerOkCancel.click() - alert = self.driver.switch_to_alert() - - # check if title of alert is correct - self.assertEqual(alert.text, "A Short Title Is Best A message should be a short, complete sentence.") - alert.accept() - - def test_slider(self): - # go to controls - self._open_menu_position(10) - - # get the slider - slider = self.driver.find_element_by_class_name("UIASlider") - self.assertEqual(slider.get_attribute("value"), "42%") - - slider.set_value(0) - self.assertEqual(slider.get_attribute("value"), "0%") - - def test_sessions(self): - data = json.loads(urllib2.urlopen("http://localhost:4723/wd/hub/sessions").read()) - self.assertEqual(self.driver.session_id, data['sessionId']) - - def test_size(self): - table = self.driver.find_element_by_class_name("UIATableView").size - row = self.driver.find_elements_by_class_name("UIATableCell")[0].size - self.assertEqual(table['width'], row['width']) - self.assertNotEqual(table['height'], row['height']) - - def test_source(self): - # get main view soruce - source_main = self.driver.page_source - self.assertIn("UIATableView", source_main) - self.assertIn("Text Fields, AAPLTextFieldViewController", source_main) - - # got to text fields section - self._open_menu_position(13) - sleep(10) - source_textfields = self.driver.page_source - self.assertIn("UIAStaticText", source_textfields) - self.assertIn("Text Fields", source_textfields) - - self.assertNotEqual(source_main, source_textfields) - - -suite = unittest.TestLoader().loadTestsFromTestCase(ComplexIOSTests) -unittest.TextTestRunner(verbosity=2).run(suite) diff --git a/sample-code/examples/python/ios_sauce.py b/sample-code/examples/python/ios_sauce.py deleted file mode 100644 index 2b4153b25..000000000 --- a/sample-code/examples/python/ios_sauce.py +++ /dev/null @@ -1,84 +0,0 @@ -"""An example of Appium running on Sauce. - -This test assumes SAUCE_USERNAME and SAUCE_ACCESS_KEY are environment variables -set to your Sauce Labs username and access key.""" - -import unittest -import os -import httplib -import base64 -from random import randint -from appium import webdriver -try: - import json -except ImportError: - import simplejson as json - -SAUCE_USERNAME=os.environ.get('SAUCE_USERNAME') -SAUCE_ACCESS_KEY=os.environ.get('SAUCE_ACCESS_KEY') -base64string = base64.encodestring('%s:%s' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY))[:-1] - -class SimpleIOSSauceTests(unittest.TestCase): - - def setUp(self): - # set up appium - app = 'http://appium.s3.amazonaws.com/TestApp6.0.app.zip' - - self.driver = webdriver.Remote( - command_executor = 'http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY), - desired_capabilities = { - 'appium-version': '1.0.0-beta.2', - 'name': 'Appium Python iOS Test', - 'platformName': 'iOS', - 'deviceName': 'iPhone Simulator', - 'platformVersion': '7.1', - 'app': app - }) - - def tearDown(self): - print("Link to your job: https://saucelabs.com/jobs/%s" % self.driver.session_id) - self.driver.quit() - - def _set_test_status(self, jobid, passed=True): - # Report the status of your test to Sauce - body_content = json.dumps({"passed": passed}) - connection = httplib.HTTPConnection("saucelabs.com") - connection.request('PUT', '/rest/v1/%s/jobs/%s' % (SAUCE_USERNAME, jobid), - body_content, - headers={"Authorization": "Basic %s" % base64string}) - result = connection.getresponse() - return result.status == 200 - - def _populate(self): - # populate text fields with two random numbers - els = self.driver.find_elements_by_ios_uiautomation('elements()') - - 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_elements_by_class_name("UIAStaticText")[0].text - sum = self.driver.find_element_by_ios_uiautomation('elements()[3]').text - try: - self.assertEqual(int(sum), self._sum) - self._set_test_status(self.driver.session_id, True) - except: - self._set_test_status(self.driver.session_id, False) - - -if __name__ == '__main__': - if not (SAUCE_USERNAME and SAUCE_ACCESS_KEY): - print "Make sure you have SAUCE_USERNAME and SAUCE_ACCESS_KEY set as environment variables." - else: - unittest.main() diff --git a/sample-code/examples/python/ios_sauce_webview.py b/sample-code/examples/python/ios_sauce_webview.py deleted file mode 100644 index 74efe86e3..000000000 --- a/sample-code/examples/python/ios_sauce_webview.py +++ /dev/null @@ -1,82 +0,0 @@ -"""An example of Appium running on Sauce, with a webview. - -This test assumes SAUCE_USERNAME and SAUCE_ACCESS_KEY are environment variables -set to your Sauce Labs username and access key.""" - -import unittest -import os -import httplib -import base64 -from random import randint -from appium import webdriver -try: - import json -except ImportError: - import simplejson as json -from time import sleep - -from selenium.webdriver.common.keys import Keys - -SAUCE_USERNAME=os.environ.get('SAUCE_USERNAME') -SAUCE_ACCESS_KEY=os.environ.get('SAUCE_ACCESS_KEY') -base64string = base64.encodestring('%s:%s' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY))[:-1] - -class WebViewIOSSauceTests(unittest.TestCase): - - def setUp(self): - # set up appium - app = 'http://appium.s3.amazonaws.com/WebViewApp6.0.app.zip' - - self.driver = webdriver.Remote( - command_executor = 'http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY), - desired_capabilities = { - 'appium-version': '1.1.0', - 'name': 'Appium iOS WebView Test', - 'platformName': 'iOS', - 'deviceName': 'iPhone Simulator', - 'platformVersion': '7.1', - 'app': app - }) - - def tearDown(self): - print("Link to your job: https://saucelabs.com/jobs/%s" % self.driver.session_id) - self.driver.quit() - - def _set_test_status(self, jobid, passed=True): - # Report the status of your test to Sauce - body_content = json.dumps({"passed": passed}) - connection = httplib.HTTPConnection("saucelabs.com") - connection.request('PUT', '/rest/v1/%s/jobs/%s' % (SAUCE_USERNAME, jobid), - body_content, - headers={"Authorization": "Basic %s" % base64string}) - result = connection.getresponse() - return result.status == 200 - - def test_get_url(self): - url_el = self.driver.find_element_by_xpath('//UIAApplication[1]/UIAWindow[1]/UIATextField[1]') - url_el.send_keys('http://www.google.com') - - go_el = self.driver.find_element_by_accessibility_id('Go') - go_el.click() - - self.driver.switch_to.context('WEBVIEW') - - search = self.driver.find_element_by_name('q') - search.send_keys('sauce labs') - search.send_keys(Keys.RETURN) - - # allow the page to load - sleep(1) - - try: - self.assertEquals('sauce labs - Google Search', self.driver.title) - self._set_test_status(self.driver.session_id, True) - except: - self._set_test_status(self.driver.session_id, False) - - -if __name__ == '__main__': - if not (SAUCE_USERNAME and SAUCE_ACCESS_KEY): - print "Make sure you have SAUCE_USERNAME and SAUCE_ACCESS_KEY set as environment variables." - else: - unittest.main() diff --git a/sample-code/examples/python/ios_simple.py b/sample-code/examples/python/ios_simple.py deleted file mode 100644 index 7a935b88a..000000000 --- a/sample-code/examples/python/ios_simple.py +++ /dev/null @@ -1,69 +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-iphonesimulator', - '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': '7.1', - 'deviceName': 'iPhone Simulator' - }) - - 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()') - - 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_ios_uiautomation('elements()[3]').text - self.assertEqual(int(sum), self._sum) - - def test_scroll(self): - els = self.driver.find_elements_by_class_name('UIAButton') - els[5].click() - - sleep(1) - el = self.driver.find_element_by_accessibility_id('OK') - el.click() - - sleep(1) - 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/sample-code/examples/python/ios_webview.py b/sample-code/examples/python/ios_webview.py deleted file mode 100644 index 546d0169d..000000000 --- a/sample-code/examples/python/ios_webview.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -Simple iOS WebView tests. -""" -import unittest -import os -from random import randint -from appium import webdriver -from time import sleep - -from selenium.webdriver.common.keys import Keys - -class WebViewIOSTests(unittest.TestCase): - - def setUp(self): - # set up appium - app = os.path.join(os.path.dirname(__file__), - '../../apps/WebViewApp/build/Release-iphonesimulator', - 'WebViewApp.app') - app = os.path.abspath(app) - self.driver = webdriver.Remote( - command_executor='http://127.0.0.1:4723/wd/hub', - desired_capabilities={ - 'app': app, - 'deviceName': 'iPhone Simulator', - 'platformName': 'iOS', - 'platformVersion': '7.1' - }) - - def tearDown(self): - self.driver.quit() - - def test_get_url(self): - url_el = self.driver.find_element_by_xpath('//UIAApplication[1]/UIAWindow[1]/UIATextField[1]') - url_el.send_keys('http://www.google.com') - - go_el = self.driver.find_element_by_accessibility_id('Go') - go_el.click() - sleep(1) - - self.driver.switch_to.context('WEBVIEW') - - search = self.driver.find_element_by_name('q') - search.send_keys('sauce labs') - search.send_keys(Keys.RETURN) - - # allow the page to load - sleep(1) - - self.assertEquals('sauce labs - Google Search', self.driver.title) - - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(WebViewIOSTests) - unittest.TextTestRunner(verbosity=2).run(suite) diff --git a/sample-code/examples/python/sauce_connect.py b/sample-code/examples/python/sauce_connect.py deleted file mode 100644 index 577dfa5e0..000000000 --- a/sample-code/examples/python/sauce_connect.py +++ /dev/null @@ -1,133 +0,0 @@ -"""An example of Appium running on Sauce using Sauce Connect to access a local webserver. - -This test assumes SAUCE_USERNAME and SAUCE_ACCESS_KEY are environment variables -set to your Sauce Labs username and access key. - -You'll also need Sauce-Connect.jar in this test directory so we can start it to enable -a tunnel between Sauce Labs and your machine - -This is an All-In-One bundle test that does a lot more than usual test would. It does following -things that you would normally do in a different way: -- starts Sauce Connect - which you would normally start from console with - "java -jar Sauce-Connect.jar SAUCE_USERNAME SAUCE_ACCESS_KEY" -- starts a local webserver on port 9999 that serves a sample string - normally you would - like to connect to your own webserver -""" - -import unittest -from selenium import webdriver -import os -import subprocess -import sys -import select -from SimpleHTTPServer import SimpleHTTPRequestHandler -from StringIO import StringIO -from threading import Thread -from BaseHTTPServer import HTTPServer -from SocketServer import ThreadingMixIn - - -SAUCE_USERNAME = os.environ.get('SAUCE_USERNAME') -SAUCE_ACCESS_KEY = os.environ.get('SAUCE_ACCESS_KEY') - - -class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): - """Handle requests in a separate thread.""" - - -class MyRequestHandler(SimpleHTTPRequestHandler): - """Serve a sample HTML page so we can check if test works properly""" - def do_GET(self): - f = StringIO() - f.write("Welcome to the flipside!") - f.seek(0) - - #send code 200 response - self.send_response(200) - - #send header first - self.send_header('Content-type', 'text-html') - self.end_headers() - - #send file content to client - self.wfile.write(f.read()) - f.close() - return - - -class Selenium2OnSauce(unittest.TestCase): - - def setUpWebServer(self): - # Setting up a local websever in separate thread on port 9999 - httpd = ThreadedHTTPServer(("", 9999), MyRequestHandler) - sa = httpd.socket.getsockname() - print "[HTTP Server] Serving HTTP on", sa[0], "port", sa[1], "..." - thread = Thread(target=httpd.serve_forever) - thread.daemon = True # so server gets killed when we exit - thread.start() - - def setUpTunnel(self): - # Setting up Sauce Connect tunnel - self.process = subprocess.Popen(["java -jar Sauce-Connect.jar %s %s" % (SAUCE_USERNAME, SAUCE_ACCESS_KEY)], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - p = self.process - print "[Sauce Connect]: Waiting for tunnel setup, this make take up to 30s" - is_ready = False - while True: - reads = [p.stdout.fileno(), p.stderr.fileno()] - ret = select.select(reads, [], []) - - for fd in ret[0]: - if fd == p.stdout.fileno(): - read = p.stdout.readline() - sys.stdout.write("[Sauce Connect]: %s" % read) - - if "Connected! You may start your tests." in read: - print "[Sauce Connect]: Tunnel ready, running the test" - is_ready = True - break - - if fd == p.stderr.fileno(): - read = p.stderr.readline() - sys.stderr.write("[Sauce Connect]: %s" % read) - if "Unable to access jarfile" in read: - self.process.terminate() - raise Exception("Sauce Connect could not start!") - - if is_ready: - break - - def setUp(self): - self.setUpWebServer() - self.setUpTunnel() - - desired_capabilities={ - 'browserName': '', - 'platformName': 'Android', - 'deviceName': 'iPhone Simulator', - 'platformVersion': '6.1', - 'app': app, - 'name': 'Appium Python iOS Test (Connect)' - }) - - self.driver = webdriver.Remote( - desired_capabilities=caps, - command_executor="http://%s:%s@ondemand.saucelabs.com:80/wd/hub" % (SAUCE_USERNAME, SAUCE_ACCESS_KEY) - ) - self.driver.implicitly_wait(30) - - def test_basic(self): - driver = self.driver - driver.get("http://127.0.0.1:9999/") - body = self.driver.find_element_by_tag_name("body") - self.assertTrue("Welcome to the flipside!" in body.text) - - def tearDown(self): - print("Link to your job: https://saucelabs.com/jobs/%s" % self.driver.session_id) - self.driver.quit() - self.process.terminate() - -if __name__ == '__main__': - if not (SAUCE_USERNAME and SAUCE_ACCESS_KEY): - print "Make sure you have SAUCE_USERNAME and SAUCE_ACCESS_KEY set as environment variables." - else: - unittest.main() diff --git a/sample-code/examples/python/selendroid_simple.py b/sample-code/examples/python/selendroid_simple.py deleted file mode 100644 index df4dece70..000000000 --- a/sample-code/examples/python/selendroid_simple.py +++ /dev/null @@ -1,60 +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) -) - -# think times can be useful e.g. when testing with an emulator -THINK_TIME = 5. - -class SimpleSalendroidTests(unittest.TestCase): - def setUp(self): - desired_caps = {} - desired_caps['platformName'] = 'Android' - desired_caps['platformVersion'] = '4.1' - desired_caps['deviceName'] = 'Android Emulator' - desired_caps['automationName'] = "selendroid" - 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_selendroid(self): - el = self.driver.find_element_by_name("Animation") - # assert el.text == "Animation" - self.assertEqual('Animation', el.text) - - el = self.driver.find_element_by_class_name("android.widget.TextView") - # assert el.text == "Accessibility" - self.assertEqual('Accessibility', el.text) - - el = self.driver.find_element_by_name("App") - el.click() - sleep(THINK_TIME) - - els = self.driver.find_elements_by_class_name("android.widget.TextView") - # Selendroid gets all the elements, not just the visible ones - self.assertLessEqual(30, len(els)) - - self.driver.find_element_by_name('Action Bar') - - self.driver.back() - sleep(THINK_TIME) - - el = self.driver.find_element_by_name("Animation") - self.assertEqual('Animation', el.text) - - -if __name__ == '__main__': - suite = unittest.TestLoader().loadTestsFromTestCase(SimpleSalendroidTests) - unittest.TextTestRunner(verbosity=2).run(suite) diff --git a/sample-code/examples/ruby/Gemfile b/sample-code/examples/ruby/Gemfile deleted file mode 100644 index 26a061e51..000000000 --- a/sample-code/examples/ruby/Gemfile +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://www.rubygems.org' - -gem 'appium_lib', '~> 3.0.2' -gem 'rest-client', '~> 1.6.7' -gem 'rspec', '~> 2.14.1' -gem 'cucumber', '~> 1.3.15' -gem 'rspec-expectations', '~> 2.14.5' -gem 'spec', '~> 5.3.4' -gem 'sauce_whisk', '~> 0.0.13' -gem 'test-unit', '~> 2.5.5' # required for bundle exec ruby xunit_android.rb \ No newline at end of file diff --git a/sample-code/examples/ruby/README.md b/sample-code/examples/ruby/README.md deleted file mode 100644 index 1da7caa09..000000000 --- a/sample-code/examples/ruby/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# Ruby Examples - -## Before you test - -All these commands are done from a terminal window. If you've already done -a step, you can safely ignore that command. - -Open this directory: `cd APPIUM-LOCATION/sample-code/examples/ruby` - -Install Ruby: `\curl -L https://get.rvm.io | bash -s stable --ruby` - -Install Bundler: `gem install bundle` - -Install Gems: `bundle update` - -You're ready to go! - -## [simple_test.rb](simple_test.rb) - -A sanity check and simple example of driving a calculator app. Run this to see -the bare minimum you need to get a test running for Appium. - -Run the test by making sure Appium is running in another terminal, then from -the terminal you opened above, running `rspec simple_test.rb` - -For more information, check out the comments at the top of -[simple_test.rb](simple_test.rb#L1) - -## [u\_i\_catalog.rb](u_i_catalog.rb) - -(NB: This example is not yet 1.0 Compliant) -A demonstration of various things you can do with Appium. Check this if you -need a recipe for a specific task, or just to see how simple and powerful iOS -testing can be. - -Run the test by making sure Appium is running in another terminal, then from -the terminal you opened above, running `rspec u_i_catalog.rb` - -For more information, check out the comments at the top of [u_i_catalog.rb](u_i_catalog.rb#L1) - -## [Cucumber](cucumber_ios) - -Cucumber is a Behaviour Driven Design framework that lots of people are keen on. -It lets you describe test actions in a clean, concise, English-like manner. - -This example also demonstrates the use of appium.txt, appium_lib's file-based -configuration option. - -To run the Cucumber examples, you'll need to change directory to the cucumber -directory (`cd APPIUM-LOCATION/sample-code/examples/ruby/cucumber`) and then, -from the commandline, run `cucumber`. - -For more information, check out the comments at the top of the files in the -cucumber directory. - -## [Sauce Example](sauce_example.rb) - -Shows how to run Appium on Sauce Labs. [Sauce Labs](http://www.saucelabs.com) -is a Selenium Platform as a Service company which helps you scale your web and -mobile test automation. - -This example demonstrates how to request an Appium session using a publicly -accessible test application, as well as how to inform Sauce Labs of test -success or failure. - -## [XUnit Android](xunit_android.rb) - -A test unit example that uses advanced xpath to launch the system's settings -app and extract the current version of Android. diff --git a/sample-code/examples/ruby/UICatalog.app.zip b/sample-code/examples/ruby/UICatalog.app.zip deleted file mode 100644 index 70d2ef2de..000000000 Binary files a/sample-code/examples/ruby/UICatalog.app.zip and /dev/null differ diff --git a/sample-code/examples/ruby/android_on_sauce.rb b/sample-code/examples/ruby/android_on_sauce.rb deleted file mode 100644 index 3449d212e..000000000 --- a/sample-code/examples/ruby/android_on_sauce.rb +++ /dev/null @@ -1,70 +0,0 @@ -# This example automates a test of the Android example notepad app. -# -# To run this example, make sure you've run: -# $ bundle install -# -# And set the environment variables: -# SAUCE_USERNAME = your-sauce-username -# SAUCE_ACCESS_KEY = your-sauce-key -# -# Then just: -# bundle exec ruby android_on_sauce.rb -# -# Of note compared to the iOS example, here we're giving the package and -# activity, no OS and an empty browserName -# -# Of note compared to the non-sauce examples, you need to host your app -# somewhere Sauce Labs' cloud can fetch it for your test. - -require 'rubygems' -require 'spec' -require 'appium_lib' -require 'sauce_whisk' - -describe 'Notepad' do - def desired_caps - { - caps: { - :'appium-version' => '1.1.0', - platformName: 'Android', - platformVersion: '4.3', - deviceName: 'Android Emulator', - app: 'http://appium.s3.amazonaws.com/NotesList.apk', - name: 'Ruby Appium Android example' - }, - appium_lib: { - wait: 60 - } - } - end - - before do - Appium::Driver.new(desired_caps).start_driver - end - - after do - driver_quit - end - - it 'can create and save new notes' do - find('New note').click - first_textfield.type 'This is a new note, from Ruby' - - find('Save').click - - note_count = ids('android:id/text1').length - note_count.must_equal 1 - texts.last.text.must_equal 'This is a new note, from Ruby' - end -end - -passed = Minitest.run_specs({ :trace => [__FILE__] }).first - -# Because WebDriver doesn't have the concept of test failure, use the Sauce -# Labs REST API to record job success or failure -user = ENV['SAUCE_USERNAME'] -key = ENV['SAUCE_ACCESS_KEY'] -if user && !user.empty? && key && !key.empty? - passed = passed.failures == 0 && passed.errors == 0 - SauceWhisk::Jobs.change_status $driver.driver.session_id, passed -end \ No newline at end of file diff --git a/sample-code/examples/ruby/cucumber_android/features/settings.feature b/sample-code/examples/ruby/cucumber_android/features/settings.feature deleted file mode 100644 index f7580ba23..000000000 --- a/sample-code/examples/ruby/cucumber_android/features/settings.feature +++ /dev/null @@ -1,43 +0,0 @@ -# WHAT ARE FEATURES? -# ------------------ -# Features describe what something should allow a user to accomplish. They're -# high-level things, like you'd put in your manual or marketing copy. Each -# line describes a "step" which should pass for the feature to be -# implemented. They're usually written with non-developers in mind, so should -# be nice, plain and English like. -# -# WHAT ARE THE OTHER FILES? -# ------------------------- -# The 'steps' are implemented in a step definition file, which is created by -# developers. Ideally, once steps have been created, anyone can write a -# feature by using step definitions to do so. The step definitions for this -# example can be found in the cucumber/features/step_definitions/steps.rb file. -# -# RUNNING THE TEST: -# ----------------- -# Assuming you've (successfully) run the examples in the simple_test.rb file, -# all you should need for Cucumber is: -# -# 1. Start Appium in a terminal window -# 2. From another terminal window, open the cucumber example directory at -# appium/sample-code/examples/ruby/cucumber_android/ -# 3. type 'cucumber' and hit enter -# 4. If you see '1 scenario (1 passed)' and some other stuff, SUCCESS! The -# test passed. If you didn't, BOOOO, that's not right. Make sure you've -# followed all the instructions for setup in the simple_test.rb file and -# give it another shot. If that doesn't work, log a support ticket on -# Github at https://github.com/appium/appium/issues/new -# -# ADDITIONAL INFORMATION: -# ----------------------- -# -# For more information about features, check out the documentation at: -# https://github.com/cucumber/cucumber/wiki/Feature-Introduction - - -Feature: Version check - Settings must display the Android version - - Scenario: Settings - Given I click about phone - Then the Android version is a number diff --git a/sample-code/examples/ruby/cucumber_android/features/step_definitions/steps.rb b/sample-code/examples/ruby/cucumber_android/features/step_definitions/steps.rb deleted file mode 100644 index 5e2f21144..000000000 --- a/sample-code/examples/ruby/cucumber_android/features/step_definitions/steps.rb +++ /dev/null @@ -1,37 +0,0 @@ -# These are the 'step definitions' which Cucumber uses to implement features. -# -# Each step starts with a regular expression matching the step you write in -# your feature description. Any variables are parsed out and passed to the -# step block. -# -# The instructions in the step are then executed with those variables. -# -# In this example, we're using rspec's assertions to test that things are happening, -# but you can use any ruby code you want in the steps. -# -# The '$driver' object is the appium_lib driver, set up in the cucumber/support/env.rb -# file, which is a convenient place to put it as we're likely to use it often. -# This is a different use to most of the examples; Cucumber steps are instances -# of `Object`, and extending Object with Appium methods (through -# `promote_appium_methods`) is a bad idea. -# -# For more on step definitions, check out the documentation at -# https://github.com/cucumber/cucumber/wiki/Step-Definitions -# -# For more on rspec assertions, check out -# https://www.relishapp.com/rspec/rspec-expectations/docs - -Given /^I click about phone$/ do - scroll_to('About phone').click -end - -Given /^the Android version is a number$/ do - android_version = 'Android version' - scroll_to android_version - - view = 'android.widget.TextView' - version = xpath(%Q(//#{view}[preceding-sibling::#{view}[@text="#{android_version}"]])).text - valid = !version.match(/\d/).nil? - - expect(valid).to eq(true) -end \ No newline at end of file diff --git a/sample-code/examples/ruby/cucumber_android/features/support/appium.txt b/sample-code/examples/ruby/cucumber_android/features/support/appium.txt deleted file mode 100644 index 5ef407aa4..000000000 --- a/sample-code/examples/ruby/cucumber_android/features/support/appium.txt +++ /dev/null @@ -1,8 +0,0 @@ -[caps] -platformName = "Android" -appActivity = ".Settings" -appPackage = "com.android.settings" - -[appium_lib] -sauce_username = false -sauce_access_key = false \ No newline at end of file diff --git a/sample-code/examples/ruby/cucumber_android/features/support/env.rb b/sample-code/examples/ruby/cucumber_android/features/support/env.rb deleted file mode 100644 index 755b0096c..000000000 --- a/sample-code/examples/ruby/cucumber_android/features/support/env.rb +++ /dev/null @@ -1,41 +0,0 @@ -# This file provides setup and common functionality across all features. It's -# included first before every test run, and the methods provided here can be -# used in any of the step definitions used in a test. This is a great place to -# put shared data like the location of your app, the capabilities you want to -# test with, and the setup of selenium. - -require 'rspec/expectations' -require 'appium_lib' -require 'cucumber/ast' - -# Create a custom World class so we don't pollute `Object` with Appium methods -class AppiumWorld -end - -# Load the desired configuration from appium.txt, create a driver then -# Add the methods to the world -caps = Appium.load_appium_txt file: File.expand_path('./', __FILE__), verbose: true -Appium::Driver.new(caps) -Appium.promote_appium_methods AppiumWorld - -World do - AppiumWorld.new -end - -Before { $driver.start_driver } -After { $driver.driver_quit } - - -=begin -# If you wanted one env.rb for both android and iOS, you could use logic similar to this: - -world_class = ENV['PLATFORM_NAME'] == 'iOS' ? IosWorld : AndroidWorld - -# each world class defines the `caps` method specific to that platform -Appium::Driver.new world_class.caps -Appium.promote_appium_methods world_class -World { world_class.new } - -Before { $driver.start_driver } -After { $driver.driver_quit } -=end diff --git a/sample-code/examples/ruby/cucumber_ios/features/calculator.feature b/sample-code/examples/ruby/cucumber_ios/features/calculator.feature deleted file mode 100644 index a992fd133..000000000 --- a/sample-code/examples/ruby/cucumber_ios/features/calculator.feature +++ /dev/null @@ -1,47 +0,0 @@ -# WHAT ARE FEATURES? -# ------------------ -# Features describe what something should allow a user to accomplish. They're -# high-level things, like you'd put in your manual or marketing copy. Each -# line describes a "step" which should pass for the feature to be -# implemented. They're usually written with non-developers in mind, so should -# be nice, plain and English like. -# -# WHAT ARE THE OTHER FILES? -# ------------------------- -# The 'steps' are implemented in a step definition file, which is created by -# developers. Ideally, once steps have been created, anyone can write a -# feature by using step definitions to do so. The step definitions for this -# example can be found in the cucumber/features/step_definitions/steps.rb file. -# -# RUNNING THE TEST: -# ----------------- -# Assuming you've (successfully) run the examples in the simple_test.rb file, -# all you should need for Cucumber is: -# -# 1. Start Appium in a terminal window -# 2. From another terminal window, open the cucumber example directory at -# appium/sample-code/examples/ruby/cucumber_ios/ -# 3. type 'cucumber' and hit enter -# 4. If you see '1 scenario (1 passed)' and some other stuff, SUCCESS! The -# test passed. If you didn't, BOOOO, that's not right. Make sure you've -# followed all the instructions for setup in the simple_test.rb file and -# give it another shot. If that doesn't work, log a support ticket on -# Github at https://github.com/appium/appium/issues/new -# -# ADDITIONAL INFORMATION: -# ----------------------- -# -# For more information about features, check out the documentation at: -# https://github.com/cucumber/cucumber/wiki/Feature-Introduction - - -Feature: Addition - In order to revolutionize maths teaching - As an iOS developer - I want to be able to sum two numbers - - Scenario: Add two numbers - Given I have entered 4 into field 1 of the calculator - And I have entered 7 into field 2 of the calculator - When I press button 1 - Then the result should be displayed as 11 diff --git a/sample-code/examples/ruby/cucumber_ios/features/calculator2.feature b/sample-code/examples/ruby/cucumber_ios/features/calculator2.feature deleted file mode 100644 index a992fd133..000000000 --- a/sample-code/examples/ruby/cucumber_ios/features/calculator2.feature +++ /dev/null @@ -1,47 +0,0 @@ -# WHAT ARE FEATURES? -# ------------------ -# Features describe what something should allow a user to accomplish. They're -# high-level things, like you'd put in your manual or marketing copy. Each -# line describes a "step" which should pass for the feature to be -# implemented. They're usually written with non-developers in mind, so should -# be nice, plain and English like. -# -# WHAT ARE THE OTHER FILES? -# ------------------------- -# The 'steps' are implemented in a step definition file, which is created by -# developers. Ideally, once steps have been created, anyone can write a -# feature by using step definitions to do so. The step definitions for this -# example can be found in the cucumber/features/step_definitions/steps.rb file. -# -# RUNNING THE TEST: -# ----------------- -# Assuming you've (successfully) run the examples in the simple_test.rb file, -# all you should need for Cucumber is: -# -# 1. Start Appium in a terminal window -# 2. From another terminal window, open the cucumber example directory at -# appium/sample-code/examples/ruby/cucumber_ios/ -# 3. type 'cucumber' and hit enter -# 4. If you see '1 scenario (1 passed)' and some other stuff, SUCCESS! The -# test passed. If you didn't, BOOOO, that's not right. Make sure you've -# followed all the instructions for setup in the simple_test.rb file and -# give it another shot. If that doesn't work, log a support ticket on -# Github at https://github.com/appium/appium/issues/new -# -# ADDITIONAL INFORMATION: -# ----------------------- -# -# For more information about features, check out the documentation at: -# https://github.com/cucumber/cucumber/wiki/Feature-Introduction - - -Feature: Addition - In order to revolutionize maths teaching - As an iOS developer - I want to be able to sum two numbers - - Scenario: Add two numbers - Given I have entered 4 into field 1 of the calculator - And I have entered 7 into field 2 of the calculator - When I press button 1 - Then the result should be displayed as 11 diff --git a/sample-code/examples/ruby/cucumber_ios/features/step_definitions/steps.rb b/sample-code/examples/ruby/cucumber_ios/features/step_definitions/steps.rb deleted file mode 100644 index a80d3b3bf..000000000 --- a/sample-code/examples/ruby/cucumber_ios/features/step_definitions/steps.rb +++ /dev/null @@ -1,47 +0,0 @@ -# These are the 'step definitions' which Cucumber uses to implement features. -# -# Each step starts with a regular expression matching the step you write in -# your feature description. Any variables are parsed out and passed to the -# step block. -# -# The instructions in the step are then executed with those variables. -# -# In this example, we're using rspec's assertions to test that things are happening, -# but you can use any ruby code you want in the steps. -# -# The '$driver' object is the appium_lib driver, set up in the cucumber/support/env.rb -# file, which is a convenient place to put it as we're likely to use it often. -# This is a different use to most of the examples; Cucumber steps are instances -# of `Object`, and extending Object with Appium methods (through -# `promote_appium_methods`) is a bad idea. -# -# For more on step definitions, check out the documentation at -# https://github.com/cucumber/cucumber/wiki/Step-Definitions -# -# For more on rspec assertions, check out -# https://www.relishapp.com/rspec/rspec-expectations/docs - -Given /^I have entered (\d+) into field (\d+) of the calculator$/ do |value, field| - # Get a textfield by index - textfield(field.to_i).type value -end - -Given /^I have entered (\d+) into a field of the calculator showing (\w+)$/ do |value, field| - # Get a textfield by string - textfield(field).type value -end - -And /^I press button (\d+)$/ do |button_index| - # Find a button by index - button(button_index.to_i).click -end - -And /^I press a button labelled (\w+)$/ do |button_text| - # Find a button by text - button(button_text).click -end - -Then /^the result should be displayed as (\d+)$/ do |expected| - # You can get just the first of a class of elements - first_text.value.should eq expected -end \ No newline at end of file diff --git a/sample-code/examples/ruby/cucumber_ios/features/support/appium.txt b/sample-code/examples/ruby/cucumber_ios/features/support/appium.txt deleted file mode 100644 index 13c672002..000000000 --- a/sample-code/examples/ruby/cucumber_ios/features/support/appium.txt +++ /dev/null @@ -1,9 +0,0 @@ -[caps] -platformName = "ios" -device = "iPhone Simulator" -platformVersion = "7.1" -app = "../../../apps/TestApp/build/release-iphonesimulator/TestApp.app" - -[appium_lib] -sauce_username = false -sauce_access_key = false \ No newline at end of file diff --git a/sample-code/examples/ruby/cucumber_ios/features/support/env.rb b/sample-code/examples/ruby/cucumber_ios/features/support/env.rb deleted file mode 100644 index f5495ff4a..000000000 --- a/sample-code/examples/ruby/cucumber_ios/features/support/env.rb +++ /dev/null @@ -1,26 +0,0 @@ -# This file provides setup and common functionality across all features. It's -# included first before every test run, and the methods provided here can be -# used in any of the step definitions used in a test. This is a great place to -# put shared data like the location of your app, the capabilities you want to -# test with, and the setup of selenium. - -require 'rspec/expectations' -require 'appium_lib' -require 'cucumber/ast' - -# Create a custom World class so we don't pollute `Object` with Appium methods -class AppiumWorld -end - -# Load the desired configuration from appium.txt, create a driver then -# Add the methods to the world -caps = Appium.load_appium_txt file: File.expand_path('./', __FILE__), verbose: true -Appium::Driver.new(caps) -Appium.promote_appium_methods AppiumWorld - -World do - AppiumWorld.new -end - -Before { $driver.start_driver } -After { $driver.driver_quit } \ No newline at end of file diff --git a/sample-code/examples/ruby/sauce_example.rb b/sample-code/examples/ruby/sauce_example.rb deleted file mode 100644 index 55987111d..000000000 --- a/sample-code/examples/ruby/sauce_example.rb +++ /dev/null @@ -1,118 +0,0 @@ -# GETTING STARTED -# ----------------- -# This documentation is intended to show you how to get started with a -# simple Appium & Sauce Labs test. This example is written with rspec and -# appium_lib, but you can use any Selenium client and test framework you like. -# -# This example expects SAUCE_USERNAME and SAUCE_ACCESS_KEY to be set in your -# environment. -# -# INSTALLING RVM -# -------------- -# We're assuming you've got rvm installed, but if not, from a terminal -# run the following line (removing the ""'s): -# -# "\curl -L https://get.rvm.io | bash -s stable --ruby" -# -# INSTALLING GEMS -# --------------- -# Then, change to the example directory: -# "cd appium-location/sample-code/examples/ruby" -# -# and install the required gems with bundler by doing: -# "bundle install" -# -# RUNNING TESTS -# ------------- -# Run with: -# -# bundle exec rspec sauce_example.rb -# - -require 'rspec' -require 'appium_lib' -require 'json' -require 'rest_client' - -SAUCE_USERNAME = ENV['SAUCE_USERNAME'] -SAUCE_ACCESS_KEY = ENV['SAUCE_ACCESS_KEY'] - -# This is the test itself -describe 'Computation' do - before(:each) do - Appium::Driver.new(desired_caps).start_driver - Appium.promote_appium_methods RSpec::Core::ExampleGroup - end - - after(:each) do - # Get the success by checking for assertion exceptions, - # and log them against the job, which is exposed by the session_id - job_id = driver.send(:bridge).session_id - update_job_success(job_id, example.exception.nil?) - driver_quit - end - - it 'should add two numbers' do - values = [rand(10), rand(10)] - expected_sum = values.reduce(&:+) - - textfields.each_with_index do |element, index| - element.send_keys values[index] - end - - # You can find buttons by text or, here, index - button(1).click - - # You can find the first static text element - first_text.text.should eq expected_sum.to_s - end -end - -def desired_caps - { caps: - { - 'appium-version' => '1.1.0', - platformName: 'iOS', - platformVersion: '7.1', - deviceName: 'iPhone Simulator', - app: 'http://appium.s3.amazonaws.com/TestApp6.0.app.zip', - name: 'Ruby Example for Appium' - } - } -end - -def auth_details - un = SAUCE_USERNAME - pw = SAUCE_ACCESS_KEY - - unless un && pw - STDERR.puts <<-EOF - Your SAUCE_USERNAME or SAUCE_ACCESS_KEY environment variables - are empty or missing. - - You need to set these values to your Sauce Labs username and access - key, respectively. - - If you don't have a Sauce Labs account, you can get one for free at - http://www.saucelabs.com/signup - EOF - - exit - end - - return "#{un}:#{pw}" -end - -def server_url - "http://#{auth_details}@ondemand.saucelabs.com:80/wd/hub" -end - -def rest_jobs_url - "https://#{auth_details}@saucelabs.com/rest/v1/#{SAUCE_USERNAME}/jobs" -end - -# Because WebDriver doesn't have the concept of test failure, use the Sauce -# Labs REST API to record job success or failure -def update_job_success(job_id, success) - RestClient.put "#{rest_jobs_url}/#{job_id}", { 'passed' => success }.to_json, :content_type => :json -end \ No newline at end of file diff --git a/sample-code/examples/ruby/simple_test.rb b/sample-code/examples/ruby/simple_test.rb deleted file mode 100644 index 3320c6390..000000000 --- a/sample-code/examples/ruby/simple_test.rb +++ /dev/null @@ -1,105 +0,0 @@ -# GETTING STARTED -# ----------------- -# This documentation is intended to show you how to get started with a -# simple Appium & appium_lib test. This example is written without a specific -# testing framework in mind; You can use appium_lib on any framework you like. -# -# INSTALLING RVM -# -------------- -# If you don't have rvm installed, run the following terminal command -# -# \curl -L https://get.rvm.io | bash -s stable --ruby -# -# INSTALLING GEMS -# --------------- -# Then, change to the example directory: -# cd appium-location/sample-code/examples/ruby -# -# and install the required gems with bundler by doing: -# bundle install -# -# RUNNING THE TESTS -# ----------------- -# To run the tests, make sure appium is running in another terminal -# window, then from the same window you used for the above commands, type -# -# bundle exec ruby simple_test.rb -# -# It will take a while, but once it's done you should get nothing but a line -# telling you "Tests Succeeded"; You'll see the iOS Simulator cranking away -# doing actions while we're running. -require 'rubygems' -require 'appium_lib' - -APP_PATH = '../../apps/TestApp/build/release-iphonesimulator/TestApp.app' - -desired_caps = { - caps: { - platformName: 'iOS', - versionNumber: '7.1', - app: APP_PATH, - }, - appium_lib: { - sauce_username: nil, # don't run on Sauce - sauce_access_key: nil - } -} - -# Start the driver -Appium::Driver.new(desired_caps).start_driver - -module Calculator - module IOS - # Add all the Appium library methods to Test to make - # calling them look nicer. - Appium.promote_singleton_appium_methods Calculator - - # Add two numbers - values = [rand(10), rand(10)] - expected_sum = values.reduce(&:+) - - # Find every textfield. - elements = textfields - - elements.each_with_index do |element, index| - element.type values[index] - end - - # Click the first button - button(1).click - - # Get the first static text field, then get its text - actual_sum = first_text.text - raise unless actual_sum == (expected_sum.to_s) - - # Alerts are visible - button('show alert').click - find_element :class_name, 'UIAAlert' # Elements can be found by :class_name - - # wait for alert to show - wait { text 'this alert is so cool' } - - # Or by find - find('Cancel').click - - # Waits until alert doesn't exist - wait_true { !exists { tag('UIAAlert') } } - - # Alerts can be switched into - button('show alert').click # Get a button by its text - alert = driver.switch_to.alert # Get the text of the current alert, using - # the Selenium::WebDriver directly - alerting_text = alert.text - raise Exception unless alerting_text.include? 'Cool title' - alert_accept # Accept the current alert - - # Window Size is easy to get - sizes = window_size - raise Exception unless sizes.height == 568 - raise Exception unless sizes.width == 320 - - # Quit when you're done! - driver_quit - puts 'Tests Succeeded!' - end -end \ No newline at end of file diff --git a/sample-code/examples/ruby/u_i_catalog.rb b/sample-code/examples/ruby/u_i_catalog.rb deleted file mode 100644 index 9cc77c4ec..000000000 --- a/sample-code/examples/ruby/u_i_catalog.rb +++ /dev/null @@ -1,263 +0,0 @@ -# THIS TEST -# --------- -# This test demonstrates the many, many things you can do with Appium. -# -# It relies on the setup in simple_test.rb, which is also a good starting -# point to make sure you can run any tests at all. -# -# run using: -# -# bundle exec rspec u_i_catalog.rb -# -# run only a tagged group: -# -# bundle exec rspec --tag one u_i_catalog.rb -# - -require 'rubygems' -require 'rspec' -require 'appium_lib' -require 'net/http' - -RSpec.configure do |c| - c.treat_symbols_as_metadata_keys_with_true_values = true -end - -APP_PATH = './UICatalog.app.zip' - -def desired_caps - { - caps: { - platformName: 'iOS', - deviceName: 'iPhone Simulator', - versionNumber: '7.1', - app: APP_PATH - }, - appium_lib: { - sauce_username: nil, # don't run on sauce - sauce_access_key: nil, - wait: 10, - } - } -end - -describe 'UI Catalog' do - before(:all) do - Appium::Driver.new(desired_caps).start_driver - Appium.promote_appium_methods RSpec::Core::ExampleGroup - end - - def back_click(opts={}) - opts ||= {} - search_wait = opts.fetch(:wait, 10) # seconds - wait(search_wait) { button_exact('Back').click } - end - - after(:all) do - driver_quit - end - - describe 'An Element', :one do - subject { find_elements(:class_name, 'UIATableView')[0] } - - it { should_not be nil } - - context 'when used as a selection context' do - it 'Can be a selection context' do - rows = subject.find_elements(:class_name, 'UIATableCell') - rows.size.should eq 12 - end - - it 'does not return elements it does not contain' do - nav_bar = subject.find_elements(:class_name, 'UIANavigationBar') - nav_bar.length.should be 0 - end - end - - it 'returns its text' do - rows = subject.find_elements(:class_name, 'UIATableCell') - rows.first.name.should eq 'Buttons, Various uses of UIButton' - end - end - - describe 'position' do - it 'is returned by the driver' do - third_row = ele_index('UIATableCell', 3) - third_row.location.x.should be 0 - third_row.location.y.should be 152 - end - end - - describe 'Screenshots' do - it 'can be made in base 64' do - # screenshot for Appium saves to disk, to get base64 you need - # to use the underlying Selenium WebDriver - screenshot = driver.screenshot_as :base64 - screenshot.should_not be_nil - end - - it 'can be saved to the filesystem' do - screenshot('./pretty_app.png') - end - end - - describe 'attributes' do - - before :all do - id('ToolbarTitle').click - @switch = find_element(:class_name, 'UIASwitch') - end - - # Go back to the menu when you're done - after :all do - back_click - end - - it 'can be tested for visibility' do - @switch.displayed?.should be_true - end - - # TODO: Text checking still seems... Not good. - it 'can have text checked' do - @switch.name.should eq 'Image' - end - - it 'can have values checked' do - # Check if this switch is off - @switch.value.should be 0 - end - - it 'reflect changes in their values' do - @switch.click - @switch.value.should be 1 - end - end - - describe 'text fields' do - - before :all do - id('TextFieldTitle').click - @text_field = first_textfield - end - - after :all do - back_click - end - - it 'can accept key presses' do - @text_field.type('discombobulate') - end - - it 'can be checked for text' do - @text_field.value.should eq 'discombobulate' - end - - it 'can be cleared' do - @text_field.clear - @text_field.value.should eq '' - end - end - - describe 'alerts' do - before :all do - id('AlertTitle').click - end - - after :all do - back_click - end - - it 'can be clicked' do - text('Show OK-Cancel').click - button('OK').click - end - - it 'can be accepted' do - text('Show OK-Cancel').click - alert_accept - end - - it 'can be dismissed' do - text('Show OK-Cancel').click - alert_dismiss - end - - it 'can be Custom' do - text('Show Custom').click - button('Button2').click - end - end - - describe 'scrolling' do - # Does not work on iOS 7 yet - it 'can be done with co-ordinates' - end - - describe 'sliders' do - before :all do - find_elements(:class_name, 'UIATableCell')[1].click - @slider = find_element(:class_name, 'UIASlider') - end - - after :all do - back_click - end - - it 'can have their values read' do - # .value is a patched method to return the value attribute - @slider.value.should eq '50%' - end - - it 'can be changed' do - @slider.value.should eq '50%' - actions = Appium::TouchAction.new - actions.press element: @slider, x: 60, y: 3 - actions.move_to element: @slider, x: 120, y: 3 - actions.release - actions.perform - @slider.value.should eq '100%' - end - end - - describe 'sessions' do - it 'can be obtained from the simulator or driver' do - data = JSON.parse(Net::HTTP.get(URI "#{server_url}/sessions")) - data.should_not be_nil - - # Convenience method to get the session ID - session_id.should eq (data['value'][0]['id']) - end - end - - describe 'sizes' do - it 'can be obtained from elements' do - table_dimensions = find_element(:class_name, 'UIATableView').size - row_dimensions = find_elements(:class_name, 'UIATableCell')[0].size - - table_dimensions.width.should eq row_dimensions.width - table_dimensions.height.should_not eq row_dimensions.height - end - end - - describe 'page source' do - before :all do - # get_source returns the source, source prints it directly - @main_source = get_source - id('TextFieldTitle').click - @text_source = get_source - end - - after :all do - back_click - end - - it 'can be obtained' do - @main_source.should include 'UIATableView' - @main_source.should include 'TextFields' - end - - it 'changes when the page does' do - @text_source.should_not eq @main_source - end - end -end \ No newline at end of file diff --git a/sample-code/examples/ruby/xunit_android.rb b/sample-code/examples/ruby/xunit_android.rb deleted file mode 100644 index d656ab33c..000000000 --- a/sample-code/examples/ruby/xunit_android.rb +++ /dev/null @@ -1,38 +0,0 @@ -# this test show you how to use scroll and locate element by xpath -# it open the system settings ui, and click the 'About phone' item to find android version -# create by testerhome.com -# author: seveniruby -# -# run using: -# bundle exec ruby xunit_android.rb - -require 'rubygems' -require 'test/unit' -require 'appium_lib' - -class SettingsTest < Test::Unit::TestCase - def setup - caps = { caps: { platformName: 'Android', appActivity: '.Settings', appPackage: 'com.android.settings' }, - appium_lib: { sauce_username: nil, sauce_access_key: nil } } - driver = Appium::Driver.new(caps) - Appium.promote_appium_methods self.class - driver.start_driver.manage.timeouts.implicit_wait = 20 # seconds - end - - def teardown - driver_quit - end - - def test_about_phone_version - scroll_to('About phone').click - android_version = 'Android version' - scroll_to android_version - - view = 'android.widget.TextView' - version = xpath(%Q(//#{view}[preceding-sibling::#{view}[@text="#{android_version}"]])).text - valid = !version.match(/\d/).nil? - - puts "Version is: #{version}" - assert_equal true, valid - end -end \ No newline at end of file diff --git a/sample-code/readme.md b/sample-code/readme.md new file mode 100644 index 000000000..cebda6353 --- /dev/null +++ b/sample-code/readme.md @@ -0,0 +1 @@ +The sample code has moved to [appium/sample-code](https://github.com/appium/sample-code)