File tree Expand file tree Collapse file tree
LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities
uiautomationutilities/src/main/java/com/microsoft/identity/client/ui/automation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ public interface ILabAccount {
5858 */
5959 String getHomeTenantId ();
6060
61+ /**
62+ * Get the guest tenant id of this account.
63+ *
64+ * @return a String representing the account's home tenant id
65+ */
66+ String getGuestTenantId ();
67+
6168 /**
6269 * Get the object id in home tenant.
6370 *
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ public class LabAccount implements ILabAccount {
5555 private final String mHomeObjectId ;
5656
5757 private final String mAssociatedClientId ;
58+ private final String mGuestTenantId ;
5859
5960 private final String mCloudUrl ;
6061
Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ public ILabAccount getAccountFromLabJsonStringInMobileBuildVault(UserType userTy
371371 .userType (userType )
372372 .homeTenantId (accountEntry .getHomeTenantId ())
373373 .homeObjectId (accountEntry .getHomeObjectId ())
374+ .guestTenantId (accountEntry .getGuestTenantId ())
374375 .associatedClientId (accountEntry .getAssociatedClientId ())
375376 .azureEnvironment (accountEntry .getAzureEnvironment ())
376377 .cloudUrl (accountEntry .getCloudUrl ())
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ public class LabJsonStringAccountEntry implements Serializable {
4848 @ SerializedName ("HomeTenantId" )
4949 private String homeTenantId ;
5050
51+ @ SerializedName ("GuestTenantId" )
52+ private String guestTenantId ;
53+
5154 @ SerializedName ("AssociatedClientId" )
5255 private String associatedClientId ;
5356
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ public class LabConstants {
2929 public static final String DEFAULT_LAB_SCOPE = "https://request.msidlab.com/.default" ;
3030 public static final String KEYVAULT_SCOPE = "https://vault.azure.net/.default" ;
3131 public static final String DEFAULT_LAB_CERT_ALIAS = "LabAuth.MSIDLab.com" ;
32- public static final String MSID_LAB3 = "https://login.microsoftonline.com/msidlab3 .com" ;
33- public static final String MSID_LAB4 = "https://login.microsoftonline.com/msidlab4 .com" ;
32+ public static final String ID4SLAB2 = "https://login.microsoftonline.com/id4slab2.onmicrosoft .com" ;
33+ public static final String ID4SLAB1 = "https://login.microsoftonline.com/id4slab1.onmicrosoft .com" ;
3434
3535 // TODO, REMOVE LEGACY UserTypes WHEN WE REMOVE LAB QUERY USAGE
3636 static final class UserType {
@@ -47,6 +47,7 @@ static final class UserType {
4747 public static final String USGOV = "usgov" ;
4848 public static final String USGOV_GUEST = "usgov_guest" ;
4949 public static final String CHINA = "china" ;
50+ public static final String CHINA_GUEST = "china_guest" ;
5051 public static final String QR_PIN = "qr_pin" ;
5152 public static final String TOKEN_BINDING = "token_binding" ;
5253 public static final String CBA = "cba" ;
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ public enum UserType {
3737 USGOV (LabConstants .UserType .USGOV ),
3838 USGOV_GUEST (LabConstants .UserType .USGOV_GUEST ),
3939 CHINA (LabConstants .UserType .CHINA ),
40+ CHINA_GUEST (LabConstants .UserType .CHINA_GUEST ),
4041 QR_PIN (LabConstants .UserType .QR_PIN ),
4142 TOKEN_BINDING (LabConstants .UserType .TOKEN_BINDING ),
4243 CBA (LabConstants .UserType .CBA ),
Original file line number Diff line number Diff line change 2424
2525import static androidx .test .platform .app .InstrumentationRegistry .getInstrumentation ;
2626
27+ import static com .microsoft .identity .client .ui .automation .utils .CommonUtils .FIND_UI_ELEMENT_TIMEOUT_SHORT ;
28+
2729import android .Manifest ;
2830import android .content .Context ;
2931import android .content .pm .PackageInfo ;
@@ -398,7 +400,7 @@ public void handleFirstRun() {
398400 // the skip button
399401 UiAutomatorUtils .handleButtonClick ("com.azure.authenticator:id/frx_skip_button" );
400402 // This is required for auth app as it has increased the compile sdk version to 34
401- UiAutomatorUtils .handleButtonClickForObjectWithTextSafely ("NOT NOW" );
403+ UiAutomatorUtils .handleButtonClickForObjectWithTextSafely ("NOT NOW" , FIND_UI_ELEMENT_TIMEOUT_SHORT );
402404 shouldHandleFirstRun = false ;
403405 }
404406 }
Original file line number Diff line number Diff line change @@ -550,6 +550,16 @@ public static void handleButtonClickForObjectWithTextSafely(@NonNull final Strin
550550 }
551551 }
552552
553+ public static void handleButtonClickForObjectWithTextSafely (@ NonNull final String text , final long existsTimeout ) {
554+ final UiObject button = obtainUiObjectWithText (text , existsTimeout );
555+
556+ try {
557+ button .click ();
558+ } catch (final UiObjectNotFoundException e ) {
559+ Logger .w (TAG , "Button with text \" " + text + "\" was not found: " + e .getMessage ());
560+ }
561+ }
562+
553563 /**
554564 * Clicks the button element that contains text matching the supplied regex
555565 */
You can’t perform that action at this time.
0 commit comments