Browse Source

Combine tests.

pull/101/head
Abhishek Banthia 3 years ago
parent
commit
2428813f34
  1. 26
      Clocker/ClockerUITests/CopyToClipboardTests.swift

26
Clocker/ClockerUITests/CopyToClipboardTests.swift

@ -21,6 +21,19 @@ class CopyToClipboardTests: XCTestCase {
}
func testFullCopy() throws {
let cell = app.tables["FloatingTableView"].cells.firstMatch
let customLabel = cell.staticTexts["CustomNameLabelForCell"].value ?? "Nil Custom Label"
let time = cell.staticTexts["ActualTime"].value ?? "Nil Value"
let expectedValue = "\(customLabel) - \(time)"
// Tap to copy!
cell.click()
let actualValue = NSPasteboard.general.string(forType: .string) ?? "Empty Pasteboard"
XCTAssert(expectedValue == actualValue,
"Clipboard value (\(actualValue)) doesn't match expected result: \(expectedValue)")
// Test full copy
let cellCount = app.tables["FloatingTableView"].cells.count
var clipboardValue = String()
for cellIndex in 0 ..< cellCount {
@ -37,19 +50,6 @@ class CopyToClipboardTests: XCTestCase {
XCTAssert(clipboardValue == clipboard)
}
func testIndividualTimezoneCopy() {
let cell = app.tables["FloatingTableView"].cells.firstMatch
let customLabel = cell.staticTexts["CustomNameLabelForCell"].value ?? "Nil Custom Label"
let time = cell.staticTexts["ActualTime"].value ?? "Nil Value"
let expectedValue = "\(customLabel) - \(time)"
// Tap to copy!
cell.click()
let clipboard = NSPasteboard.general.string(forType: .string) ?? "Empty Pasteboard"
XCTAssert(expectedValue == clipboard, "Clipboard value (\(clipboard)) doesn't match expected result")
}
func testModernSlider() {
if app.buttons["FloatingPin"].exists {
app.buttons["FloatingPin"].click()

Loading…
Cancel
Save