Skip to content

Commit

Permalink
Added tests for WarningDowload page foralready downloaded release sha…
Browse files Browse the repository at this point in the history
…256.txt
  • Loading branch information
qlrd committed Aug 27, 2023
1 parent d805027 commit c62563e
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 3 deletions.
8 changes: 7 additions & 1 deletion test/e2e/pageobjects/app.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ 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 __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 @@ -135,6 +137,7 @@ 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.__found_release_zip_sha256_txt_msg__ = 'pre#v22-08-2-krux-v22-08-2-zip-sha256-txt-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'
Expand Down Expand Up @@ -398,11 +401,14 @@ class App {
return $(this.__not_found_release_zip_sha256_txt_msg__)
}

get foundReleaseZipSha256txtMsg () {
return $(this.__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__)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ describe('KruxInstaller SelectVersion page (download release sha256.txt)', () =>
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 () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
const expectChai = require('chai').expect
const expectWDIO = require('@wdio/globals').expect
const { describe, it } = require('mocha')

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

describe('KruxInstaller SelectVersion page (already downloaded release sha256.txt - show only)', () => {

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.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 \'v22.08.2/krux-v22.08.2.zip.sha256.txt found\' message appears', async () => {
await instance.checkingReleaseZipSha256txtMsg.waitForExist()
await expectWDIO(instance.checkingReleaseZipSha256txtMsg).toBeDisplayed()
if (process.platform === 'linux' || process.platform === 'darwin') {
await expectWDIO(instance.foundReleaseZipSha256txtMsg).toHaveText('v22.08.2/krux-v22.08.2.zip.sha256.txt found')
} else if (process.platform === 'win32') {
await expectWDIO(instance.foundReleaseZipSha256txtMsg).toHaveText('v22.08.2\\krux-v22.08.2.zip.sha256.txt found')
}
})

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.sha256.txt already downloaded\' message be displayed', async () => {
await instance.warningAlreadyDownloadedText.waitForExist()
await expectWDIO(instance.warningAlreadyDownloadedText).toBeDisplayed()
if (process.platform === 'linux' || process.platform === 'darwin') {
await expectWDIO(instance.warningAlreadyDownloadedText).toHaveText('v22.08.2/krux-v22.08.2.zip.sha256.txt already downloaded')
} else if (process.platform === 'win32') {
await expectWDIO(instance.warningAlreadyDownloadedText).toHaveText('v22.08.2\\krux-v22.08.2.zip.sha256.txt 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')
})

})
15 changes: 14 additions & 1 deletion wdio.conf.mts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,20 @@ specs.map(async function (file: string) {
} catch (error) {
SPECS_TO_TEST.push(file)
}
} else {
} else if (
file === 'test/e2e/specs/020.select-version-selfcustody-release-zip-sha256.spec.ts'
) {
try {
const r = join(resources, 'v22.08.2', 'krux-v22.08.2.zip.sha256.txt')
debug(` checking ${r}`)
accessSync(r)
debug(` ${r} exists`)
SPECS_TO_EXCLUDE.push(file)
} catch (error) {
SPECS_TO_TEST.push(file)
}
}
else {
SPECS_TO_TEST.push(file)
}
})
Expand Down

0 comments on commit c62563e

Please sign in to comment.