/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.apps.common.testing.ui.espresso;
import android.view.View;
import javax.annotation.Nullable;
/**
* Responsible for performing assertions on a View element.
*
* This is considered part of the test framework public API - developers are free to write their own * assertions as long as they meet the following requirements: *
* Strongly consider using a existing ViewAssertion via the ViewAssertions utility class before * writing your own assertion. */ public interface ViewAssertion { /** * Checks the state of the given view (if such a view is present). * * @param view the view, if one was found during the view interaction or null if it was not * (which may be an acceptable option for an assertion) * @param noViewFoundException an exception detailing why the view could not be found or null if * the view was found */ void check(@Nullable View view, @Nullable NoMatchingViewException noViewFoundException); }