2021-09-16 13:04:26 +01:00
|
|
|
// Copyright (C) 2021 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2021-09-22 10:20:03 +01:00
|
|
|
package satellite_test
|
2021-09-16 13:04:26 +01:00
|
|
|
|
|
|
|
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"
|
|
|
|
)
|
|
|
|
|
2022-01-05 15:01:33 +00:00
|
|
|
func TestOnboarding_WizardBrowser(t *testing.T) {
|
|
|
|
uitest.Edge(t, func(t *testing.T, ctx *testcontext.Context, planet *uitest.EdgePlanet, browser *rod.Browser) {
|
|
|
|
signupPageURL := planet.Satellites[0].ConsoleURL() + "/signup"
|
|
|
|
fullName := "John Doe"
|
|
|
|
emailAddress := "test@email.test"
|
|
|
|
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!")
|
|
|
|
|
|
|
|
// first time user log in
|
|
|
|
page.MustElement("[href=\"/login\"]").MustClick()
|
|
|
|
waitVueTick(page)
|
|
|
|
page.MustElement("[aria-roledescription=email] input").MustInput(emailAddress)
|
|
|
|
page.MustElement("[aria-roledescription=password] input").MustInput(password)
|
|
|
|
page.Keyboard.MustPress(input.Enter)
|
|
|
|
waitVueTick(page)
|
|
|
|
|
|
|
|
// testing onboarding workflow browser
|
|
|
|
wait := page.MustWaitRequestIdle()
|
|
|
|
page.MustElementX("(//span[text()=\"Continue in web\"])").MustClick()
|
|
|
|
wait()
|
|
|
|
|
|
|
|
// Buckets Page
|
|
|
|
bucketsTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, bucketsTitle, "Buckets")
|
|
|
|
page.Race().ElementR("p", "demo-bucket").MustHandle(func(el *rod.Element) {
|
|
|
|
el.MustClick()
|
|
|
|
waitVueTick(page)
|
|
|
|
}).MustDo()
|
|
|
|
|
|
|
|
// Passphrase screen
|
|
|
|
encryptionTitle := page.MustElement("[aria-roledescription=objects-title]").MustText()
|
|
|
|
require.Contains(t, encryptionTitle, "The object browser uses server side encryption.")
|
|
|
|
customPassphrase := page.MustElement("[aria-roledescription=enter-passphrase-label]")
|
|
|
|
customPassphraseLabel := customPassphrase.MustText()
|
|
|
|
require.Contains(t, customPassphraseLabel, "Enter your own passphrase")
|
|
|
|
customPassphrase.MustClick()
|
|
|
|
waitVueTick(page)
|
|
|
|
page.MustElement("[aria-roledescription=passphrase] input").MustInput("password123")
|
|
|
|
page.MustElement(".checkmark").MustClick()
|
|
|
|
waitVueTick(page)
|
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
|
|
|
waitVueTick(page)
|
|
|
|
|
|
|
|
// Verify that browser component has loaded and that the dropzone is present
|
|
|
|
page.MustElementR("p", "Drop Files Here to Upload")
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestOnboarding_WizardCLIFlow(t *testing.T) {
|
2021-09-16 13:04:26 +01:00
|
|
|
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"
|
2022-01-05 11:07:03 +00:00
|
|
|
emailAddress := "test@email.test"
|
2021-09-16 13:04:26 +01:00
|
|
|
password := "qazwsx123"
|
|
|
|
|
2021-09-22 10:20:03 +01:00
|
|
|
page := openPage(browser, signupPageURL)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
|
|
|
// First time User signup
|
2021-09-30 14:27:46 +01:00
|
|
|
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)
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElement(".checkmark").MustClick()
|
|
|
|
page.Keyboard.MustPress(input.Enter)
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
|
|
|
|
2021-09-16 13:04:26 +01:00
|
|
|
confirmAccountEmailMessage := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, confirmAccountEmailMessage, "You're almost there!")
|
|
|
|
|
|
|
|
// First time User log in
|
|
|
|
page.MustElement("[href=\"/login\"]").MustClick()
|
2021-09-30 14:27:46 +01:00
|
|
|
page.MustElement("[aria-roledescription=email] input").MustInput(emailAddress)
|
|
|
|
page.MustElement("[aria-roledescription=password] input").MustInput(password)
|
2021-09-16 13:04:26 +01:00
|
|
|
page.Keyboard.MustPress(input.Enter)
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
|
|
|
// Testing onboarding workflow uplinkCLI method
|
2021-09-23 18:00:40 +01:00
|
|
|
// Welcome screen
|
2021-10-06 17:35:33 +01:00
|
|
|
wait := page.MustWaitRequestIdle()
|
2021-09-22 12:41:54 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Continue in cli\"])").MustClick()
|
2021-10-06 17:35:33 +01:00
|
|
|
wait()
|
2021-09-23 18:00:40 +01:00
|
|
|
|
|
|
|
// API key generated screen
|
2021-09-16 13:04:26 +01:00
|
|
|
apiKeyGeneratedTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, apiKeyGeneratedTitle, "API Key Generated")
|
2021-10-06 17:35:33 +01:00
|
|
|
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()
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
welcomeTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, welcomeTitle, "Welcome")
|
|
|
|
page.MustElementX("(//span[text()=\"Continue in cli\"])").MustClick()
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// API key generated screen
|
2021-09-16 13:04:26 +01:00
|
|
|
cliInstallTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, cliInstallTitle, "Install Uplink CLI")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// OS tabs
|
|
|
|
page.MustElement("[aria-roledescription=windows]").MustClick()
|
2021-09-30 14:27:46 +01:00
|
|
|
windowsBinaryLink, err := page.MustElementX("(//a[text()=\" Windows Uplink Binary \"])").Attribute("href")
|
2021-09-28 11:08:47 +01:00
|
|
|
require.NoError(t, err)
|
2022-01-22 00:03:05 +00:00
|
|
|
require.Equal(t, *windowsBinaryLink, "https://github.com/storj/storj/releases/latest/download/uplinkng_windows_amd64.zip")
|
2021-09-28 11:08:47 +01:00
|
|
|
page.MustElement("[aria-roledescription=linux]").MustClick()
|
2021-09-30 14:27:46 +01:00
|
|
|
linuxAMDBinaryLink, err := page.MustElementX("(//a[text()=\" Linux AMD64 Uplink Binary \"])").Attribute("href")
|
2021-09-28 11:08:47 +01:00
|
|
|
require.NoError(t, err)
|
2022-01-22 00:03:05 +00:00
|
|
|
require.Equal(t, *linuxAMDBinaryLink, "https://github.com/storj/storj/releases/latest/download/uplinkng_linux_amd64.zip")
|
2021-09-30 14:27:46 +01:00
|
|
|
linuxARMBinaryLink, err := page.MustElementX("(//a[text()=\" Linux ARM Uplink Binary \"])").Attribute("href")
|
2021-09-28 11:08:47 +01:00
|
|
|
require.NoError(t, err)
|
2022-01-22 00:03:05 +00:00
|
|
|
require.Equal(t, *linuxARMBinaryLink, "https://github.com/storj/storj/releases/latest/download/uplinkng_linux_arm.zip")
|
2021-09-28 11:08:47 +01:00
|
|
|
page.MustElement("[aria-roledescription=macos]").MustClick()
|
2021-09-30 14:27:46 +01:00
|
|
|
macOSBinaryLink, err := page.MustElementX("(//a[text()=\" macOS Uplink Binary \"])").Attribute("href")
|
2021-09-28 11:08:47 +01:00
|
|
|
require.NoError(t, err)
|
2022-01-22 00:03:05 +00:00
|
|
|
require.Equal(t, *macOSBinaryLink, "https://github.com/storj/storj/releases/latest/download/uplinkng_darwin_amd64.zip")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// Back and forth click test
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
apiKeyGeneratedTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, apiKeyGeneratedTitle1, "API Key Generated")
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// CLI setup screen
|
2021-09-16 13:04:26 +01:00
|
|
|
cliSetupTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, cliSetupTitle, "CLI Setup")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// OS tabs
|
|
|
|
page.MustElement("[aria-roledescription=windows]").MustClick()
|
|
|
|
windowsCLISetupCmd := page.MustElement("[aria-roledescription=windows-cli-setup]").MustText()
|
|
|
|
require.Equal(t, "./uplink.exe setup", windowsCLISetupCmd)
|
|
|
|
page.MustElement("[aria-roledescription=linux]").MustClick()
|
|
|
|
linuxCLISetupCmd := page.MustElement("[aria-roledescription=linux-cli-setup]").MustText()
|
|
|
|
require.Equal(t, "uplink setup", linuxCLISetupCmd)
|
|
|
|
page.MustElement("[aria-roledescription=macos]").MustClick()
|
|
|
|
macosCLISetupCmd := page.MustElement("[aria-roledescription=macos-cli-setup]").MustText()
|
|
|
|
require.Equal(t, "uplink setup", macosCLISetupCmd)
|
|
|
|
|
|
|
|
// Back and forth click test
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
cliInstallTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, cliInstallTitle1, "Install Uplink CLI")
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// Create bucket screen
|
2021-09-16 13:04:26 +01:00
|
|
|
createBucketTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, createBucketTitle, "Create a bucket")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// OS tabs
|
|
|
|
page.MustElement("[aria-roledescription=windows]").MustClick()
|
|
|
|
windowsCreateBucketCmd := page.MustElement("[aria-roledescription=windows-create-bucket]").MustText()
|
|
|
|
require.Equal(t, "./uplink.exe mb sj://cakes", windowsCreateBucketCmd)
|
|
|
|
page.MustElement("[aria-roledescription=linux]").MustClick()
|
|
|
|
linuxCreateBucketCmd := page.MustElement("[aria-roledescription=linux-create-bucket]").MustText()
|
|
|
|
require.Equal(t, "uplink mb sj://cakes", linuxCreateBucketCmd)
|
|
|
|
page.MustElement("[aria-roledescription=macos]").MustClick()
|
|
|
|
macosCreateBucketCmd := page.MustElement("[aria-roledescription=macos-create-bucket]").MustText()
|
|
|
|
require.Equal(t, "uplink mb sj://cakes", macosCreateBucketCmd)
|
|
|
|
|
|
|
|
// Back and forth click test
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
cliSetupTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, cliSetupTitle1, "CLI Setup")
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// Ready to upload screen
|
2021-09-16 13:04:26 +01:00
|
|
|
readyToUploadTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, readyToUploadTitle, "Ready to upload")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// OS tabs
|
|
|
|
page.MustElement("[aria-roledescription=windows]").MustClick()
|
|
|
|
windowsUploadCmd := page.MustElement("[aria-roledescription=windows-upload]").MustText()
|
|
|
|
require.Equal(t, "./uplink.exe cp <FILE_PATH> sj://cakes", windowsUploadCmd)
|
|
|
|
page.MustElement("[aria-roledescription=linux]").MustClick()
|
|
|
|
linuxUploadCmd := page.MustElement("[aria-roledescription=linux-upload]").MustText()
|
|
|
|
require.Equal(t, "uplink cp ~/Desktop/cheesecake.jpg sj://cakes", linuxUploadCmd)
|
|
|
|
page.MustElement("[aria-roledescription=macos]").MustClick()
|
|
|
|
macosUploadCmd := page.MustElement("[aria-roledescription=macos-upload]").MustText()
|
|
|
|
require.Equal(t, "uplink cp ~/Desktop/cheesecake.jpg sj://cakes", macosUploadCmd)
|
|
|
|
|
|
|
|
// Back and forth click test
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
createBucketTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, createBucketTitle1, "Create a bucket")
|
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// List a bucket screen
|
2021-09-16 13:04:26 +01:00
|
|
|
listTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, listTitle, "Listing a bucket")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// OS tabs
|
|
|
|
page.MustElement("[aria-roledescription=windows]").MustClick()
|
|
|
|
windowsListCmd := page.MustElement("[aria-roledescription=windows-list]").MustText()
|
|
|
|
require.Equal(t, "./uplink.exe ls sj://cakes", windowsListCmd)
|
|
|
|
page.MustElement("[aria-roledescription=linux]").MustClick()
|
|
|
|
linuxListCmd := page.MustElement("[aria-roledescription=linux-list]").MustText()
|
|
|
|
require.Equal(t, "uplink ls sj://cakes", linuxListCmd)
|
|
|
|
page.MustElement("[aria-roledescription=macos]").MustClick()
|
|
|
|
macosListCmd := page.MustElement("[aria-roledescription=macos-list]").MustText()
|
|
|
|
require.Equal(t, "uplink ls sj://cakes", macosListCmd)
|
|
|
|
|
|
|
|
// Back and forth click test
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
readyToUploadTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, readyToUploadTitle1, "Ready to upload")
|
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// Download screen
|
2021-09-16 13:04:26 +01:00
|
|
|
downloadTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, downloadTitle, "Download")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// OS tabs
|
|
|
|
page.MustElement("[aria-roledescription=windows]").MustClick()
|
|
|
|
windowsDownloadCmd := page.MustElement("[aria-roledescription=windows-download]").MustText()
|
|
|
|
require.Equal(t, "./uplink.exe cp sj://cakes/cheesecake.jpg <DESTINATION_PATH>/cheesecake.jpg", windowsDownloadCmd)
|
|
|
|
page.MustElement("[aria-roledescription=linux]").MustClick()
|
|
|
|
linuxDownloadCmd := page.MustElement("[aria-roledescription=linux-download]").MustText()
|
|
|
|
require.Equal(t, "uplink cp sj://cakes/cheesecake.jpg ~/Downloads/cheesecake.jpg", linuxDownloadCmd)
|
|
|
|
page.MustElement("[aria-roledescription=macos]").MustClick()
|
|
|
|
macosDownloadCmd := page.MustElement("[aria-roledescription=macos-download]").MustText()
|
|
|
|
require.Equal(t, "uplink cp sj://cakes/cheesecake.jpg ~/Downloads/cheesecake.jpg", macosDownloadCmd)
|
|
|
|
|
|
|
|
// Back and forth click test
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
listTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, listTitle1, "Listing a bucket")
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// Share link screen
|
2021-09-16 13:04:26 +01:00
|
|
|
shareLinkTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, shareLinkTitle, "Share a link")
|
2021-09-28 11:08:47 +01:00
|
|
|
|
|
|
|
// OS tabs
|
|
|
|
page.MustElement("[aria-roledescription=windows]").MustClick()
|
|
|
|
windowsShareCmd := page.MustElement("[aria-roledescription=windows-share]").MustText()
|
|
|
|
require.Equal(t, "./uplink.exe share --url sj://cakes/cheesecake.jpg", windowsShareCmd)
|
|
|
|
page.MustElement("[aria-roledescription=linux]").MustClick()
|
|
|
|
linuxShareCmd := page.MustElement("[aria-roledescription=linux-share]").MustText()
|
|
|
|
require.Equal(t, "uplink share --url sj://cakes/cheesecake.jpg", linuxShareCmd)
|
|
|
|
page.MustElement("[aria-roledescription=macos]").MustClick()
|
|
|
|
macosShareCmd := page.MustElement("[aria-roledescription=macos-share]").MustText()
|
|
|
|
require.Equal(t, "uplink share --url sj://cakes/cheesecake.jpg", macosShareCmd)
|
|
|
|
|
|
|
|
// Back and forth click test
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"< Back\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
downloadTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, downloadTitle1, "Download")
|
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Next >\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-16 13:04:26 +01:00
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// Success screen
|
2021-09-16 13:04:26 +01:00
|
|
|
successTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, successTitle, "Wonderful")
|
2021-09-23 18:00:40 +01:00
|
|
|
page.MustElementX("(//span[text()=\"Finish\"])").MustClick()
|
2021-09-22 10:20:03 +01:00
|
|
|
waitVueTick(page)
|
2021-09-23 18:00:40 +01:00
|
|
|
dashboardTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, dashboardTitle, "My First Project Dashboard")
|
|
|
|
page.MustNavigateBack()
|
|
|
|
successTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, successTitle1, "Wonderful")
|
2021-09-16 13:04:26 +01:00
|
|
|
page.MustElementX("(//button[contains(., 'Upgrade')])").MustClick()
|
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// Upgrade to pro account modal
|
2021-09-16 13:04:26 +01:00
|
|
|
addPMModalTitle := page.MustElement("[aria-roledescription=modal-title]").MustText()
|
|
|
|
require.Contains(t, addPMModalTitle, "Upgrade to Pro Account")
|
|
|
|
page.MustElement(".close-cross-container").MustClick()
|
|
|
|
|
2021-09-23 18:00:40 +01:00
|
|
|
// Dashboard screen
|
|
|
|
dashboardTitle1 := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, dashboardTitle1, "My First Project Dashboard")
|
2021-09-16 13:04:26 +01:00
|
|
|
})
|
|
|
|
}
|
2022-01-05 15:01:33 +00:00
|
|
|
|
|
|
|
func TestOnboarding_WelcomeScreenEncryption(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.test"
|
|
|
|
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)
|
|
|
|
|
|
|
|
// Welcome screen encryption test
|
|
|
|
welcomeTitle := page.MustElement("[aria-roledescription=title]").MustText()
|
|
|
|
require.Contains(t, welcomeTitle, "Welcome")
|
|
|
|
serverSideEncTitle := page.MustElement("[aria-roledescription=server-side-encryption-title]").MustText()
|
|
|
|
require.Contains(t, serverSideEncTitle, "SERVER-SIDE ENCRYPTED")
|
|
|
|
endToEndEncTitle := page.MustElement("[aria-roledescription=end-to-end-encryption-title]").MustText()
|
|
|
|
require.Contains(t, endToEndEncTitle, "END-TO-END ENCRYPTED")
|
|
|
|
serverSideEncLink, err := page.MustElement("[aria-roledescription=server-side-encryption-link]").Attribute("href")
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.Equal(t, "https://docs.storj.io/concepts/encryption-key/design-decision-server-side-encryption", *serverSideEncLink)
|
|
|
|
endToEndEncLink, err := page.MustElement("[aria-roledescription=end-to-end-encryption-link]").Attribute("href")
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.Equal(t, "https://docs.storj.io/concepts/encryption-key/design-decision-end-to-end-encryption", *endToEndEncLink)
|
|
|
|
})
|
|
|
|
}
|