Extend a base configuration context API

About this task

This procedure is followed by a detailed example with code that you can copy and paste into Studio to form a working context API extension.

Procedure

  1. Create new scenarios and feature files that specify new steps.
  2. Create a new step class that provides step methods for the new steps.
  3. Create a new context API interface.
    • It must extend the existing interface. (For example: AdminContext_Ext extends AdminContext)
    • It must define the new methods that are being added to the base configuration API.
  4. Create a new context API impl.
    • It must extend the existing impl. (For example: AdminContextImpl_Ext extends AdminContextImpl)
    • It must implement the new interface. (For example: implements AdminContext_Ext)
    • It must provide implementations for the new methods.
  5. Modify ContextFactory.
    • Add a new method that returns the extended context API. (For example: AdminContext_Ext).
  6. Modify ContextFactoryImpl.
    • Inject the extended context API. (For example: AdminContext_Ext).
    • Add a new override that returns the extended context API. (For example: AdminContext_Ext).
  7. Modify the RemoteSmokeTestHelperModule class.
    • Add code to bind the extended context API's interface to its impl.