OzFramework / oz

Oz is a behavioral web-ui testing framework developed to reduce test maintenance by using a predictive model rather than a scriptive model when writing tests.
Apache License 2.0
23 stars 7 forks source link

Allow manipulation of routes from within page objects #175

Closed Castone22 closed 5 years ago

Castone22 commented 5 years ago

It may be worthwhile to expose the routes variable in the proceed_to loop so that a page can dynamically set which page it will end up on based on application state.

Proposal would basically be to allow something like

some_element.on_fill do
  @world.routes.insert_route(SomePage)
end

or

def on_page_load
  @world.routes.insert_route(SomePage) if ledger.get_value(APreviousPage, :visit_some_page_checkbox).eql?('checked')
end

This is a natural progression from the proceed_to! solution, which does have several drawbacks

The reason i'm leaning towards this solution is that it, like most of oz, is declarative, and it continues to encapsulate the knowledge of where pages can route to inside of them.

PanoramicPanda commented 5 years ago

I like this idea a lot.

Castone22 commented 5 years ago

it's actually theoretically done, i'm just making sure it works and i'll persist it up later today.

Castone22 commented 5 years ago

Theoetically, this also in part falls under the jurisdiction of #41.