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
This commit is contained in:
Vitalii Shpital 2021-09-28 13:08:47 +03:00
parent 1def7b0ec3
commit 8e3d7d30e8
10 changed files with 159 additions and 26 deletions

View File

@ -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 <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
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 <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
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()

View File

@ -17,7 +17,10 @@
<div class="cli-install__windows">
<h2 class="cli-install__macos__sub-title">
1. Download the
<a href="https://github.com/storj/storj/releases/download/v1.34.3/uplink_windows_amd64.zip">
<a
href="https://github.com/storj/storj/releases/latest/download/uplink_windows_amd64.zip"
aria-roledescription="windows-binary-link"
>
Windows Uplink Binary
</a>
zip file
@ -54,7 +57,11 @@
sudo mv uplink /usr/local/bin/uplink
</p>
</div>
<a class="cli-install__linux__link" href="https://github.com/storj/storj/releases/latest/download/uplink_linux_amd64.zip">
<a
class="cli-install__linux__link"
href="https://github.com/storj/storj/releases/latest/download/uplink_linux_amd64.zip"
aria-roledescription="linux-amd-binary-link"
>
Linux AMD64 Uplink Binary
</a>
<h1 class="cli-install__linux__title margin-top">ARM</h1>
@ -73,7 +80,11 @@
sudo mv uplink /usr/local/bin/uplink
</p>
</div>
<a class="cli-install__linux__link" href="https://github.com/storj/storj/releases/latest/download/uplink_linux_arm.zip">
<a
class="cli-install__linux__link"
href="https://github.com/storj/storj/releases/latest/download/uplink_linux_arm.zip"
aria-roledescription="linux-arm-binary-link"
>
Linux ARM Uplink Binary
</a>
</div>
@ -95,7 +106,11 @@
sudo mv uplink /usr/local/bin/uplink
</p>
</div>
<a class="cli-install__macos__link" href="https://github.com/storj/storj/releases/latest/download/uplink_darwin_amd64.zip">
<a
class="cli-install__macos__link"
href="https://github.com/storj/storj/releases/latest/download/uplink_darwin_amd64.zip"
aria-roledescription="macos-binary-link"
>
macOS Uplink Binary
</a>
</div>

View File

@ -21,13 +21,13 @@
</p>
<OSContainer>
<template #windows>
<TabWithCopy value="./uplink.exe setup" />
<TabWithCopy value="./uplink.exe setup" aria-role-description="windows-cli-setup" />
</template>
<template #linux>
<TabWithCopy value="uplink setup" />
<TabWithCopy value="uplink setup" aria-role-description="linux-cli-setup" />
</template>
<template #macos>
<TabWithCopy value="uplink setup" />
<TabWithCopy value="uplink setup" aria-role-description="macos-cli-setup" />
</template>
</OSContainer>
<p class="cli__msg">Follow the prompts. When asked for your API Key, enter the token from the previous step.</p>

View File

@ -17,13 +17,13 @@
</p>
<OSContainer>
<template #windows>
<TabWithCopy value="./uplink.exe mb sj://cakes" />
<TabWithCopy value="./uplink.exe mb sj://cakes" aria-role-description="windows-create-bucket" />
</template>
<template #linux>
<TabWithCopy value="uplink mb sj://cakes" />
<TabWithCopy value="uplink mb sj://cakes" aria-role-description="linux-create-bucket" />
</template>
<template #macos>
<TabWithCopy value="uplink mb sj://cakes" />
<TabWithCopy value="uplink mb sj://cakes" aria-role-description="macos-create-bucket" />
</template>
</OSContainer>
</template>

View File

@ -16,13 +16,13 @@
</p>
<OSContainer>
<template #windows>
<TabWithCopy value="./uplink.exe cp sj://cakes/cheesecake.jpg <DESTINATION_PATH>/cheesecake.jpg" />
<TabWithCopy value="./uplink.exe cp sj://cakes/cheesecake.jpg <DESTINATION_PATH>/cheesecake.jpg" aria-role-description="windows-download" />
</template>
<template #linux>
<TabWithCopy value="uplink cp sj://cakes/cheesecake.jpg ~/Downloads/cheesecake.jpg" />
<TabWithCopy value="uplink cp sj://cakes/cheesecake.jpg ~/Downloads/cheesecake.jpg" aria-role-description="linux-download" />
</template>
<template #macos>
<TabWithCopy value="uplink cp sj://cakes/cheesecake.jpg ~/Downloads/cheesecake.jpg" />
<TabWithCopy value="uplink cp sj://cakes/cheesecake.jpg ~/Downloads/cheesecake.jpg" aria-role-description="macos-download" />
</template>
</OSContainer>
</template>

View File

@ -16,13 +16,13 @@
</p>
<OSContainer>
<template #windows>
<TabWithCopy value="./uplink.exe ls sj://cakes" />
<TabWithCopy value="./uplink.exe ls sj://cakes" aria-role-description="windows-list" />
</template>
<template #linux>
<TabWithCopy value="uplink ls sj://cakes" />
<TabWithCopy value="uplink ls sj://cakes" aria-role-description="linux-list" />
</template>
<template #macos>
<TabWithCopy value="uplink ls sj://cakes" />
<TabWithCopy value="uplink ls sj://cakes" aria-role-description="macos-list" />
</template>
</OSContainer>
</template>

View File

@ -45,13 +45,13 @@
</div>
<OSContainer>
<template #windows>
<TabWithCopy value="./uplink.exe share --url sj://cakes/cheesecake.jpg" />
<TabWithCopy value="./uplink.exe share --url sj://cakes/cheesecake.jpg" aria-role-description="windows-share" />
</template>
<template #linux>
<TabWithCopy value="uplink share --url sj://cakes/cheesecake.jpg" />
<TabWithCopy value="uplink share --url sj://cakes/cheesecake.jpg" aria-role-description="linux-share" />
</template>
<template #macos>
<TabWithCopy value="uplink share --url sj://cakes/cheesecake.jpg" />
<TabWithCopy value="uplink share --url sj://cakes/cheesecake.jpg" aria-role-description="macos-share" />
</template>
</OSContainer>
<p class="share-object__msg">

View File

@ -20,13 +20,13 @@
</p>
<OSContainer>
<template #windows>
<TabWithCopy value="./uplink.exe cp <FILE_PATH> sj://cakes" />
<TabWithCopy value="./uplink.exe cp <FILE_PATH> sj://cakes" aria-role-description="windows-upload" />
</template>
<template #linux>
<TabWithCopy value="uplink cp ~/Desktop/cheesecake.jpg sj://cakes" />
<TabWithCopy value="uplink cp ~/Desktop/cheesecake.jpg sj://cakes" aria-role-description="linux-upload" />
</template>
<template #macos>
<TabWithCopy value="uplink cp ~/Desktop/cheesecake.jpg sj://cakes" />
<TabWithCopy value="uplink cp ~/Desktop/cheesecake.jpg sj://cakes" aria-role-description="macos-upload" />
</template>
</OSContainer>
</template>

View File

@ -4,13 +4,28 @@
<template>
<div class="os">
<div class="os__tabs">
<p class="os__tabs__choice" :class="{active: isWindows && !isInstallStep, 'active-install-step': isWindows && isInstallStep}" @click="setIsWindows">
<p
class="os__tabs__choice"
:class="{active: isWindows && !isInstallStep, 'active-install-step': isWindows && isInstallStep}"
aria-roledescription="windows"
@click="setIsWindows"
>
Windows
</p>
<p class="os__tabs__choice" :class="{active: isLinux && !isInstallStep, 'active-install-step': isLinux && isInstallStep}" @click="setIsLinux">
<p
class="os__tabs__choice"
:class="{active: isLinux && !isInstallStep, 'active-install-step': isLinux && isInstallStep}"
aria-roledescription="linux"
@click="setIsLinux"
>
Linux
</p>
<p class="os__tabs__choice" :class="{active: isMacOS && !isInstallStep, 'active-install-step': isMacOS && isInstallStep}" @click="setIsMacOS">
<p
class="os__tabs__choice"
:class="{active: isMacOS && !isInstallStep, 'active-install-step': isMacOS && isInstallStep}"
aria-roledescription="macos"
@click="setIsMacOS"
>
macOS
</p>
</div>

View File

@ -3,7 +3,7 @@
<template>
<div class="tab-copy">
<p class="tab-copy__value">{{ value }}</p>
<p class="tab-copy__value" :aria-roledescription="ariaRoleDescription">{{ value }}</p>
<CopyIcon class="tab-copy__icon" @click="onCopyClick" />
</div>
</template>
@ -22,6 +22,8 @@ import CopyIcon from '@/../static/images/onboardingTour/copy.svg';
export default class TabWithCopy extends Vue {
@Prop({ default: ''})
public readonly value: string;
@Prop({ default: ''})
public readonly ariaRoleDescription: string;
/**
* Holds on copy button click logic.