Skip to content

Commit

Permalink
Use safari
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo committed Oct 17, 2018
1 parent 1f41786 commit 95e9ffe
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 16 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Expand Up @@ -59,6 +59,8 @@ dependencies {
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-safari-driver', version: '3.14.0'

testCompile "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
testCompile "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
Expand Down
24 changes: 18 additions & 6 deletions src/integration-test/groovy/demo/BookingCRUDSpec.groovy
Expand Up @@ -61,7 +61,9 @@ class BookingCRUDSpec extends GebReportingSpec {
page.buttons.create()

then:
at CreateBookingPage
waitFor {
at CreateBookingPage
}
}

def 'enter the details'() {
Expand All @@ -82,7 +84,9 @@ class BookingCRUDSpec extends GebReportingSpec {
page.save()

then:
at BookingShowPage
waitFor {
at BookingShowPage
}
}

def 'check the entered details'() {
Expand Down Expand Up @@ -117,7 +121,9 @@ class BookingCRUDSpec extends GebReportingSpec {
editPage.buttons.update()

then:
at BookingShowPage
waitFor {
at BookingShowPage
}
}

def 'check in listing'() {
Expand All @@ -126,7 +132,9 @@ class BookingCRUDSpec extends GebReportingSpec {
page.nav.home()

then:
at BookingListPage
waitFor {
at BookingListPage
}

when:
BookingListPage listPage = browser.page BookingListPage
Expand All @@ -149,7 +157,9 @@ class BookingCRUDSpec extends GebReportingSpec {
page.table.select('Tim Cook')

then:
at BookingShowPage
waitFor {
at BookingShowPage
}

and:
BookingShowPage showPage = browser.page BookingShowPage
Expand All @@ -165,7 +175,9 @@ class BookingCRUDSpec extends GebReportingSpec {
withConfirm { page.buttons.delete() }

then:
at BookingListPage
waitFor {
at BookingListPage
}

when:
BookingListPage listPage = browser.page BookingListPage
Expand Down
20 changes: 15 additions & 5 deletions src/integration-test/groovy/demo/ExtraCRUDSpec.groovy
Expand Up @@ -30,7 +30,9 @@ class ExtraCRUDSpec extends GebReportingSpec {
page.buttons.create()

then:
at CreateExtraPage
waitFor {
at CreateExtraPage
}
}

def 'enter the extra details'() {
Expand All @@ -42,7 +44,9 @@ class ExtraCRUDSpec extends GebReportingSpec {
page.save()

then:
at ShowExtraPage
waitFor {
at ShowExtraPage
}
}

def 'check the entered details for the extra'() {
Expand All @@ -68,7 +72,9 @@ class ExtraCRUDSpec extends GebReportingSpec {
editPage.buttons.update()

then:
at ShowExtraPage
waitFor {
at ShowExtraPage
}
}

def 'check extra in listing'() {
Expand Down Expand Up @@ -100,7 +106,9 @@ class ExtraCRUDSpec extends GebReportingSpec {
page.table.select('English Breakfast')

then:
at ShowExtraPage
waitFor {
at ShowExtraPage
}
}

def 'delete extra'() {
Expand All @@ -111,7 +119,9 @@ class ExtraCRUDSpec extends GebReportingSpec {
withConfirm { page.buttons.delete() }

then:
at ExtraListPage
waitFor {
at ExtraListPage
}

when:
ExtraListPage listPage = browser.page ExtraListPage
Expand Down
20 changes: 15 additions & 5 deletions src/integration-test/groovy/demo/RoomCRUDSpec.groovy
Expand Up @@ -30,7 +30,9 @@ class RoomCRUDSpec extends GebReportingSpec {
page.buttons.create()

then:
at CreateRoomPage
waitFor {
at CreateRoomPage
}
}

def 'enter the details'() {
Expand All @@ -42,7 +44,9 @@ class RoomCRUDSpec extends GebReportingSpec {
page.save()

then:
at ShowRoomPage
waitFor {
at ShowRoomPage
}
}

def 'check the entered details'() {
Expand All @@ -68,7 +72,9 @@ class RoomCRUDSpec extends GebReportingSpec {
editPage.buttons.update()

then:
at ShowRoomPage
waitFor {
at ShowRoomPage
}
}

def 'check in listing'() {
Expand Down Expand Up @@ -100,7 +106,9 @@ class RoomCRUDSpec extends GebReportingSpec {
page.table.select('Room101')

then:
at ShowRoomPage
waitFor {
at ShowRoomPage
}
}

def 'delete room'() {
Expand All @@ -111,7 +119,9 @@ class RoomCRUDSpec extends GebReportingSpec {
withConfirm { page.buttons.delete() }

then:
at RoomListPage
waitFor {
at RoomListPage
}

when:
RoomListPage listPage = browser.page RoomListPage
Expand Down
6 changes: 6 additions & 0 deletions src/integration-test/resources/GebConfig.groovy
Expand Up @@ -2,9 +2,15 @@ import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.firefox.FirefoxOptions
import org.openqa.selenium.safari.SafariDriver

environments {

// You need to configure in Safari -> Develop -> Allowed Remote Automation
safari {
driver = { new SafariDriver() }
}

// run via “./gradlew -Dgeb.env=chrome iT”
chrome {
driver = { new ChromeDriver() }
Expand Down

0 comments on commit 95e9ffe

Please sign in to comment.