Open Castone22 opened 5 years ago
This is a very interesting concept so far. I'd like to discuss this further. What do you mean by "let particularly complex pages be extracted into a yaml file in some situations a lot more easily"
A Pattern like this
#~! pages/yaml_page.rb
class YamlPage < BasePage
include Oz::YamlLoadedPage
end
#~! yaml_page_elements.rb
:links:
:submit:
:id: 'submit-button'
:text_fields:
:first_name:
:id: 'first_name'
:last_name:
:id: 'last_name'
etc etc
Why? I don't see an advantage to this level of abstraction. You loose all ability to be dynamic this way and I don't see a good reason to do it.
Eh, just an idea. The core thing is really the replication reduction we would get from being able to bulk add
There is definitely something to that statement for sure. I think there are a couple ways we could potentially go about it (they are pretty much all variations similar to this). We should chat about this one over discord soon :)
I'm thinking on this a little bit but.. something like the following pattern might be somewhat more user friendly when defining a lot of the same element type
Implementation wouldn't be too hard and it reduces repetition as well as reduces cyclic complexity of some of the methods we write in our base pages, also would let particularly complex pages be extracted into a yaml file in some situations a lot more easily.