2021-06-09 12:39:38 +01:00
|
|
|
// Copyright (C) 2021 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package satellite_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/go-rod/rod"
|
|
|
|
"github.com/go-rod/rod/lib/input"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"storj.io/common/testcontext"
|
|
|
|
"storj.io/storj/private/testplanet"
|
2021-08-18 13:46:50 +01:00
|
|
|
"storj.io/storj/testsuite/ui/uitest"
|
2021-06-09 12:39:38 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestLoginToAccount(t *testing.T) {
|
|
|
|
uitest.Run(t, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet, browser *rod.Browser) {
|
|
|
|
loginPageURL := planet.Satellites[0].ConsoleURL() + "/login"
|
|
|
|
user := planet.Uplinks[0].User[planet.Satellites[0].ID()]
|
|
|
|
|
|
|
|
page := browser.Timeout(10 * time.Second).MustPage(loginPageURL)
|
|
|
|
page.MustSetViewport(1350, 600, 1, false)
|
2021-08-18 13:46:50 +01:00
|
|
|
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElement("[aria-roledescription=email]").MustInput(user.Email)
|
|
|
|
page.MustElement("[aria-roledescription=password]").MustInput(user.Password)
|
2021-06-09 12:39:38 +01:00
|
|
|
page.Keyboard.MustPress(input.Enter)
|
|
|
|
|
2021-09-16 13:04:26 +01:00
|
|
|
dashboardTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
2021-06-09 12:39:38 +01:00
|
|
|
require.Contains(t, dashboardTitle, "Dashboard")
|
|
|
|
})
|
|
|
|
}
|