Skip to content

Instantly share code, notes, and snippets.

@tilltue
Last active June 17, 2018 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tilltue/964479a7920315f52f0d72ab34941e14 to your computer and use it in GitHub Desktop.
Save tilltue/964479a7920315f52f0d72ab34941e14 to your computer and use it in GitHub Desktop.
Example Delete Purchase Item
//테이블 cell 을 delete 하면 물품이 삭제 된다.
//expect : cell swipe -> (delete) row
func test_DeletePurchaseItem() {
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("300"))
EarlGrey.select(elementWithMatcher: CustomMatcher.allOfsufficiently(id: "PurchaseInputConfirm").matcher).perform(grey_tap())
EarlGrey.select(elementWithMatcher: grey_accessibilityID("ListOfPurchasesViewController")).assert(grey_sufficientlyVisible())
EarlGrey.select(elementWithMatcher: grey_text("$ 300")).perform(grey_swipeFastInDirectionWithStartPoint(.left, 0.3, 0.3))
EarlGrey.select(elementWithMatcher: CustomMatcher.displayButton(text: "삭제").matcher).perform(grey_tap())
EarlGrey.select(elementWithMatcher: grey_text("$ 300")).assert(grey_notVisible())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment