[Ricky Bobby] Fix to the test - catbox_functional_network_palette
Test: Locally
Bug: 320989871
ABTD Links :
[Seahawk] :- Trunk Staging >>> https://android-build.corp.google.com/builds/abtd/run/L84900030001359404
[Seahawk] :- Trunk Food >>> https://android-build.corp.google.com/builds/abtd/run/L06700030001388527
[CF] :- Trunk Staging >>> https://android-build.corp.google.com/builds/abtd/run/L65100030001355972
[CF] :- Trunk Food >>> https://android-build.corp.google.com/builds/abtd/run/L29800030001359839
[RB] :- Trunk Staging >>> https://android-build.corp.google.com/builds/abtd/run/L98600030001370498
[RB] :- Trunk Food >>> https://android-build.corp.google.com/builds/abtd/run/L17900030001408123
gPaste Link for successful Execution of the test in RB,CF after Fix :https://paste.googleplex.com/6330553819725824
Change-Id: I7344435b73edb5502e40410cb9f46fdcc4eb9c17
diff --git a/libraries/app-helpers/interfaces/auto/src/android/platform/helpers/IAutoStatusBarHelper.java b/libraries/app-helpers/interfaces/auto/src/android/platform/helpers/IAutoStatusBarHelper.java
index d287334..7030d67 100644
--- a/libraries/app-helpers/interfaces/auto/src/android/platform/helpers/IAutoStatusBarHelper.java
+++ b/libraries/app-helpers/interfaces/auto/src/android/platform/helpers/IAutoStatusBarHelper.java
@@ -170,6 +170,13 @@
/**
* Setup expectations: Network & Internet
*
+ * <p>click on connected Wifi
+ */
+ void clickOnConnectedWifi();
+
+ /**
+ * Setup expectations: Network & Internet
+ *
* <p>click on forget button
*/
void forgetWifi();
diff --git a/libraries/automotive-helpers/auto-default-config/resources/assets/defaultSpectatioConfig.json b/libraries/automotive-helpers/auto-default-config/resources/assets/defaultSpectatioConfig.json
index 1625bca..de61a89 100644
--- a/libraries/automotive-helpers/auto-default-config/resources/assets/defaultSpectatioConfig.json
+++ b/libraries/automotive-helpers/auto-default-config/resources/assets/defaultSpectatioConfig.json
@@ -2049,19 +2049,13 @@
"VALUE": "qc_summary",
"PACKAGE": "com.android.systemui"
},
+ "CONNECTED_WIFI": {
+ "TYPE": "TEXT",
+ "VALUE": "Connected"
+ },
"FORGET_WIFI": {
- "TYPE": "MULTIPLE",
- "SPECIFIERS": [
- {
- "TYPE": "CLASS",
- "VALUE": "android.widget.ImageView"
- },
- {
- "TYPE": "RESOURCE_ID",
- "VALUE": "car_ui_secondary_action_concrete",
- "PACKAGE": "com.android.car.settings"
- }
- ]
+ "TYPE": "TEXT",
+ "VALUE": "Forget"
},
"NETWORK_PALETTE_WIFI": {
"TYPE": "MULTIPLE",
diff --git a/libraries/automotive-helpers/auto-default-config/src/android/platform/helpers/AutomotiveConfigConstants.java b/libraries/automotive-helpers/auto-default-config/src/android/platform/helpers/AutomotiveConfigConstants.java
index 3a8258e..a3ce29e 100644
--- a/libraries/automotive-helpers/auto-default-config/src/android/platform/helpers/AutomotiveConfigConstants.java
+++ b/libraries/automotive-helpers/auto-default-config/src/android/platform/helpers/AutomotiveConfigConstants.java
@@ -540,6 +540,7 @@
public static final String NETWORK_PALETTE_WIFI = "NETWORK_PALETTE_WIFI";
public static final String NETWORK_PALETTE_SUMMARY = "NETWORK_PALETTE_SUMMARY";
public static final String NETWORK_PALETTE_SWITCH_WIDGET = "NETWORK_PALETTE_SWITCH_WIDGET";
+ public static final String CONNECTED_WIFI = "CONNECTED_WIFI";
public static final String FORGET_WIFI = "FORGET_WIFI";
public static final String CLOCK_TIME = "CLOCK_TIME";
diff --git a/libraries/automotive-helpers/status-bar-helper/src/android/platform/helpers/StatusBarHelperImpl.java b/libraries/automotive-helpers/status-bar-helper/src/android/platform/helpers/StatusBarHelperImpl.java
index fd7dc15..6f95739 100644
--- a/libraries/automotive-helpers/status-bar-helper/src/android/platform/helpers/StatusBarHelperImpl.java
+++ b/libraries/automotive-helpers/status-bar-helper/src/android/platform/helpers/StatusBarHelperImpl.java
@@ -332,7 +332,17 @@
disabledMediaProfile, AutomotiveConfigConstants.DISABLED_MEDIA_PROFILE);
return disabledMediaProfile.isChecked();
}
-
+ /** {@inheritDoc} */
+ @Override
+ public void clickOnConnectedWifi() {
+ UiObject2 connectedObject =
+ getSpectatioUiUtil()
+ .findUiObject(
+ getUiElementFromConfig(AutomotiveConfigConstants.CONNECTED_WIFI));
+ getSpectatioUiUtil()
+ .validateUiObject(connectedObject, AutomotiveConfigConstants.CONNECTED_WIFI);
+ getSpectatioUiUtil().clickAndWait(connectedObject);
+ }
/** {@inheritDoc} */
@Override
public void forgetWifi() {
diff --git a/tests/automotive/functional/statusbar/src/android/platform/tests/NetworkPaletteTest.java b/tests/automotive/functional/statusbar/src/android/platform/tests/NetworkPaletteTest.java
index c6b7187..1d0f304 100644
--- a/tests/automotive/functional/statusbar/src/android/platform/tests/NetworkPaletteTest.java
+++ b/tests/automotive/functional/statusbar/src/android/platform/tests/NetworkPaletteTest.java
@@ -102,6 +102,7 @@
@Test
public void testNetworkAndinternetSettings() {
mSettingHelper.get().openMenuWith("Network & internet settings");
+ mStatusBarHelper.get().clickOnConnectedWifi();
mStatusBarHelper.get().forgetWifi();
openNetworkPalette();
// check if wifi and hostpot is enabled