A platform for community discussion. Free, open, simple.
DEV: Fix flaky spec for the /about admin config area (#27697)
Osama Sayegh7c12b75a5ccb
diff --git a/spec/system/admin_about_config_area_spec.rb b/spec/system/admin_about_config_area_spec.rbindex 44a5c90a5c1..be62a78afa5 100644--- a/spec/system/admin_about_config_area_spec.rb+++ b/spec/system/admin_about_config_area_spec.rb@@ -38,7 +38,7 @@ describe "Admin About Config Area Page", type: :system doexpect(config_area.general_settings_section.community_description_editor.value).to eq("this is an extended description for my forums",)- expect(config_area.general_settings_section.banner_image_uploader).to have_uploaded_picture+ expect(config_area.general_settings_section.banner_image_uploader).to have_uploaded_imageexpect(config_area.contact_information_section.community_owner_input.value).to eq("kitty")expect(config_area.contact_information_section.contact_email_input.value).to eq(@@ -79,6 +79,7 @@ describe "Admin About Config Area Page", type: :system dowith: "here's an extended description for the **community**",)config_area.general_settings_section.banner_image_uploader.select_image(image_file.path)+ expect(config_area.general_settings_section.banner_image_uploader).to have_uploaded_imageconfig_area.general_settings_section.save_button.clickexpect(config_area.general_settings_section).to have_saved_successfullydiff --git a/spec/system/page_objects/components/uppy_image_uploader.rb b/spec/system/page_objects/components/uppy_image_uploader.rbindex 1ecf69c6504..e5b1c1fcb06 100644--- a/spec/system/page_objects/components/uppy_image_uploader.rb+++ b/spec/system/page_objects/components/uppy_image_uploader.rb@@ -11,8 +11,12 @@ module PageObjectsattach_file(path) { @element.find("label.btn-default").click }end- def has_uploaded_picture?- @element.has_css?(".uploaded-image-preview")+ def has_uploaded_image?+ # if there's a delete button (.btn-danger), then there must be an+ # uploaded image.+ # allow up to 10 seconds for the upload to finish in case this is+ # called immediately after selecting an image.+ @element.has_css?(".btn-danger", wait: 10)endendend