From 63d4ab98fd83175efa2fc46ce20ae6351ee147b7 Mon Sep 17 00:00:00 2001 From: qlrd <106913782+qlrd@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:14:22 -0300 Subject: [PATCH] Fixed some tests on SelectVersion's page buttons --- src/pages/SelectVersion.vue | 9 +++++++-- test/e2e/pageobjects/app.page.ts | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/SelectVersion.vue b/src/pages/SelectVersion.vue index c3d85779..2b909238 100644 --- a/src/pages/SelectVersion.vue +++ b/src/pages/SelectVersion.vue @@ -8,9 +8,9 @@ variant="outlined" :class="[selectedClass]" @click="select(version)" - :id="`select-version-page-${version}-button`" + :id="`select-version-page-${ transformVersion(version) }-button`" > - {{ version }} + {{ version }} @@ -43,6 +43,7 @@ const props = defineProps<{ }>() const { versions } = toRefs(props) + /** * Functions */ @@ -54,4 +55,8 @@ async function select(version: string) { await window.api.invoke('krux:store:set', { from: 'SelectVersion', key: 'version', value: version }) } +function transformVersion (version: string): string { + return version.replace(/[\/\_\.]/g, '-') +} + \ No newline at end of file diff --git a/test/e2e/pageobjects/app.page.ts b/test/e2e/pageobjects/app.page.ts index 51250726..98ccf035 100644 --- a/test/e2e/pageobjects/app.page.ts +++ b/test/e2e/pageobjects/app.page.ts @@ -71,11 +71,11 @@ class App { this.__select_device_page_maixpy_dock_text__ = 'div#select-device-page-maixpy_dock-text' this.__select_device_page_maixpy_back_text__ = 'div#select-device-page-back-text' this.__select_version_page__ = 'div#select-version-page'; - this.__select_version_page_selfcustody_button__ = 'div#select-version-page-selfcustody/krux/releases/tag/v22.08.2-button' + this.__select_version_page_selfcustody_button__ = 'div#select-version-page-selfcustody-krux-releases-tag-v22-08-2-button' this.__select_version_page_back_button__ = 'div#select-version-page-back-button' - this.__select_version_page_odudex_button__ = 'div#select-version-page-odudex/krux_binaries-button' - this.__select_version_page_selfcustody_text__ = 'div#select-version-page-selfcustody/krux/releases/tag/v22.08.2-text' - this.__select_version_page_odudex_text__ = 'div#select-version-page-odudex/krux_binaries-text' + this.__select_version_page_odudex_button__ = 'div#select-version-page-odudex-krux-binaries-button' + this.__select_version_page_selfcustody_text__ = 'div#select-version-page-selfcustody-krux-releases-tag-v22-08-2-text' + this.__select_version_page_odudex_text__ = 'div#select-version-page-odudex-krux-binaries-text' this.__select_version_page_back_text__ = 'div#select-version-page-back-text' this.__github_octocat_checker_logo__ = 'pre#github-octocat-checker-logo' }