From 8e3d7d30e8d0ad3ce0781ccc6f2f317929dd9b82 Mon Sep 17 00:00:00 2001 From: Vitalii Shpital Date: Tue, 28 Sep 2021 13:08:47 +0300 Subject: [PATCH] web/satellite, testsuite/ui/satellite: added tests for onb CLI os tabs switching Added tests to check if os tabs switching works during new onb CLI flow. Change-Id: I614cfdc5c18a48e69e40f6a7613b352d4367c3a6 --- .../onboarding_wizard_CLI_flow_test.go | 101 ++++++++++++++++++ .../steps/cliFlow/CLIInstall.vue | 23 +++- .../onboardingTour/steps/cliFlow/CLISetup.vue | 6 +- .../steps/cliFlow/CreateBucket.vue | 6 +- .../steps/cliFlow/DownloadObject.vue | 6 +- .../steps/cliFlow/ListObject.vue | 6 +- .../steps/cliFlow/ShareObject.vue | 6 +- .../steps/cliFlow/UploadObject.vue | 6 +- .../steps/common/OSContainer.vue | 21 +++- .../steps/common/TabWithCopy.vue | 4 +- 10 files changed, 159 insertions(+), 26 deletions(-) diff --git a/testsuite/ui/satellite/onboarding_wizard_CLI_flow_test.go b/testsuite/ui/satellite/onboarding_wizard_CLI_flow_test.go index 947c680a4..899db9b41 100644 --- a/testsuite/ui/satellite/onboarding_wizard_CLI_flow_test.go +++ b/testsuite/ui/satellite/onboarding_wizard_CLI_flow_test.go @@ -64,6 +64,29 @@ func TestOnboardingWizardCLIFlow(t *testing.T) { // API key generated screen cliInstallTitle := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, cliInstallTitle, "Install Uplink CLI") + + // OS tabs + page.MustElement("[aria-roledescription=windows]").MustClick() + windowsBinaryCTA := page.MustElement("[aria-roledescription=windows-binary-link]") + windowsBinaryURL, err := windowsBinaryCTA.Attribute("href") + require.NoError(t, err) + require.Equal(t, "https://github.com/storj/storj/releases/latest/download/uplink_windows_amd64.zip", *windowsBinaryURL) + page.MustElement("[aria-roledescription=linux]").MustClick() + linuxAMDBinaryCTA := page.MustElement("[aria-roledescription=linux-amd-binary-link]") + linuxAMDBinaryURL, err := linuxAMDBinaryCTA.Attribute("href") + require.NoError(t, err) + require.Equal(t, "https://github.com/storj/storj/releases/latest/download/uplink_linux_amd64.zip", *linuxAMDBinaryURL) + linuxARMBinaryCTA := page.MustElement("[aria-roledescription=linux-arm-binary-link]") + linuxARMBinaryURL, err := linuxARMBinaryCTA.Attribute("href") + require.NoError(t, err) + require.Equal(t, "https://github.com/storj/storj/releases/latest/download/uplink_linux_arm.zip", *linuxARMBinaryURL) + page.MustElement("[aria-roledescription=macos]").MustClick() + macOSBinaryCTA := page.MustElement("[aria-roledescription=macos-binary-link]") + macOSBinaryURL, err := macOSBinaryCTA.Attribute("href") + require.NoError(t, err) + require.Equal(t, "https://github.com/storj/storj/releases/latest/download/uplink_darwin_amd64.zip", *macOSBinaryURL) + + // Back and forth click test page.MustElementX("(//span[text()=\"< Back\"])").MustClick() page.MustWaitNavigation() apiKeyGeneratedTitle1 := page.MustElement("[aria-roledescription=title]").MustText() @@ -76,6 +99,19 @@ func TestOnboardingWizardCLIFlow(t *testing.T) { // CLI setup screen cliSetupTitle := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, cliSetupTitle, "CLI Setup") + + // 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 page.MustElementX("(//span[text()=\"< Back\"])").MustClick() page.MustWaitNavigation() cliInstallTitle1 := page.MustElement("[aria-roledescription=title]").MustText() @@ -88,6 +124,19 @@ func TestOnboardingWizardCLIFlow(t *testing.T) { // Create bucket screen createBucketTitle := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, createBucketTitle, "Create a bucket") + + // 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 page.MustElementX("(//span[text()=\"< Back\"])").MustClick() page.MustWaitNavigation() cliSetupTitle1 := page.MustElement("[aria-roledescription=title]").MustText() @@ -100,6 +149,19 @@ func TestOnboardingWizardCLIFlow(t *testing.T) { // Ready to upload screen readyToUploadTitle := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, readyToUploadTitle, "Ready to upload") + + // OS tabs + page.MustElement("[aria-roledescription=windows]").MustClick() + windowsUploadCmd := page.MustElement("[aria-roledescription=windows-upload]").MustText() + require.Equal(t, "./uplink.exe cp 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 page.MustElementX("(//span[text()=\"< Back\"])").MustClick() page.MustWaitNavigation() createBucketTitle1 := page.MustElement("[aria-roledescription=title]").MustText() @@ -112,6 +174,19 @@ func TestOnboardingWizardCLIFlow(t *testing.T) { // List a bucket screen listTitle := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, listTitle, "Listing a bucket") + + // 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 page.MustElementX("(//span[text()=\"< Back\"])").MustClick() page.MustWaitNavigation() readyToUploadTitle1 := page.MustElement("[aria-roledescription=title]").MustText() @@ -124,6 +199,19 @@ func TestOnboardingWizardCLIFlow(t *testing.T) { // Download screen downloadTitle := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, downloadTitle, "Download") + + // 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 /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 page.MustElementX("(//span[text()=\"< Back\"])").MustClick() page.MustWaitNavigation() listTitle1 := page.MustElement("[aria-roledescription=title]").MustText() @@ -136,6 +224,19 @@ func TestOnboardingWizardCLIFlow(t *testing.T) { // Share link screen shareLinkTitle := page.MustElement("[aria-roledescription=title]").MustText() require.Contains(t, shareLinkTitle, "Share a link") + + // 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 page.MustElementX("(//span[text()=\"< Back\"])").MustClick() page.MustWaitNavigation() downloadTitle1 := page.MustElement("[aria-roledescription=title]").MustText() diff --git a/web/satellite/src/components/onboardingTour/steps/cliFlow/CLIInstall.vue b/web/satellite/src/components/onboardingTour/steps/cliFlow/CLIInstall.vue index 4a0ed8ada..a9d1c1d27 100644 --- a/web/satellite/src/components/onboardingTour/steps/cliFlow/CLIInstall.vue +++ b/web/satellite/src/components/onboardingTour/steps/cliFlow/CLIInstall.vue @@ -17,7 +17,10 @@

1. Download the - + Windows Uplink Binary zip file @@ -54,7 +57,11 @@ sudo mv uplink /usr/local/bin/uplink

- + Linux AMD64 Uplink Binary

ARM

@@ -73,7 +80,11 @@ sudo mv uplink /usr/local/bin/uplink

- + Linux ARM Uplink Binary @@ -95,7 +106,11 @@ sudo mv uplink /usr/local/bin/uplink

- + macOS Uplink Binary diff --git a/web/satellite/src/components/onboardingTour/steps/cliFlow/CLISetup.vue b/web/satellite/src/components/onboardingTour/steps/cliFlow/CLISetup.vue index d8cd32680..45b1e6f6f 100644 --- a/web/satellite/src/components/onboardingTour/steps/cliFlow/CLISetup.vue +++ b/web/satellite/src/components/onboardingTour/steps/cliFlow/CLISetup.vue @@ -21,13 +21,13 @@

Follow the prompts. When asked for your API Key, enter the token from the previous step.

diff --git a/web/satellite/src/components/onboardingTour/steps/cliFlow/CreateBucket.vue b/web/satellite/src/components/onboardingTour/steps/cliFlow/CreateBucket.vue index 1022108a7..1d25bbf95 100644 --- a/web/satellite/src/components/onboardingTour/steps/cliFlow/CreateBucket.vue +++ b/web/satellite/src/components/onboardingTour/steps/cliFlow/CreateBucket.vue @@ -17,13 +17,13 @@

diff --git a/web/satellite/src/components/onboardingTour/steps/cliFlow/DownloadObject.vue b/web/satellite/src/components/onboardingTour/steps/cliFlow/DownloadObject.vue index 655831a26..714d7f35c 100644 --- a/web/satellite/src/components/onboardingTour/steps/cliFlow/DownloadObject.vue +++ b/web/satellite/src/components/onboardingTour/steps/cliFlow/DownloadObject.vue @@ -16,13 +16,13 @@

diff --git a/web/satellite/src/components/onboardingTour/steps/cliFlow/ListObject.vue b/web/satellite/src/components/onboardingTour/steps/cliFlow/ListObject.vue index e1bc14599..c5f5c4791 100644 --- a/web/satellite/src/components/onboardingTour/steps/cliFlow/ListObject.vue +++ b/web/satellite/src/components/onboardingTour/steps/cliFlow/ListObject.vue @@ -16,13 +16,13 @@

diff --git a/web/satellite/src/components/onboardingTour/steps/cliFlow/ShareObject.vue b/web/satellite/src/components/onboardingTour/steps/cliFlow/ShareObject.vue index f0012ee8b..8169aa7b2 100644 --- a/web/satellite/src/components/onboardingTour/steps/cliFlow/ShareObject.vue +++ b/web/satellite/src/components/onboardingTour/steps/cliFlow/ShareObject.vue @@ -45,13 +45,13 @@ diff --git a/web/satellite/src/components/onboardingTour/steps/common/OSContainer.vue b/web/satellite/src/components/onboardingTour/steps/common/OSContainer.vue index 328937d20..8b9fa485c 100644 --- a/web/satellite/src/components/onboardingTour/steps/common/OSContainer.vue +++ b/web/satellite/src/components/onboardingTour/steps/common/OSContainer.vue @@ -4,13 +4,28 @@