migration
This commit is contained in:
29
PediFoodsUITests/SavedCardsFlowTests.swift
Normal file
29
PediFoodsUITests/SavedCardsFlowTests.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
import XCTest
|
||||
|
||||
/// Covers Profile -> Meus Cartões -> Novo Cartão
|
||||
/// (SavedCardsView.swift + AddCardFormView.swift, ~1170 lines on the form
|
||||
/// alone, was 0% covered). Only reaches the form, doesn't submit a real
|
||||
/// card.
|
||||
final class SavedCardsFlowTests: XCTestCase {
|
||||
override func setUpWithError() throws {
|
||||
continueAfterFailure = false
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
XCUIApplication().logoutIfAuthenticated()
|
||||
}
|
||||
|
||||
func testAddCardFormReachableFromSavedCards() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
XCTAssertTrue(app.ensureLoggedIn(), "Login never completed")
|
||||
XCTAssertTrue(app.buttons["Sair da Conta"].waitForExistence(timeout: 10), "Never reached authenticated Profile")
|
||||
|
||||
app.staticTexts["Meus Cartões"].tap()
|
||||
XCTAssertTrue(app.staticTexts["Meus Cartões"].waitForExistence(timeout: 10), "Never reached Meus Cartões")
|
||||
|
||||
app.staticTexts["Adicionar novo cartão"].tap()
|
||||
XCTAssertTrue(app.staticTexts["Novo Cartão"].waitForExistence(timeout: 10), "Never reached Novo Cartão form")
|
||||
XCTAssertTrue(app.staticTexts["Número do cartão"].waitForExistence(timeout: 5))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user