-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also adds a new method in common.Browser API so we can get the underlying browser process WS URL. This is required in order to reuse the current TestBrowser implementation to launch a new browser and connecto to it through BrowserType.Connect.
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/grafana/xk6-browser/chromium" | ||
"github.com/grafana/xk6-browser/k6ext/k6test" | ||
) | ||
|
||
func TestBrowserTypeConnect(t *testing.T) { | ||
// Start a test browser so we can get its WS URL | ||
// and use it to connect through BrowserType.Connect. | ||
tb := newTestBrowser(t) | ||
vu := k6test.NewVU(t) | ||
bt := chromium.NewBrowserType(vu) | ||
vu.MoveToVUContext() | ||
|
||
b := bt.Connect(tb.WsURL(), nil) | ||
b.NewPage(nil) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters