Skip to content

Instantly share code, notes, and snippets.

@tilltue
Created June 28, 2018 14:58
Show Gist options
  • Save tilltue/93d40241a6e1417417cfd86463b29f24 to your computer and use it in GitHub Desktop.
Save tilltue/93d40241a6e1417417cfd86463b29f24 to your computer and use it in GitHub Desktop.
코디네이터 스냅샷 테스트
//스냅샷 테스트: 물품 목록화면
//snapshottest : coordinator (present) ListOfPurchasesViewController
func test_AppCoordinator() {
let addButtonMatcher = grey_allOf([grey_accessibilityID("addButton"),grey_sufficientlyVisible()])
EarlGrey.select(elementWithMatcher: addButtonMatcher).perform(grey_tap())
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PriceTextField").matcher).perform(grey_replaceText("600"))
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PurchaseInputConfirm").matcher).perform(grey_tap())
EarlGrey.select(elementWithMatcher: grey_allOf([grey_accessibilityID("ListOfPurchasesViewController"),grey_sufficientlyVisible()])).assert(grey_sufficientlyVisible())
EarlGrey.select(elementWithMatcher: addButtonMatcher).perform(grey_tap())
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PriceTextField").matcher).perform(grey_replaceText("100"))
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PurchaseInputConfirm").matcher).perform(grey_tap())
EarlGrey.select(elementWithMatcher: grey_allOf([grey_accessibilityID("ListOfPurchasesViewController"),grey_sufficientlyVisible()])).assert(grey_sufficientlyVisible()).assert(grey_verifySnapshot())
// EarlGrey.select(elementWithMatcher: grey_allOf([grey_accessibilityID("ListOfPurchasesViewController"),grey_sufficientlyVisible()])).assert(grey_sufficientlyVisible()).assert(grey_recordSnapshot())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment