Skip to content

Commit

Permalink
Added tests for download release sha256.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
qlrd committed Aug 26, 2023
1 parent ee093f8 commit d805027
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/pages/DownloadOfficialReleaseSha256.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<v-item-group>
<v-container>
<v-container id="download-official-release-zip-sha256-txt-page">
<v-row>
<v-col>
<v-item>
<v-card
variant="plain"
>
<v-card-title>
<v-card-title id="download-official-release-zip-sha256-txt-page-title">
Downloading
</v-card-title>
<v-card-subtitle>
<v-card-subtitle id="download-official-release-zip-sha256-txt-page-subtitle">
{{ downloadUrl }}
</v-card-subtitle>
<v-card-text class="downloading">
<v-card-text class="downloading" id="download-official-release-zip-sha256-txt-page-progress">
<strong> {{ downloadProgress }} </strong>
</v-card-text>
</v-card>
Expand Down
29 changes: 28 additions & 1 deletion test/e2e/pageobjects/app.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class App {
private __warning_already_downloaded_overlay_button_close__: string;
private __checking_release_zip_sha256_txt_msg__: string;
private __not_found_release_zip_sha256_txt_msg__: string;
private __download_official_release_zip_sha256_txt_page__: string;
private __download_official_release_zip_sha256_txt_page_title__: string;
private __download_official_release_zip_sha256_txt_page_subtitle__: string;
private __download_official_release_zip_sha256_txt_page_progress__: string;


constructor () {
this.__app__ = '#app'
Expand Down Expand Up @@ -130,6 +135,10 @@ class App {
this.__warning_already_downloaded_overlay_button_close__ = 'div#warning-already-downloaded-overlay-button-close'
this.__checking_release_zip_sha256_txt_msg__ = 'pre#checking-v22-08-2-krux-v22-08-2-zip-sha256-txt'
this.__not_found_release_zip_sha256_txt_msg__ = 'pre#v22-08-2-krux-v22-08-2-zip-sha256-txt-not-found'
this.__download_official_release_zip_sha256_txt_page__ = 'div#download-official-release-zip-sha256-txt-page'
this.__download_official_release_zip_sha256_txt_page_title__ = 'div#download-official-release-zip-sha256-txt-page-title'
this.__download_official_release_zip_sha256_txt_page_subtitle__ = 'div#download-official-release-zip-sha256-txt-page-subtitle'
this.__download_official_release_zip_sha256_txt_page_progress__ = 'div#download-official-release-zip-sha256-txt-page-progress'
}

get title () {
Expand Down Expand Up @@ -386,8 +395,26 @@ class App {
}

get notFoundReleaseZipSha256txtMsg () {
return $(this.__not_found_release_zip_sha256_txt_msg__ )
return $(this.__not_found_release_zip_sha256_txt_msg__)
}

get downloadOfficialReleaseZipSha256txtPage () {
return $(this.__download_official_release_zip_sha256_txt_page__)
}

downloadOfficialReleaseZipSha26txtPageTitle
get downloadOfficialReleaseZipSha256txtPageTitle () {
return $(this.__download_official_release_zip_sha256_txt_page_title__)
}

get downloadOfficialReleaseZipSha256txtPageSubtitle () {
return $(this.__download_official_release_zip_sha256_txt_page_subtitle__)
}

get downloadOfficialReleaseZipSha256txtPageProgress () {
return $(this.__download_official_release_zip_sha256_txt_page_progress__)
}

}

module.exports = App
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { describe, it } = require('mocha')

const App = require('../pageobjects/app.page')

describe('KruxInstaller SelectVersion page (already downloaded release - click show details button)', () => {
describe('KruxInstaller SelectVersion page (already downloaded release - click proceed button)', () => {

let instance: any;

Expand Down Expand Up @@ -60,10 +60,5 @@ describe('KruxInstaller SelectVersion page (already downloaded release - click s
await instance.warningDownloadPage.waitForExist({ reverse: true })
await expectWDIO(instance.warningDownloadPage).not.toBeDisplayed()
})

it ('should go to ConsoleLoad page to check sha256page', async () => {
await instance.checkingReleaseZipSha256txtMsg.waitForExist()
await expectWDIO(instance.checkingReleaseZipSha256txtMsg).toBeDisplayed()
})

})
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
const expectWDIO = require('@wdio/globals').expect
const { join } = require('path')
const { homedir } = require('os')
const { osLangSync } = require('os-lang')
const { describe, it } = require('mocha')

const App = require('../pageobjects/app.page')

describe('KruxInstaller SelectVersion page (download release sha256.txt)', () => {

let instance: any;

before(async function () {
instance = new App()
await instance.app.waitForExist()
await instance.main.waitForExist()
await instance.logo.waitForExist()
await instance.logo.waitForExist({ reverse: true })
await instance.loadingDataMsg.waitForExist()
await instance.verifyingOpensslMsg.waitForExist()
if (process.platform === 'linux') {
await instance.opensslForLinuxFound.waitForExist()
} else if (process.platform === 'darwin') {
await instance.opensslForDarwinFound.waitForExist()
} else if (process.platform === 'win32') {
await instance.opensslForWin32Found.waitForExist()
}
await instance.loadingDataMsg.waitForExist({ reverse: true })
await instance.verifyingOpensslMsg.waitForExist({ reverse: true })
await instance.opensslForLinuxFound.waitForExist({ reverse: true })
await instance.mainPage.waitForExist()
await instance.mainSelectDeviceButton.waitForExist()
await instance.mainSelectVersionButton.waitForExist()
await instance.mainSelectVersionButton.click()
await instance.mainPage.waitForExist({ reverse: true })
await instance.githubOctocatCheckerLogo.waitForExist({ timeout: 3000 })
await instance.selectVersionPage.waitForExist()
await instance.selectVersionSelfcustodyButton.waitForExist()
await instance.selectVersionSelfcustodyText.waitForExist()
await instance.selectVersionOdudexButton.waitForExist()
await instance.selectVersionOdudexText.waitForExist()
await instance.selectVersionSelfcustodyButton.click()
await instance.selectVersionPage.waitForExist({ reverse: true })
await instance.checkingReleaseZipMsg.waitForExist()
await instance.foundReleaseZipMsg.waitForExist()
await instance.warningDownloadPage.waitForExist()
await instance.warningAlreadyDownloadedText.waitForExist()
await instance.warningDownloadProceedButton.waitForExist()
await instance.warningDownloadProceedButtonText.waitForExist()
await instance.warningDownloadAgainButton.waitForExist()
await instance.warningDownloadAgainButtonText.waitForExist()
await instance.warningDownloadShowDetailsButton.waitForExist()
await instance.warningDownloadShowDetailsButtonText.waitForExist()
await instance.warningDownloadBackButton.waitForExist()
await instance.warningDownloadBackButtonText.waitForExist()
await instance.warningDownloadProceedButton.click()
await instance.warningDownloadPage.waitForExist({ reverse: true })

})

it ('should \'checking v22.08.2/krux-v22.08.2.zip.sha256.txt\' message appears', async () => {
await instance.checkingReleaseZipSha256txtMsg.waitForExist()
await expectWDIO(instance.checkingReleaseZipSha256txtMsg).toBeDisplayed()
})

it ('should \'v22.08.2/krux-v22.08.2.zip.sha256.txt not found\' message appears', async () => {
await instance.notFoundReleaseZipSha256txtMsg.waitForExist()
await expectWDIO(instance.notFoundReleaseZipSha256txtMsg).toBeDisplayed()
})

it('should go to DownloadOfficialReleaseZipSha256 page', async () => {
await instance.downloadOfficialReleaseZipSha256txtPage.waitForExist()
await expectWDIO(instance.downloadOfficialReleaseZipSha256txtPage).toBeDisplayed()
})

it('should DownloadOfficialReleaseZipSha256 page have \'Downloading\' title', async () => {
await instance.downloadOfficialReleaseZipSha256txtPageTitle.waitForExist()
await expectWDIO(instance.downloadOfficialReleaseZipSha256txtPageTitle).toBeDisplayed()
await expectWDIO(instance.downloadOfficialReleaseZipSha256txtPageTitle).toHaveText('Downloading')
})

it('should DownloadOfficialReleaseZipSha256 page have \'https://github.com/selfcustody/krux/releases/download/v22.08.2/krux-v22.08.2.zip.sha256.txt\' subtitle', async () => {
await instance.downloadOfficialReleaseZipSha256txtPageSubtitle.waitForExist()
await expectWDIO(instance.downloadOfficialReleaseZipSha256txtPageSubtitle).toBeDisplayed()
await expectWDIO(instance.downloadOfficialReleaseZipSha256txtPageSubtitle).toHaveText('https://github.com/selfcustody/krux/releases/download/v22.08.2/krux-v22.08.2.zip.sha256.txt')
})

it('should DownloadOfficialReleaseZipSha256 page progress until 100%', async () => {
await instance.downloadOfficialReleaseZipSha256txtPageProgress.waitForExist()
await expectWDIO(instance.downloadOfficialReleaseZipSha256txtPageProgress).toBeDisplayed()
await instance.downloadOfficialReleaseZipSha256txtPageProgress.waitUntil(async function () {
const percentText = await this.getText()
const percent = parseFloat(percentText.split('%')[0])
return percent === 100.00
}, {
timeout: 600000,
interval: 50
})
})

})

0 comments on commit d805027

Please sign in to comment.