openstax_kitchen 3.2.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/CHANGELOG.md +42 -1
  4. data/Gemfile.lock +13 -14
  5. data/docker/ci +0 -1
  6. data/lib/kitchen/book_element.rb +16 -2
  7. data/lib/kitchen/chapter_element.rb +8 -11
  8. data/lib/kitchen/chapter_element_enumerator.rb +1 -1
  9. data/lib/kitchen/composite_chapter_element.rb +7 -11
  10. data/lib/kitchen/composite_page_element.rb +15 -10
  11. data/lib/kitchen/composite_page_element_enumerator.rb +1 -1
  12. data/lib/kitchen/config.rb +7 -0
  13. data/lib/kitchen/directions/bake_chapter_glossary/main.rb +18 -0
  14. data/lib/kitchen/directions/bake_chapter_glossary/v1.rb +30 -0
  15. data/lib/kitchen/directions/bake_chapter_introductions.rb +1 -1
  16. data/lib/kitchen/directions/bake_chapter_key_concepts/main.rb +7 -2
  17. data/lib/kitchen/directions/bake_chapter_key_concepts/v1.rb +12 -7
  18. data/lib/kitchen/directions/bake_chapter_key_equations.rb +26 -21
  19. data/lib/kitchen/directions/bake_chapter_summary.rb +48 -42
  20. data/lib/kitchen/directions/bake_equations.rb +1 -1
  21. data/lib/kitchen/directions/bake_example.rb +5 -1
  22. data/lib/kitchen/directions/bake_figure.rb +1 -1
  23. data/lib/kitchen/directions/{bake_problem_first_elements.rb → bake_first_elements.rb} +2 -2
  24. data/lib/kitchen/directions/bake_footnotes/v1.rb +2 -1
  25. data/lib/kitchen/directions/bake_free_response/free_response.xhtml.erb +10 -0
  26. data/lib/kitchen/directions/bake_free_response/main.rb +11 -0
  27. data/lib/kitchen/directions/bake_free_response/v1.rb +29 -0
  28. data/lib/kitchen/directions/bake_further_research.rb +59 -0
  29. data/lib/kitchen/directions/bake_index/v1.rb +35 -14
  30. data/lib/kitchen/directions/bake_link_placeholders.rb +1 -1
  31. data/lib/kitchen/directions/bake_notes/bake_note_subtitle.rb +4 -0
  32. data/lib/kitchen/directions/bake_notes/bake_numbered_notes.rb +9 -21
  33. data/lib/kitchen/directions/bake_numbered_exercise/main.rb +6 -2
  34. data/lib/kitchen/directions/bake_numbered_exercise/v1.rb +25 -12
  35. data/lib/kitchen/directions/bake_numbered_table/v1.rb +1 -1
  36. data/lib/kitchen/directions/bake_page_abstracts.rb +1 -1
  37. data/lib/kitchen/directions/bake_references/main.rb +16 -0
  38. data/lib/kitchen/directions/bake_references/v1.rb +48 -0
  39. data/lib/kitchen/directions/bake_suggested_reading.rb +5 -0
  40. data/lib/kitchen/directions/bake_toc.rb +4 -2
  41. data/lib/kitchen/directions/{bake_book_answer_key → book_answer_key_container}/eob_solutions_container.xhtml.erb +0 -0
  42. data/lib/kitchen/directions/{bake_book_answer_key → book_answer_key_container}/main.rb +1 -1
  43. data/lib/kitchen/directions/{bake_book_answer_key → book_answer_key_container}/v1.rb +1 -1
  44. data/lib/kitchen/directions/{bake_chapter_review → chapter_review_container}/chapter_review.xhtml.erb +0 -0
  45. data/lib/kitchen/directions/{bake_chapter_review → chapter_review_container}/main.rb +1 -1
  46. data/lib/kitchen/directions/{bake_chapter_review → chapter_review_container}/v1.rb +1 -1
  47. data/lib/kitchen/directions/eoc_section_title_link_snippet.rb +1 -1
  48. data/lib/kitchen/directions/move_exercises_to_eoc/main.rb +27 -0
  49. data/lib/kitchen/directions/{bake_chapter_review_exercises → move_exercises_to_eoc}/v1.rb +8 -10
  50. data/lib/kitchen/directions/{bake_chapter_review_exercises → move_exercises_to_eoc}/v2.rb +8 -9
  51. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/main.rb +1 -1
  52. data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/american_government.rb +19 -0
  53. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/strategies/calculus.rb +1 -1
  54. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/strategies/uphysics.rb +5 -3
  55. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/v1.rb +3 -1
  56. data/lib/kitchen/document.rb +11 -0
  57. data/lib/kitchen/element.rb +9 -3
  58. data/lib/kitchen/element_base.rb +61 -10
  59. data/lib/kitchen/element_enumerator_base.rb +9 -1
  60. data/lib/kitchen/element_enumerator_factory.rb +9 -5
  61. data/lib/kitchen/element_factory.rb +3 -3
  62. data/lib/kitchen/example_element.rb +8 -11
  63. data/lib/kitchen/example_element_enumerator.rb +1 -1
  64. data/lib/kitchen/exercise_element.rb +5 -8
  65. data/lib/kitchen/exercise_element_enumerator.rb +1 -1
  66. data/lib/kitchen/figure_element.rb +8 -11
  67. data/lib/kitchen/figure_element_enumerator.rb +1 -1
  68. data/lib/kitchen/metadata_element.rb +8 -2
  69. data/lib/kitchen/metadata_element_enumerator.rb +1 -1
  70. data/lib/kitchen/note_element.rb +8 -11
  71. data/lib/kitchen/note_element_enumerator.rb +1 -1
  72. data/lib/kitchen/page_element.rb +20 -7
  73. data/lib/kitchen/page_element_enumerator.rb +1 -1
  74. data/lib/kitchen/reference_element.rb +27 -0
  75. data/lib/kitchen/references_element_enumerator.rb +20 -0
  76. data/lib/kitchen/search_query.rb +25 -3
  77. data/lib/kitchen/selector.rb +24 -0
  78. data/lib/kitchen/selectors/base.rb +39 -0
  79. data/lib/kitchen/selectors/standard_1.rb +13 -0
  80. data/lib/kitchen/table_element.rb +8 -11
  81. data/lib/kitchen/table_element_enumerator.rb +1 -1
  82. data/lib/kitchen/templates/eob_section_title_template.xhtml.erb +10 -0
  83. data/lib/kitchen/templates/eoc_section_title_template.xhtml.erb +10 -0
  84. data/lib/kitchen/term_element.rb +5 -8
  85. data/lib/kitchen/term_element_enumerator.rb +1 -1
  86. data/lib/kitchen/unit_element.rb +13 -7
  87. data/lib/kitchen/unit_element_enumerator.rb +1 -1
  88. data/lib/kitchen/version.rb +1 -1
  89. data/lib/locales/en.yml +3 -0
  90. data/lib/openstax_kitchen.rb +1 -0
  91. metadata +30 -22
  92. data/lib/kitchen/directions/bake_chapter_glossary.rb +0 -39
  93. data/lib/kitchen/directions/bake_chapter_key_concepts/key_concepts.xhtml.erb +0 -16
  94. data/lib/kitchen/directions/bake_chapter_review_exercises/main.rb +0 -15
  95. data/lib/kitchen/directions/bake_chapter_review_exercises/review_exercises.xhtml.erb +0 -10
  96. data/lib/kitchen/directions/bake_exercises/main.rb +0 -12
  97. data/lib/kitchen/directions/bake_exercises/v1.rb +0 -169
  98. data/lib/kitchen/directions/bake_notes/bake_notes.rb +0 -48
@@ -46,6 +46,17 @@ module Kitchen
46
46
  @config = config || Config.new
47
47
  @next_paste_count_for_id = {}
48
48
  @id_copy_suffix = '_copy_'
49
+
50
+ # Nokogiri by default only recognizes the namespaces on the root node. Collect all
51
+ # namespaces and add them manually.
52
+ return unless @config.enable_all_namespaces && raw.present?
53
+
54
+ raw.collect_namespaces.each do |namespace, url|
55
+ prefix, name = namespace.split(':')
56
+ next unless prefix == 'xmlns' && name.present?
57
+
58
+ raw.root.add_namespace_definition(name, url)
59
+ end
49
60
  end
50
61
 
51
62
  # Returns an enumerator that iterates over all children of this document
@@ -19,8 +19,14 @@ module Kitchen
19
19
  short_type: short_type)
20
20
  end
21
21
 
22
- # # @!method pages
23
- # # Returns a pages enumerator
24
- # def_delegators :as_enumerator, :pages, :chapters, :terms, :figures, :notes, :tables, :examples
22
+ # Returns true if this class represents the element for the given node; always false
23
+ # for this generic class
24
+ #
25
+ # @param node [Nokogiri::XML::Node] the underlying node
26
+ # @return [Boolean]
27
+ #
28
+ def self.is_the_element_class_for?(_node, **)
29
+ false
30
+ end
25
31
  end
26
32
  end
@@ -3,6 +3,7 @@
3
3
  require 'forwardable'
4
4
  require 'securerandom'
5
5
 
6
+ # rubocop:disable Metrics/ClassLength
6
7
  module Kitchen
7
8
  # Abstract base class for all elements. If you are looking for a simple concrete
8
9
  # element class, use `Element`.
@@ -92,6 +93,14 @@ module Kitchen
92
93
  # @return [Selectors::Base]
93
94
  def_delegators :config, :selectors
94
95
 
96
+ # @!method pantry
97
+ # Access the pantry for this element's document
98
+ # @return [Pantry]
99
+ # @!method :clipboard
100
+ # Access the clipboard for this element's document
101
+ # @return [Clipboard]
102
+ def_delegators :document, :pantry, :clipboard
103
+
95
104
  # Creates a new instance
96
105
  #
97
106
  # @param node [Nokogiri::XML::Node] the wrapped element
@@ -108,7 +117,9 @@ module Kitchen
108
117
 
109
118
  @enumerator_class = enumerator_class
110
119
 
111
- @short_type = short_type || "unknown_type_#{SecureRandom.hex(4)}"
120
+ @short_type = short_type ||
121
+ self.class.try(:short_type) ||
122
+ "unknown_type_#{SecureRandom.hex(4)}"
112
123
 
113
124
  @document =
114
125
  case document
@@ -123,14 +134,50 @@ module Kitchen
123
134
  @is_a_clone = false
124
135
  end
125
136
 
137
+ # Returns ElementBase descendent type or nil if none found
138
+ #
139
+ # @param type [Symbol] the descendant type, e.g. `:page`
140
+ # @return [Class] the child class for the given type
141
+ #
142
+ def self.descendant(type)
143
+ @types_to_descendants ||=
144
+ descendants.each_with_object({}) do |descendant, hash|
145
+ next unless descendant.try(:short_type)
146
+
147
+ hash[descendant.short_type] = descendant
148
+ end
149
+
150
+ @types_to_descendants[type]
151
+ end
152
+
153
+ # Returns ElementBase descendent type or Error if none found
154
+ #
155
+ # @param type [Symbol] the descendant type, e.g. `:page`
156
+ # @raise if the type is unknown
157
+ # @return [Class] the child class for the given type
158
+ #
159
+ def self.descendant!(type)
160
+ descendant(type) || raise("Unknown ElementBase descendant type '#{type}'")
161
+ end
162
+
163
+ # Returns true if this element is the given type
164
+ #
165
+ # @param type [Symbol] the descendant type, e.g. `:page`
166
+ # @raise if the type is unknown
167
+ # @return [Boolean]
168
+ #
169
+ def is?(type)
170
+ ElementBase.descendant!(type).is_the_element_class_for?(raw, config: config)
171
+ end
172
+
126
173
  # Returns true if this class represents the element for the given node
127
174
  #
128
175
  # @param node [Nokogiri::XML::Node] the underlying node
176
+ # @param config [Kitchen::Config]
129
177
  # @return [Boolean]
130
178
  #
131
- def self.is_the_element_class_for?(_node)
132
- # override this in subclasses
133
- false
179
+ def self.is_the_element_class_for?(node, config:)
180
+ Selector.named(short_type).matches?(node, config: config)
134
181
  end
135
182
 
136
183
  # Returns true if this element has the given class
@@ -383,7 +430,7 @@ module Kitchen
383
430
  block_error_if(block_given?)
384
431
 
385
432
  node.remove
386
- clipboard(to).add(self) if to.present?
433
+ get_clipboard(to).add(self) if to.present?
387
434
  self
388
435
  end
389
436
 
@@ -404,7 +451,7 @@ module Kitchen
404
451
 
405
452
  document.record_id_copied(node[:id])
406
453
  end
407
- clipboard(to).add(the_copy) if to.present?
454
+ get_clipboard(to).add(the_copy) if to.present?
408
455
  the_copy
409
456
  end
410
457
 
@@ -646,7 +693,8 @@ module Kitchen
646
693
  # @!method pages
647
694
  # Returns a pages enumerator
648
695
  def_delegators :as_enumerator, :pages, :chapters, :terms, :figures, :notes, :tables, :examples,
649
- :metadatas, :non_introduction_pages, :units, :titles, :exercises, :composite_pages
696
+ :metadatas, :non_introduction_pages, :units, :titles, :exercises, :references,
697
+ :composite_pages
650
698
 
651
699
  # Returns this element as an enumerator (over only one element, itself)
652
700
  #
@@ -671,10 +719,10 @@ module Kitchen
671
719
  # @param name_or_object [String, Clipboard] the name of the clipboard or the clipboard itself
672
720
  # @return [Clipboard]
673
721
  #
674
- def clipboard(name_or_object)
722
+ def get_clipboard(name_or_object)
675
723
  case name_or_object
676
724
  when Symbol
677
- document.clipboard(name: name_or_object)
725
+ clipboard(name: name_or_object)
678
726
  when Clipboard
679
727
  name_or_object
680
728
  else
@@ -688,7 +736,9 @@ module Kitchen
688
736
  # @param string [String] the string to clean
689
737
  def remove_default_namespaces_if_clone(string)
690
738
  if is_a_clone
691
- string.gsub('xmlns:default="http://www.w3.org/1999/xhtml"', '').gsub('default:', '')
739
+ string.gsub('xmlns:default="http://www.w3.org/1999/xhtml"', '')
740
+ .gsub('xmlns="http://www.w3.org/1999/xhtml"', '')
741
+ .gsub('default:', '')
692
742
  else
693
743
  string
694
744
  end
@@ -701,3 +751,4 @@ module Kitchen
701
751
 
702
752
  end
703
753
  end
754
+ # rubocop:enable Metrics/ClassLength
@@ -218,11 +218,19 @@ module Kitchen
218
218
  except: except)
219
219
  end
220
220
 
221
- # Returns an enumerator that iterates through exercises within the scope of this enumerator
221
+ # Returns an enumerator that iterates through references within the scope of this enumerator
222
222
  #
223
223
  # @param css_or_xpath [String] additional selectors to further narrow the element iterated over;
224
224
  # a "$" in this argument will be replaced with the default selector for the element being
225
225
  # iterated over.
226
+ #
227
+ def references(css_or_xpath=nil)
228
+ block_error_if(block_given?)
229
+ chain_to(ReferenceElementEnumerator, css_or_xpath: css_or_xpath)
230
+ end
231
+
232
+ # Returns an enumerator that iterates through exercises within the scope of this enumerator
233
+ #
226
234
  # @param only [Symbol, Callable] the name of a method to call on an element or a
227
235
  # lambda or proc that accepts an element; elements will only be included in the
228
236
  # search results if the method or callable returns true
@@ -12,8 +12,11 @@ module Kitchen
12
12
 
13
13
  # Creates a new instance
14
14
  #
15
- # @param default_css_or_xpath [String] The selectors to substitute for the "$" character
16
- # when this factory is used to build an enumerator.
15
+ # @param default_css_or_xpath [String, Proc, Symbol] The selectors to substitute for the "$" character
16
+ # when this factory is used to build an enumerator. A string argument is used literally. A proc
17
+ # is eventually called given the document's Config object (for accessing selectors). A symbol
18
+ # is interpreted as the name of a selector and is called on the document's Config object's
19
+ # selectors object. The easiest way to get a Proc is to pass `Selector.named(:name_of_selector)`
17
20
  # @param sub_element_class [ElementBase] The element class to use for what the enumerator finds.
18
21
  # @param enumerator_class [ElementEnumeratorBase] The enumerator class to return
19
22
  # @param detect_sub_element_class [Boolean] If true, infers the sub_element_class from the node
@@ -37,8 +40,6 @@ module Kitchen
37
40
  # given to the factory in its constructor.
38
41
  #
39
42
  def build_within(enumerator_or_element, search_query: SearchQuery.new)
40
- search_query.apply_default_css_or_xpath_and_normalize(default_css_or_xpath)
41
-
42
43
  case enumerator_or_element
43
44
  when ElementBase
44
45
  build_within_element(enumerator_or_element, search_query: search_query)
@@ -55,7 +56,7 @@ module Kitchen
55
56
  #
56
57
  def or_with(other_factory)
57
58
  self.class.new(
58
- default_css_or_xpath: "#{default_css_or_xpath}, #{other_factory.default_css_or_xpath}",
59
+ default_css_or_xpath: [default_css_or_xpath, other_factory.default_css_or_xpath],
59
60
  enumerator_class: TypeCastingElementEnumerator,
60
61
  detect_sub_element_class: true
61
62
  )
@@ -64,6 +65,9 @@ module Kitchen
64
65
  protected
65
66
 
66
67
  def build_within_element(element, search_query:)
68
+ search_query.apply_default_css_or_xpath_and_normalize(default_css_or_xpath,
69
+ config: element.config)
70
+
67
71
  enumerator_class.new(search_query: search_query) do |block|
68
72
  grand_ancestors = element.ancestors
69
73
  parent_ancestor = Ancestor.new(element)
@@ -25,7 +25,7 @@ module Kitchen
25
25
  element_class: nil,
26
26
  default_short_type: nil,
27
27
  detect_element_class: false)
28
- element_class ||= detect_element_class ? specific_element_class_for_node(node) : Element
28
+ element_class ||= detect_element_class ? find_element_class(node, document.config) : Element
29
29
 
30
30
  if element_class == Element
31
31
  element_class.new(node: node,
@@ -37,9 +37,9 @@ module Kitchen
37
37
  end
38
38
  end
39
39
 
40
- def self.specific_element_class_for_node(node)
40
+ def self.find_element_class(node, config)
41
41
  ELEMENT_CLASSES.find do |klass|
42
- klass.is_the_element_class_for?(node)
42
+ klass.is_the_element_class_for?(node, config: config)
43
43
  end || Element
44
44
  end
45
45
 
@@ -13,8 +13,14 @@ module Kitchen
13
13
  def initialize(node:, document: nil)
14
14
  super(node: node,
15
15
  document: document,
16
- enumerator_class: ExampleElementEnumerator,
17
- short_type: :example)
16
+ enumerator_class: ExampleElementEnumerator)
17
+ end
18
+
19
+ # Returns the short type
20
+ # @return [Symbol]
21
+ #
22
+ def self.short_type
23
+ :example
18
24
  end
19
25
 
20
26
  # Returns the an enumerator for titles.
@@ -25,14 +31,5 @@ module Kitchen
25
31
  search("span[data-type='title']")
26
32
  end
27
33
 
28
- # Returns true if this class represents the element for the given node
29
- #
30
- # @param node [Nokogiri::XML::Node] the underlying node
31
- # @return [Boolean]
32
- #
33
- def self.is_the_element_class_for?(node)
34
- node['data-type'] == 'example'
35
- end
36
-
37
34
  end
38
35
  end
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: "div[data-type='example']", # TODO: element.document.selectors.example
14
+ default_css_or_xpath: Selector.named(:example),
15
15
  sub_element_class: ExampleElement,
16
16
  enumerator_class: self
17
17
  )
@@ -13,17 +13,14 @@ module Kitchen
13
13
  def initialize(node:, document: nil)
14
14
  super(node: node,
15
15
  document: document,
16
- enumerator_class: ExerciseElementEnumerator,
17
- short_type: :exercise)
16
+ enumerator_class: ExerciseElementEnumerator)
18
17
  end
19
18
 
20
- # Returns true if this class represents the element for the given node
19
+ # Returns the short type
20
+ # @return [Symbol]
21
21
  #
22
- # @param node [Nokogiri::XML::Node] the underlying node
23
- # @return [Boolean]
24
- #
25
- def self.is_the_element_class_for?(node)
26
- node['data-type'] == 'exercise'
22
+ def self.short_type
23
+ :exercise
27
24
  end
28
25
 
29
26
  # Returns the enumerator for problem.
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: "div[data-type='exercise']", # TODO: element.document.selectors.exercise
14
+ default_css_or_xpath: Selector.named(:exercise),
15
15
  sub_element_class: ExerciseElement,
16
16
  enumerator_class: self
17
17
  )
@@ -13,8 +13,14 @@ module Kitchen
13
13
  def initialize(node:, document: nil)
14
14
  super(node: node,
15
15
  document: document,
16
- enumerator_class: FigureElementEnumerator,
17
- short_type: :figure)
16
+ enumerator_class: FigureElementEnumerator)
17
+ end
18
+
19
+ # Returns the short type
20
+ # @return [Symbol]
21
+ #
22
+ def self.short_type
23
+ :figure
18
24
  end
19
25
 
20
26
  # Returns the caption element
@@ -41,14 +47,5 @@ module Kitchen
41
47
  parent.name == 'figure'
42
48
  end
43
49
 
44
- # Returns true if this class represents the element for the given node
45
- #
46
- # @param node [Nokogiri::XML::Node] the underlying node
47
- # @return [Boolean]
48
- #
49
- def self.is_the_element_class_for?(node)
50
- node.name == 'figure'
51
- end
52
-
53
50
  end
54
51
  end
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: 'figure', # TODO: get from config?
14
+ default_css_or_xpath: Selector.named(:figure),
15
15
  sub_element_class: FigureElement,
16
16
  enumerator_class: self
17
17
  )
@@ -12,8 +12,14 @@ module Kitchen
12
12
  def initialize(node:, document: nil)
13
13
  super(node: node,
14
14
  document: document,
15
- enumerator_class: MetadataElementEnumerator,
16
- short_type: :metadata)
15
+ enumerator_class: MetadataElementEnumerator)
16
+ end
17
+
18
+ # Returns the short type
19
+ # @return [Symbol]
20
+ #
21
+ def self.short_type
22
+ :metadata
17
23
  end
18
24
 
19
25
  # Returns set of selected data elements
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: "div[data-type='metadata']",
14
+ default_css_or_xpath: Selector.named(:metadata),
15
15
  sub_element_class: MetadataElement,
16
16
  enumerator_class: self
17
17
  )
@@ -13,8 +13,14 @@ module Kitchen
13
13
  def initialize(node:, document: nil)
14
14
  super(node: node,
15
15
  document: document,
16
- enumerator_class: NoteElementEnumerator,
17
- short_type: :note)
16
+ enumerator_class: NoteElementEnumerator)
17
+ end
18
+
19
+ # Returns the short type
20
+ # @return [Symbol]
21
+ #
22
+ def self.short_type
23
+ :note
18
24
  end
19
25
 
20
26
  # Returns the note's title element
@@ -46,15 +52,6 @@ module Kitchen
46
52
  end
47
53
  end
48
54
 
49
- # Returns true if this class represents the element for the given node
50
- #
51
- # @param node [Nokogiri::XML::Node] the underlying node
52
- # @return [Boolean]
53
- #
54
- def self.is_the_element_class_for?(node)
55
- node['data-type'] == 'note'
56
- end
57
-
58
55
  protected
59
56
 
60
57
  def detected_note_title_key
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: "div[data-type='note']", # TODO: get from config?
14
+ default_css_or_xpath: Selector.named(:note),
15
15
  sub_element_class: NoteElement,
16
16
  enumerator_class: self
17
17
  )