Skip to content

Commit

Permalink
Added test for CheckVerifyOfficialRelease page
Browse files Browse the repository at this point in the history
added test/e2e/specs/038-check-verify-official-release.spec.ts

modified test/e2e/pageobjects/app.page.ts

modified src/pages/CheckVerifyOfficialRelease.vue
  • Loading branch information
qlrd committed Sep 10, 2023
1 parent 26acbab commit 3d71e2d
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 25 deletions.
50 changes: 26 additions & 24 deletions src/pages/CheckVerifyOfficialRelease.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-container>
<v-container id="check-verify-official-release-page">
<v-row>
<v-col>
<AsciiMorph
Expand All @@ -8,6 +8,7 @@
:canvas="canvas"
:timeout="timeout"
:fontSize="fontSize"
id="check-verify-official-release-len-sassaman-is-using-openssl"
/>
</v-col>
</v-row>
Expand All @@ -30,29 +31,30 @@ const fontSize: Ref<string> = ref('12px')
const list: Ref<string[][]> = ref([
[ " " ],
[
" :.:'' ,,xiW,\"4x, '' ",
" : ,dWWWXXXXi,4WX, ",
" ' dWWWXXX7\" `X, ",
" lWWWXX7 __ _ X ",
" :WWWXX7 ,xXX7' \"^^X ",
" lWWWX7, _.+,, _.+., ",
" :WWW7,. `^\"-\" ,^-' ",
" WW\",X: X, ",
" \"7^^Xl. _(_x7' ",
" l ( :X: __ _ ",
" `. \" XX ,xxWWWWX7 ",
" )X- \"\" 4X\" .___. ",
" ,W X :Xi _,,_ ",
" WW X 4XiyXWWXd ",
" \"\" ,, 4XWWWWXX ",
" , R7X, \"^447^ ",
" R, \"4RXk, _, , ",
" TWk \"4RXXi, X',x ",
" lTWk, \"4RRR7' 4 XH ",
" :lWWWk, ^\" `4 ",
" ::TTXWWi,_ Xll :.. ",
" ",
" verifying sha256sum and signature "
" :.:'' ,,xiW,\"4x, '' ",
" : ,dWWWXXXXi,4WX, ",
" ' dWWWXXX7\" `X, ",
" lWWWXX7 __ _ X ",
" :WWWXX7 ,xXX7' \"^^X ",
" lWWWX7, _.+,, _.+., ",
" :WWW7,. `^\"-\" ,^-' ",
" WW\",X: X, ",
" \"7^^Xl. _(_x7' ",
" l ( :X: __ _ ",
" `. \" XX ,xxWWWWX7 ",
" )X- \"\" 4X\" .___. ",
" ,W X :Xi _,,_ ",
" WW X 4XiyXWWXd ",
" \"\" ,, 4XWWWWXX ",
" , R7X, \"^447^ ",
" R, \"4RXk, _, , ",
" TWk \"4RXXi, X',x ",
" lTWk, \"4RRR7' 4 XH ",
" :lWWWk, ^\" `4 ",
" ::TTXWWi,_ Xll :.. ",
" ",
" Len Sassaman is using openssl to ",
" verify sha256sum and signature... "
],
[ " " ]
])
Expand Down
17 changes: 16 additions & 1 deletion test/e2e/pageobjects/app.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ class App {
private __warning_already_downloaded_overlay_text_remote__: string;
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 __warning_already_downloaded_overlay_button_close__: string

private __check_verify_official_release_page__: string;
private __check_verify_official_release_len_sassaman_is_using_openssl__: string;

constructor () {
this.__app__ = '#app'
this.__main__ = '#app>div>main'
Expand Down Expand Up @@ -196,6 +199,10 @@ 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.__check_verify_official_release_page__ = 'div#check-verify-official-release-page'
this.__check_verify_official_release_len_sassaman_is_using_openssl__ = 'pre#check-verify-official-release-len-sassaman-is-using-openssl'

}

get title () {
Expand Down Expand Up @@ -531,6 +538,14 @@ class App {
return $(this.__found_release_pem_msg__)
}

get checkVerifyOfficialReleasePage () {
return $(this.__check_verify_official_release_page__)
}

get checkVerifyOfficialReleaseLenSassamanIsUsingOpenssl (){
return $(this.__check_verify_official_release_len_sassaman_is_using_openssl__)
}

}

module.exports = App
124 changes: 124 additions & 0 deletions test/e2e/specs/038-check-verify-official-release.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
const expectChai = require('chai').expect
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')

const LEN_SASSAMAN = [
":.:'' ,,xiW,\"4x, '' ",
" : ,dWWWXXXXi,4WX, ",
" ' dWWWXXX7\" `X, ",
" lWWWXX7 __ _ X ",
" :WWWXX7 ,xXX7' \"^^X ",
" lWWWX7, _.+,, _.+., ",
" :WWW7,. `^\"-\" ,^-' ",
" WW\",X: X, ",
" \"7^^Xl. _(_x7' ",
" l ( :X: __ _ ",
" `. \" XX ,xxWWWWX7 ",
" )X- \"\" 4X\" .___. ",
" ,W X :Xi _,,_ ",
" WW X 4XiyXWWXd ",
" \"\" ,, 4XWWWWXX ",
" , R7X, \"^447^ ",
" R, \"4RXk, _, , ",
" TWk \"4RXXi, X',x ",
" lTWk, \"4RRR7' 4 XH ",
" :lWWWk, ^\" `4 ",
" ::TTXWWi,_ Xll :.. ",
" ",
" Len Sassaman is using openssl to ",
" verify sha256sum and signature..."
].join('\n')

describe('KruxInstaller CheckVerifyOfficialRelease page (show Lensassaman \'using\' openssl)', () => {

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 })
await instance.checkingReleaseZipSha256txtMsg.waitForExist()
await instance.foundReleaseZipSha256txtMsg.waitForExist()
await instance.warningDownloadPage.waitForExist()
await instance.warningDownloadProceedButton.waitForExist()
await instance.warningDownloadProceedButtonText.waitForExist()
await instance.warningDownloadProceedButton.click()
await instance.warningDownloadPage.waitForExist({ reverse: true })
await instance.checkingReleaseZipSigMsg.waitForExist()
await instance.foundReleaseZipSigMsg.waitForExist()
await instance.warningDownloadPage.waitForExist()
await instance.warningDownloadProceedButton.waitForExist()
await instance.warningDownloadProceedButtonText.waitForExist()
await instance.warningDownloadProceedButton.click()
await instance.warningDownloadPage.waitForExist({ reverse: true })
await instance.checkingReleasePemMsg.waitForExist()
await instance.foundReleasePemMsg.waitForExist()
await instance.warningDownloadPage.waitForExist()
await instance.warningDownloadProceedButton.waitForExist()
await instance.warningDownloadProceedButtonText.waitForExist()
await instance.warningDownloadProceedButton.click()
await instance.warningDownloadPage.waitForExist({ reverse: true })
})

it('should go to CheckVerifyOfficialRelease page', async () => {
await instance.checkVerifyOfficialReleasePage.waitForExist({ timeout: 3000 })
await expectWDIO(instance.checkVerifyOfficialReleasePage).toBeDisplayed()
})

it('should show correctly Len Sassaman \'verifying\' with openssl', async () => {
await instance.checkVerifyOfficialReleaseLenSassamanIsUsingOpenssl.waitForExist()
await expectWDIO(instance.checkVerifyOfficialReleaseLenSassamanIsUsingOpenssl).toHaveText(LEN_SASSAMAN)
})

it('should go out of CheckVerifyOfficialRelease page', async () => {
await instance.checkVerifyOfficialReleaseLenSassamanIsUsingOpenssl.waitForExist({ reverse: true })
await instance.checkVerifyOfficialReleasePage.waitForExist({ reverse: true })
})

})

0 comments on commit 3d71e2d

Please sign in to comment.