Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LoginScreenFeatureTest : ApplicationTest() {
- override fun init() {
- FxToolkit.registerStage { Stage() }
- }
- override fun start(stage: Stage) {
- LoginScreen().openWindow()
- //MyMainApp().start(stage)
- }
- override fun stop() {
- FxToolkit.cleanupStages()
- //FxToolkit.toolkitContext().registeredStage.close()
- //MyMainApp().stop()
- }
- @Test fun should_contain_button() {
- // expect:
- verifyThat("#submitBut", hasText("SUBMIT"))
- }
- @Test fun should_click_on_button_and_pass_login() {
- //init
- //Why do I always need to erase text. I want a new stage for every test case.
- clickOn("#username").eraseText(10).write("validUser")
- clickOn("#password").eraseText(10).write("validPwd")
- clickOn("#orgId").eraseText(10).write("validOrg")
- // when:
- clickOn("#submitBut")
- // then:
- //verify success
- }
- @Test fun should_click_on_button_and_fail_login() {
- //init
- clickOn("#username").eraseText(10).write("anyuser")
- clickOn("#password").eraseText(10).write("anypwd")
- clickOn("#orgId").eraseText(10).write("anyorg")
- // when:
- clickOn("#submitBut")
- // then:
- //verify fail
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement