Skip to content

Commit 7a4b22b

Browse files
committed
Add Native Auth to installed apps
1 parent 2dc5782 commit 7a4b22b

4 files changed

Lines changed: 59 additions & 2 deletions

File tree

LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/constants/LabConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static final class UserType {
6262
public static final String ONPREM = "onprem";
6363
public static final String GUEST = "guest";
6464
public static final String B2C = "b2c";
65+
public static final String CIAM = "ciam";
6566
}
6667

6768
static final class UserRole {

LabApiUtilities/src/main/com/microsoft/identity/labapi/utilities/constants/UserType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public enum UserType {
5252
CLOUD(LabConstants.UserType.CLOUD),
5353
B2C(LabConstants.UserType.B2C),
5454
GUEST(LabConstants.UserType.GUEST),
55-
ONPREM(LabConstants.UserType.ONPREM);
55+
ONPREM(LabConstants.UserType.ONPREM),
56+
CIAM(LabConstants.UserType.CIAM);
5657

5758
final String value;
5859

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// All rights reserved.
3+
//
4+
// This code is licensed under the MIT License.
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files(the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions :
12+
//
13+
// The above copyright notice and this permission notice shall be included in
14+
// all copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
// THE SOFTWARE.
23+
package com.microsoft.identity.client.ui.automation.app;
24+
25+
import com.microsoft.identity.client.ui.automation.installer.LocalApkInstaller;
26+
27+
import lombok.NonNull;
28+
29+
/**
30+
* A model for interacting with the NativeAuth Sample App during UI automation tests.
31+
*/
32+
public class NativeAuthSampleApp extends App {
33+
34+
public static final String NATIVE_AUTH_SAMPLE_PACKAGE_NAME = "com.azuresamples.msalnativeauthandroidkotlinsampleapp";
35+
public static final String NATIVE_AUTH_SAMPLE_APP_NAME = "NativeAuth Sample App";
36+
public static final String NATIVE_AUTH_SAMPLE_APK = "NativeAuthSampleApp.apk";
37+
38+
public NativeAuthSampleApp() {
39+
super(NATIVE_AUTH_SAMPLE_PACKAGE_NAME, NATIVE_AUTH_SAMPLE_APP_NAME, new LocalApkInstaller());
40+
localApkFileName = NATIVE_AUTH_SAMPLE_APK;
41+
localUpdateApkFileName = NATIVE_AUTH_SAMPLE_APK;
42+
}
43+
44+
@Override
45+
protected void initialiseAppImpl() {
46+
// No version-specific implementation needed for NativeAuthSampleApp
47+
}
48+
49+
@Override
50+
public void handleFirstRun() {
51+
// No first-run dialog to handle for NativeAuthSampleApp
52+
}
53+
}

uiautomationutilities/src/main/java/com/microsoft/identity/client/ui/automation/rules/CopyFileRule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.microsoft.identity.client.ui.automation.app.AzureSampleApp;
2828
import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp;
2929
import com.microsoft.identity.client.ui.automation.app.MsalTestApp;
30+
import com.microsoft.identity.client.ui.automation.app.NativeAuthSampleApp;
3031
import com.microsoft.identity.client.ui.automation.app.OneDriveApp;
3132
import com.microsoft.identity.client.ui.automation.app.OutlookApp;
3233
import com.microsoft.identity.client.ui.automation.app.TeamsApp;
@@ -75,7 +76,8 @@ public class CopyFileRule implements TestRule {
7576
OneAuthTestApp.ONEAUTH_TESTAPP_APK,
7677
OneAuthTestApp.OLD_ONEAUTH_TESTAPP_APK,
7778
MsalTestApp.MSAL_TEST_APP_APK,
78-
MsalTestApp.OLD_MSAL_TEST_APP_APK
79+
MsalTestApp.OLD_MSAL_TEST_APP_APK,
80+
NativeAuthSampleApp.NATIVE_AUTH_SAMPLE_APK
7981
};
8082

8183
public CopyFileRule() {

0 commit comments

Comments
 (0)