Skip to content

Commit

Permalink
Merge pull request #154 from grails/feature/geb
Browse files Browse the repository at this point in the history
Update Gradle Webdriverbinaries plugin to support architecture "aarch64"
  • Loading branch information
puneetbehl authored Jun 17, 2023
2 parents 41fec16 + 4fb5026 commit 9fc656a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Geb(Spock spock) {

@Override
public boolean shouldApply(ApplicationType applicationType, Options options, Set<Feature> selectedFeatures) {
return options.getOperatingSystem() != OperatingSystem.MACOS_ARCH64 && applicationType == ApplicationType.WEB;
return applicationType == ApplicationType.WEB;
}

@NonNull
Expand Down Expand Up @@ -100,7 +100,7 @@ public void apply(GeneratorContext generatorContext) {
generatorContext.addBuildPlugin(GradlePlugin.builder()
.id("com.github.erdi.webdriver-binaries")
.lookupArtifactId("webdriver-binaries-gradle-plugin")
.extension(new RockerWritable(webdriverBinariesPlugin.template(generatorContext.getProject())))
.extension(new RockerWritable(webdriverBinariesPlugin.template(generatorContext.getProject(), generatorContext.getOperatingSystem())))
.build());

generatorContext.addDependency(Dependency.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Project project
package @project.getPackageName()
}

import grails.gormImpl.transactions.Rollback
import grails.gorm.transactions.Rollback
import grails.testing.mixin.integration.Integration

import geb.spock.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
@import org.grails.forge.application.Project;
@import org.grails.forge.application.OperatingSystem;

@args(Project project)
@args(Project project, OperatingSystem os)

webdriverBinaries {
chromedriver '2.32'
geckodriver '0.19.0'
iedriverserver '3.8.0'
edgedriver '86.0.601.0'
chromedriver '110.0.5481.77'
geckodriver '0.32.2'
@if (os == OperatingSystem.WINDOWS) {
iedriverserver '3.141.59'
}
edgedriver '110.0.1587.57'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.grails.forge.feature.test

import org.grails.forge.ApplicationContextSpec
import org.grails.forge.application.ApplicationType
import org.grails.forge.application.OperatingSystem
import org.grails.forge.fixture.CommandOutputFixture
import org.grails.forge.options.BuildTool
import org.grails.forge.options.JdkVersion
Expand Down Expand Up @@ -47,9 +48,22 @@ class GebSpec extends ApplicationContextSpec implements CommandOutputFixture {
expect:
buildGradle.contains("id \"com.github.erdi.webdriver-binaries\" version \"3.0\"")
buildGradle.contains("webdriverBinaries")
buildGradle.contains("chromedriver '2.32'")
buildGradle.contains("geckodriver '0.19.0'")
buildGradle.contains("iedriverserver '3.8.0'")
buildGradle.contains("edgedriver '86.0.601.0'")
buildGradle.contains("chromedriver '110.0.5481.77'")
buildGradle.contains("geckodriver '0.32.2'")
buildGradle.contains("edgedriver '110.0.1587.57'")
}

void "test webdriver binaries gradle configurations for windows OS"() {
given:
final def output = generate(ApplicationType.WEB, new Options(Language.GROOVY, TestFramework.SPOCK, BuildTool.GRADLE, JdkVersion.JDK_11, OperatingSystem.WINDOWS))
final def buildGradle = output["build.gradle"]

expect:
buildGradle.contains("id \"com.github.erdi.webdriver-binaries\" version \"3.0\"")
buildGradle.contains("webdriverBinaries")
buildGradle.contains("chromedriver '110.0.5481.77'")
buildGradle.contains("geckodriver '0.32.2'")
buildGradle.contains("iedriverserver '3.141.59'")
buildGradle.contains("edgedriver '110.0.1587.57'")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait CommandOutputFixture {
beanContext.getBean(ProjectGenerator).generate(type,
NameUtils.parse("example.grails.foo"),
options,
OperatingSystem.LINUX,
options.operatingSystem,
features,
handler,
ConsoleOutput.NOOP
Expand All @@ -38,7 +38,7 @@ trait CommandOutputFixture {
beanContext.getBean(ProjectGenerator).generate(type,
NameUtils.parse("example.grails.foo"),
options,
OperatingSystem.LINUX,
options.operatingSystem,
features,
handler,
ConsoleOutput.NOOP
Expand Down

0 comments on commit 9fc656a

Please sign in to comment.