premganz / SeleniumPageObjects

An implementation of the Page Object Pattern in Selenium along with a bunch of other features like KeyWords for oft used Webdriver calls, driver lifecycle management, effective logging and Test Script Templates
Other
2 stars 1 forks source link

Same tests to be run in different modes #43

Closed premganz closed 7 years ago

premganz commented 8 years ago

Tests are basically designed in the structure as performing operations on the website and passing domain messages and evaluating the state of both to be equal in the end. this presents a problem with the variety of the tests to be executed. What if i want to use different benchmark page instead of the one supplied by the domain model that listens to the domain messages. What if the benchmark page was yesterday's build application page. This can be sorted out by the ability to replace the module fetching the page (or in theory any other relevant module) inside the service hub, that had been injected to the script. This way a script can be made to dance differently. However, where can we change the modules, one point is the testRunnerTemplate. Here the script comes in to be executed along with the runner. Instead of statically coding the script library composition (using init method) we can also allow for a getKw(0 method on the script that can be modified before execution by the runner(?) or the RunnerTemplate.

Already the test can modify the runner(by using a different runner, in the init method) , the runner can modify the script based on startUp params (like testEnv). I think this is better than allowing the script (via the SimpleScriptMYP) to sense the runEnvironment like testEnv and modify itself.

It is for the runner to modify the environment services, such as domain page benchmark servers and url for the SUT. Hence the runner should be able to sense startUp params and modify script libraries. This is to be built. However, regarding retaining the control of the test itself on the runner, we can still have it, because the test is where we give ultimate control.

premganz commented 7 years ago

1.5.3