From 580cfb6d4b4c9909c27378962ac85275a50ff296 Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Tue, 3 May 2022 16:17:24 +0300 Subject: [PATCH] testsuite/ui/uitest: do not use localhost for testing We must always use 127.0.0.1 for testing and optionally support customizing it for different scenarios. Also few minor fixes to testsuite/ui/satellite. Change-Id: I46ef151c6aa92768cb24fc2b8c768f10d5dea75d --- testsuite/ui/satellite/billing_coupon_test.go | 9 +++------ testsuite/ui/satellite/onboarding_test.go | 4 ++-- testsuite/ui/uitest/browser.go | 2 +- testsuite/ui/uitest/edge.go | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/testsuite/ui/satellite/billing_coupon_test.go b/testsuite/ui/satellite/billing_coupon_test.go index 0ae0f9b4d..0529f81b3 100644 --- a/testsuite/ui/satellite/billing_coupon_test.go +++ b/testsuite/ui/satellite/billing_coupon_test.go @@ -18,7 +18,7 @@ import ( func navigateToBilling(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet, browser *rod.Browser, signupQuery string) *rod.Page { signupPageURL := planet.Satellites[0].ConsoleURL() + "/signup" + signupQuery fullName := "John Doe" - emailAddress := "test@email.com" + emailAddress := "test@email.test" password := "qazwsx123" page := openPage(browser, signupPageURL) @@ -56,7 +56,6 @@ func navigateToBilling(t *testing.T, ctx *testcontext.Context, planet *testplane func TestCouponCodes(t *testing.T) { uitest.Run(t, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet, browser *rod.Browser) { - page := navigateToBilling(t, ctx, planet, browser, "") couponText := page.MustElement(".coupon-area__container__text-container").MustText() @@ -128,9 +127,8 @@ func TestCouponCodes(t *testing.T) { }) } -func TestCouponCodeSignupGood(t *testing.T) { +func TestCouponCode_SignupGood(t *testing.T) { uitest.Run(t, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet, browser *rod.Browser) { - page := navigateToBilling(t, ctx, planet, browser, "/?promo=promo1") couponText := page.MustElement(".coupon-area__container__text-container").MustText() @@ -140,9 +138,8 @@ func TestCouponCodeSignupGood(t *testing.T) { }) } -func TestCouponCodeSignupBad(t *testing.T) { +func TestCouponCode_SignupBad(t *testing.T) { uitest.Run(t, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet, browser *rod.Browser) { - page := navigateToBilling(t, ctx, planet, browser, "/?promo=badCode") couponText := page.MustElement(".coupon-area__container__text-container").MustText() diff --git a/testsuite/ui/satellite/onboarding_test.go b/testsuite/ui/satellite/onboarding_test.go index 615df2a6a..2d60d1c12 100644 --- a/testsuite/ui/satellite/onboarding_test.go +++ b/testsuite/ui/satellite/onboarding_test.go @@ -313,7 +313,7 @@ func TestOnboarding_WizardCLIFlow(t *testing.T) { page.MustElementX("(//span[text()=\"Finish\"])").MustClick() waitVueTick(page) dashboardTitle := page.MustElement("[aria-roledescription=title]").MustText() - require.Contains(t, dashboardTitle, "My First Project Dashboard") + require.Contains(t, dashboardTitle, "Dashboard") page.MustNavigateBack() successTitle1 := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, successTitle1, "Wonderful") @@ -326,7 +326,7 @@ func TestOnboarding_WizardCLIFlow(t *testing.T) { // Dashboard screen dashboardTitle1 := page.MustElement("[aria-roledescription=title]").MustText() - require.Contains(t, dashboardTitle1, "My First Project Dashboard") + require.Contains(t, dashboardTitle1, "Dashboard") }) } diff --git a/testsuite/ui/uitest/browser.go b/testsuite/ui/uitest/browser.go index dbd3398f7..ee2f010dd 100644 --- a/testsuite/ui/uitest/browser.go +++ b/testsuite/ui/uitest/browser.go @@ -84,7 +84,7 @@ func Browser(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet, WithPanic(func(v interface{}) { require.Fail(t, "check failed", v) }) if slowBrowser { - browser = browser.SlowMotion(300 * time.Millisecond).Trace(true) + browser = browser.SlowMotion(100 * time.Millisecond).Trace(true) } defer ctx.Check(func() error { diff --git a/testsuite/ui/uitest/edge.go b/testsuite/ui/uitest/edge.go index 60ce056d0..3ed34ec49 100644 --- a/testsuite/ui/uitest/edge.go +++ b/testsuite/ui/uitest/edge.go @@ -61,7 +61,7 @@ type EdgeTest func(t *testing.T, ctx *testcontext.Context, planet *EdgePlanet, b func Edge(t *testing.T, test EdgeTest) { edgehost := os.Getenv("STORJ_TEST_EDGE_HOST") if edgehost == "" { - edgehost = "localhost" + edgehost = "127.0.0.1" } // TODO: make address not hardcoded the address selection here may @@ -107,7 +107,7 @@ func Edge(t *testing.T, test EdgeTest) { KVBackend: "memory://", ListenAddr: authSvcAddr, ListenAddrTLS: authSvcAddrTLS, - DRPCListenAddr: ":0", + DRPCListenAddr: net.JoinHostPort(edgehost, "0"), DRPCListenAddrTLS: authSvcDrpcAddrTLS, CertFile: certFile.Name(), KeyFile: keyFile.Name(),