Skip to content
代码片段 群组 项目
提交 8d778113 编辑于 作者: Nivetha Prabakaran's avatar Nivetha Prabakaran 提交者: Dan Davison
浏览文件

[E2E] Fix for failures for upload_new_file_in_web_ide_spec in staging

上级 c41f8fd2
No related branches found
No related tags found
无相关合并请求
......@@ -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
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册