diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 360f589..9ae8f51 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -26,6 +26,10 @@ jobs: - name: "🔨 Build project" id: build run: ./gradlew build + - name: "🏃‍♀️Run functional tests" + run: | + cd spock-container-test-app + ./gradlew check publish: if: github.event_name == 'push' runs-on: ubuntu-latest diff --git a/spock-container-test-app/src/integration-test/groovy/org/demo/spock/DownloadSupportSpec.groovy b/spock-container-test-app/src/integration-test/groovy/org/demo/spock/DownloadSupportSpec.groovy new file mode 100644 index 0000000..0244a14 --- /dev/null +++ b/spock-container-test-app/src/integration-test/groovy/org/demo/spock/DownloadSupportSpec.groovy @@ -0,0 +1,16 @@ +package org.demo.spock + +import grails.plugin.geb.ContainerGebSpec +import grails.testing.mixin.integration.Integration + +@Integration +class DownloadSupportSpec extends ContainerGebSpec { + + void 'should be able to use download methods'() { + when: + go '/' + + then: + downloadText().contains('Welcome to Grails') + } +} \ No newline at end of file diff --git a/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy b/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy index e4a9cbf..d612578 100644 --- a/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy +++ b/src/testFixtures/groovy/grails/plugin/geb/ContainerAwareDownloadSupport.groovy @@ -40,5 +40,9 @@ trait ContainerAwareDownloadSupport implements DownloadSupport { @Delegate @Shared - DownloadSupport downloadSupport + static DownloadSupport downloadSupport + + static void setDownloadSupport(DownloadSupport downloadSupport) { + this.downloadSupport = downloadSupport + } } \ No newline at end of file