Skip to content

Commit

Permalink
Added tests for proceed button on WarningDownload release.
Browse files Browse the repository at this point in the history
Avoided download release 2 times when release exists on system.
  • Loading branch information
qlrd committed Aug 26, 2023
1 parent 441c30a commit ee093f8
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
12 changes: 12 additions & 0 deletions test/e2e/pageobjects/app.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class App {
private __warning_already_downloaded_overlay_text_local__: string;
private __warning_already_downloaded_overlay_text_whatdo__: string;
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;

constructor () {
this.__app__ = '#app'
Expand Down Expand Up @@ -126,6 +128,8 @@ class App {
this.__warning_already_downloaded_overlay_text_local__ = 'div#warning-already-downloaded-overlay-text-local'
this.__warning_already_downloaded_overlay_text_whatdo__ = 'div#warning-already-downloaded-overlay-text-whatdo'
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'
}

get title () {
Expand Down Expand Up @@ -376,6 +380,14 @@ class App {
get warningAlreadyDownloadedOverlayButtonClose () {
return $(this.__warning_already_downloaded_overlay_button_close__)
}

get checkingReleaseZipSha256txtMsg () {
return $(this.__checking_release_zip_sha256_txt_msg__)
}

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

module.exports = App
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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 (already downloaded release - click show details button)', () => {

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

it ('should click \'Proceed\' button and go out of WarningDownload page', async () => {
await instance.warningDownloadProceedButton.click()
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()
})

})
5 changes: 4 additions & 1 deletion wdio.conf.mts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ if (process.env.CI && process.env.GITHUB_ACTION) {
const specs = globSync('./test/e2e/specs/*.spec.ts')
specs.map(async function (file: string) {
debug(` checking ${file}`)
if (file === 'test/e2e/specs/014.select-version-selfcustody-release-zip.spec.ts') {
if (
file === 'test/e2e/specs/014.select-version-selfcustody-release-zip.spec.ts' ||
file === 'test/e2e/specs/018.already-downloaded-selfcustody-release-zip-click-download-again.spec.ts'
) {
try {
const r = join(resources, 'v22.08.2', 'krux-v22.08.2.zip')
debug(` checking ${r}`)
Expand Down

0 comments on commit ee093f8

Please sign in to comment.