Skip to content

Commit

Permalink
Added some tests for release zip's WarningDownload page
Browse files Browse the repository at this point in the history
  • Loading branch information
qlrd committed Aug 23, 2023
1 parent 2528144 commit e0285b2
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/pages/WarningDownload.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-item-group>
<v-item-group id="warning-download-page">
<v-container>
<v-row>
<v-col>
Expand Down Expand Up @@ -32,7 +32,7 @@
</v-col>
</v-row>
<v-row>
<v-col>
<v-col id="warning-already-downloaded-text">
<span style="color: yellowgreen;">{{ resourceName }} </span> already downloaded
</v-col>
</v-row>
Expand All @@ -43,8 +43,9 @@
variant="outlined"
:class="[selectedClass]"
@click="proceedToFn"
>
<v-card-title>Proceed with current file</v-card-title>
id="warning-download-proceed-button"
>
<v-card-title id="warning-download-proceed-button-text">Proceed with current file</v-card-title>
</v-card>
</v-item>
</v-col>
Expand All @@ -56,8 +57,9 @@
variant="outlined"
:class="[selectedClass]"
@click="downloadToFn"
>
<v-card-title> Download it again</v-card-title>
id="warning-download-again-button"
>
<v-card-title id="warning-download-again-button-text">Download it again</v-card-title>
</v-card>
</v-item>
</v-col>
Expand All @@ -69,8 +71,9 @@
variant="outlined"
:class="[selectedClass]"
@click="showDetails"
>
<v-card-title>Show details</v-card-title>
id="warning-download-show-details-button"
>
<v-card-title id="warning-download-show-details-button-text">Show details</v-card-title>
</v-card>
</v-item>
</v-col>
Expand All @@ -82,8 +85,9 @@
variant="outlined"
:class="[selectedClass]"
@click="backToFn"
>
<v-card-title>Back</v-card-title>
id="warning-download-back-button"
>
<v-card-title id="warning-download-back-button-text">Back</v-card-title>
</v-card>
</v-item>
</v-col>
Expand Down Expand Up @@ -185,4 +189,4 @@ async function backToFn () {
keys: ['device', 'version', 'os', 'isMac10']
})
}
</script>
</script>
59 changes: 59 additions & 0 deletions test/e2e/pageobjects/app.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ class App {
private __checking_release_zip_msg__: string;
private __not_found_release_zip_msg__: string;
private __found_release_zip_msg__: string;
private __warning_download_page__: string;
private __warning_already_downloaded_text__ : string;
private __warning_download_proceed_button__: string;
private __warning_download_proceed_button_text__: string;
private __warning_download_show_details_button__: string;
private __warning_download_show_details_button_text__: string;
private __warning_download_again_button__: string
private __warning_download_again_button_text__: string;
private __warning_download_back_button__: string;
private __warning_download_back_button_text__: string;

constructor () {
this.__app__ = '#app'
Expand Down Expand Up @@ -92,6 +102,16 @@ class App {
this.__checking_release_zip_msg__ = 'pre#checking-v22-08-2-krux-v22-08-2-zip'
this.__not_found_release_zip_msg__ = 'pre#v22-08-2-krux-v22-08-2-zip-not-found'
this.__found_release_zip_msg__ = 'pre#v22-08-2-krux-v22-08-2-zip-found'
this.__warning_download_page__ = 'div#warning-download-page'
this.__warning_already_downloaded_text__ = 'div#warning-already-downloaded-text'
this.__warning_download_proceed_button__ = 'div#warning-download-proceed-button'
this.__warning_download_proceed_button_text__ = 'div#warning-download-proceed-button-text'
this.__warning_download_again_button__ = 'div#warning-download-again-button'
this.__warning_download_again_button_text__ = 'div#warning-download-again-button-text'
this.__warning_download_show_details_button__ = 'div#warning-download-show-details-button'
this.__warning_download_show_details_button_text__ = 'div#warning-download-show-details-button-text'
this.__warning_download_back_button__ = 'div#warning-download-back-button'
this.__warning_download_back_button_text__ = 'div#warning-download-back-button-text'
}

get title () {
Expand Down Expand Up @@ -275,6 +295,45 @@ class App {
return $(this.__download_official_release_zip_progress__)
}

get warningDownloadPage () {
return $(this.__warning_download_page__)
}

get warningAlreadyDownloadedText() {
return $(this.__warning_already_downloaded_text__)
}

get warningDownloadProceedButton () {
return $(this.__warning_download_proceed_button__)
}

get warningDownloadProceedButtonText () {
return $(this.__warning_download_proceed_button_text__)
}

get warningDownloadAgainButton () {
return $(this.__warning_download_again_button__)
}

get warningDownloadAgainButtonText () {
return $(this.__warning_download_again_button_text__)
}

get warningDownloadShowDetailsButton () {
return $(this.__warning_download_show_details_button__)
}

get warningDownloadShowDetailsButtonText () {
return $(this.__warning_download_show_details_button_text__)
}

get warningDownloadBackButton () {
return $(this.__warning_download_back_button__)
}

get warningDownloadBackButtonText () {
return $(this.__warning_download_back_button_text__)
}
}

module.exports = App
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,46 @@ describe('KruxInstaller SelectVersion page (already downloaded release)', () =>
}
})

it('should WarningDownload page should be displayed', async () => {
await instance.warningDownloadPage.waitForExist()
await expectWDIO(instance.warningDownloadPage).toBeDisplayed()
})

it('should \'v22.08.2/krux-v22.08.2.zip already downloaded\' message be displayed', async () => {
await instance.warningAlreadyDownloadedText.waitForExist()
await expectWDIO(instance.warningAlreadyDownloadedText).toBeDisplayed()
await expectWDIO(instance.warningAlreadyDownloadedText).toHaveText('v22.08.2/krux-v22.08.2.zip already downloaded')
})

it('should \'Proceed with current file\' button be displayed', async () => {
await instance.warningDownloadProceedButton.waitForExist()
await instance.warningDownloadProceedButtonText.waitForExist()
await expectWDIO(instance.warningDownloadProceedButton).toBeDisplayed()
await expectWDIO(instance.warningDownloadProceedButtonText).toBeDisplayed()
await expectWDIO(instance.warningDownloadProceedButtonText).toHaveText('Proceed with current file')
})

it('should \'Download it again\' button be displayed', async () => {
await instance.warningDownloadAgainButton.waitForExist()
await instance.warningDownloadAgainButtonText.waitForExist()
await expectWDIO(instance.warningDownloadAgainButton).toBeDisplayed()
await expectWDIO(instance.warningDownloadAgainButtonText).toBeDisplayed()
await expectWDIO(instance.warningDownloadAgainButtonText).toHaveText('Download it again')
})

it('should \'Show details\' button be displayed', async () = > {
await instance.warningDownloadShowDetailsButton.waitForExist()
await instance.warningDownloadShowDetailsButtonText.waitForExist()
await expectWDIO(instance.warningDownloadShowDetailsButton).toBeDisplayed()
await expectWDIO(instance.warningDownloadShowDetailsButtonText).toBeDisplayed()
await expectWDIO(instance.warningDownloadShowDetailsButtonText).toHaveText('Show details')
})

it('should \'Back\' button be displayed', async () => {
await instance.warningDownloadBackButton.waitForExist()
await instance.warningDownloadBackButtonText.waitForExist()
await expectWDIO(instance.warningDownloadBackButton).toBeDisplayed()
await expectWDIO(instance.warningDownloadBackButtonText).toBeDisplayed()
await expectWDIO(instance.warningDownloadBackButtonText).toHaveText('Back')
})
})

0 comments on commit e0285b2

Please sign in to comment.