2021-07-06 12:36:42 +01:00
|
|
|
// 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"
|
2021-08-19 19:59:13 +01:00
|
|
|
"storj.io/storj/testsuite/ui/uitest"
|
2021-07-06 12:36:42 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestOnboardingWizardBrowser(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)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-07-06 12:36:42 +01:00
|
|
|
// first time User signup
|
2021-09-16 13:04:26 +01:00
|
|
|
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)
|
2021-07-06 12:36:42 +01:00
|
|
|
page.MustElement(".checkmark").MustClick()
|
|
|
|
page.Keyboard.MustPress(input.Enter)
|
2021-09-16 13:04:26 +01:00
|
|
|
confirmAccountEmailMessage := page.MustElement("[aria-roledescription=title]").MustText()
|
2021-07-06 12:36:42 +01:00
|
|
|
require.Contains(t, confirmAccountEmailMessage, "You're almost there!")
|
|
|
|
|
|
|
|
// first time user log in
|
2021-08-18 13:46:50 +01:00
|
|
|
page.MustElement("[href=\"/login\"]").MustClick()
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElement("[aria-roledescription=email]").MustInput(emailAddress)
|
|
|
|
page.MustElement("[aria-roledescription=password]").MustInput(password)
|
2021-07-06 12:36:42 +01:00
|
|
|
page.Keyboard.MustPress(input.Enter)
|
|
|
|
|
|
|
|
// testing onboarding workflow browser
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"CONTINUE IN WEB\"])").MustClick()
|
|
|
|
objectBrowserWarning := page.MustElement("[aria-roledescription=sub-title]").MustText()
|
2021-07-06 12:36:42 +01:00
|
|
|
require.Contains(t, objectBrowserWarning, "The object browser uses server side encryption.")
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Continue\"])").MustClick()
|
2021-07-06 12:36:42 +01:00
|
|
|
|
2021-09-16 13:04:26 +01:00
|
|
|
encryptionPassphraseWarningTitle := page.MustElement("[aria-roledescription=warning-title]").MustText()
|
|
|
|
require.Contains(t, encryptionPassphraseWarningTitle, "The object browser uses server side encryption.")
|
|
|
|
customPassphrase := page.MustElement("[aria-roledescription=enter-passphrase-label]")
|
2021-08-18 13:46:50 +01:00
|
|
|
customPassphraseLabel := customPassphrase.MustText()
|
|
|
|
require.Contains(t, customPassphraseLabel, "Enter Your Own Passphrase")
|
2021-07-06 12:36:42 +01:00
|
|
|
customPassphrase.MustClick()
|
|
|
|
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElement("[aria-roledescription=passphrase]").MustInput("password123")
|
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-07-06 12:36:42 +01:00
|
|
|
|
|
|
|
// Buckets Page
|
2021-09-16 13:04:26 +01:00
|
|
|
bucketsTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
2021-07-06 12:36:42 +01:00
|
|
|
require.Contains(t, bucketsTitle, "Buckets")
|
|
|
|
})
|
|
|
|
}
|