Skip to content

Instantly share code, notes, and snippets.

@pbernet
Created October 23, 2012 16:12
Show Gist options
  • Save pbernet/3939758 to your computer and use it in GitHub Desktop.
Save pbernet/3939758 to your computer and use it in GitHub Desktop.
MyGUITest
package xx.testcase.gui
import exception.LinkNotFoundException
import pageobjects.page._
import xx.testpool.Users
import util.I18N
import xx.util.Utils
class MyGUITest extends GUISpecificationCARE {
step {
makeBoxLoginReady()
}
"Login as admin" in {
browser = Browser.openAndTest("http://10.1.2.127")
val loginPage = new LoginPage(browser)
loginPage.isAt must beTrue
loginPage.unableToLoginWith("blabla", "blabla") must beMatching(I18N.getOrEmpty("config.login.error.usernotfound"))
loginPage.unableToLoginWith("admin", "blabla") must beMatching(I18N.getOrEmpty("config.login.error.passwordfail"))
val configPage = loginPage.loginAs("admin", "xxx")
configPage.isAt must beTrue
configPage.doesShowArchiveSpaces must beTrue
}
"Change tokenpin back and forth" in {
val configPage = new ConfigPage(browser)
val tokenPage = configPage.toSettingsPage.toSystemPage.toTokenPage
tokenPage.isAt must beTrue
tokenPage.set("xxx", "yyy", "yyy")
tokenPage.submitAndGetOks must beMatching(I18N.getOrEmpty("config.tokenpin.persistsuccess"))
tokenPage.set("yyy", "xxx", "xxx")
tokenPage.submitAndGetOks must beMatching(I18N.getOrEmpty("config.tokenpin.persistsuccess"))
tokenPage.toLogout.isAt must beTrue
success
}
step {
close()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment