)]}'
{"openstack_dashboard/test/selenium/integration/test_images.py":[{"author":{"_account_id":35133,"name":"Jan Jasek","email":"jjasek@redhat.com","username":"janjasek"},"change_message_id":"3a8e1ecb26f65d964f463faa5ddf20bea5f584b2","unresolved":true,"context_lines":[{"line_number":369,"context_line":"            pytest.fail(\"Delete option should not exist\")"},{"line_number":370,"context_line":"    actions_column.find_element_by_xpath("},{"line_number":371,"context_line":"        f\".//*[normalize-space()\u003d\u0027Edit Image\u0027]\").click()"},{"line_number":372,"context_line":"    wait_for_image_form_to_load_fully(driver)"},{"line_number":373,"context_line":"    time.sleep(3)"},{"line_number":374,"context_line":"    image_form \u003d driver.find_element_by_css_selector(\".ng-wizard\")"},{"line_number":375,"context_line":"    image_form.find_element_by_xpath(\".//label[text()\u003d\u0027No\u0027]\").click()"},{"line_number":376,"context_line":"    image_form.find_element_by_xpath("}],"source_content_type":"text/x-python","patch_set":4,"id":"bb82565f_b6dc9da7","line":373,"range":{"start_line":372,"start_character":0,"end_line":373,"end_character":17},"updated":"2024-01-10 13:42:05.000000000","message":"I am not very deep in these things but the issue is in javascript/angular loading I guess. The basic skeleton of the page is loaded immediately (that is the reason why we can not resolve the issue using selenium wait). Because although the page is from selenium point of view fully loaded, there is still something else going on because of angular (some additional loading/refreshing).\nProbably someone from developers could clarify to us if it works how I think.\n\nThis workaround works for me (wait for JavaScript engines task queue becomes empty - at that moment not only the basic skeleton of the page but also all the angular things should be loaded/done):\n\ndriver.set_script_timeout(10)\ndriver.execute_async_script(\"\"\"\n    var callback \u003d arguments[arguments.length - 1];\n    var element \u003d document.querySelector(\u0027div.btn-group[name\u003d\"protected\"]\u0027);\n    if (!window.angular) {\n        callback(false)\n    }\n    if (angular.getTestability) {\n        angular.getTestability(element).whenStable(function(){callback(true)});\n    } else {\n        if (!angular.element(element).injector()) {\n            callback(false)\n        }\n        var browser \u003d angular.element(element).injector().get(\u0027$browser\u0027);\n        browser.notifyWhenNoOutstandingRequests(function(){callback(true)});\n};\"\"\")\n\n\nIt solved the issue for my env (which is quite fast and it is sometimes hard to debug issues that you or Zuul could face). Could you please try it at your environment?\nIt is more complicated than time.sleep(3) but faster and more \"under control\" than hard coded wait I would say.","commit_id":"8529743376eb744781786c94154739c02591deaf"},{"author":{"_account_id":35153,"name":"Ashish Gupta","email":"ashigupt@redhat.com","username":"ashigupt","status":"Redhat"},"change_message_id":"de85707260036e4fc2193c5f131f0edb4f256c0b","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            pytest.fail(\"Delete option should not exist\")"},{"line_number":370,"context_line":"    actions_column.find_element_by_xpath("},{"line_number":371,"context_line":"        f\".//*[normalize-space()\u003d\u0027Edit Image\u0027]\").click()"},{"line_number":372,"context_line":"    wait_for_image_form_to_load_fully(driver)"},{"line_number":373,"context_line":"    time.sleep(3)"},{"line_number":374,"context_line":"    image_form \u003d driver.find_element_by_css_selector(\".ng-wizard\")"},{"line_number":375,"context_line":"    image_form.find_element_by_xpath(\".//label[text()\u003d\u0027No\u0027]\").click()"},{"line_number":376,"context_line":"    image_form.find_element_by_xpath("}],"source_content_type":"text/x-python","patch_set":4,"id":"9728abde_0b4a67f6","line":373,"range":{"start_line":372,"start_character":0,"end_line":373,"end_character":17},"in_reply_to":"bb82565f_b6dc9da7","updated":"2024-01-22 09:49:30.000000000","message":"Done","commit_id":"8529743376eb744781786c94154739c02591deaf"},{"author":{"_account_id":35133,"name":"Jan Jasek","email":"jjasek@redhat.com","username":"janjasek"},"change_message_id":"0aebebd20f2a897126d20389b76e23e4226bd978","unresolved":true,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"def test_image_filtration_admin(login, driver, image_names,"},{"line_number":330,"context_line":"                                new_image_admin, config):"},{"line_number":331,"context_line":"    image_name \u003d image_names[0]"},{"line_number":332,"context_line":"    login(\u0027admin\u0027, \u0027admin\u0027)"},{"line_number":333,"context_line":"    url \u003d \u0027/\u0027.join(("},{"line_number":334,"context_line":"        config.dashboard.dashboard_url,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f2e5203_08bc7066","line":331,"range":{"start_line":331,"start_character":4,"end_line":331,"end_character":31},"updated":"2024-01-22 17:27:27.000000000","message":"It is not a big deal, just hint for next tests. In last few patches I started to use:\nnew_image_admin.name instead of image_names.\nThen we can eliminate fixture image_names from parameters of the test, because it is already called in fixture new_image_admin and new_image_admin.name is more self explanatory than just fixture image_names.","commit_id":"6458017353d4bf365a40095a4e733f96c6a23595"},{"author":{"_account_id":35153,"name":"Ashish Gupta","email":"ashigupt@redhat.com","username":"ashigupt","status":"Redhat"},"change_message_id":"da23c0499eba2840e0daf2b5824baed9e7894f8a","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"def test_image_filtration_admin(login, driver, image_names,"},{"line_number":330,"context_line":"                                new_image_admin, config):"},{"line_number":331,"context_line":"    image_name \u003d image_names[0]"},{"line_number":332,"context_line":"    login(\u0027admin\u0027, \u0027admin\u0027)"},{"line_number":333,"context_line":"    url \u003d \u0027/\u0027.join(("},{"line_number":334,"context_line":"        config.dashboard.dashboard_url,"}],"source_content_type":"text/x-python","patch_set":8,"id":"57e9455a_641a7528","line":331,"range":{"start_line":331,"start_character":4,"end_line":331,"end_character":31},"in_reply_to":"5f2e5203_08bc7066","updated":"2024-01-23 13:02:34.000000000","message":"Done","commit_id":"6458017353d4bf365a40095a4e733f96c6a23595"},{"author":{"_account_id":35133,"name":"Jan Jasek","email":"jjasek@redhat.com","username":"janjasek"},"change_message_id":"0aebebd20f2a897126d20389b76e23e4226bd978","unresolved":true,"context_lines":[{"line_number":433,"context_line":"    assert len(rows) \u003d\u003d 1"},{"line_number":434,"context_line":"    driver.find_element_by_xpath("},{"line_number":435,"context_line":"        f\"//a[normalize-space()\u003d\u0027{new_image_name}\u0027]\").click()"},{"line_number":436,"context_line":"    description \u003d driver.find_element_by_xpath("},{"line_number":437,"context_line":"        \"//dl[@class\u003d\u0027dl-horizontal\u0027]//div[1]\").text"},{"line_number":438,"context_line":"    assert new_description \u003d\u003d description.split(\"\\n\")[1]"},{"line_number":439,"context_line":"    driver.get(url)"},{"line_number":440,"context_line":"    rows \u003d driver.find_elements_by_xpath(f\"//a[text()\u003d\u0027{new_image_name}\u0027]\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"b75d92a8_b8a46d90","line":437,"range":{"start_line":436,"start_character":0,"end_line":437,"end_character":52},"updated":"2024-01-22 17:27:27.000000000","message":"1)\nIf you want to do it in UI then I would recommend to use something more specific. Something that will contain [title\u003d\u0027description\u0027].\nBecause when the description textbox is not filled then the output of find_element in current solution will be something like:\n\nfile /v2/images/1ac11c2e-389a-422a-a307-4bf4a41e6eee/file\n\nBecause when description is not set then the \"file\" is on the first position (div[1]) not the description.\n\nThe result of the test will be ok, because it will not pass the assert on the next line but use locator with [title\u003d\u0027description\u0027] will be more clear solution I guess.\n\n\n2)\nAnyway... those tests are integration tests, not UI tests. So you do not need to check it like that. You can do just:\nassert (openstack_demo.compute.get(\"/images/{image_id}\").json()[\u0027image\u0027][\u0027metadata\u0027][\u0027description\u0027] \u003d\u003d new_description)\n\nI like the UI things but as we have openstack SDK I would like to reduce  the number of steps in UI to minimum to eliminate potential random failures as much as possible.","commit_id":"6458017353d4bf365a40095a4e733f96c6a23595"},{"author":{"_account_id":35153,"name":"Ashish Gupta","email":"ashigupt@redhat.com","username":"ashigupt","status":"Redhat"},"change_message_id":"da23c0499eba2840e0daf2b5824baed9e7894f8a","unresolved":false,"context_lines":[{"line_number":433,"context_line":"    assert len(rows) \u003d\u003d 1"},{"line_number":434,"context_line":"    driver.find_element_by_xpath("},{"line_number":435,"context_line":"        f\"//a[normalize-space()\u003d\u0027{new_image_name}\u0027]\").click()"},{"line_number":436,"context_line":"    description \u003d driver.find_element_by_xpath("},{"line_number":437,"context_line":"        \"//dl[@class\u003d\u0027dl-horizontal\u0027]//div[1]\").text"},{"line_number":438,"context_line":"    assert new_description \u003d\u003d description.split(\"\\n\")[1]"},{"line_number":439,"context_line":"    driver.get(url)"},{"line_number":440,"context_line":"    rows \u003d driver.find_elements_by_xpath(f\"//a[text()\u003d\u0027{new_image_name}\u0027]\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"3629e17c_d341d71a","line":437,"range":{"start_line":436,"start_character":0,"end_line":437,"end_character":52},"in_reply_to":"b75d92a8_b8a46d90","updated":"2024-01-23 13:02:34.000000000","message":"Done","commit_id":"6458017353d4bf365a40095a4e733f96c6a23595"},{"author":{"_account_id":35133,"name":"Jan Jasek","email":"jjasek@redhat.com","username":"janjasek"},"change_message_id":"0aebebd20f2a897126d20389b76e23e4226bd978","unresolved":true,"context_lines":[{"line_number":436,"context_line":"    description \u003d driver.find_element_by_xpath("},{"line_number":437,"context_line":"        \"//dl[@class\u003d\u0027dl-horizontal\u0027]//div[1]\").text"},{"line_number":438,"context_line":"    assert new_description \u003d\u003d description.split(\"\\n\")[1]"},{"line_number":439,"context_line":"    driver.get(url)"},{"line_number":440,"context_line":"    rows \u003d driver.find_elements_by_xpath(f\"//a[text()\u003d\u0027{new_image_name}\u0027]\")"},{"line_number":441,"context_line":"    actions_column \u003d rows[0].find_element_by_xpath("},{"line_number":442,"context_line":"        \".//ancestor::tr/td[contains(@class,\u0027actions_column\u0027)]\")"},{"line_number":443,"context_line":"    widgets.select_from_dropdown(actions_column, \"Delete Image\")"},{"line_number":444,"context_line":"    widgets.confirm_modal(driver)"},{"line_number":445,"context_line":"    messages \u003d widgets.get_and_dismiss_messages(driver)"},{"line_number":446,"context_line":"    assert f\"Success: Deleted Image: {new_image_name}.\" in messages"},{"line_number":447,"context_line":"    assert openstack_admin.compute.find_image(new_image_name) is None"}],"source_content_type":"text/x-python","patch_set":8,"id":"a981f347_5ced7ec7","line":447,"range":{"start_line":439,"start_character":4,"end_line":447,"end_character":69},"updated":"2024-01-22 17:27:27.000000000","message":"I would remove all the the steps after \"assert new_description...\" and delete the image using fixture. The test is test for edit image description and name, we already have test for delete image. It is just increase of execution time and increase of space for random failures in UI.","commit_id":"6458017353d4bf365a40095a4e733f96c6a23595"},{"author":{"_account_id":35153,"name":"Ashish Gupta","email":"ashigupt@redhat.com","username":"ashigupt","status":"Redhat"},"change_message_id":"da23c0499eba2840e0daf2b5824baed9e7894f8a","unresolved":false,"context_lines":[{"line_number":436,"context_line":"    description \u003d driver.find_element_by_xpath("},{"line_number":437,"context_line":"        \"//dl[@class\u003d\u0027dl-horizontal\u0027]//div[1]\").text"},{"line_number":438,"context_line":"    assert new_description \u003d\u003d description.split(\"\\n\")[1]"},{"line_number":439,"context_line":"    driver.get(url)"},{"line_number":440,"context_line":"    rows \u003d driver.find_elements_by_xpath(f\"//a[text()\u003d\u0027{new_image_name}\u0027]\")"},{"line_number":441,"context_line":"    actions_column \u003d rows[0].find_element_by_xpath("},{"line_number":442,"context_line":"        \".//ancestor::tr/td[contains(@class,\u0027actions_column\u0027)]\")"},{"line_number":443,"context_line":"    widgets.select_from_dropdown(actions_column, \"Delete Image\")"},{"line_number":444,"context_line":"    widgets.confirm_modal(driver)"},{"line_number":445,"context_line":"    messages \u003d widgets.get_and_dismiss_messages(driver)"},{"line_number":446,"context_line":"    assert f\"Success: Deleted Image: {new_image_name}.\" in messages"},{"line_number":447,"context_line":"    assert openstack_admin.compute.find_image(new_image_name) is None"}],"source_content_type":"text/x-python","patch_set":8,"id":"83904582_e747710d","line":447,"range":{"start_line":439,"start_character":4,"end_line":447,"end_character":69},"in_reply_to":"a981f347_5ced7ec7","updated":"2024-01-23 13:02:34.000000000","message":"Done","commit_id":"6458017353d4bf365a40095a4e733f96c6a23595"},{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"53fbb12f02714bd92507f9e895ec788d5333ef8a","unresolved":true,"context_lines":[{"line_number":63,"context_line":"                disk_format\u003d\"qcow2\","},{"line_number":64,"context_line":"                filename\u003dtemporary_file,"},{"line_number":65,"context_line":"                wait\u003dTrue,"},{"line_number":66,"context_line":"            )"},{"line_number":67,"context_line":"    yield image"},{"line_number":68,"context_line":"    for img in image_names:"},{"line_number":69,"context_line":"        openstack_admin.delete_image(img)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1df0d2a8_9cec0a46","line":66,"updated":"2024-01-23 14:17:46.000000000","message":"I wonder if it wouldn\u0027t be simpler to just have a separate fixture for this? We use it in separate tests anyways.","commit_id":"305977e1d7564a46addd183ef4f0028c2097ec76"},{"author":{"_account_id":35153,"name":"Ashish Gupta","email":"ashigupt@redhat.com","username":"ashigupt","status":"Redhat"},"change_message_id":"3d9c23a00f93354f0309cde6b222e073f5f45bdc","unresolved":true,"context_lines":[{"line_number":63,"context_line":"                disk_format\u003d\"qcow2\","},{"line_number":64,"context_line":"                filename\u003dtemporary_file,"},{"line_number":65,"context_line":"                wait\u003dTrue,"},{"line_number":66,"context_line":"            )"},{"line_number":67,"context_line":"    yield image"},{"line_number":68,"context_line":"    for img in image_names:"},{"line_number":69,"context_line":"        openstack_admin.delete_image(img)"}],"source_content_type":"text/x-python","patch_set":9,"id":"f189a5a5_de73d958","line":66,"in_reply_to":"1df0d2a8_9cec0a46","updated":"2024-01-23 18:39:51.000000000","message":"Okay I will add a separate fixture then if that makes things simpler","commit_id":"305977e1d7564a46addd183ef4f0028c2097ec76"},{"author":{"_account_id":35153,"name":"Ashish Gupta","email":"ashigupt@redhat.com","username":"ashigupt","status":"Redhat"},"change_message_id":"a898aa7d70990b5943d4f59a45984dd5c2a41032","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                disk_format\u003d\"qcow2\","},{"line_number":64,"context_line":"                filename\u003dtemporary_file,"},{"line_number":65,"context_line":"                wait\u003dTrue,"},{"line_number":66,"context_line":"            )"},{"line_number":67,"context_line":"    yield image"},{"line_number":68,"context_line":"    for img in image_names:"},{"line_number":69,"context_line":"        openstack_admin.delete_image(img)"}],"source_content_type":"text/x-python","patch_set":9,"id":"07097a96_d1128ead","line":66,"in_reply_to":"f189a5a5_de73d958","updated":"2024-01-24 15:19:34.000000000","message":"Done","commit_id":"305977e1d7564a46addd183ef4f0028c2097ec76"}],"openstack_dashboard/test/selenium/widgets.py":[{"author":{"_account_id":8648,"name":"Radomir Dopieralski","email":"openstack@dopieralski.pl","username":"thesheep"},"change_message_id":"53fbb12f02714bd92507f9e895ec788d5333ef8a","unresolved":true,"context_lines":[{"line_number":96,"context_line":"                                       count\u003dlen(names), names\u003d[names[0].text])"},{"line_number":97,"context_line":"        return actual_table"},{"line_number":98,"context_line":"    except exceptions.WebDriverException:"},{"line_number":99,"context_line":"        return None"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def get_image_table_definition(driver, sorting\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":9,"id":"0aaa11c9_e0a76db2","line":99,"updated":"2024-01-23 14:17:46.000000000","message":"can\u0027t we just let the exception propagate?","commit_id":"305977e1d7564a46addd183ef4f0028c2097ec76"},{"author":{"_account_id":35153,"name":"Ashish Gupta","email":"ashigupt@redhat.com","username":"ashigupt","status":"Redhat"},"change_message_id":"3d9c23a00f93354f0309cde6b222e073f5f45bdc","unresolved":true,"context_lines":[{"line_number":96,"context_line":"                                       count\u003dlen(names), names\u003d[names[0].text])"},{"line_number":97,"context_line":"        return actual_table"},{"line_number":98,"context_line":"    except exceptions.WebDriverException:"},{"line_number":99,"context_line":"        return None"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def get_image_table_definition(driver, sorting\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":9,"id":"a49e12d3_e035dc33","line":99,"in_reply_to":"0aaa11c9_e0a76db2","updated":"2024-01-23 18:39:51.000000000","message":"I prefer to handle it here rather than in the calling function which is the testcase itself as I am expecting exception to be thrown in some scenarios like when I try to filter for a non-existing image . The test case of course has proper asserts expecting whats being returned . Please let me know if I misunderstood or you have some other suggestion .","commit_id":"305977e1d7564a46addd183ef4f0028c2097ec76"}]}
