From bcb11b2a88201ef6365180b33703466bfee7d9c4 Mon Sep 17 00:00:00 2001 From: Kevin Jin Date: Tue, 17 Feb 2015 15:00:09 -0800 Subject: Add doc for UI test framework design principles Change-Id: I5b5bcbc46ef0d0540b871508d4803be6acf01740 --- .../droiddriver/helpers/BaseDroidDriverTest.java | 4 +- .../android/droiddriver/helpers/package-info.java | 111 +++++++++++++++++++++ 2 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 src/com/google/android/droiddriver/helpers/package-info.java diff --git a/src/com/google/android/droiddriver/helpers/BaseDroidDriverTest.java b/src/com/google/android/droiddriver/helpers/BaseDroidDriverTest.java index 48113fd..c1b523f 100644 --- a/src/com/google/android/droiddriver/helpers/BaseDroidDriverTest.java +++ b/src/com/google/android/droiddriver/helpers/BaseDroidDriverTest.java @@ -112,8 +112,8 @@ public abstract class BaseDroidDriverTest extends /** * Initializes test fixture once for all tests extending this class. This may have unexpected - * behavior - if multiple subclasses override this method, only the override is executed. The - * other overrides are silently ignored. You can either use {@link SingleRun} in {@link #setUp}, + * behavior - if multiple subclasses override this method, only the first override is executed. + * Other overrides are silently ignored. You can either use {@link SingleRun} in {@link #setUp}, * or override this method, which is a simpler alternative with the aforementioned catch. *

* If an InstrumentationDriver is used, this is a good place to call {@link diff --git a/src/com/google/android/droiddriver/helpers/package-info.java b/src/com/google/android/droiddriver/helpers/package-info.java new file mode 100644 index 0000000..0f5b6fd --- /dev/null +++ b/src/com/google/android/droiddriver/helpers/package-info.java @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2015 DroidDriver committers + * + * 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. + */ + +/** + * Helper classes for writing an Android UI test framework using DroidDriver. + * + *

UI test framework design principles

+ * + * A UI test framework should model the UI of the AUT in a hierarchical way to maximize code reuse. + * Common interactions should be abstracted as methods of page objects. Uncommon interactions may + * not be abstracted, but carried out using "driver" directly. + *

+ * The organization of the entities (pages, components) does not need to strictly follow the AUT + * structure. The UI model can be greatly simplified to make it easy to use. + *

+ * In general the framework should follow these principles: + *

+ * + *

Common pitfalls

+ * + */ +package com.google.android.droiddriver.helpers; -- cgit v1.2.3