storj/testsuite/ui/satellite/user_login_test.go
storj-antonio 8c8a3e217f testsuite/ui: move from integration
Move ui tests to testsuite/ and introduce a new go.mod.
This prevents cyclic references when building edge binaries for testing.

Change-Id: I613fdc21ef9eaffba2052f6ad973bfa18c7c86bd
2021-08-20 16:33:53 +00:00

34 lines
1.0 KiB
Go

// 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/integration/ui/uitest"
"storj.io/storj/private/testplanet"
)
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)
page.MustElement(".headerless-input").MustInput(user.Email)
page.MustElement("[type=password]").MustInput(user.Password)
page.Keyboard.MustPress(input.Enter)
dashboardTitle := page.MustElement(".dashboard-area__header-wrapper__title").MustText()
require.Contains(t, dashboardTitle, "Dashboard")
})
}