forked from apache/cordova-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tests): Use XCTestPlans for unit testing (apache#1509)
This allows us to set up default behaviour of re-running tests up to 3 times if they fail, which should significantly cut down the number of failing builds in CI. I also opted to only keep the unit tests for the case where CordovaLib is consumed as a framework, since that's now the default behaviour for the template app (using Swift Packages) rather than a static library. Also cleaned up the test app project naming and moved some boilerplate stuff over to Swift.
- Loading branch information
Showing
24 changed files
with
225 additions
and
1,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
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 UIKit | ||
import Cordova | ||
|
||
@main | ||
@objc class AppDelegate : CDVAppDelegate { | ||
fileprivate var _window : UIWindow? | ||
fileprivate var _viewController : ViewController? | ||
|
||
@objc public var testViewController : CDVViewController? { | ||
return _viewController | ||
} | ||
|
||
@objc func createViewController() { | ||
_viewController = ViewController(); | ||
_viewController?.webContentFolderName = "www"; | ||
_viewController?.startPage = "index.html"; | ||
|
||
_window?.rootViewController = _viewController; | ||
_window?.makeKeyAndVisible(); | ||
} | ||
|
||
@objc func destroyViewController() { | ||
_viewController = nil | ||
} | ||
|
||
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { | ||
let retVal = super.application(application, didFinishLaunchingWithOptions:launchOptions); | ||
|
||
let bounds = UIScreen.main.bounds; | ||
_window = UIWindow(frame: bounds); | ||
_window?.autoresizesSubviews = true; | ||
|
||
if NSClassFromString("CDVWebViewTest") != nil { | ||
createViewController(); | ||
} | ||
|
||
return retVal; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
tests/CordovaLibTests/CordovaLibApp/CordovaLibApp-Info.plist
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
tests/CordovaLibTests/CordovaLibApp/en.lproj/InfoPlist.strings
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.