mobile/android/base/tests/components/BaseComponent.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/tests/components/BaseComponent.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +package org.mozilla.gecko.tests.components;
     1.9 +
    1.10 +import org.mozilla.gecko.Actions;
    1.11 +import org.mozilla.gecko.tests.UITestContext;
    1.12 +
    1.13 +import android.app.Activity;
    1.14 +
    1.15 +import com.jayway.android.robotium.solo.Solo;
    1.16 +
    1.17 +/**
    1.18 + * A base class for constructing components - an abstraction over small bits of Firefox
    1.19 + * functionality. For example, the Toolbar or the about:home screen could be considered a
    1.20 + * component. Components should not need to know about each others existences and should be
    1.21 + * combined via helpers. Helpers can also handle a series of actions taken on one component
    1.22 + * (e.g. clicking the toolbar, entering a url, and waiting for page load).
    1.23 + */
    1.24 +public abstract class BaseComponent {
    1.25 +    protected final UITestContext mTestContext;
    1.26 +    protected final Activity mActivity;
    1.27 +    protected final Solo mSolo;
    1.28 +    protected final Actions mActions;
    1.29 +
    1.30 +    public BaseComponent(final UITestContext testContext) {
    1.31 +        mTestContext = testContext;
    1.32 +        mActivity = mTestContext.getActivity();
    1.33 +        mSolo = mTestContext.getSolo();
    1.34 +        mActions = mTestContext.getActions();
    1.35 +    }
    1.36 +}

mercurial