Skip to content

Commit e687f8a

Browse files
authored
April UI Maintenance: Take in common changes to mitigate firebase issues, other test improvements (#1814)
Common PR AzureAD/microsoft-authentication-library-common-for-android#2029 April UI Maintenance: Take in common changes to mitigate firebase issues, other test improvements Aside from common fix, added some retries to some inconsistent tests and had to ignore a couple tests that are failing at the moment due to something with the Lab account used (investigating them with Ryan now) Fixed a brokerapi test case that used brokerhost
1 parent 1ac9f7f commit e687f8a

File tree

7 files changed

+25
-16
lines changed

7 files changed

+25
-16
lines changed

msalautomationapp/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ if (project.hasProperty("distMsalVersion")) {
88

99
android {
1010

11+
packagingOptions {
12+
pickFirst 'META-INF/common4j.kotlin_module'
13+
}
14+
1115
compileOptions {
1216
// Flag to enable support for the new language APIs
1317
coreLibraryDesugaringEnabled true

msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/brokerapi/TestCase1561652.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.microsoft.identity.client.msal.automationapp.R;
2626
import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest;
2727
import com.microsoft.identity.client.ui.automation.annotations.LocalBrokerHostDebugUiTest;
28+
import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure;
2829
import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers;
2930
import com.microsoft.identity.client.ui.automation.broker.BrokerHost;
3031
import com.microsoft.identity.labapi.utilities.client.LabQuery;
@@ -36,6 +37,7 @@
3637
// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/1561652
3738
@SupportedBrokers(brokers = {BrokerHost.class})
3839
@LocalBrokerHostDebugUiTest
40+
@RetryOnFailure
3941
public class TestCase1561652 extends AbstractMsalBrokerTest {
4042
@Test
4143
public void test_1561652() {
@@ -47,6 +49,7 @@ public void test_1561652() {
4749
final String nonce = "testNonce";
4850
// Get SSO token and decode to confirm nonce
4951
final String ssoToken = ((BrokerHost) mBroker).acquireSSOToken(nonce);
52+
5053
((BrokerHost) mBroker).decodeSSOTokenAndVerifyNonce(ssoToken, nonce);
5154
}
5255

msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/brokerapi/TestCase1600567.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import com.microsoft.identity.client.msal.automationapp.R;
2828
import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest;
29+
import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure;
2930
import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers;
3031
import com.microsoft.identity.client.ui.automation.broker.BrokerHost;
3132
import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator;
@@ -39,48 +40,46 @@
3940
// Invoke each API from non-allowed apps. the request should be blocked.
4041
// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/1600567
4142
@SupportedBrokers(brokers = {BrokerMicrosoftAuthenticator.class})
43+
@RetryOnFailure
4244
public class TestCase1600567 extends AbstractMsalBrokerTest {
4345
@Test
4446
public void test_1600567() throws Throwable {
4547
final BrokerHost brokerHost = new BrokerHost();
4648
brokerHost.install();
4749
brokerHost.launch();
4850

51+
brokerHost.brokerApiFragment.launch();
4952
// verify getAccounts call gives calling app not verified
50-
UiAutomatorUtils.obtainChildInScrollable("Get Accounts");
51-
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/buttonGetAccounts");
53+
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/button_get_accounts");
5254
brokerHost.confirmCallingAppNotVerified();
5355

5456
// verify removeAccount call gives calling app not verified
5557
final UiObject usernameTxt = UiAutomatorUtils.obtainChildInScrollable("[email protected]");
5658
usernameTxt.setText("[email protected]");
5759
final UiObject removeAccount = UiAutomatorUtils.obtainUiObjectWithResourceId(
58-
"com.microsoft.identity.testuserapp:id/buttonRemoveAccount"
60+
"com.microsoft.identity.testuserapp:id/button_remove_account"
5961
);
6062
removeAccount.click();
6163
brokerHost.confirmCallingAppNotVerified();
6264

6365
// verify update BRT call gives calling app not verified
6466
// fill BRT
65-
final UiObject brokerRTTxt = UiAutomatorUtils.obtainChildInScrollable("Broker RT");
66-
brokerRTTxt.setText("5e0c0ce6-0f40-4738-b2d4-3d83a5a2b555");
67+
UiAutomatorUtils.handleInput("com.microsoft.identity.testuserapp:id/edit_text_broker_rt", "5e0c0ce6-0f40-4738-b2d4-3d83a5a2b555");
6768
// fill home authority
68-
final UiObject homeAuthorityTxt = UiAutomatorUtils.obtainChildInScrollable("Home Authority");
69-
homeAuthorityTxt.setText("https://login.microsoftonline.com/common");
69+
UiAutomatorUtils.handleInput("com.microsoft.identity.testuserapp:id/edit_text_home_authority", "https://login.microsoftonline.com/common");
7070
// click on update BRT
71-
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/buttonUpdateBRT");
71+
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/button_update_brt");
7272
brokerHost.confirmCallingAppNotVerified();
7373

74+
brokerHost.brokerFlightsFragment.launch();
7475
// verify setFlights call gives calling app not verified
75-
UiAutomatorUtils.obtainChildInScrollable("Update Flights");
76-
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/flightProvider_localStorage");
77-
UiAutomatorUtils.handleInput("com.microsoft.identity.testuserapp:id/editTextFlights", "{test : true}");
78-
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/setFlightsButton");
76+
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/flight_provider_local_storage");
77+
UiAutomatorUtils.handleInput("com.microsoft.identity.testuserapp:id/edit_text_flights", "{test : true}");
78+
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/button_set_flights");
7979
brokerHost.confirmCallingAppNotVerified();
8080

8181
// verify getFlights call gives calling app not verified
82-
final UiObject getFlightsBtn = UiAutomatorUtils.obtainChildInScrollable("Get Flights");
83-
getFlightsBtn.click();
82+
UiAutomatorUtils.handleButtonClick("com.microsoft.identity.testuserapp:id/button_get_flights");
8483
brokerHost.confirmCallingAppNotVerified();
8584
}
8685

msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/flw/TestCase833513.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void test_833513() throws MsalException, InterruptedException, LabApiExce
117117
.broker(mBroker)
118118
.prompt(PromptParameter.SELECT_ACCOUNT)
119119
.expectingBrokerAccountChooserActivity(false)
120-
.howWouldYouLikeToSignInExpected(true)
120+
.howWouldYouLikeToSignInExpected(false)
121121
.build();
122122

123123
AdfsPromptHandler adfsPromptHandler = new AdfsPromptHandler(promptHandlerParameters);

msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/mdm/TestCase833526.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.microsoft.identity.labapi.utilities.constants.ProtectionPolicy;
4444
import com.microsoft.identity.labapi.utilities.constants.TempUserType;
4545

46+
import org.junit.Ignore;
4647
import org.junit.Test;
4748

4849
import java.util.Arrays;

msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/usgov/TestCase938383.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.microsoft.identity.client.msal.automationapp.sdk.MsalSdk;
3232
import com.microsoft.identity.client.ui.automation.TestContext;
3333
import com.microsoft.identity.client.ui.automation.TokenRequestTimeout;
34+
import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure;
3435
import com.microsoft.identity.client.ui.automation.app.IApp;
3536
import com.microsoft.identity.client.ui.automation.interaction.OnInteractionRequired;
3637
import com.microsoft.identity.client.ui.automation.interaction.PromptHandlerParameters;
@@ -46,6 +47,7 @@
4647

4748
// [USGOV][MSAL-ONLY] Acquire token silent with unexpired RT with USGov authority
4849
// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/938383
50+
@RetryOnFailure
4951
public class TestCase938383 extends AbstractMsalUiTest {
5052

5153
@Test

0 commit comments

Comments
 (0)