storj/testsuite/ui/satellite/user_login_test.go
Egon Elbre 6ab2647adb ci: run UI tests
We have implemented few UI tests using go-rod, but haven't been running
them regularly.

Change-Id: I6c89365f719882431842a2026b426860f1293b8b
2021-10-06 15:54:06 +00:00

34 lines
1013 B
Go

// Copyright (C) 2021 Storj Labs, Inc.
// See LICENSE for copying information.
package satellite_test
import (
"testing"
"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"
"storj.io/storj/testsuite/ui/uitest"
)
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 := openPage(browser, loginPageURL)
page.MustElement("[aria-roledescription=email] input").MustInput(user.Email)
page.MustElement("[aria-roledescription=password] input").MustInput(user.Password)
page.Keyboard.MustPress(input.Enter)
waitVueTick(page)
dashboardTitle := page.MustElement("[aria-roledescription=title]").MustText()
require.Contains(t, dashboardTitle, "Dashboard")
})
}