storj/testsuite/ui/satellite/onboarding_wizard_restart_test.go
Vitalii Shpital 46d1b4dfaa testsuite/ui/satellite: added test for restart onb tour functionality
Updated old test to include 'restart tour functionality'.

Change-Id: Id5d1e375f5b455fb2494d21ae2b66cc6d20d3a18
2021-09-29 13:12:36 +00:00

56 lines
2.1 KiB
Go

// Copyright (C) 2021 Storj Labs, Inc.
// See LICENSE for copying information.
package satellite
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 := browser.MustPage(signupPageURL)
page.MustSetViewport(1350, 600, 1, false)
// First time User signup
page.MustElement("[aria-roledescription=name]").MustInput(fullName)
page.MustElement("[aria-roledescription=email]").MustInput(emailAddress)
page.MustElement("[aria-roledescription=password]").MustInput(password)
page.MustElement("[aria-roledescription=retype-password]").MustInput(password)
page.MustElement(".checkmark").MustClick()
page.Keyboard.MustPress(input.Enter)
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]").MustInput(emailAddress)
page.MustElement("[aria-roledescription=password]").MustInput(password)
page.Keyboard.MustPress(input.Enter)
// 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.MustElement("[aria-roledescription=restart-onb-icon]").MustHover()
page.MustElementX("(//span[text()=\"Start tour\"])").MustClick()
welcomeTitle := page.MustElement("[aria-roledescription=title]").MustText()
require.Contains(t, welcomeTitle, "Welcome")
})
}