testsuite/ui/uitest: fixes for uitest

Enable leakless for killing processes. Maybe it'll prevent issues with
the jenkins stage stalling.

Unify some of the code.

Set the browser tests non-parallel again, it might be causing some of
the issues.

Change-Id: Idb123bff3640e8adab5db0917ee774f0cf7e2568
This commit is contained in:
Egon Elbre 2021-11-12 10:46:09 +02:00
parent 788d775f6a
commit 1fd14e291f
4 changed files with 16 additions and 17 deletions

View File

@ -41,7 +41,7 @@ func Browser(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet,
launch := launcher.New().
Headless(!showBrowser).
Leakless(false).
Leakless(true).
Devtools(false).
NoSandbox(true).
UserDataDir(ctx.Dir("browser")).

View File

@ -67,12 +67,7 @@ func Edge(t *testing.T, test EdgeTest) {
SatelliteCount: 1, StorageNodeCount: 4, UplinkCount: 1,
Reconfigure: testplanet.Reconfigure{
Satellite: func(log *zap.Logger, index int, config *satellite.Config) {
if dir := os.Getenv("STORJ_TEST_SATELLITE_WEB"); dir != "" {
config.Console.StaticDir = dir
}
config.Console.NewOnboarding = true
config.Console.NewObjectsFlow = true
config.Console.NewBrowser = true
configureSatellite(log, index, config)
// TODO: this should be dynamically set from the auth service
config.Console.GatewayCredentialsRequestURL = "http://" + authSvcAddr
},

View File

@ -24,6 +24,7 @@ func Multinode(t *testing.T, multinodeCount int, test Test) {
config.Console.StaticDir = dir
}
},
Satellite: configureSatellite,
},
NonParallel: true,
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {

View File

@ -30,22 +30,25 @@ func (log zapWriter) Write(data []byte) (int, error) {
return len(data), nil
}
func configureSatellite(log *zap.Logger, index int, config *satellite.Config) {
if dir := os.Getenv("STORJ_TEST_SATELLITE_WEB"); dir != "" {
config.Console.StaticDir = dir
}
config.Console.NewOnboarding = true
config.Console.NewNavigation = true
config.Console.NewBrowser = true
config.Console.NewObjectsFlow = true
config.Console.CouponCodeBillingUIEnabled = true
}
// Run starts a new UI test.
func Run(t *testing.T, test Test) {
testplanet.Run(t, testplanet.Config{
SatelliteCount: 1, StorageNodeCount: 4, UplinkCount: 1,
Reconfigure: testplanet.Reconfigure{
Satellite: func(log *zap.Logger, index int, config *satellite.Config) {
if dir := os.Getenv("STORJ_TEST_SATELLITE_WEB"); dir != "" {
config.Console.StaticDir = dir
}
config.Console.NewOnboarding = true
config.Console.NewNavigation = true
config.Console.NewBrowser = true
config.Console.CouponCodeBillingUIEnabled = true
config.Console.NewObjectsFlow = true
},
Satellite: configureSatellite,
},
NonParallel: true,
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
Browser(t, ctx, planet, func(browser *rod.Browser) {
test(t, ctx, planet, browser)