Welcome to Magium

Welcome to Magium.

Magium is a Selenium-based testing solution that allows people who are on the spectrum of not-great to reasonably good testers to build really good tests.  But in order to do that there are a few philosophical points we need to dispense with.

Otherwise you will probably feel a little lost.

What is Magium?

Magium is a Selenium-based testing framework. What Magium boils down to is a series of enhanced Selenium calls and batching classes integrated with PHPUnit.

Another nutshell is that Magium turns many of the funtional API calls into design-level API calls. What that means is that it takes the Selenium functionality and adapts it to how a developer will work. It takes the what and adapts it to how.

Design Philosophy

SOLID principles have proven themselves over the course of the years when working with software development. With that in mind there are a lot of classes in the framework. But by having all those classes which have specific responsibilities (Single Responsibility) allows for easy modification of funtionality (Open/Closed & Lyskov). Then, because Magium uses a Dependency Injection Container (Dependency Inversion) you can easily modify small bits of functionality to handle your own customizations but retain much of the functionality.

Components

There are 6 primary components that Magium uses.

Themes

Themes are used to describe the frontend interaction with Magium. They contain things like the base URL, default category navigation, and, most importantly, Xpath definitions that many of the other components will use.

Navigators

Navigators are used to “go somewhere”, They should not cause changes to occur in the site. An example of a navigator is the category navigator which will navigate the taxonomy of a shopping cart. An example of a not-navigator is adding a product to your shopping cart.

Extractors

An extractor does just that; it extracts stuff from the page. Sometimes it will be text, sometimes it will be a large number of objects that represent items on the page, such as the order summary information from the checkout.

Identities

An identity is an object that represents an individual doing something on the site. They could, like the admin user, just have a username and password. Or they could, like a registered user, have the full billing and shipping information embedded in them. Many actions will use identities to do things.

Actions

Actions are when something needs to change on the site. One example is adding a product to the shopping cart. Oftentimes an action will use a theme, navigator, and extractor (and sometimes identities) to do its action.

Assertions

An assertion is a class that does assertions beyond what is available in the test case class.

Conclusion

The instructions for getting started with Magium are on the home page. On there we also have a 45 minute tutorial you can watch to see how things work.

Also, search on the bar on the top of the site. There are dozens and dozens of examples for you to work with and get to know Magium better.