Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit fb77d33

Browse files
authored
Merge pull request #340 from vania-pooh/master
Showing labels from extension capabilities
2 parents 77fc1b3 + 45c02df commit fb77d33

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup Golang
1515
uses: actions/setup-go@v2
1616
with:
17-
go-version: 1.15.x
17+
go-version: 1.16.x
1818

1919
- uses: actions/cache@v1
2020
with:

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup Golang
1414
uses: actions/setup-go@v2
1515
with:
16-
go-version: 1.15.x
16+
go-version: 1.16.x
1717

1818
- uses: actions/cache@v1
1919
with:

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Setup Golang
1313
uses: actions/setup-go@v2
1414
with:
15-
go-version: 1.15.x
15+
go-version: 1.16.x
1616

1717
- uses: actions/cache@v1
1818
with:

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.12
1+
FROM alpine:3
22

33
RUN apk add -U tzdata ca-certificates && rm -Rf /var/cache/apk/*
44
COPY ggr /usr/bin

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/aerokube/ggr
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/aandryashin/matchers v0.0.0-20160729131923-5eb67beb188b

proxy.go

+5
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ func (c caps) capabilities(fn func(m map[string]interface{}, w3c bool)) {
9898
if alwaysMatch, ok := m[keys.alwaysMatch]; ok {
9999
if m, ok := alwaysMatch.(map[string]interface{}); ok {
100100
fn(m, true)
101+
for k, v := range m { // Extension capabilities have ":" in key
102+
if ec, ok := v.(map[string]interface{}); ok && strings.Contains(k, ":") {
103+
fn(ec, true)
104+
}
105+
}
101106
}
102107
}
103108
}

proxy_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ func TestStartSessionWithDefaultVersionW3C(t *testing.T) {
880880
mux.HandleFunc("/wd/hub/session", postOnly(func(w http.ResponseWriter, r *http.Request) {
881881
body, _ := ioutil.ReadAll(r.Body)
882882
r.Body.Close()
883-
var sess map[string]map[string]map[string]string
883+
var sess map[string]map[string]map[string]interface{}
884884
err := json.Unmarshal(body, &sess)
885885
w.Write([]byte(`{"sessionId":"123"}`))
886886
AssertThat(t, err, Is{nil})
@@ -911,7 +911,7 @@ func TestStartSessionWithDefaultVersionW3C(t *testing.T) {
911911
}}}}
912912
updateQuota(user, browsers)
913913

914-
createSession(`{"capabilities":{"alwaysMatch":{"browserName":"browser"}}}`)
914+
createSession(`{"capabilities":{"alwaysMatch":{"browserName":"browser", "selenoid:options": {"labels": {"some-key": "some-value"}}}}}`)
915915
}
916916

917917
func TestClientClosedConnection(t *testing.T) {

0 commit comments

Comments
 (0)