From fe9f18589429eec095487199ccd0c18c73569a84 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Fri, 18 Oct 2024 10:22:52 +0300 Subject: [PATCH] test: Wait for image search to be over in CreateContainer tests The test was typing into the image name input and then immmediately proceeded to select an image from the dropdown. The selected image would already be in the dropdown from the start and thus it would be selected without waiting for the search to reveal it. The actual search would only start 300ms later and would at that point reset the image selection. If the test wasn't already done with the dialog at that point, the "Create button" would then be disabled. Let's just wait for the searching to be done before continuing, by observing the Alpine image disappear from the list. --- test/check-application | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/check-application b/test/check-application index eaf8265f..4aa7e6ce 100755 --- a/test/check-application +++ b/test/check-application @@ -2795,13 +2795,15 @@ class TestApplication(testlib.MachineCase): self.assertIn(podname, b.text("#pf-modal-part-1")) b.set_input_text("#run-image-dialog-name", container_name) + # Open image dropdown, it should list both Alpine and Busybox from the local repository + b.click("#create-image-image") + b.wait_visible(f'button.pf-v5-c-select__menu-item:contains("{IMG_ALPINE_LATEST}")') + b.wait_visible(f'button.pf-v5-c-select__menu-item:contains("{IMG_BUSYBOX_LATEST}")') + # Filter it down to just Busybox b.set_input_text("#create-image-image-select-typeahead", IMG_BUSYBOX_LATEST) - # we want to switch to "Local", but to make waiting for IMG_BUSYBOX race-free, we first need to - # switch to another view; different images have different registries, so don't assume their name, just - # that at least one more exists - b.click('.image-search-footer .pf-v5-c-toggle-group__item:nth-of-type(3) button') - b.wait_in_text(".pf-v5-c-select__menu-list", "No images found") - b.click('button.pf-v5-c-toggle-group__button:contains("Local")') + b.wait_visible(f'button.pf-v5-c-select__menu-item:contains("{IMG_BUSYBOX_LATEST}")') + b.wait_not_present(f'button.pf-v5-c-select__menu-item:contains("{IMG_ALPINE_LATEST}")') + # Let's select Busybox and create the container b.click(f'button.pf-v5-c-select__menu-item:contains("{IMG_BUSYBOX_LATEST}")') b.click('.pf-v5-c-modal-box__footer #create-image-create-run-btn') b.wait_not_present("#run-image-dialog-name")