From 8d778113cb284efb465fb50045ab4c0d135f8cbd Mon Sep 17 00:00:00 2001 From: Nivetha Prabakaran <nprabakaran@gitlab.com> Date: Mon, 18 Sep 2023 19:01:50 +0000 Subject: [PATCH] [E2E] Fix for failures for upload_new_file_in_web_ide_spec in staging --- qa/qa/page/project/web_ide/vscode.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qa/qa/page/project/web_ide/vscode.rb b/qa/qa/page/project/web_ide/vscode.rb index 13c8bf0139f9d..8f257e95f3e6a 100644 --- a/qa/qa/page/project/web_ide/vscode.rb +++ b/qa/qa/page/project/web_ide/vscode.rb @@ -13,6 +13,7 @@ class VSCode < Page::Base def has_file_explorer? page.has_css?('.explorer-folders-view', visible: true) + page.has_css?('[aria-label="Files Explorer"]', visible: true) end def right_click_file_explorer @@ -33,11 +34,11 @@ def enter_new_folder_text_input(name) end def has_upload_menu_item? - page.has_css?('[aria-label="Upload..."]', visible: true) + page.has_css?('.menu-item-check', visible: true) end def click_upload_menu_item - page.find('[aria-label="Upload..."]').click + page.find('[aria-label="Upload..."]', visible: true).click end def enter_file_input(file) @@ -170,11 +171,10 @@ def upload_file(file_path) # We need to execute a script on the iframe to stub out the iframes body.removeChild to add it back in. page.execute_script("document.body.removeChild = function(){};") - right_click_file_explorer - has_upload_menu_item? - # Use for stability, WebIDE inside an iframe is finnicky, webdriver sometimes moves too fast - Support::Waiter.wait_until(max_duration: 60, retry_on_exception: true) do + Support::Waiter.wait_until(max_duration: 20, retry_on_exception: true) do + right_click_file_explorer + has_upload_menu_item? click_upload_menu_item enter_file_input(file_path) end -- GitLab