This project is for practiceing Groovy, Geb, and Spock.
This is to keep my automations skills sharp.
This automation is happy path only and does not test for failures. It is an example and learning on how it can done. If you wish to test more thoroughly then I would suggest using Cucumber and Scenario Outlines to test many different scenarios including failures.
BDD framework used
Built with
Continuous Intergration
Depandacy Maintenance
Downloads
Spock
With testing our Circle-CI runner will use maven to run our automation scripts in Command line.
Setup
chromeHeadless {
driver = {
ChromeOptions options = new ChromeOptions()
options.addArguments('headless')
options.addArguments("--no-sandbox")
options.addArguments("--disable-gpu")
options.addArguments("--window-size=1400x1200")
options.addArguments("--disable-extensions")
new ChromeDriver(options)
}
}
Test
def "Can get to Software Testing"(){
when:
to BenWeeseDevHome
then:
sideMenu.links[1].text().startsWith("Software Testing")
when:
sideMenu.links[1].click()
then:
at SoftwareTestingPage
}
Page Object
class SoftwareTestingPage extends Page{
static url = "QA/softwaretesting/"
static at = { title.startsWith("Software Testing") }
static content = {
sideMenu { module(SideMenuModule) }
}
}
Module
class SideMenuModule extends Module{
static content = {
linksContainer { $(".navigation-list") }
links { linksContainer.find("a") }
}
}