-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathStatusFragmentUITests.java
More file actions
52 lines (42 loc) · 2.34 KB
/
StatusFragmentUITests.java
File metadata and controls
52 lines (42 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.openxc.ui;
import android.test.suitebuilder.annotation.LargeTest;
import com.android21buttons.fragmenttestrule.FragmentTestRule;
import com.openxc.enabler.OpenXcEnablerActivity;
import com.openxcplatform.enabler.R;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.fragment.app.Fragment;
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner;
import androidx.test.rule.ActivityTestRule;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
@LargeTest
@RunWith(AndroidJUnit4ClassRunner.class)
public class StatusFragmentUITests {
@Rule
public FragmentTestRule<?, Fragment> mActivityTestRule = new FragmentTestRule<>(OpenXcEnablerActivity.class,Fragment.class);
@Test
public void check_elements_presence() {
onView(withText("SEARCH FOR BLUETOOTH VI")).check(matches(isDisplayed()));
onView(withText("DISCONNECT")).check(matches(isDisplayed()));
onView(withText("Active Connections")).check(matches(isDisplayed()));
onView(withText("Messages Received")).check(matches(isDisplayed()));
onView(withText("Bytes Per Second")).check(matches(isDisplayed()));
onView(withText("Messages Per Second")).check(matches(isDisplayed()));
onView(withText("Average Message Size")).check(matches(isDisplayed()));
onView(withText("VI Version")).check(matches(isDisplayed()));
onView(withText("VI Device ID")).check(matches(isDisplayed()));
onView(withText("VI Platform")).check(matches(isDisplayed()));
onView(withText("USB Dropped")).check(doesNotExist());
onView(withText("Bluetooth is disabled, can't search for devices")).check(doesNotExist());
onView(withText("Unable to enable Bluetooth vehicle interface")).check(doesNotExist());
onView(withText("Bluetooth needs to be enabled for search.")).check(doesNotExist());
onView(withText("No Trace File")).check(doesNotExist());
}
}