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
This commit is contained in:
Egon Elbre 2022-05-03 16:17:24 +03:00 committed by Fadila
parent 4a46d41c1c
commit 580cfb6d4b
4 changed files with 8 additions and 11 deletions

View File

@ -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()

View File

@ -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")
})
}

View File

@ -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 {

View File

@ -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(),