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

Dev: Update OONI to use new Design System #636

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 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
0723c62
fix: Match result colors with descriptor theme color (#672)
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
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
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,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
Expand Up @@ -17,12 +17,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 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,22 @@
package org.openobservatory.ooniprobe.ui.resultdetails;

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

import com.schibsted.spain.barista.rule.flaky.AllowFlaky;
import com.schibsted.spain.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.*;

@RunWith(AndroidJUnit4.class)
public class CircumventionTest extends MeasurementAbstractTest {
Expand All @@ -32,7 +28,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 +40,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 +57,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 +73,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 +93,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
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
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.Result;
import org.openobservatory.ooniprobe.test.suite.InstantMessagingSuite;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
Expand All @@ -30,7 +30,7 @@ public class InstantMessagingTest extends MeasurementAbstractTest {
@AllowFlaky(attempts = 3)
public void testHeaderData() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite());
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));

// Act
launchDetails(testResult.id);
Expand All @@ -43,7 +43,7 @@ public void testHeaderData() {
@AllowFlaky(attempts = 2)
public void testSuccessWhatsApp() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite());
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));

// Act
launchDetails(testResult.id);
Expand All @@ -57,7 +57,7 @@ public void testSuccessWhatsApp() {
@Test
public void testBlockedWhatsApp() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite(), 0, 4);
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c), 0, 4);

// Act
launchDetails(testResult.id);
Expand All @@ -72,7 +72,7 @@ public void testBlockedWhatsApp() {
@Test
public void testSuccessTelegram() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite());
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));

// Act
launchDetails(testResult.id);
Expand All @@ -87,7 +87,7 @@ public void testSuccessTelegram() {
@Test
public void testBlockedTelegram() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite(), 0, 4);
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c), 0, 4);

// Act
launchDetails(testResult.id);
Expand All @@ -102,7 +102,7 @@ public void testBlockedTelegram() {
@Test
public void testSuccessFacebookMessenger() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite());
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));

// Act
launchDetails(testResult.id);
Expand All @@ -117,7 +117,7 @@ public void testSuccessFacebookMessenger() {
@Test
public void testBlockedFacebookMessenger() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite(), 0, 4);
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c), 0, 4);

// Act
launchDetails(testResult.id);
Expand All @@ -132,7 +132,7 @@ public void testBlockedFacebookMessenger() {
@Test
public void testSuccessSignal() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite());
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));

// Act
launchDetails(testResult.id);
Expand All @@ -146,7 +146,7 @@ public void testSuccessSignal() {
@Test
public void testBlockedSignal() {
// Arrange
Result testResult = ResultFactory.createAndSave(new InstantMessagingSuite(), 0, 4);
Result testResult = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c), 0, 4);

// Act
launchDetails(testResult.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
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.model.jsonresult.TestKeys;
import org.openobservatory.ooniprobe.test.suite.PerformanceSuite;
import org.openobservatory.ooniprobe.test.test.Dash;
import org.openobservatory.ooniprobe.test.test.HttpHeaderFieldManipulation;
import org.openobservatory.ooniprobe.test.test.HttpInvalidRequestLine;
Expand All @@ -43,7 +43,7 @@ public class PerformanceTest extends MeasurementAbstractTest {
@AllowFlaky(attempts = 3)
public void testHeaderData() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite());
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
Measurement dashMeasurement = testResult.getMeasurement(Dash.NAME);
String videoQuality = getResourceString(dashMeasurement.getTestKeys().getVideoQuality(false));

Expand Down Expand Up @@ -90,7 +90,7 @@ public void testHeaderData() {
@Test
public void testListOfMeasurements() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite());
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
Measurement dashMeasurement = testResult.getMeasurement(Dash.NAME);
String videoQuality = getResourceString(dashMeasurement.getTestKeys().getVideoQuality(true));
String notDetected = getResourceString(R.string.TestResults_Overview_MiddleBoxes_NotFound);
Expand Down Expand Up @@ -146,7 +146,7 @@ public void testListOfMeasurements() {
@Test
public void testNDT() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite());
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
Measurement ndtMeasurement = testResult.getMeasurement(Ndt.NAME);
Integer ndtProtocol = ndtMeasurement.getTestKeys().protocol;
TestKeys.Summary ndtSummary = ndtMeasurement.getTestKeys().summary;
Expand Down Expand Up @@ -192,7 +192,7 @@ public void testNDT() {
@Test
public void testStreaming() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite());
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
Measurement dashMeasurement = testResult.getMeasurement(Dash.NAME);
String videoQuality = getResourceString(dashMeasurement.getTestKeys().getVideoQuality(true));
String bitrateUnit = getResourceString(dashMeasurement.getTestKeys().getMedianBitrateUnit());
Expand All @@ -213,7 +213,7 @@ public void testStreaming() {
@Test
public void testRequestLine() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite());
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
Measurement invalidRequest = testResult.getMeasurement(HttpInvalidRequestLine.NAME);

// Act
Expand All @@ -228,7 +228,7 @@ public void testRequestLine() {
@Test
public void testRequestLineDetection() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite(), 2, 2);
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c), 2, 2);
Measurement invalidRequest = testResult.getMeasurement(HttpInvalidRequestLine.NAME);

// Act
Expand All @@ -243,7 +243,7 @@ public void testRequestLineDetection() {
@Test
public void testFieldManipulation() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite());
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
Measurement fieldManipulation = testResult.getMeasurement(HttpHeaderFieldManipulation.NAME);

// Act
Expand All @@ -258,7 +258,7 @@ public void testFieldManipulation() {
@Test
public void testFieldManipulationDetection() {
// Arrange
Result testResult = ResultFactory.createAndSave(new PerformanceSuite(), 2, 2);
Result testResult = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c), 2, 2);
Measurement fieldManipulation = testResult.getMeasurement(HttpHeaderFieldManipulation.NAME);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
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.Result;
import org.openobservatory.ooniprobe.model.jsonresult.TestKeys;
import org.openobservatory.ooniprobe.test.suite.CircumventionSuite;
import org.openobservatory.ooniprobe.test.suite.InstantMessagingSuite;
import org.openobservatory.ooniprobe.test.suite.PerformanceSuite;
import org.openobservatory.ooniprobe.test.suite.WebsitesSuite;
import org.openobservatory.ooniprobe.test.test.Dash;
import org.openobservatory.ooniprobe.test.test.Ndt;
import org.openobservatory.ooniprobe.utils.FormattingUtils;
Expand Down Expand Up @@ -49,10 +46,10 @@ public class TestResultsMainScreenTest extends MeasurementAbstractTest {
@AllowFlaky(attempts = 3)
public void testHeaderData() {
// Arrange
Result websites = ResultFactory.createAndSave(new WebsitesSuite());
Result messaging = ResultFactory.createAndSave(new InstantMessagingSuite());
Result circumvention = ResultFactory.createAndSave(new CircumventionSuite(), 1, 2);
Result performance = ResultFactory.createAndSave(new PerformanceSuite());
Result websites = ResultFactory.createAndSave(OONITests.WEBSITES.toOONIDescriptor(c));
Result messaging = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));
Result circumvention = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 1, 2);
Result performance = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));

long totalDownload = websites.data_usage_down +
messaging.data_usage_down +
Expand All @@ -78,19 +75,19 @@ public void testHeaderData() {
@AllowFlaky(attempts = 3)
public void testListOfResults() {
// Arrange
Result websites = ResultFactory.createAndSave(new WebsitesSuite());
Result websites = ResultFactory.createAndSave(OONITests.WEBSITES.toOONIDescriptor(c));
websites.start_time = getDateFrom(1, Calendar.JANUARY, 2020);
websites.save();

Result messaging = ResultFactory.createAndSave(new InstantMessagingSuite());
Result messaging = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));
messaging.start_time = getDateFrom(1, Calendar.FEBRUARY, 2020);
messaging.save();

Result circumvention = ResultFactory.createAndSave(new CircumventionSuite(), 1, 2);
Result circumvention = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 1, 2);
circumvention.start_time = getDateFrom(1, Calendar.MARCH, 2020);
circumvention.save();

Result performance = ResultFactory.createAndSave(new PerformanceSuite());
Result performance = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
performance.start_time = getDateFrom(1, Calendar.APRIL, 2020);
performance.save();

Expand Down Expand Up @@ -189,8 +186,8 @@ public void testListOfResults() {
@AllowFlaky(attempts = 3)
public void deleteResultsTest() {
// Arrange
ResultFactory.createAndSave(new WebsitesSuite());
ResultFactory.createAndSave(new PerformanceSuite());
ResultFactory.createAndSave(OONITests.WEBSITES.toOONIDescriptor(c));
ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));

// Act
launchResults();
Expand All @@ -208,19 +205,19 @@ public void deleteResultsTest() {
@AllowFlaky(attempts = 3)
public void filterTest() {
// Arrange
Result websites = ResultFactory.createAndSave(new WebsitesSuite());
Result websites = ResultFactory.createAndSave(OONITests.WEBSITES.toOONIDescriptor(c));
websites.start_time = getDateFrom(1, Calendar.JANUARY, 2020);
websites.save();

Result messaging = ResultFactory.createAndSave(new InstantMessagingSuite());
Result messaging = ResultFactory.createAndSave(OONITests.INSTANT_MESSAGING.toOONIDescriptor(c));
messaging.start_time = getDateFrom(1, Calendar.FEBRUARY, 2020);
messaging.save();

Result circumvention = ResultFactory.createAndSave(new CircumventionSuite(), 1, 2);
Result circumvention = ResultFactory.createAndSave(OONITests.CIRCUMVENTION.toOONIDescriptor(c), 1, 2);
circumvention.start_time = getDateFrom(1, Calendar.MARCH, 2020);
circumvention.save();

Result performance = ResultFactory.createAndSave(new PerformanceSuite());
Result performance = ResultFactory.createAndSave(OONITests.PERFORMANCE.toOONIDescriptor(c));
performance.start_time = getDateFrom(1, Calendar.APRIL, 2020);
performance.save();

Expand Down
Loading
Loading