Created
September 24, 2019 06:33
-
-
Save mpahuja/b99ba78cb0e25af1f9581d7dfa96d4a4 to your computer and use it in GitHub Desktop.
UITests - TableViewTests.swift
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
import XCTest | |
class TableViewTests: BaseTest { | |
func testRowAlert() { | |
XCTContext.runActivity(named: "Test Correct row alert is being shown on random row") { _ in | |
XCTAssertTrue(tableViewPage.isRandomTableDisplayed()) | |
let countOfRows = tableViewPage.countTableRows() | |
XCTAssertGreaterThan(countOfRows, 0) | |
let randomRowElement = Int.random(in: 1 ... countOfRows) | |
let currentRowValue = tableViewPage.getValueAtDesiredRow(desiredIndex: randomRowElement) | |
print(currentRowValue) | |
tableViewPage.tapDesiredRow(desiredIndex: randomRowElement) | |
// XCTAssertTrue(tableViewPage.isCorrectAlertDisplayed(rowTitle: currentRowValue)) | |
XCTAssertTrue(tableViewPage.tapOkOnAlert()) | |
} | |
XCTContext.runActivity(named: "Test Correct row alert is being shown on first row") { _ in | |
// Not implemented | |
// Purpose is to make test deterministic and make sure a (first) row is rendered and shows the alert | |
} | |
XCTContext.runActivity(named: "Test Correct row alert is being shown on last row when we have 20 rows") { _ in | |
// Not implemented | |
// Purpose is to make test deterministic and make sure a after scrolling a row is rendered and shows the alert | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment