Project

General

Profile

Defect #40683 » 0002-Stabilize-inline-autocomplete-system-test.patch

Ko Nagase, 2024-05-12 16:18

View differences:

test/application_system_test_case.rb
end
files.last
end
def fill_in_with_delay(locator, with:, delay: 0.01)
find(:fillable_field, locator).set('')
if with.is_a?(String) && with.length > 0
with.chars.each do |char|
find(:fillable_field, locator).send_keys(char)
sleep delay
end
end
end
end
FileUtils.mkdir_p ApplicationSystemTestCase::DOWNLOADS_PATH
test/system/inline_autocomplete_test.rb
log_user('admin', 'admin')
visit 'projects/ecookbook/issues/new'
fill_in 'Description', :with => '##12'
fill_in_with_delay 'Description', :with => '##12'
within('.tribute-container') do
assert page.has_text? 'Bug #12: Closed issue on a locked version'
......
log_user('jsmith', 'jsmith')
visit 'issues/new'
fill_in 'Description', :with => '#Closed'
fill_in_with_delay 'Description', :with => '#Closed'
within('.tribute-container') do
assert page.has_text? 'Bug #12: Closed issue on a locked version'
......
log_user('jsmith', 'jsmith')
visit 'issues/new'
fill_in 'Description', :with => '[['
fill_in_with_delay 'Description', :with => '[['
within('.tribute-container') do
assert page.has_text? 'Child_1_1'
assert page.has_text? 'Page_with_sections'
end
fill_in 'Description', :with => '[[page'
fill_in_with_delay 'Description', :with => '[[page'
within('.tribute-container') do
assert page.has_text? 'Page_with_sections'
assert page.has_text? 'Another_page'
......
log_user('jsmith', 'jsmith')
visit 'projects/1/issues/new'
fill_in 'Description', :with => '#This'
fill_in_with_delay 'Description', :with => '#This'
within('.tribute-container') do
assert page.has_text? "Bug ##{issue.id}: This issue has a <select> element"
......
visit '/issues/1/edit'
find('#issue_notes').click
fill_in 'issue[notes]', :with => '@lopper'
fill_in_with_delay 'issue[notes]', :with => '@lopper'
within('.tribute-container') do
assert page.has_text? "Dave Lopper"
......
page.find('#issue_status_id').select('Feedback')
find('#issue_notes').click
fill_in 'issue[notes]', :with => '@lopper'
fill_in_with_delay 'issue[notes]', :with => '@lopper'
within('.tribute-container') do
assert page.has_text? "Dave Lopper"
......
visit '/issues/bulk_edit?ids[]=1&ids[]=2'
find('#notes').click
fill_in 'notes', :with => '@lopper'
fill_in_with_delay 'notes', :with => '@lopper'
within('.tribute-container') do
assert page.has_text? 'Dave Lopper'
(1-1/3)