diff SimoleonUITests/SimoleonUITests.swift @ 144:4271fb5f69e2

Add Scheme for automating App Preview
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Tue, 17 Aug 2021 22:15:48 +0100
parents 081f0857af51
children ad8c6567539d
line wrap: on
line diff
--- a/SimoleonUITests/SimoleonUITests.swift	Tue Aug 17 08:42:00 2021 +0100
+++ b/SimoleonUITests/SimoleonUITests.swift	Tue Aug 17 22:15:48 2021 +0100
@@ -14,9 +14,6 @@
         if UIDevice.current.userInterfaceIdiom == .pad {
             XCUIDevice.shared.orientation = .landscapeLeft
         }
-        
-        let app = XCUIApplication()
-        app.launch()
 
         // In UI tests it is usually best to stop immediately when a failure occurs.
         continueAfterFailure = false
@@ -30,6 +27,8 @@
     
     func testTabBar() throws {
         let app = XCUIApplication()
+        app.launch()
+        
         if UIDevice.current.userInterfaceIdiom == .pad {
             app.tables["Sidebar"].buttons["NavigateToConversion"].tap()
             XCTAssertTrue(app.staticTexts["Convert"].exists)
@@ -54,6 +53,7 @@
     
     func testCurrencySelector() throws {
         let app = XCUIApplication()
+        app.launch()
         app.scrollViews.buttons["OpenCurrencySelector"].tap()
         
         let currencySearchBar = app.textFields["CurrencySearchBar"]
@@ -64,7 +64,7 @@
     
     func testCoreData() throws {
         let app = XCUIApplication()
-        app.scrollViews.buttons["AddToFavorites"].tap()
+        app.launch()
         
         if UIDevice.current.userInterfaceIdiom == .pad {
             app.tables["Sidebar"].buttons["NavigateToFavorites"].tap()