Skip to content

Instantly share code, notes, and snippets.

@EdZilla
Created June 22, 2012 21:26
Show Gist options
  • Save EdZilla/2975294 to your computer and use it in GitHub Desktop.
Save EdZilla/2975294 to your computer and use it in GitHub Desktop.
Geb Spec
package com.comcast.neto.chimps.func
import geb.Browser;
import spock.lang.Ignore
import spock.lang.Stepwise
import org.openqa.selenium.Keys
import com.comcast.neto.chimps.func.BaseGebSpec
import com.comcast.neto.chimps.func.pages.*
import com.comcast.neto.chimps.func.modules.*;
class ChimpsTestUserCreateSpec extends BaseGebSpec {
def "at the login page"() {
when:
to LoginPage
then:
println "landed at " + $("title").text()
at LoginPage
and:
authModule.loggedOut
when:
to LoginPage
$("form").username = "loadTestUser-0"
$("form").password = "admin"
authModule.loginButton.click()
then:
println "landed at " + $("title").text()
at ResByEnvReportPage
}
def "look for loadTestGuestUser, and be sure is active"() {
// and verify that it's the user we just created with no errors.
when:
def newUsername = "loadTestGuestUser"
to UserListPage
then:
at UserListPage
when:
$("#userData tr td:nth-child(2)").text() == newUsername
$("form").filter = newUsername
$("#search").click()
then:
at UserListPage
when:
println "looking for link: " + $("#userTable tr td:first-child").text()
println "looking for link: " + $("#userTable tr td:nth-child(2)").text()
$("#userTable tr td:nth-child(2)").text() == newUsername
$("#userTable tr td:first-child a").click()
then:
at UserShowPage
println "name: " + $("#userData tr td:nth-child(2)").text()
$("#userData tr td:nth-child(2)").text() == newUsername
// verify is active, and if not, set to acive
}
def "look for loadTestLabOpsUser, and be sure is active"() {
}
@Ignore
def "sign out by using id in signout link"() {
when:
at ResByEnvStatusReportPage
println "signOutEl: " + $("#signOutEl").text()
println "a.customizedLink: " + $("a.customizedLink").text()
$("a.customizedLink").click()
then:
at LoginPage
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment