From f9d21900e843fc233ba572f362b7cb51ddb0445c Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 23 Apr 2024 08:53:21 +0100 Subject: [PATCH] Remove page.goback --- common/page.go | 6 ------ tests/browser_test.go | 8 ++------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/common/page.go b/common/page.go index 6c9c7df67..3c9074a6a 100644 --- a/common/page.go +++ b/common/page.go @@ -815,12 +815,6 @@ func (p *Page) GetTouchscreen() *Touchscreen { return p.Touchscreen } -// GoBack is not implemented. -func (p *Page) GoBack(_ goja.Value) *Response { - k6ext.Panic(p.ctx, "Page.goBack(opts) has not been implemented yet") - return nil -} - // Goto will navigate the page to the specified URL and return a HTTP response object. func (p *Page) Goto(url string, opts *FrameGotoOptions) (*Response, error) { p.logger.Debugf("Page:Goto", "sid:%v url:%q", p.sessionID(), url) diff --git a/tests/browser_test.go b/tests/browser_test.go index 0fb42a0b0..8f3f150e0 100644 --- a/tests/browser_test.go +++ b/tests/browser_test.go @@ -18,6 +18,7 @@ import ( "github.com/grafana/xk6-browser/browser" "github.com/grafana/xk6-browser/common" "github.com/grafana/xk6-browser/env" + "github.com/grafana/xk6-browser/k6ext" "github.com/grafana/xk6-browser/k6ext/k6test" ) @@ -278,14 +279,9 @@ func TestMultiBrowserPanic(t *testing.T) { b1 = newTestBrowser(t) b2 = newTestBrowser(t) - bctx, err := b1.NewContext(nil) - require.NoError(t, err) - p1, err := bctx.NewPage() - require.NoError(t, err, "failed to create page #1") - func() { defer func() { _ = recover() }() - p1.GoBack(nil) + k6ext.Panic(b1.ctx, "forcing a panic") }() })