Commit 885314b4 authored by Tim Zallmann's avatar Tim Zallmann
Browse files

Merge branch 'user-edit-files-spec-fix' into 'master'

Wait for requests to finish before running the ace JS

Closes #36191

See merge request !13405
parents 21a6898b 3ba782d5
......@@ -20,6 +20,9 @@
it 'inserts a content of a file', js: true do
click_link('.gitignore')
find('.js-edit-blob').click
wait_for_requests
execute_script("ace.edit('editor').setValue('*.rbca')")
expect(evaluate_script('ace.edit("editor").getValue()')).to eq('*.rbca')
......@@ -35,6 +38,9 @@
it 'commits an edited file', js: true do
click_link('.gitignore')
find('.js-edit-blob').click
wait_for_requests
execute_script("ace.edit('editor').setValue('*.rbca')")
fill_in(:commit_message, with: 'New commit message', visible: true)
click_button('Commit changes')
......@@ -49,6 +55,9 @@
it 'commits an edited file to a new branch', js: true do
click_link('.gitignore')
find('.js-edit-blob').click
wait_for_requests
execute_script("ace.edit('editor').setValue('*.rbca')")
fill_in(:commit_message, with: 'New commit message', visible: true)
fill_in(:branch_name, with: 'new_branch_name', visible: true)
......@@ -65,6 +74,9 @@
it 'shows the diff of an edited file', js: true do
click_link('.gitignore')
find('.js-edit-blob').click
wait_for_requests
execute_script("ace.edit('editor').setValue('*.rbca')")
click_link('Preview changes')
......@@ -92,6 +104,8 @@
"A fork of this project has been created that you can make changes in, so you can submit a merge request."
)
wait_for_requests
execute_script("ace.edit('editor').setValue('*.rbca')")
expect(evaluate_script('ace.edit("editor").getValue()')).to eq('*.rbca')
......@@ -105,6 +119,9 @@
expect(page).to have_button('Cancel')
click_link('Fork')
wait_for_requests
execute_script("ace.edit('editor').setValue('*.rbca')")
fill_in(:commit_message, with: 'New commit message', visible: true)
click_button('Commit changes')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment