Skip to content

Commit

Permalink
fix pytest for namespace selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaydee94 committed Nov 14, 2024
1 parent 8e7c21b commit 8c6bca4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ui/src/components/Secrets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
md="4"
>
<v-autocomplete
id="namespaceSelection"
v-model="namespaceName"
:items="sortedNamespaces"
ref="namespaceSelector"
Expand All @@ -40,7 +41,7 @@
>
{{ favoriteNamespaces.has(item.value) ? 'mdi-heart' : 'mdi-heart-outline' }}
</v-icon>
<span>{{ item.value }}</span>
<span class="v-list-item-title">{{ item.value }}</span>
</div>
<v-divider v-if="item.value === lastFavoriteNamespace" :thickness="2"></v-divider>
</template>
Expand Down
12 changes: 7 additions & 5 deletions ui/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_ui_start():

def test_secret_form_with_value():
with sync_playwright() as ctx:
browser = ctx.chromium.launch(headless=True)
browser = ctx.chromium.launch(headless=False)
page = browser.new_page()
page.goto("http://localhost:8080")
page.wait_for_load_state("load")
Expand Down Expand Up @@ -75,17 +75,19 @@ def test_secret_form_with_invalid_file():


def namespace_select(page: Page):
input_selector = "input#input-4"
input_selector = "input#namespaceSelection"
page.wait_for_selector(input_selector, timeout=10000)
page.click(input_selector)
suggestions = page.query_selector_all(".v-list-item-title")
assert len(suggestions) > 0, "No suggestions found."
first_suggestion_text = suggestions[0].inner_text()
suggestions[0].click()
selected_value = page.input_value(input_selector)
selected_text_selector = ".v-autocomplete__selection-text"
page.wait_for_selector(selected_text_selector, timeout=10000)
displayed_text = page.inner_text(selected_text_selector)
assert (
selected_value == first_suggestion_text
), f"Expected '{first_suggestion_text}', but got '{selected_value}'"
displayed_text == first_suggestion_text
), f"Expected '{first_suggestion_text}', but got '{displayed_text}'"


def secret_name(page: Page):
Expand Down

0 comments on commit 8c6bca4

Please sign in to comment.