Попытка получить спецификации, передаваемые в старом проекте Rails 4 после миграции с Poltergeist на Selenium WebDriver / ChromeDriver.Типичная ошибка около .native.send_key(:Enter)
Есть ли эквивалентная или лучшая практика, на которую мы должны перейти?
17) Comment creation for image changes counter
Failure/Error: find('input[name="comment[body]"]').native.send_key(:Enter)
Selenium::WebDriver::Error::UnsupportedOperationError:
no such key :Enter
# ./spec/support/helpers/comments_page_helpers.rb:13:in `add_comment'
# ./spec/features/comments/creation_spec.rb:72:in `block (4 levels) in <top (required)>'
# ./spec/features/comments/creation_spec.rb:71:in `block (3 levels) in <top (required)>'
# spec / features / comments / creation_spec.rb
require 'spec_helper'
feature 'Comment creation', type: :feature, js: true do
...
context 'for image' do
background do
open_image_comments_modal section_position: 1, photo_position: 1
within '.modal-comments-container' do
add_comment 'First comment message'
end
end
...
end
# spec / support / helpers / comments_page_helpers.rb
module CommentsPageHelpers
...
def add_comment(text)
fill_in 'comment[body]', with: text
find('input[name="comment[body]"]').native.send_key(:Enter)
expect(page).to have_css '.comments .comment-body', text: text
end
...
end