Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. class LoginScreenFeatureTest : ApplicationTest() {
  2.  
  3. override fun init() {
  4. FxToolkit.registerStage { Stage() }
  5. }
  6.  
  7. override fun start(stage: Stage) {
  8. LoginScreen().openWindow()
  9. //MyMainApp().start(stage)
  10. }
  11.  
  12. override fun stop() {
  13. FxToolkit.cleanupStages()
  14. //FxToolkit.toolkitContext().registeredStage.close()
  15. //MyMainApp().stop()
  16. }
  17.  
  18. @Test fun should_contain_button() {
  19. // expect:
  20. verifyThat("#submitBut", hasText("SUBMIT"))
  21. }
  22.  
  23. @Test fun should_click_on_button_and_pass_login() {
  24. //init
  25. //Why do I always need to erase text. I want a new stage for every test case.
  26. clickOn("#username").eraseText(10).write("validUser")
  27. clickOn("#password").eraseText(10).write("validPwd")
  28. clickOn("#orgId").eraseText(10).write("validOrg")
  29.  
  30. // when:
  31. clickOn("#submitBut")
  32.  
  33. // then:
  34. //verify success
  35. }
  36.  
  37. @Test fun should_click_on_button_and_fail_login() {
  38. //init
  39. clickOn("#username").eraseText(10).write("anyuser")
  40. clickOn("#password").eraseText(10).write("anypwd")
  41. clickOn("#orgId").eraseText(10).write("anyorg")
  42.  
  43. // when:
  44. clickOn("#submitBut")
  45.  
  46. // then:
  47. //verify fail
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement