While addign new features to 1.4.0 I started to get concerns that the code base was starting to become very monolithic, all the logic for Fitnium is contained with a single 5000+ class BaseFitniumFixture.java. Some of the new features are starting to add more complex logic to the code, I therefore started looking at options. This has led to a major refactor of the code base. Each suite of API Button, Attribute, Cookie, File etc all now exist in their own classes. BaseFitniumFixture is now pass through or proxy to these classes.
Fitnium being a DoFixture requires all the methods to be in one class but now have a structure like
class BaseFitniumFixture extends DoFixture {
:
public boolean isElementVisible ( String locator ) {
return FitniumElementAPI.isElementVisible ( this, locator );
}
}
class FitniumElementAPI extends FitniumAPI {
:
public boolean isElementVisible ( BaseFitniumFixture fixture, String locator ) {
// Convert any variables to values
// Apply Regular expression logic
// Real logic for checking element for visibility
}
}
This means I can now apply tests to whole suites of API and makes managing the code base much more easier as you don’t have to scroll up and down a 5000 line class for logic