Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

In this example, we are going to write a single test for a login form. The login form will be created as a custom MXML component. We will instantiate the component in the method marked with [Before] and wait until the creationComplete event fires before beginning our test. Our test will set the username and password. Once the values have been committed, we will simulate the login button click and wait for a custom login event to be broadcast. Once that event is received, we will check that the password matches what we entered.

...

*Create a setup() method and mark it with the [Before] metadata. This method will be called before each of your test methods. In addition, annotate the [Before] metadata with async and ui. The async annotation notifies the runner this test is waiting on an some asynchronous behavior. The ui metadata notifies the runner this test contains ui interaction that must be completed.

...

*Create a method named tearDown() and mark it with the [After] metadata to remove the LoginForm instance from the test environment and set its reference to null. Once again, annotate the metadata with async and ui.

...