Space Automation (ci) maven build that needs a headless chrome...

Hi,

My project is built using Maven, and as part of its build it runs a number of Selenium tests. For this I would need to have a headless Chrome with chromerunner present inside the container.

I started with something like this:

job("Build and run tests") {
container(displayName = "Run mvn install", image = "maven:3.8.1-jdk-11") {
service("chromedp/headless-shell:latest") {
alias("browser")
}
shellScript {
content = """
mvn clean install
"""
}
}
}

which at least seems to start the container and start the build, but I'm not sure on how to configure the connections..

The maven build itself starts a Jetty server with the code under test; maven then runs the integration tests which more or less should connect run chromerunner and connect to that jetty inside the main container- but I do not really have a clue how..

Is this something that can be done?

1 comment
Comment actions Permalink

For posterity: I managed to do this with an image that contained both Maven, Java 11 AND chrome+chromerunner, using the following:

job("Build and run tests") {
container(displayName = "Run mvn install", image = "markhobson/maven-chrome:jdk-11") {
shellScript {
content = """
mvn clean install
"""
}
}
}

Many thanks to Mark Hobson ;)

 

0

Please sign in to leave a comment.