Bromium is a framework for running automated integration/end-to-end tests through the browser. It is especially effective for single page applications (SPA) and any front end that has a lot of dynamic stuff going on.
TODO
This defines an action named Click on login button
which translates to clicking the element with id login
. If for example
in another version we cannot locate the element by id, but by class, and leave the other actions unchanged, the configuration would look like this:
Now if we execute a test with the step Click on login button
, it would execute it correctly in any of the two versions.
This makes your end-to-end tests version-independent.
You can record integration tests by just performing actions in the browser. Note that the recorded tests are different
from most recorder tools, because they are on the abstract level you have defined - in the example above if you click on
the button with class login
in the second version, this would be recorded as Click on login button
, making it possible
to execute the step on other versions of your app out of the box.
Stable test execution - no more waits, polling, etc. needed. Bromium uses mutation observers to intelligently know the exact moment of when an action should be performed.
Get performance data for every run in HAR format and timestamps of the actions. If you are not familiar with HAR, it is basically a format for storing HTTP requests/responses with response times, body sizes, etc.
Execute tests either on your screen or in headless mode (invisible mode).
Very flexible architecture based on Guice
and dependency injection, easily extensible.
bromium init
to
have a wizard guide you through the process.bromium record
with the configuration created, execute the test case yourself. After the run, a json file with your
test case will be outputted.bromium replay
with the configuration and the test case from the previous step. This will output an execution report
consisting of performance data, timestamps of actions, result of the test, etc. If want to do this programmatically and
not from the terminal, you can use the ReplayBrowser
class and it's method replay
to get the same data.bromium update
for a
wizard to guide you through the process.bromium version
for a wizard to guide you through the process. You can now record on ne version and replay it on
any other version.Bromium uses Selenium under the hood, but it adds more features and makes it faster to develop, because we assume that you are using Selenium for application testing. Selenium does not include any synchronization logic, which makes tests flaky unless you implement wait-for logic to cater for timing differences
Bromium uses actual interaction with the browser and records every HTTP request as well as action timestamps (perceived speed), making it possible to measure more complicated scenarios that the ones possible with JMeter. JMeter is better for example for performance testing of REST APIs, while Bromium is more suitable for integration tests and UI performance tests.
Selenium IDE records test cases on an HTML level, not on your application level. If I click on an element, it would record
for example that the third div was clicked. Bromium would record that as an action in your application in the way you defined
it, for example Click the third row
, which would give you an executable test immediately after recording.
It works by putting a proxy between the browser and your server and injecting javascript code to listen for events. When an event is detected, the javascript sends HTTP request to the proxy and the event in registered in the Java code. The whole test case is written to a JSON file. By a given configuration for your application and a given test case, you can replay your test using any browser.