From 64b7c8c3faa4537899ab3027ce2a4eb2660a5c08 Mon Sep 17 00:00:00 2001 From: James Butters Date: Fri, 20 Mar 2020 23:43:48 -0600 Subject: [PATCH] spec: add_folder method sometimes doesn't add full name send_keys has an issue that sometimes it won't send the full string before the next line of code is executed resulting in a new folder with wrong name. It's recommended to add a click to the input before send_keys. flag = none Change-Id: Ib2659a418d29ef85fd0fcadd91037e5f309e94a0 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230876 Tested-by: Service Cloud Jenkins Reviewed-by: Jacob Powell Reviewed-by: Derek Bender QA-Review: James Butters Product-Review: James Butters --- spec/selenium/helpers/files_common.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/selenium/helpers/files_common.rb b/spec/selenium/helpers/files_common.rb index e04b595ce7e..f991765312b 100644 --- a/spec/selenium/helpers/files_common.rb +++ b/spec/selenium/helpers/files_common.rb @@ -158,8 +158,9 @@ module FilesCommon def add_folder(name = 'new folder') click_new_folder_button new_folder = f("input[aria-label='Folder Name']") + new_folder.click # sometimes send_keys won't send all keys unless click first new_folder.send_keys(name) - new_folder.send_keys(:return) + f('.ef-edit-name-accept').click wait_for_ajaximations end