Mercurial > public > simoleon
diff SimoleonUITests/SimoleonUITests.swift @ 173:ad8c6567539d
restart project
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Tue, 26 Oct 2021 13:09:17 +0200 |
parents | 4271fb5f69e2 |
children | 5a9430fd6b4d |
line wrap: on
line diff
--- a/SimoleonUITests/SimoleonUITests.swift Tue Oct 12 17:14:05 2021 +0200 +++ b/SimoleonUITests/SimoleonUITests.swift Tue Oct 26 13:09:17 2021 +0200 @@ -2,7 +2,7 @@ // SimoleonUITests.swift // SimoleonUITests // -// Created by Dennis Concepción Martín on 08/07/2021. +// Created by Dennis Concepción Martín on 26/10/21. // import XCTest @@ -11,9 +11,6 @@ override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. - if UIDevice.current.userInterfaceIdiom == .pad { - XCUIDevice.shared.orientation = .landscapeLeft - } // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false @@ -24,60 +21,14 @@ override func tearDownWithError() throws { // Put teardown code here. This method is called after the invocation of each test method in the class. } - - func testTabBar() throws { + + func testExample() throws { + // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() - - if UIDevice.current.userInterfaceIdiom == .pad { - app.tables["Sidebar"].buttons["NavigateToConversion"].tap() - XCTAssertTrue(app.staticTexts["Convert"].exists) - - app.tables["Sidebar"].buttons["NavigateToFavorites"].tap() - XCTAssertTrue(app.staticTexts["Favorites"].exists) - - app.tables["Sidebar"].buttons["NavigateToSettings"].tap() - XCTAssertTrue(app.staticTexts["Settings"].exists) - } else { - app.tabBars.buttons.element(boundBy: 0).tap() - XCTAssertTrue(app.staticTexts["Convert"].exists) - - app.tabBars.buttons.element(boundBy: 1).tap() - XCTAssertTrue(app.staticTexts["Favorites"].exists) - - app.tabBars.buttons.element(boundBy: 2).tap() - XCTAssertTrue(app.staticTexts["Settings"].exists) - - } - } - - func testCurrencySelector() throws { - let app = XCUIApplication() - app.launch() - app.scrollViews.buttons["OpenCurrencySelector"].tap() - - let currencySearchBar = app.textFields["CurrencySearchBar"] - currencySearchBar.tap() - currencySearchBar.typeText("USD/BTC") - app.tables.buttons["From USD to BTC"].tap() - } - - func testCoreData() throws { - let app = XCUIApplication() - app.launch() - - if UIDevice.current.userInterfaceIdiom == .pad { - app.tables["Sidebar"].buttons["NavigateToFavorites"].tap() - } else { - app.tabBars.buttons.element(boundBy: 1).tap() - } - - XCTAssertTrue(app.tables.buttons["From USD to GBP"].exists) - - let favoriteList = app.tables - favoriteList.buttons["From USD to GBP"].swipeLeft() - favoriteList.buttons["Delete"].tap() - XCTAssertFalse(app.tables.buttons["From USD to GBP"].exists) + + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. } func testLaunchPerformance() throws {