Add spec helper to fill translatable ckeditor fields

This commit is contained in:
Julian Herrero
2019-01-20 13:38:52 +01:00
parent 60ce72f3a0
commit 7b8f8f0f74

View File

@@ -44,6 +44,12 @@ module Verifications
end
end
def fill_in_translatable_ckeditor(field, locale, params = {})
selector = ".translatable-fields[data-locale='#{locale}'] textarea[id$='_#{field}']"
locator = find(selector, visible: false)[:id]
fill_in_ckeditor(locator, params)
end
# @param [String] locator label text for the textarea or textarea id
def fill_in_ckeditor(locator, params = {})
# Find out ckeditor id at runtime using its label