storj/testsuite/ui/satellite/onboarding_wizard_restart_test.go
Vitalii Shpital 609526f6aa web/satellite: reworked new navigation sidebar
Reworked projects selection.
Added billing route to sidebar.
Reworked accounts container.
Fixed navigation console errors.
Fixed Quick start -> CLI flow back route bug.

Change-Id: Ia926146172598b9abde9a0ab5ed38cd7f9719ddd
2021-11-05 15:27:02 +00:00

66 lines
2.5 KiB
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 TestRestartOnboardingWizard(t *testing.T) {
uitest.Run(t, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet, browser *rod.Browser) {
signupPageURL := planet.Satellites[0].ConsoleURL() + "/signup"
fullName := "John Doe"
emailAddress := "test@email.com"
password := "qazwsx123"
page := openPage(browser, signupPageURL)
// First time User signup
page.MustElement("[aria-roledescription=name] input").MustInput(fullName)
page.MustElement("[aria-roledescription=email] input").MustInput(emailAddress)
page.MustElement("[aria-roledescription=password] input").MustInput(password)
page.MustElement("[aria-roledescription=retype-password] input").MustInput(password)
page.MustElement(".checkmark").MustClick()
page.Keyboard.MustPress(input.Enter)
waitVueTick(page)
confirmAccountEmailMessage := page.MustElement("[aria-roledescription=title]").MustText()
require.Contains(t, confirmAccountEmailMessage, "You're almost there!")
// Login as first time User
page.MustElement("[href=\"/login\"]").MustClick()
page.MustElement("[aria-roledescription=email] input").MustInput(emailAddress)
page.MustElement("[aria-roledescription=password] input").MustInput(password)
page.Keyboard.MustPress(input.Enter)
waitVueTick(page)
// Checking out skip of onboarding process
page.MustElement("[href=\"/project-dashboard\"]").MustClick()
dashboardTitle := page.MustElement("[aria-roledescription=title]").MustText()
require.Contains(t, dashboardTitle, "Dashboard")
// Testing restart tour functionality
page.MustElementR("p", "Quick Start").MustClick()
wait := page.MustWaitRequestIdle()
page.MustElement("[aria-roledescription=cli-flow-route]").MustClick()
wait()
apiKeyGeneratedTitle := page.MustElement("[aria-roledescription=title]").MustText()
require.Contains(t, apiKeyGeneratedTitle, "API Key Generated")
page.Race().Element("[aria-roledescription=satellite-address]").MustHandle(func(el *rod.Element) {
require.NotEmpty(t, el.MustText())
}).MustDo()
page.Race().Element("[aria-roledescription=api-key]").MustHandle(func(el *rod.Element) {
require.NotEmpty(t, el.MustText())
}).MustDo()
})
}