Ran
|
Files
48
|
Run time
0s
|
Badge
Embed ▾
README BADGES
|
push
github
Fix issue with non-has_one macros and duplicate element names What? ===== This introduces a test and change to address issues with non-has_one macros and elements that share the same name across different macro blocks. 5ef0fd2c0 introduced the notion of a class attribute `macro_registrar` on `PageEz::Page`. This attribute caches each element and corresponding construction strategy (e.g. dynamic vs static selectors) in order to determine how and when to run dynamic selectors. This solution did not account for initializing subclasses (run in `PageEz::Page.constructor_from_block`) with an empty registrar, which it should have; every layer of nesting should begin with an empty register since it operates as a new scope. By not starting with an empty register, naming collisions across nesting would result in erroneous behavior: ``` capybara-3.39.1/lib/capybara/selector/selector.rb:69: warning: Locator PageEz::HasOneResult:#<PageEz::HasOneResult:0x0000000109c5a940 @result=#<#<Class:0x00000001092cac90>:0x0000000109c50c10 @container=#<Capybara::Node::Element tag="div" path="/HTML/BODY[1]/MAIN[1]/SECTION[1]/UL[1]/LI[1]/DIV[1]">>> for selector :css must be an instance of String or Symbol. This will raise an error in a future version of Capybara. Called from: /Users/eebs/code/eebs/page_ez/lib/page_ez/has_one_result.rb:7 ``` Closes #35 Co-authored-by: Josh Clayton <joshua.clayton@gmail.com>
1110 of 1114 relevant lines covered (99.64%)
68.05 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|