storj/testsuite/ui/satellite/onboarding_wizard_skip_test.go
Vitalii Shpital 0376fcdaef integration/ui/satellite: fixed tests for onboarding flow
Fixed tests to pass

Change-Id: I90c61168a3a67188e586564a5df381f2f41e2834
2021-08-26 19:07:52 +03:00

51 lines
1.8 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 TestSkipOnboardingWizard(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("[placeholder=\"Enter Full Name\"]").MustInput(fullName)
page.MustElement("[placeholder=\"example@email.com\"]").MustInput(emailAddress)
page.MustElement("[placeholder=\"Enter Password\"]").MustInput(password)
page.MustElement("[placeholder=\"Retype Password\"]").MustInput(password)
page.MustElement(".checkmark").MustClick()
page.Keyboard.MustPress(input.Enter)
confirmAccountEmailMessage := page.MustElement(".register-success-area__form-container__title").MustText()
require.Contains(t, confirmAccountEmailMessage, "You're almost there!")
// Login as first time User
page.MustElement("[href=\"/login\"]").MustClick()
page.MustElement("[type=text]").MustInput(emailAddress)
page.MustElement("[type=password]").MustInput(password)
page.Keyboard.MustPress(input.Enter)
// Checking out skip of onboarding process
page.MustElement(".overview-area__skip-button").MustClick()
dashboardTitle := page.MustElement(".dashboard-area__header-wrapper__title").MustText()
require.Contains(t, dashboardTitle, "Dashboard")
})
}