You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.8 KiB

// Copyright © 2015 Abhishek Banthia
import XCTest
class ReviewTests: XCTestCase {
var app: XCUIApplication!
6 years ago
override func setUp() {
super.setUp()
continueAfterFailure = false
app = XCUIApplication()
app.launchArguments.append(CLUITestingLaunchArgument)
app.launch()
6 years ago
app.tapMenubarIcon()
app.tapMenubarIcon()
app.tapMenubarIcon()
}
func testIfReviewIsNegativeAndUserWantsToProvideFeedback() {
guard app.buttons["Not Really"].exists else { return }
XCTAssertTrue(app.staticTexts["ReviewLabel"].exists)
app.buttons["Not Really"].click()
sleep(2)
app.buttons["Yes?"].click()
XCTAssertFalse(app.staticTexts["ReviewLabel"].exists)
XCTAssertTrue(app.windows["Clocker Feedback"].exists)
}
6 years ago
func testIfReviewIsNegativeAndNoFeedback() {
guard app.buttons["Not Really"].exists else { return }
XCTAssertTrue(app.staticTexts["ReviewLabel"].exists)
app.buttons["Not Really"].click()
sleep(2)
app.buttons["No, thanks"].click()
XCTAssertFalse(app.staticTexts["ReviewLabel"].exists)
}
6 years ago
func testOnPositiveReviewAndNoAction() {
guard app.buttons["Yes!"].exists else { return }
XCTAssertTrue(app.staticTexts["ReviewLabel"].exists)
app.buttons["Yes!"].click()
sleep(2)
app.buttons["No, thanks"].click()
XCTAssertFalse(app.staticTexts["ReviewLabel"].exists)
}
6 years ago
func testOnPositiveReviewAndAction() {
guard app.buttons["Yes!"].exists else { return }
XCTAssertTrue(app.staticTexts["ReviewLabel"].exists)
app.buttons["Yes!"].click()
sleep(2)
app.buttons["Yes"].click()
XCTAssertFalse(app.staticTexts["ReviewLabel"].exists)
}
}