Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OONI Run v2 #671

Merged
merged 100 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
997840c
[New Designs] Update OONI Run v1 UI to v2 (#626)
aanorbel Nov 24, 2023
0bf531c
[New Designs] Update Test overview to remove run button and implement…
aanorbel Nov 24, 2023
5aac551
[New Designs] Update Dashboard view to match new design (#631)
aanorbel Dec 5, 2023
706eef1
[New Designs] Update Chose websites view (#630)
aanorbel Dec 5, 2023
c0e47af
Merge branch 'master' of github.com:ooni/probe-android into dev/desig…
aanorbel Dec 6, 2023
7b8ec93
[New Designs] Update Run button from dashboard to display new flow fo…
aanorbel Dec 14, 2023
755f943
[New Designs] Update Preferences to conform to new designs (#633)
aanorbel Dec 14, 2023
366c5cf
Chore: Migrate dashboard and overview to descriptors (#637)
aanorbel Dec 18, 2023
e7390a6
Feat: Test overview preference for automated testing (#638)
aanorbel Dec 18, 2023
6f671bf
Merge branch 'master' of github.com:ooni/probe-android into dev/desig…
aanorbel Dec 18, 2023
06222fe
Merge branch 'dev/design-update' of github.com:ooni/probe-android int…
aanorbel Dec 18, 2023
4c5c67a
Updated Boradcast reciever to do nothing if key is null
aanorbel Dec 18, 2023
f2ba495
Merge branch 'fix/broadcast-reciever-failure-for-null-key' of github.…
aanorbel Dec 18, 2023
07869dc
Updates null checks and updates OverviewActivity
aanorbel Dec 18, 2023
6c0dd75
Merge branch 'master' of github.com:ooni/probe-android into dev/desig…
aanorbel Jan 15, 2024
b432281
fix: OONI cards not enabled by default. (#654)
aanorbel Jan 26, 2024
1493046
fix: https://github.com/ooni/probe/issues/2659#issuecomment-191227053…
aanorbel Feb 11, 2024
0060c85
Merge branches 'dev/design-update' and 'master' of github.com:ooni/pr…
aanorbel Feb 13, 2024
c459e1c
[New Designs] Implement add link flow (#642)
aanorbel Feb 16, 2024
0723c62
fix: Match result colors with descriptor theme color (#672)
aanorbel Feb 19, 2024
f81263c
Merge branch 'dev/design-update' of github.com:ooni/probe-android int…
aanorbel Feb 19, 2024
60db89f
Updated `ResultDetailActivity`
aanorbel Feb 19, 2024
00f9abb
Updated support for colors in test results fragment and add prefix wh…
aanorbel Feb 19, 2024
3e0238e
Updated Progress fragment and its position on dashboard.
aanorbel Feb 26, 2024
24f16bf
Merge pull request #676 from ooni/fix/dashboard-progress-indicator
aanorbel Feb 28, 2024
ce1e1da
Merge branch 'master' of github.com:ooni/probe-android into dev/desig…
aanorbel Mar 18, 2024
f4f11df
Merge branch 'dev/design-update' of github.com:ooni/probe-android int…
aanorbel Mar 18, 2024
09613d9
[New Designs] Implement Dashboard Link update loading and Review Upda…
aanorbel Mar 21, 2024
902dfbf
Revert "[New Designs] Implement Dashboard Link update loading and Rev…
aanorbel Mar 21, 2024
eafd4a6
feat: (OONI Run v2) Add Link uninstall warning (#699)
aanorbel Mar 21, 2024
b309db6
feat: (OONI Run v2) Web connectivity tests always appears selected, e…
aanorbel Mar 21, 2024
4949b3f
[New Designs] Implement Dashboard Link update loading and Review Upda…
aanorbel Mar 21, 2024
a93cccc
Updated tests
aanorbel Mar 21, 2024
e943572
Schedule workers only when Mainactivity is instantiated
aanorbel Mar 22, 2024
7c9876c
fix (OONI Run v2) : Hidden `ExpandableListView` section (#706)
aanorbel Mar 26, 2024
50448c9
feat (OONI Run v2): Change backend for fetching descriptors (#713)
aanorbel Apr 9, 2024
5b7a6e9
feat(OONI Run v2): Filter out expired tests when launching `RunTestsA…
aanorbel Apr 11, 2024
13ddead
feat (OONI Run v2): Add support for revisions. (#718)
aanorbel Apr 12, 2024
fdcbe62
feat(OONI Run v2): enable translation for properties supporting `*Intl`
aanorbel May 8, 2024
d112c90
chore:update call to fetch descriptor to handle errors better
aanorbel May 14, 2024
6263520
feat (OONI Run v2): Add support for updated badge (#727)
aanorbel May 20, 2024
2879a6e
feat: Refine updates changing the fetch interval and behaviour. (#736)
aanorbel May 22, 2024
782ffbd
fix: inconsitent text result and `ReviewDescriptorUpdatesActivity` te…
aanorbel May 23, 2024
cd63d92
fix: update `RunTestsExpandableListViewAdapter` event listenners to f…
aanorbel May 24, 2024
977e027
fix: Icon set discrepancy between web and mobile. (#737)
aanorbel May 24, 2024
6f13727
fix: npe for last run time
aanorbel May 24, 2024
d0b8841
feat: update `AutoUpdateDescriptorsWorker` callbacks
aanorbel May 27, 2024
d33a351
feat: update `OverviewActivity` UI (#738)
aanorbel May 27, 2024
ad71086
fix: install automatic updates in `ManualUpdateDescriptorsWorker` wih…
aanorbel May 28, 2024
8cd95a8
feat: add filter support for run v2 links (#747)
aanorbel May 30, 2024
ea4e68b
feat: Update the install screen so layout matches revised test overvi…
aanorbel Jun 5, 2024
e4f5333
fix: possible delay start for `WorkRequest` causing UI inconsistency …
aanorbel Jun 5, 2024
c0edae8
feat: add support for run v2 autorun (#759)
aanorbel Jun 13, 2024
484bfc6
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Jun 13, 2024
241afab
chore: update method call to set url
aanorbel Jun 13, 2024
4e631a1
fix: broken display for ooni run v1 due to icon change.
aanorbel Jun 17, 2024
f7cd7fc
chore: clear pending updates before fetching update
aanorbel Jun 20, 2024
983f908
fix: bug with estimated runtime and automated runs
aanorbel Jun 21, 2024
a195966
Merge branch 'dev/ooni-run-v2' of github.com:ooni/probe-android into …
aanorbel Jun 21, 2024
cd228a4
fix: update events for changing state of automatic update switch (#764)
aanorbel Jun 27, 2024
552e055
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Jul 5, 2024
ac9f103
fix: issues/2756 (#766)
aanorbel Jul 5, 2024
cc375d9
chore: replace checkbox with imageview as checkbox events a problematic
aanorbel Jul 10, 2024
d7c9ab5
Merge branches 'dev/ooni-run-v2' and 'master' of github.com:ooni/prob…
aanorbel Jul 12, 2024
9b59c20
feat: add see more to revisions view (#779)
aanorbel Jul 15, 2024
7f4e51e
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Jul 15, 2024
c13d05f
chore: update `nms` dashboard view
aanorbel Jul 15, 2024
8fe1177
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Jul 16, 2024
fdc7895
chore(tests): fix broken `AbstractSuiteTest`
aanorbel Jul 17, 2024
8fcf5f6
[NMS] Run v2 Support (#728)
aanorbel Jul 17, 2024
6e166ae
fix: failing run v2 ci (#787)
aanorbel Jul 18, 2024
1598bd9
fix: failing review screen
aanorbel Jul 18, 2024
df4873a
fix: possible npe when rerunning tests
aanorbel Jul 19, 2024
4a66878
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Jul 24, 2024
5f4017e
chore: update translation (#796)
aanorbel Aug 7, 2024
bca40ff
fix: updated tag alignment
aanorbel Aug 7, 2024
39111d8
fix: update state after review updates complete
aanorbel Aug 7, 2024
f4e6023
fix: update expired check to use expiration date
aanorbel Aug 9, 2024
5d48660
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Aug 13, 2024
a4d1457
update API base URL
aanorbel Aug 13, 2024
7bb2f96
chore: update nms translation
aanorbel Aug 13, 2024
4ef50f4
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Aug 13, 2024
8619313
feat: update selection items (#807)
aanorbel Aug 26, 2024
a6c04ff
Fix: No prompt to enable notifications (#778)
aanorbel Aug 27, 2024
b683b19
chore: add `openvpn` experiment to experimental card. (#811)
aanorbel Aug 27, 2024
5a94cb5
use default `RUN_V2_DOMAIN`
aanorbel Aug 27, 2024
1984190
correct preference bug
aanorbel Aug 27, 2024
229fc72
fix: update notification permission request
aanorbel Aug 28, 2024
ca320e7
chore: update translations
aanorbel Aug 30, 2024
cf8cce1
chore: update translations
aanorbel Aug 30, 2024
d75e48a
chore: update translations
aanorbel Sep 2, 2024
e32ac7e
mErge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Sep 2, 2024
14d4c9e
chore: revert notification prompt and add run id (#816)
aanorbel Sep 3, 2024
66c5dd8
Merge branch 'master' of github.com:ooni/probe-android into dev/ooni-…
aanorbel Sep 23, 2024
2ec805f
chore: move to prod domain
aanorbel Sep 23, 2024
e0c307b
chore: update backend to *.ooni.org
aanorbel Sep 24, 2024
a361002
chore: update app and prepare for beta release
aanorbel Sep 24, 2024
04f9d21
chore: update to `4.0.0`
aanorbel Oct 7, 2024
9a7140e
chore: update localization and added `km` (#833)
aanorbel Oct 11, 2024
156a3bb
chore: update version code
aanorbel Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ android {
applicationId 'org.openobservatory.ooniprobe'
minSdk libs.versions.minSdk.get().toInteger()
targetSdk libs.versions.targetSdk.get().toInteger()
versionName '3.9.0-beta'
versionCode 119
versionName '4.0.0'
versionCode 122
testInstrumentationRunner "org.openobservatory.ooniprobe.TestAndroidJUnitRunner"
buildConfigField 'String', 'OONI_API_BASE_URL', '"https://api.ooni.io/"'
buildConfigField 'String', 'OONI_API_BASE_URL', '"https://api.ooni.org"'
buildConfigField 'String', 'NOTIFICATION_SERVER', '"https://countly.ooni.io"'
buildConfigField 'String', 'OONI_RUN_DASHBOARD_URL', '"https://run.ooni.org"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe'
resValue "string", "APP_NAME", "OONI Probe"
resValue "string", "RUN_V2_DOMAIN", "run.ooni.org"
buildConfigField 'String', 'SOFTWARE_NAME', 'BASE_SOFTWARE_NAME+IS_DEBUG'
buildConfigField 'String', 'COUNTLY_KEY', '"146836f41172f9e3287cab6f2cc347de3f5ddf3b"'
buildConfigField "boolean", "RUN_AUTOMATION", "false"
Expand Down Expand Up @@ -120,6 +122,10 @@ android {
viewBinding = true
buildConfig = true
}
dataBinding {
enabled = true
enabledForTests = true
}
namespace 'org.openobservatory.ooniprobe'
}

Expand All @@ -136,6 +142,7 @@ dependencies {
implementation libs.androidx.preference
implementation libs.androidx.localbroadcastmanager
implementation libs.androidx.legacy.support.v4
implementation libs.androidx.work.runtime

// Google
implementation libs.google.material
Expand Down Expand Up @@ -177,7 +184,7 @@ dependencies {
// Unit Testing
testImplementation project(':shared-test')
testImplementation libs.junit4
testImplementation libs.androidx.core
testImplementation libs.androidx.test.core
testImplementation libs.androidx.runner
testImplementation libs.androidx.rules
testImplementation libs.mockito.core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
package org.openobservatory.ooniprobe.ui;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition;
import static androidx.test.espresso.intent.Intents.intending;
import static androidx.test.espresso.intent.matcher.IntentMatchers.anyIntent;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.openobservatory.ooniprobe.ui.utils.RecyclerViewMatcher.withRecyclerView;
import static org.openobservatory.ooniprobe.ui.utils.ViewMatchers.withIndex;

import android.app.Activity;
import android.app.Instrumentation;
import android.content.Intent;
import android.view.View;

import androidx.test.core.app.ActivityScenario;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.espresso.intent.Intents;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.adevinta.android.barista.rule.flaky.AllowFlaky;
import com.adevinta.android.barista.rule.flaky.FlakyTestRule;

import org.hamcrest.Matcher;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openobservatory.ooniprobe.AbstractTest;
import org.openobservatory.ooniprobe.R;
import org.openobservatory.ooniprobe.activity.MainActivity;
import org.openobservatory.ooniprobe.activity.RunningActivity;
import org.openobservatory.ooniprobe.fragment.ProgressFragment;

import io.bloco.faker.Faker;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition;
import static androidx.test.espresso.intent.Intents.intended;
import static androidx.test.espresso.intent.Intents.intending;
import static androidx.test.espresso.intent.matcher.ComponentNameMatchers.hasClassName;
import static androidx.test.espresso.intent.matcher.IntentMatchers.anyIntent;
import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.not;
import static org.openobservatory.ooniprobe.ui.utils.RecyclerViewMatcher.withRecyclerView;
import static org.openobservatory.ooniprobe.ui.utils.ViewMatchers.withIndex;

@RunWith(AndroidJUnit4.class)
public class MainActivityWebsitesTest extends AbstractTest {

Expand All @@ -50,6 +47,26 @@ public class MainActivityWebsitesTest extends AbstractTest {
@Rule
public FlakyTestRule flakyRule = new FlakyTestRule();

public static ViewAction clickChildViewWithId(final int id) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return null;
}

@Override
public String getDescription() {
return "Click on a child view with specified id.";
}

@Override
public void perform(UiController uiController, View view) {
View v = view.findViewById(id);
v.performClick();
}
};
}

@Test
@AllowFlaky(attempts = 3)
public void addCustomWebsiteTest() {
Expand All @@ -62,22 +79,17 @@ public void addCustomWebsiteTest() {

// Act
launchDashboard();
onView(withId(R.id.recycler))
.perform(scrollToPosition(0));
onView(withId(R.id.recycler)).perform(scrollToPosition(1));

onView(withRecyclerView(R.id.recycler)
.atPositionOnView(0, R.id.title))
.perform(click());
onView(withRecyclerView(R.id.recycler).atPositionOnView(1, R.id.title)).perform(click());

onView(withId(R.id.customUrl)).perform(click());

onView(withIndex(withId(R.id.editText), 0))
.perform(typeText(url1));
onView(withIndex(withId(R.id.editText), 0)).perform(typeText(url1));

onView(withId(R.id.add)).perform(click());

onView(withIndex(withId(R.id.editText), 1))
.perform(typeText(url2));
onView(withIndex(withId(R.id.editText), 1)).perform(typeText(url2));

// Assert
onView(withText(totalUrls)).check(matches(isDisplayed()));
Expand All @@ -90,32 +102,32 @@ public void deleteCustomWebsiteTest() {
Faker faker = new Faker();
String url1 = faker.internet.domainName() + faker.internet.domainSuffix();
String url2 = faker.internet.domainName() + faker.internet.domainSuffix();
String totalUrls = String.format(getResourceString(R.string.OONIRun_URLs), 1);
String totalUrls = String.format("Test %s URLs", 1);

// Act
launchDashboard();
onView(withId(R.id.recycler))
.perform(scrollToPosition(0));
onView(withId(R.id.recycler)).perform(scrollToPosition(1));

onView(withRecyclerView(R.id.recycler)
.atPositionOnView(0, R.id.title))
.perform(click());
onView(withRecyclerView(R.id.recycler).atPositionOnView(1, R.id.title)).perform(click());

onView(withId(R.id.customUrl)).perform(click());

onView(withIndex(withId(R.id.editText), 0))
.perform(typeText(url1));
onView(withIndex(withId(R.id.editText), 0)).perform(typeText(url1));

onView(withId(R.id.urlContainer)).perform(scrollToPosition(0));

onView(withIndex(withId(R.id.delete), 0))
.check(matches(not(isDisplayed())));
onView(withRecyclerView(R.id.urlContainer).atPositionOnView(0, R.id.delete)).check(matches(isDisplayed()));

onView(withId(R.id.add)).perform(click());

onView(withIndex(withId(R.id.editText), 1))
.perform(typeText(url2));
onView(withIndex(withId(R.id.editText), 1)).perform(typeText(url2));

onView(withIndex(withId(R.id.delete), 1))
.perform(click());
onView(withIndex(withId(R.id.delete), 1)).perform(click());

onView(withId(R.id.urlContainer)).perform(scrollToPosition(1));

// TODO: fix click action
onView(withRecyclerView(R.id.urlContainer).atPosition(1)).perform(RecyclerViewActions.actionOnItemAtPosition(1, clickChildViewWithId(R.id.delete)));

// Assert
onView(withText(totalUrls)).check(matches(isDisplayed()));
Expand All @@ -126,29 +138,18 @@ public void deleteCustomWebsiteTest() {
public void lunchCustomWebsiteIntentTest() {
// Act
launchDashboard();
onView(withId(R.id.recycler))
.perform(scrollToPosition(0));
onView(withId(R.id.recycler)).perform(scrollToPosition(1));

onView(withRecyclerView(R.id.recycler)
.atPositionOnView(0, R.id.title))
.perform(click());
onView(withRecyclerView(R.id.recycler).atPositionOnView(1, R.id.title)).perform(click());

onView(withId(R.id.customUrl)).perform(click());

Intents.init();

Intent emptyIntent = new Intent();
Instrumentation.ActivityResult result =
new Instrumentation.ActivityResult(Activity.RESULT_OK, emptyIntent);
Instrumentation.ActivityResult result = new Instrumentation.ActivityResult(Activity.RESULT_OK, emptyIntent);
intending(anyIntent()).respondWith(result);


onView(withId(R.id.runButton)).perform(click());
// TODO(aanorbel): resolve issue. Running activity no longer available.
// ```intended(hasComponent(hasClassName(RunningActivity.class.getName())));```
// progress display is dismissed before its availability is checked
// ```onView(withId(R.id.progress_layout)).check(matches(isDisplayed()));```

Intents.release();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ServiceTestRule;

import com.adevinta.android.barista.rule.flaky.AllowFlaky;
import com.adevinta.android.barista.rule.flaky.FlakyTestRule;

import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -17,12 +14,12 @@
import org.openobservatory.ooniprobe.AbstractTest;
import org.openobservatory.ooniprobe.activity.MainActivity;
import org.openobservatory.ooniprobe.activity.RunningActivity;
import org.openobservatory.ooniprobe.common.OONITests;
import org.openobservatory.ooniprobe.common.service.RunTestService;
import org.openobservatory.ooniprobe.engine.TestEngineInterface;
import org.openobservatory.ooniprobe.model.jsonresult.EventResult;
import org.openobservatory.ooniprobe.test.EngineProvider;
import org.openobservatory.ooniprobe.test.suite.AbstractSuite;
import org.openobservatory.ooniprobe.test.suite.InstantMessagingSuite;
import org.openobservatory.ooniprobe.utils.DatabaseUtils;

import java.util.ArrayList;
Expand All @@ -31,6 +28,9 @@
import static org.openobservatory.ooniprobe.testing.ActivityAssertions.assertCurrentActivity;
import static org.openobservatory.ooniprobe.testing.ActivityAssertions.waitForCurrentActivity;

import com.adevinta.android.barista.rule.flaky.AllowFlaky;
import com.adevinta.android.barista.rule.flaky.FlakyTestRule;

@RunWith(AndroidJUnit4.class)
public class RunningActivityTest extends AbstractTest {

Expand Down Expand Up @@ -87,7 +87,7 @@ private void startRunTestService() {
serviceRule.startService(
new Intent(c, RunTestService.class)
.putExtra("testSuites", new ArrayList<AbstractSuite>() {{
add(new InstantMessagingSuite());
add(OONITests.WEBSITES.toOONIDescriptor(c).getTest(c));
}})
);
} catch (TimeoutException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
package org.openobservatory.ooniprobe.ui.resultdetails;

import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.adevinta.android.barista.rule.flaky.AllowFlaky;
import com.adevinta.android.barista.rule.flaky.FlakyTestRule;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openobservatory.ooniprobe.R;
import org.openobservatory.ooniprobe.common.OONITests;
import org.openobservatory.ooniprobe.factory.ResultFactory;
import org.openobservatory.ooniprobe.model.database.Measurement;
import org.openobservatory.ooniprobe.model.database.Result;
import org.openobservatory.ooniprobe.test.suite.CircumventionSuite;
import org.openobservatory.ooniprobe.utils.FormattingUtils;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
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;
import static androidx.test.espresso.matcher.ViewMatchers.*;

import com.adevinta.android.barista.rule.flaky.AllowFlaky;
import com.adevinta.android.barista.rule.flaky.FlakyTestRule;

@RunWith(AndroidJUnit4.class)
public class CircumventionTest extends MeasurementAbstractTest {
Expand All @@ -32,7 +29,7 @@ public class CircumventionTest extends MeasurementAbstractTest {
@AllowFlaky(attempts = 3)
public void testHeaderData() {
// Arrange
Result testResult = ResultFactory.createAndSave(new CircumventionSuite(), 3, 0);
Result testResult = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 3, 0);

// Act
launchDetails(testResult.id);
Expand All @@ -44,7 +41,7 @@ public void testHeaderData() {
@Test
public void testSuccessPsiphon() {
// Arrange
Result testResult = ResultFactory.createAndSave(new CircumventionSuite(), 3, 0);
Result testResult = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 3, 0);
Measurement measurement = testResult.getMeasurement("psiphon");
String formattedBootstrap = FormattingUtils.formatBootstrap(measurement.getTestKeys().bootstrap_time);

Expand All @@ -61,7 +58,7 @@ public void testSuccessPsiphon() {
@Test
public void testBlockedPsiphon() {
// Arrange
Result testResult = ResultFactory.createAndSave(new CircumventionSuite(), 0, 3);
Result testResult = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 0, 3);
Measurement measurement = testResult.getMeasurement("psiphon");

// Act
Expand All @@ -77,7 +74,7 @@ public void testBlockedPsiphon() {
@Test
public void testSuccessTor() {
// Arrange
Result testResult = ResultFactory.createAndSave(new CircumventionSuite(), 3, 0);
Result testResult = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 3, 0);
Measurement measurement = testResult.getMeasurement("tor");

String formattedBridges = FormattingUtils.getFormattedBridges(measurement);
Expand All @@ -97,7 +94,7 @@ public void testSuccessTor() {
@Test
public void testBlockedTor() {
// Arrange
Result testResult = ResultFactory.createAndSave(new CircumventionSuite(), 0, 3);
Result testResult = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 0, 3);
Measurement measurement = testResult.getMeasurement("tor");

String formattedBridges = FormattingUtils.getFormattedBridges(measurement);
Expand Down
Loading
Loading