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

Commit

Permalink
Merge pull request #340 from vania-pooh/master
Browse files Browse the repository at this point in the history
Showing labels from extension capabilities
  • Loading branch information
vania-pooh authored Mar 22, 2021
2 parents 77fc1b3 + 45c02df commit fb77d33
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- uses: actions/cache@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- uses: actions/cache@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- uses: actions/cache@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.12
FROM alpine:3

RUN apk add -U tzdata ca-certificates && rm -Rf /var/cache/apk/*
COPY ggr /usr/bin
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/aerokube/ggr

go 1.15
go 1.16

require (
github.com/aandryashin/matchers v0.0.0-20160729131923-5eb67beb188b
Expand Down
5 changes: 5 additions & 0 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ func (c caps) capabilities(fn func(m map[string]interface{}, w3c bool)) {
if alwaysMatch, ok := m[keys.alwaysMatch]; ok {
if m, ok := alwaysMatch.(map[string]interface{}); ok {
fn(m, true)
for k, v := range m { // Extension capabilities have ":" in key
if ec, ok := v.(map[string]interface{}); ok && strings.Contains(k, ":") {
fn(ec, true)
}
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ func TestStartSessionWithDefaultVersionW3C(t *testing.T) {
mux.HandleFunc("/wd/hub/session", postOnly(func(w http.ResponseWriter, r *http.Request) {
body, _ := ioutil.ReadAll(r.Body)
r.Body.Close()
var sess map[string]map[string]map[string]string
var sess map[string]map[string]map[string]interface{}
err := json.Unmarshal(body, &sess)
w.Write([]byte(`{"sessionId":"123"}`))
AssertThat(t, err, Is{nil})
Expand Down Expand Up @@ -911,7 +911,7 @@ func TestStartSessionWithDefaultVersionW3C(t *testing.T) {
}}}}
updateQuota(user, browsers)

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

func TestClientClosedConnection(t *testing.T) {
Expand Down

0 comments on commit fb77d33

Please sign in to comment.