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.
 
 
 
 
 

59 lines
1.8 KiB

// Copyright © 2015 Abhishek Banthia
import XCTest
class ReviewTests: XCTestCase {
var app: XCUIApplication!
override func setUp() {
super.setUp()
continueAfterFailure = false
app = XCUIApplication()
app.launchArguments.append(CLUITestingLaunchArgument)
app.launch()
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)
}
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)
}
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)
}
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)
}
}