From 7b8f8f0f74a04186b63f8621f46e1e1bf3c13bba Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Sun, 20 Jan 2019 13:38:52 +0100 Subject: [PATCH] Add spec helper to fill translatable ckeditor fields --- spec/support/common_actions/verifications.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/support/common_actions/verifications.rb b/spec/support/common_actions/verifications.rb index af5896121..9e5e8ed79 100644 --- a/spec/support/common_actions/verifications.rb +++ b/spec/support/common_actions/verifications.rb @@ -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