From e6c13d29544c7cbdad16575af04e5f2efca06e01 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 26 Aug 2017 12:51:47 -0700 Subject: Improve flaky ACE editor spec The ACE editor JavaScript may not be loaded when the spec runs evaluateScript. Wait for the editor to load before attempting to run ACE-specific JavaScript. --- spec/features/projects/user_creates_files_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/features/projects/user_creates_files_spec.rb b/spec/features/projects/user_creates_files_spec.rb index 4b78cc4fc53..3d335687510 100644 --- a/spec/features/projects/user_creates_files_spec.rb +++ b/spec/features/projects/user_creates_files_spec.rb @@ -56,11 +56,10 @@ describe 'User creates files' do find('.add-to-tree').click click_link('New file') + expect(page).to have_selector('.file-editor') end it 'creates and commit a new file', js: true do - expect(page).to have_selector('.file-editor') - execute_script("ace.edit('editor').setValue('*.rbca')") fill_in(:file_name, with: 'not_a_file.md') fill_in(:commit_message, with: 'New commit message', visible: true) -- cgit v1.2.1