Commit b2cd7b21 authored by Andrew Nicols's avatar Andrew Nicols
Browse files

Add headless browser support to runs

parent d9501909
Pipeline #30845 passed with stages
in 2 minutes and 28 seconds
......@@ -5,7 +5,12 @@ class Browser {
protected String defaultTags
def getName() {
public boolean headless
String getName() {
if (headless) {
return "headless${name}"
}
return name
}
......
package test.org.moodle.ci.browsers;
import spock.lang.Specification
class Chrome extends Specification {
def "Default tags are @javascript"() {
given:
def browser = new org.moodle.ci.browsers.Chrome();
when:
def output = browser.getDefaultTags()
then:
assert output == "@javascript"
}
def "Name is chrome"() {
given:
def browser = new org.moodle.ci.browsers.Chrome();
when:
def output = browser.name
then:
assert output == "chrome"
}
def "Name is chrome when not headless"() {
given:
def browser = new org.moodle.ci.browsers.Chrome();
when:
browser.headless = false
def output = browser.name
then:
assert output == "chrome"
}
def "Name is headlesschrome when headless"() {
given:
def browser = new org.moodle.ci.browsers.Chrome();
when:
browser.headless = true
def output = browser.name
then:
assert output == "headlesschrome"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment