Skip to content

Commit

Permalink
Merge pull request #68 from makeen-project/ALS-1805_Remove_Amplify
Browse files Browse the repository at this point in the history
Als-1805 Final Remove amplify commit with test case fixes
  • Loading branch information
wadhawh authored Oct 8, 2024
2 parents f75f6cd + f7163fe commit 4bdbcc3
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-ios-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
test-iOS:
name: Test iOS App
runs-on: macos-15-xlarge
runs-on: macos-15
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
test-iOS:
name: Run Unit Tests for iOS
runs-on: macos-14-xlarge
runs-on: macos-15
steps:
- uses: actions/checkout@v4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@
"MapUITests\/testMapMaxZoomIn()",
"MapUITests\/testMapMaxZoomOut()",
"MapUITests\/testMapZoomInByTap()",
"MapUITests\/testMapZoomOut()",
"NavigationUITests\/testRouteFerriesOption()",
"NavigationUITests\/testRouteTollsOption()",
"SettingsUITests\/testTrackerOptions()",
"TrackingUITests\/testStartTracking()",
"TrackingUITests\/testStartTrackingHistoryStarted()",
"TrackingUITests\/testStopTracking()",
"TrackingUITests\/testTrackingGeofenceE2E()",
"TrackingUITests\/testTrackingNotifyEnteredGeofence()"
],
"target" : {
Expand Down
11 changes: 1 addition & 10 deletions LocationServices/LocationServices/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
//init keyboard observer
let _ = KeyboardObserver.shared
SettingsDefaultValueHelper.shared.createValues()

// debug logger for AWS
//AWSDDLog.sharedInstance.logLevel = .debug
//AWSDDLog.add(AWSDDTTYLogger.sharedInstance)


Reachability.shared.startMonitoring()

Expand All @@ -42,10 +39,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
2 changes: 0 additions & 2 deletions LocationServices/LocationServices/iot/MqttIoTContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class MqttIoTContext: ObservableObject {
public var client: Mqtt5Client?
/// Print the text and pending new message to message list
func printView(_ txt: String) {
let newMessage = Message(id: messages.count, text: txt)
self.messages.append(newMessage)
print(txt)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ struct UITestTrackingScreen: UITestScreen {
func continueTrackingAlert() -> Self {
let alert = app.alerts.element
if (alert.waitForExistence(timeout: UITestWaitTime.regular.time)) {
//let responseMessage = alert.label
//XCTAssertEqual(responseMessage, StringConstant.enableTracking)
let continueButton = alert.buttons.firstMatch
XCTAssertTrue(continueButton.waitForExistence(timeout: UITestWaitTime.regular.time))
continueButton.tap()
Expand Down
29 changes: 26 additions & 3 deletions LocationServices/LocationServicesUITests/TrackingUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,32 @@ final class TrackingUITests: LocationServicesUITests {
super.tearDown()
}

func testGeofenceE2E() throws {

var app = startApp(allowPermissions: true)

let menuScreen = UITestTabBarScreen(app: app)
.tapSettingsButton()
.tapConnectAWSRow()
.connectAWSConnect()
.signInAWSAccount()

if(UIDevice.current.userInterfaceIdiom == .phone) {
menuScreen.getBackButton().tap()
}

let _ = UITestGeofenceScreen(app: app)
.deleteAllGeofences()
Thread.sleep(forTimeInterval: 2)
app = restartApp()

let geofenceName = UITestGeofenceScreen.generateUniqueGeofenceName()

_ = UITestTabBarScreen(app: app)
.tapGeofenceButton()
.addGeofence(geofenceNameToAdd: geofenceName,location: Constants.geofenceLocationAddress, selectDefault: true)
}

func testTrackingGeofenceE2E() throws {

var app = startApp(allowPermissions: true)
Expand Down Expand Up @@ -90,9 +116,6 @@ final class TrackingUITests: LocationServicesUITests {

let _ = trackingUIScreen
.waitForGeofenceExitedAlert(geofenceName: geofenceName)

Thread.sleep(forTimeInterval: 1)
XCUIDevice.shared.location = .init(location: Constants.trackingPoints[1])

let _ = trackingUIScreen
.tapStopTrackingButton()
Expand Down
2 changes: 1 addition & 1 deletion LocationServices/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ platform :ios do
code_coverage: true,
output_directory: Dir.pwd + "/test_output",
include_simulator_logs: true,
xcargs: "-test-iterations '3' -retry-tests-on-failure"
xcargs: "-test-iterations '5' -retry-tests-on-failure"
)
ensure
xcresult_path = Actions.lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]
Expand Down

0 comments on commit 4bdbcc3

Please sign in to comment.