Skip to content

Commit 7d7c8e8

Browse files
author
Enrique Gonzalez
committed
roll back iOS 13 support and use Xcode 10.4
Prior to this change, the application was built with Xcode 12.1.1 but was getting a bunch of errors on Sauce This change rolls back the iOS 13 compatibility and updates Appium tests so they keep passing
1 parent 748b1b4 commit 7d7c8e8

4 files changed

Lines changed: 19 additions & 57 deletions

File tree

AppiumTests/tests/location-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const latitude = "37.7869037"
2-
const longitude = "-122.4012196"
1+
const latitude = "37.79"
2+
const longitude = "-122.401"
33
const altitude = "19.31"
44
describe("Location test", () => {
55
it("should set location to Sauce SF office", () => {

AppiumTests/wdio.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ exports.config = {
7070
{
7171
testobject_api_key: process.env.SAUCE_RDC_API_KEY,
7272
platformName: "iOS",
73-
platformVersion: "11"
73+
platformVersion: "12"
7474
}
7575

7676

SimpleLocationApp.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
isa = XCBuildConfiguration;
448448
buildSettings = {
449449
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
450-
CODE_SIGN_IDENTITY = "Apple Development";
450+
CODE_SIGN_IDENTITY = "iPhone Developer";
451451
CODE_SIGN_STYLE = Automatic;
452452
CURRENT_PROJECT_VERSION = 1.0.1;
453453
DEVELOPMENT_TEAM = 7YPEWC4JFX;
@@ -467,7 +467,7 @@
467467
isa = XCBuildConfiguration;
468468
buildSettings = {
469469
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
470-
CODE_SIGN_IDENTITY = "Apple Development";
470+
CODE_SIGN_IDENTITY = "iPhone Developer";
471471
CODE_SIGN_STYLE = Automatic;
472472
CURRENT_PROJECT_VERSION = 1.0.1;
473473
DEVELOPMENT_TEAM = 7YPEWC4JFX;
@@ -488,7 +488,7 @@
488488
buildSettings = {
489489
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
490490
BUNDLE_LOADER = "$(TEST_HOST)";
491-
CODE_SIGN_IDENTITY = "Apple Development";
491+
CODE_SIGN_IDENTITY = "iPhone Developer";
492492
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
493493
CODE_SIGN_STYLE = Automatic;
494494
DEVELOPMENT_TEAM = 7YPEWC4JFX;
@@ -509,7 +509,7 @@
509509
buildSettings = {
510510
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
511511
BUNDLE_LOADER = "$(TEST_HOST)";
512-
CODE_SIGN_IDENTITY = "Apple Development";
512+
CODE_SIGN_IDENTITY = "iPhone Developer";
513513
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
514514
CODE_SIGN_STYLE = Automatic;
515515
DEVELOPMENT_TEAM = 7YPEWC4JFX;
@@ -529,7 +529,7 @@
529529
isa = XCBuildConfiguration;
530530
buildSettings = {
531531
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
532-
CODE_SIGN_IDENTITY = "Apple Development";
532+
CODE_SIGN_IDENTITY = "iPhone Developer";
533533
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
534534
CODE_SIGN_STYLE = Automatic;
535535
DEVELOPMENT_TEAM = 7YPEWC4JFX;
@@ -549,7 +549,7 @@
549549
isa = XCBuildConfiguration;
550550
buildSettings = {
551551
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
552-
CODE_SIGN_IDENTITY = "Apple Development";
552+
CODE_SIGN_IDENTITY = "iPhone Developer";
553553
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
554554
CODE_SIGN_STYLE = Automatic;
555555
DEVELOPMENT_TEAM = 7YPEWC4JFX;

SimpleLocationAppUITests/SimpleLocationAppUITests.swift

Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SimpleLocationAppUITests: XCTestCase {
2828
}
2929

3030
func testMexicoLocation() {
31-
let SauceEUDefaultLocation = "52.535, 13.264"
31+
let SauceEUDefaultLocation = "52.527, 13.395"
3232
let SauceUSDefaultLocation = "37.78, -122.397"
3333
let SauceUSOtherDefaultLocation = "37.39, -121.962"
3434
let UITestDefaultLocation = "19.435, -99.136"
@@ -65,7 +65,7 @@ class SimpleLocationAppUITests: XCTestCase {
6565
}
6666
XCTAssertTrue(locationTextElement.exists, "locationText does not exist")
6767
NSLog("\(locationTextElement.debugDescription)")
68-
var locationText = locationTextElement.value as! String
68+
let locationText = locationTextElement.value
6969

7070
//Take screenshot
7171
self.takeScreenshot()
@@ -75,57 +75,19 @@ class SimpleLocationAppUITests: XCTestCase {
7575
NSLog("SauceUSOtherDefaultLocation %@", SauceUSOtherDefaultLocation)
7676
NSLog("UITestDefaultLocation %@", UITestDefaultLocation)
7777

78-
var assertMessage = String(format: "Current Location %@ is not equal to expected locations.", locationText)
79-
var locationConditional = SauceEUDefaultLocation == locationText || SauceUSDefaultLocation == locationText || UITestDefaultLocation == locationText || SauceUSOtherDefaultLocation == locationText
80-
takeScreenshot()
81-
82-
if (!locationConditional) { //Run everything again
83-
84-
addUIInterruptionMonitor(withDescription: "Location Services") { (alert) -> Bool in
85-
let alertQuery = alert.buttons.matching(NSPredicate(format: "label BEGINSWITH %@", "Allow"))
86-
if (alertQuery.count > 0) {
87-
let alertElement = alertQuery.element(boundBy: 0)
88-
let isAlertPresent = alertElement.waitForExistence(timeout: 10)
89-
90-
if (isAlertPresent) {
91-
self.takeScreenshot()
92-
alertElement.tap()
93-
}
94-
}
95-
return true
96-
}
97-
98-
XCUIApplication().tap() // need to interact with the app again for the handler to fire
99-
100-
101-
// Uncomment to print Application's element hierarchy
102-
NSLog("\(app.debugDescription)")
103-
var locationTextElement = app.otherElements["locationText"]
104-
105-
// Needed for iOS 13 compatability
106-
if (!locationTextElement.exists) {
107-
locationTextElement = app.textViews.element(matching: NSPredicate(format: "identifier = %@", "locationText"))
108-
self.takeScreenshot()
78+
if let location = locationText {
79+
let locationTextString = location as! String
80+
let assertMessage = String(format: "Current Location %@ is not equal to expected locations.", locationTextString)
81+
let locationConditional = SauceEUDefaultLocation == locationTextString || SauceUSDefaultLocation == locationTextString || UITestDefaultLocation == locationTextString || SauceUSOtherDefaultLocation == locationTextString
10982

110-
}
111-
XCTAssertTrue(locationTextElement.exists, "locationText does not exist")
112-
NSLog("\(locationTextElement.debugDescription)")
113-
locationText = locationTextElement.value as! String
114-
115-
self.takeScreenshot()
83+
XCTAssert(locationConditional, assertMessage)
84+
}
11685

117-
NSLog("SauceEUDefaultLocation: %@", SauceEUDefaultLocation)
118-
NSLog("SauceUSDefaultLocation %@", SauceUSDefaultLocation)
119-
NSLog("SauceUSOtherDefaultLocation %@", SauceUSOtherDefaultLocation)
120-
NSLog("UITestDefaultLocation %@", UITestDefaultLocation)
121-
122-
assertMessage = String(format: "Current Location %@ is not equal to expected locations.", locationText)
123-
locationConditional = SauceEUDefaultLocation == locationText || SauceUSDefaultLocation == locationText || UITestDefaultLocation == locationText || SauceUSOtherDefaultLocation == locationText
124-
self.takeScreenshot()
86+
else {
87+
XCTFail("locationText was nil!")
12588
}
12689

12790

128-
XCTAssert(locationConditional, assertMessage)
12991

13092

13193
}

0 commit comments

Comments
 (0)