From af033829cd2bf982b672142fe37fd3ac785422fd Mon Sep 17 00:00:00 2001 From: yixilin Date: Mon, 31 Jul 2023 10:46:36 +0800 Subject: [PATCH 01/21] commit 17 LTW broker test cases --- .../msalonly/basic/TestCase2517374.java | 131 ++++++++++++++ .../msalonly/basic/TestCase2517381.java | 162 ++++++++++++++++++ .../msalonly/basic/TestCase2571345.java | 143 ++++++++++++++++ .../msalonly/basic/TestCase2571361.java | 149 ++++++++++++++++ .../msalonly/basic/TestCase2571508.java | 149 ++++++++++++++++ .../msalonly/basic/TestCase2571565.java | 143 ++++++++++++++++ .../msalonly/basic/TestCase2571580.java | 141 +++++++++++++++ .../msalonly/basic/TestCase2572249.java | 148 ++++++++++++++++ .../msalonly/basic/TestCase2572280.java | 118 +++++++++++++ .../msalonly/basic/TestCase2572283.java | 117 +++++++++++++ .../msalonly/basic/TestCase2572294.java | 122 +++++++++++++ .../msalonly/basic/TestCase2579095.java | 153 +++++++++++++++++ .../msalonly/basic/TestCase2584409.java | 122 +++++++++++++ .../msalonly/basic/TestCase2584410.java | 122 +++++++++++++ .../msalonly/basic/TestCase2584411.java | 133 ++++++++++++++ .../msalonly/basic/TestCase2584412.java | 122 +++++++++++++ .../msalonly/basic/TestCase2584414.java | 122 +++++++++++++ 17 files changed, 2297 insertions(+) create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571565.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571580.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572249.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java create mode 100644 msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java new file mode 100644 index 000000000..c2b179183 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import android.util.Log; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; +import org.junit.Assert; +import org.junit.Test; +import java.util.List; + +// Add a UI test on MsalTestApp +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2517374 +@LTWTests +@SupportedBrokers(brokers = {BrokerCompanyPortal.class}) +public class TestCase2517374 extends AbstractMsalBrokerTest { + + @Test + public void test_2517374 () throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + // acquire toke interactively and validate the token + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + // then acquire token silently and validate the token + msalTestApp.handleBackButton(); + String silentToken = msalTestApp.acquireTokenSilent(); + Assert.assertNotNull(silentToken); + + // finally get users and validate the users + msalTestApp.handleBackButton(); + List users = msalTestApp.getUsers(); + Assert.assertTrue(users.size() == 1); + + // select POP from auth scheme spinner + msalTestApp.handleBackButton(); + msalTestApp.selectFromAuthScheme("POP"); + String SHRToken = msalTestApp.generateSHR(); + Assert.assertTrue(SHRToken != null && !SHRToken.isEmpty()); + + // validate toast message when remove account + msalTestApp.handleBackButton(); + final String msg = msalTestApp.removeUser(); + Assert.assertEquals("The account is successfully removed.", msg); + } + + // if getLabQuery return null then will use getTempUserType to create account + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java new file mode 100644 index 000000000..29dc07ddb --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import android.text.TextUtils; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Add a UI testcase with update scenarios on OneAuthTest and MsalTest apps +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2517381 +@LTWTests +@SupportedBrokers(brokers = {BrokerCompanyPortal.class}) +public class TestCase2517381 extends AbstractMsalBrokerTest { + + @Test + public void test_2517381 () throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + // install old MsalTestApp then acquires token interactively and silently + MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.installOldApk(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal,true); + Assert.assertNotNull(token); + + // then acquire token silently and validate the token + msalTestApp.handleBackButton(); + String silentToken = msalTestApp.acquireTokenSilent(); + Assert.assertNotNull(silentToken); + + // install old OneAuthTestApp then acquires token interactively and silently + final OneAuthTestApp oneAuthApp = new OneAuthTestApp(); + oneAuthApp.installOldApk(); + oneAuthApp.launch(); + oneAuthApp.handleFirstRun(); + + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + oneAuthApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oneAuthApp.confirmAccount(username); + + // Hit back button to go on launch screen + oneAuthApp.handleBackButton(); + + final String silentTokenOneAuth = oneAuthApp.acquireTokenSilent(); + Assert.assertFalse(TextUtils.isEmpty(silentTokenOneAuth)); + oneAuthApp.assertSuccess(); + + // update msal test app + msalTestApp.update(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + // acquire token interactively and silently without prompting for creds + final String tokenAfterUpdatedMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); + Assert.assertNotNull(tokenAfterUpdatedMsal); + + msalTestApp.handleBackButton(); + final String silentTokenAfterUpdatedMsal = msalTestApp.acquireTokenSilent(); + Assert.assertNotNull(silentTokenAfterUpdatedMsal); + + // update oneauth test app + oneAuthApp.update(); + oneAuthApp.launch(); + + // acquire token without prompting for creds + final String tokenAfterUpdatedOneAuth = oneAuthApp.acquireTokenSilent(); + Assert.assertFalse(TextUtils.isEmpty(tokenAfterUpdatedOneAuth)); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java new file mode 100644 index 000000000..0aa12f0d6 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Samsung GA Coverage +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571345 +@LTWTests +public class TestCase2571345 extends AbstractMsalBrokerTest { + @Test + public void test_2571345() throws Throwable{ + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + // Install new LTW app + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + // Install new OneAuthTestApp + final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); + oneAuthTestApp.uninstall(); + oneAuthTestApp.install(); + oneAuthTestApp.launch(); + oneAuthTestApp.handleFirstRun(); + + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + // Click on sign in button, prompted to enter username and password + oneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oneAuthTestApp.confirmAccount(username); + + // Install new MsalTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(false) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + // Add login hint as the username and Click on AcquireToken button + // NOT prompted for credentials. + msalTestApp.handleUserNameInput(username); + final String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); + Assert.assertNotNull(token); + + // Click on "Get Active Broker Pkg Name" button + //The response msg should show LTW's pkg name + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java new file mode 100644 index 000000000..a36e2e750 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// If Company Portal is installed after LTW, user should still get SSO +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571361 +@LTWTests +public class TestCase2571361 extends AbstractMsalBrokerTest { + + @Test + public void test_2571361() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + // Install new LTW + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + // AcquireToken interactively on OneAuthTestApp + final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); + oneAuthTestApp.uninstall(); + oneAuthTestApp.install(); + oneAuthTestApp.launch(); + oneAuthTestApp.handleFirstRun(); + + final FirstPartyAppPromptHandlerParameters promptHandlerParameters = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + oneAuthTestApp.addFirstAccount(username, password, promptHandlerParameters); + oneAuthTestApp.confirmAccount(username); + + // Install new Company Portal + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + // Install new MsalTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(false) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + // Add login hint and click on acquireToken button + // will not be prompted to enter credentials + msalTestApp.handleUserNameInput(username); + final String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); + Assert.assertNotNull(token); + + // Click on "Get Active Broker Pkg Name" button + //The response msg should show LTW's pkg name + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java new file mode 100644 index 000000000..e419469b6 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// If LTW without broker is installed, updated MSAL should still get SSO +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571508 +@LTWTests +public class TestCase2571508 extends AbstractMsalBrokerTest { + @Test + public void test_2571508() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + // Install new Authenticator app + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + // Install old LTW + final BrokerLTW brokerLTW = new BrokerLTW(BrokerLTW.OLD_BROKER_LTW_APK, BrokerLTW.BROKER_LTW_APK); + brokerLTW.uninstall(); + brokerLTW.install(); + + // AcquireToken interactively on OneAuthTestApp + final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); + oneAuthTestApp.uninstall(); + oneAuthTestApp.install(); + oneAuthTestApp.launch(); + oneAuthTestApp.handleFirstRun(); + + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + // Click on sign in button, prompted to enter username and password + oneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oneAuthTestApp.confirmAccount(username); + + // Install new MSALTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(false) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + // Add login hint as the username and Click on AcquireToken button + // NOT prompted for credentials. + msalTestApp.handleUserNameInput(username); + final String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); + Assert.assertNotNull(token); + + // Click on "Get Active Broker Pkg Name" button + // return Authenticator app package name + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571565.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571565.java new file mode 100644 index 000000000..0f6a4f38e --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571565.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Uninstall scenario - with old Auth app new LTW +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571565 +@LTWTests +public class TestCase2571565 extends AbstractMsalBrokerTest { + + @Test + public void test_2571565() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + // Install legacy authenticator app + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(BrokerMicrosoftAuthenticator.OLD_AUTHENTICATOR_APK, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APK); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + // Install new LTW + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + // AcquireToken Interactively in MsalTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String tokenMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, true); + Assert.assertNotNull(tokenMsal); + + // Uninstall legacy authenticator app + brokerMicrosoftAuthenticator.uninstall(); + + // Install new oneAuthTestApp + final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); + oneAuthTestApp.uninstall(); + oneAuthTestApp.install(); + oneAuthTestApp.launch(); + oneAuthTestApp.handleFirstRun(); + + // AcquireToken Interactively in OneAuthTestApp, should prompt for password + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .passwordPageExpected(true) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + oneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oneAuthTestApp.confirmAccount(username); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571580.java new file mode 100644 index 000000000..6d6eee9ee --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571580.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Legacy auth app, updated LTW and uninstall LTW +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571580 +@LTWTests +public class TestCase2571580 extends AbstractMsalBrokerTest { + @Test + public void test_2571580() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + // Install legacy authenticator app + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(BrokerMicrosoftAuthenticator.OLD_AUTHENTICATOR_APK, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APK); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + // Install update LTW app + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + // AcquireToken Interactively in MsalTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String tokenMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, true); + Assert.assertNotNull(tokenMsal); + + // Uninstall LTW + brokerLTW.uninstall(); + + // Install updated OneAuthTestApp + final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); + oneAuthTestApp.uninstall(); + oneAuthTestApp.install(); + oneAuthTestApp.launch(); + oneAuthTestApp.handleFirstRun(); + + // AcquireToken Interactively in OneAuthTestApp, should not prompt for password + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + oneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oneAuthTestApp.confirmAccount(username); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572249.java new file mode 100644 index 000000000..ea32e84e4 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572249.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import android.text.TextUtils; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Updated LTW, Updated Auth app and uninstall LTW +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572249 +@LTWTests +public class TestCase2572249 extends AbstractMsalBrokerTest { + + @Test + public void test_2572249() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + // install updated LTW + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + // install updated auth app + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + // acquire token interactively in MsalTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String tokenMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, true); + Assert.assertNotNull(tokenMsal); + + // uninstall LTW + brokerLTW.uninstall(); + + // install OneAuthTestApp + final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); + oneAuthTestApp.uninstall(); + oneAuthTestApp.install(); + oneAuthTestApp.launch(); + oneAuthTestApp.handleFirstRun(); + + // sign in to OneAuthTestApp + // should not prompt for password + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .passwordPageExpected(false) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + + oneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oneAuthTestApp.confirmAccount(username); + } + + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java new file mode 100644 index 000000000..733da63a9 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// LTW has higher priority than CP +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572280 +@LTWTests +public class TestCase2572280 extends AbstractMsalBrokerTest { + + @Test + public void test_2572280() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME); + } + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java new file mode 100644 index 000000000..aecff5fd7 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// LTW has higher priority than CP - Case2 +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572283 +@LTWTests +public class TestCase2572283 extends AbstractMsalBrokerTest { + + @Test + public void test_2572283() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME); + } + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java new file mode 100644 index 000000000..1ed0cec75 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Authenticator has highest priority - Case1 (LTW, Auth, CP) +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572294 +@LTWTests +public class TestCase2572294 extends AbstractMsalBrokerTest { + @Test + public void test_2572294() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java new file mode 100644 index 000000000..c31520179 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; +import androidx.test.uiautomator.UiObjectNotFoundException; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Even Authenticator has the highest priority, if CP already has an artifact, CP will remain the broker. +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2579095 +@LTWTests +public class TestCase2579095 extends AbstractMsalBrokerTest { + + @Test + public void test_2579095() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + // install legacy company portal + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(BrokerCompanyPortal.OLD_COMPANY_PORTAL_APK, + BrokerCompanyPortal.COMPANY_PORTAL_APK); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + // install old OneAuthTestApp + final OneAuthTestApp oldOneAuthTestApp = new OneAuthTestApp(); + oldOneAuthTestApp.uninstall(); + oldOneAuthTestApp.installOldApk(); + oldOneAuthTestApp.launch(); + oldOneAuthTestApp.handleFirstRun(); + + // acquire token interactively on OneAuthTestApp + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + oldOneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oldOneAuthTestApp.confirmAccount(username); + + // install new Authenticator + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + // update Company Portal + brokerCompanyPortal.update(); + + // install new MsalTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + // acquire token interactively on MsalTestApp and should not get prompt + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(false) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + msalTestApp.handleUserNameInput(username); + String tokenMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); + Assert.assertNotNull(tokenMsal); + + // getPackageName on MsalTestApp and should be Company Portal + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(BrokerCompanyPortal.COMPANY_PORTAL_APP_PACKAGE_NAME, activeBroker); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java new file mode 100644 index 000000000..eb604d1bf --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Authenticator has highest priority - Case2 (LTW, CP, Auth) +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584409 +@LTWTests +public class TestCase2584409 extends AbstractMsalBrokerTest { + @Test + public void test_2584409() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java new file mode 100644 index 000000000..f75fe7395 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Authenticator has highest priority - Case3 (Auth, LTW, CP) +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584410 +@LTWTests +public class TestCase2584410 extends AbstractMsalBrokerTest { + @Test + public void test_2584410() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java new file mode 100644 index 000000000..6d70b7e7b --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.Prompt; +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.sdk.MsalAuthResult; +import com.microsoft.identity.client.msal.automationapp.sdk.MsalAuthTestParams; +import com.microsoft.identity.client.msal.automationapp.sdk.MsalSdk; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.TokenRequestTimeout; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.OnInteractionRequired; +import com.microsoft.identity.client.ui.automation.interaction.PromptHandlerParameters; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.UiResponse; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.AadPromptHandler; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.Arrays; + +// Authenticator has highest priority - Case4 (Auth, CP, LTW) +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584411 +@LTWTests +public class TestCase2584411 extends AbstractMsalBrokerTest { + @Test + public void test_2584411() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + } + + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java new file mode 100644 index 000000000..d1b146b78 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Authenticator has highest priority - Case5 (CP, Auth, LTW) +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584412 +@LTWTests +public class TestCase2584412 extends AbstractMsalBrokerTest { + + @Test + public void test_2584412() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + } + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java new file mode 100644 index 000000000..1c3fd4354 --- /dev/null +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; + +import androidx.test.uiautomator.UiObject; + +import com.microsoft.identity.client.msal.automationapp.R; +import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; +import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.app.MsalTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; +import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; +import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; +import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; +import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; +import com.microsoft.identity.labapi.utilities.client.LabQuery; +import com.microsoft.identity.labapi.utilities.constants.TempUserType; + +import org.junit.Assert; +import org.junit.Test; + +// Authenticator has highest priority - Case6 (CP, LTW, Auth) +// https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584414 +@LTWTests +public class TestCase2584414 extends AbstractMsalBrokerTest { + + @Test + public void test_2584414() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + mBroker.uninstall(); + + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); + brokerCompanyPortal.uninstall(); + brokerCompanyPortal.install(); + + final BrokerLTW brokerLTW = new BrokerLTW(); + brokerLTW.uninstall(); + brokerLTW.install(); + + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.uninstall(); + brokerMicrosoftAuthenticator.install(); + + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.uninstall(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + final MicrosoftStsPromptHandlerParameters promptHandlerParameters = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(true) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + Assert.assertNotNull(token); + + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getPackageName(); + Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + } + @Override + public LabQuery getLabQuery() { + return null; + } + + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } + + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } + + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } + + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } +} From aec7665fedee64e570aa8186457fbede5da193d5 Mon Sep 17 00:00:00 2001 From: yixilin Date: Tue, 1 Aug 2023 00:53:49 +0800 Subject: [PATCH 02/21] fixed typo of method name --- .../testpass/msalonly/basic/TestCase2571345.java | 2 +- .../testpass/msalonly/basic/TestCase2571361.java | 2 +- .../testpass/msalonly/basic/TestCase2571508.java | 2 +- .../testpass/msalonly/basic/TestCase2572280.java | 4 ++-- .../testpass/msalonly/basic/TestCase2572283.java | 4 ++-- .../testpass/msalonly/basic/TestCase2572294.java | 4 ++-- .../testpass/msalonly/basic/TestCase2579095.java | 2 +- .../testpass/msalonly/basic/TestCase2584409.java | 4 ++-- .../testpass/msalonly/basic/TestCase2584410.java | 4 ++-- .../testpass/msalonly/basic/TestCase2584411.java | 4 ++-- .../testpass/msalonly/basic/TestCase2584412.java | 4 ++-- .../testpass/msalonly/basic/TestCase2584414.java | 4 ++-- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java index 0aa12f0d6..47345b25e 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java @@ -112,7 +112,7 @@ public void test_2571345() throws Throwable{ // Click on "Get Active Broker Pkg Name" button //The response msg should show LTW's pkg name msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java index a36e2e750..beeccb46b 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java @@ -118,7 +118,7 @@ public void test_2571361() throws Throwable { // Click on "Get Active Broker Pkg Name" button //The response msg should show LTW's pkg name msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java index e419469b6..02f7049b2 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java @@ -118,7 +118,7 @@ public void test_2571508() throws Throwable { // Click on "Get Active Broker Pkg Name" button // return Authenticator app package name msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java index 733da63a9..18e249854 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java @@ -88,8 +88,8 @@ public void test_2572280() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java index aecff5fd7..428360153 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java @@ -87,8 +87,8 @@ public void test_2572283() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java index 1ed0cec75..6676e92bd 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java @@ -91,8 +91,8 @@ public void test_2572294() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java index c31520179..18502b2ed 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java @@ -122,7 +122,7 @@ public void test_2579095() throws Throwable { // getPackageName on MsalTestApp and should be Company Portal msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); Assert.assertEquals(BrokerCompanyPortal.COMPANY_PORTAL_APP_PACKAGE_NAME, activeBroker); } diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java index eb604d1bf..3c887eaaa 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java @@ -91,8 +91,8 @@ public void test_2584409() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java index f75fe7395..1105d9ceb 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java @@ -91,8 +91,8 @@ public void test_2584410() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java index 6d70b7e7b..ff984cb4d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java @@ -102,8 +102,8 @@ public void test_2584411() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java index d1b146b78..fe17c43f5 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java @@ -92,8 +92,8 @@ public void test_2584412() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java index 1c3fd4354..41a3b96b6 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java @@ -92,8 +92,8 @@ public void test_2584414() throws Throwable { Assert.assertNotNull(token); msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getPackageName(); - Assert.assertEquals(activeBroker, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { From 1bddad85d67c8ae7cce3535c5b1e663ccb4537f3 Mon Sep 17 00:00:00 2001 From: yixilin Date: Fri, 4 Aug 2023 17:19:41 +0800 Subject: [PATCH 03/21] fix assert expectation --- .../testpass/msalonly/basic/TestCase2571345.java | 4 +--- .../testpass/msalonly/basic/TestCase2571361.java | 4 +--- .../testpass/msalonly/basic/TestCase2571508.java | 4 +--- .../testpass/msalonly/basic/TestCase2572280.java | 5 +---- .../testpass/msalonly/basic/TestCase2572283.java | 4 +--- .../testpass/msalonly/basic/TestCase2572294.java | 4 +--- .../testpass/msalonly/basic/TestCase2579095.java | 5 +---- .../testpass/msalonly/basic/TestCase2584409.java | 4 +--- .../testpass/msalonly/basic/TestCase2584410.java | 4 +--- .../testpass/msalonly/basic/TestCase2584411.java | 15 +-------------- .../testpass/msalonly/basic/TestCase2584412.java | 4 +--- .../testpass/msalonly/basic/TestCase2584414.java | 4 +--- 12 files changed, 12 insertions(+), 49 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java index 47345b25e..2fd247342 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -113,7 +111,7 @@ public void test_2571345() throws Throwable{ //The response msg should show LTW's pkg name msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java index beeccb46b..8da795812 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -119,7 +117,7 @@ public void test_2571361() throws Throwable { //The response msg should show LTW's pkg name msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java index 02f7049b2..4be3fa84e 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -119,7 +117,7 @@ public void test_2571508() throws Throwable { // return Authenticator app package name msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java index 18e249854..eeb60f42c 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java @@ -22,15 +22,12 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; -import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; import com.microsoft.identity.labapi.utilities.client.LabQuery; @@ -89,7 +86,7 @@ public void test_2572280() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java index 428360153..fbef79aa5 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -88,7 +86,7 @@ public void test_2572283() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerLTW.BROKER_LTW_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java index 6676e92bd..00d255363 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -92,7 +90,7 @@ public void test_2572294() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java index 18502b2ed..3b0a322d5 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java @@ -22,9 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; -import androidx.test.uiautomator.UiObjectNotFoundException; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -123,7 +120,7 @@ public void test_2579095() throws Throwable { // getPackageName on MsalTestApp and should be Company Portal msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerCompanyPortal.COMPANY_PORTAL_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerCompanyPortal.COMPANY_PORTAL_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java index 3c887eaaa..c7e7a0018 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -92,7 +90,7 @@ public void test_2584409() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java index 1105d9ceb..3e8d5a434 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -92,7 +90,7 @@ public void test_2584410() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java index ff984cb4d..9e69db9a1 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java @@ -22,25 +22,14 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - -import com.microsoft.identity.client.Prompt; import com.microsoft.identity.client.msal.automationapp.R; -import com.microsoft.identity.client.msal.automationapp.sdk.MsalAuthResult; -import com.microsoft.identity.client.msal.automationapp.sdk.MsalAuthTestParams; -import com.microsoft.identity.client.msal.automationapp.sdk.MsalSdk; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; -import com.microsoft.identity.client.ui.automation.TokenRequestTimeout; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; -import com.microsoft.identity.client.ui.automation.interaction.OnInteractionRequired; -import com.microsoft.identity.client.ui.automation.interaction.PromptHandlerParameters; import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; -import com.microsoft.identity.client.ui.automation.interaction.UiResponse; -import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.AadPromptHandler; import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; import com.microsoft.identity.labapi.utilities.client.LabQuery; import com.microsoft.identity.labapi.utilities.constants.TempUserType; @@ -48,8 +37,6 @@ import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; - // Authenticator has highest priority - Case4 (Auth, CP, LTW) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584411 @LTWTests @@ -103,7 +90,7 @@ public void test_2584411() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java index fe17c43f5..e3d1ab01a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -93,7 +91,7 @@ public void test_2584412() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java index 41a3b96b6..670f7176a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -93,7 +91,7 @@ public void test_2584414() throws Throwable { msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals(BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } @Override public LabQuery getLabQuery() { From 7b464da91dfbb15d2563f7c71a98de78cb1f3081 Mon Sep 17 00:00:00 2001 From: yixilin Date: Tue, 8 Aug 2023 13:21:12 +0800 Subject: [PATCH 04/21] add annotation for cases that use oneauthtestapp --- .../testpass/msalonly/basic/TestCase2517381.java | 1 + .../testpass/msalonly/{basic => ltw}/TestCase2571345.java | 4 +++- .../testpass/msalonly/{basic => ltw}/TestCase2571361.java | 4 +++- .../testpass/msalonly/{basic => ltw}/TestCase2571508.java | 4 +++- .../testpass/msalonly/{basic => ltw}/TestCase2571565.java | 4 +++- .../testpass/msalonly/{basic => ltw}/TestCase2571580.java | 4 +++- .../testpass/msalonly/{basic => ltw}/TestCase2572249.java | 4 +++- .../testpass/msalonly/{basic => ltw}/TestCase2572280.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2572283.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2572294.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2579095.java | 4 +++- .../testpass/msalonly/{basic => ltw}/TestCase2584409.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2584410.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2584411.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2584412.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2584414.java | 2 +- 16 files changed, 30 insertions(+), 15 deletions(-) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2571345.java (98%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2571361.java (98%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2571508.java (98%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2571565.java (98%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2571580.java (98%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2572249.java (98%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2572280.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2572283.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2572294.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2579095.java (98%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2584409.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2584410.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2584411.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2584412.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2584414.java (99%) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java index 29dc07ddb..e275508a2 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java @@ -45,6 +45,7 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2517381 @LTWTests @SupportedBrokers(brokers = {BrokerCompanyPortal.class}) +@RunOnAPI29Minus public class TestCase2517381 extends AbstractMsalBrokerTest { @Test diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java similarity index 98% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java index 2fd247342..c741cee53 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java @@ -20,11 +20,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -40,6 +41,7 @@ // Samsung GA Coverage // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571345 @LTWTests +@RunOnAPI29Minus public class TestCase2571345 extends AbstractMsalBrokerTest { @Test public void test_2571345() throws Throwable{ diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java similarity index 98% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java index 8da795812..7be5ebda3 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571361.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java @@ -20,11 +20,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; @@ -41,6 +42,7 @@ // If Company Portal is installed after LTW, user should still get SSO // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571361 @LTWTests +@RunOnAPI29Minus public class TestCase2571361 extends AbstractMsalBrokerTest { @Test diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java similarity index 98% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java index 4be3fa84e..daab0d44b 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java @@ -20,11 +20,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -41,6 +42,7 @@ // If LTW without broker is installed, updated MSAL should still get SSO // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571508 @LTWTests +@RunOnAPI29Minus public class TestCase2571508 extends AbstractMsalBrokerTest { @Test public void test_2571508() throws Throwable { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571565.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java similarity index 98% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571565.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java index 0f6a4f38e..72537bfd8 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571565.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java @@ -20,11 +20,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -41,6 +42,7 @@ // Uninstall scenario - with old Auth app new LTW // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571565 @LTWTests +@RunOnAPI29Minus public class TestCase2571565 extends AbstractMsalBrokerTest { @Test diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java similarity index 98% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571580.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java index 6d6eee9ee..3cd0cfdfb 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java @@ -20,11 +20,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -41,6 +42,7 @@ // Legacy auth app, updated LTW and uninstall LTW // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571580 @LTWTests +@RunOnAPI29Minus public class TestCase2571580 extends AbstractMsalBrokerTest { @Test public void test_2571580() throws Throwable { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java similarity index 98% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572249.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java index ea32e84e4..f8af326c3 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java @@ -20,13 +20,14 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import android.text.TextUtils; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -43,6 +44,7 @@ // Updated LTW, Updated Auth app and uninstall LTW // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572249 @LTWTests +@RunOnAPI29Minus public class TestCase2572249 extends AbstractMsalBrokerTest { @Test diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java index eeb60f42c..b2c4472bd 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java index fbef79aa5..d8b552bd7 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572283.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java index 00d255363..a0be23188 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java similarity index 98% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java index 3b0a322d5..ff540c772 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java @@ -20,11 +20,12 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; @@ -41,6 +42,7 @@ // Even Authenticator has the highest priority, if CP already has an artifact, CP will remain the broker. // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2579095 @LTWTests +@RunOnAPI29Minus public class TestCase2579095 extends AbstractMsalBrokerTest { @Test diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java index c7e7a0018..a9ebfebf9 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584409.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java index 3e8d5a434..4c96e277b 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java index 9e69db9a1..8b0732e2b 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java index e3d1ab01a..83b88ecae 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584412.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java index 670f7176a..e974d23fe 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2584414.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; From 55c5c784aff7ff247bd6484bab36de93fb096ce4 Mon Sep 17 00:00:00 2001 From: yixilin Date: Tue, 8 Aug 2023 13:49:34 +0800 Subject: [PATCH 05/21] add supportedbrokers annotation and remove unneccessary broker installation and uninstallation --- .../testpass/msalonly/ltw/TestCase2571345.java | 10 +++------- .../testpass/msalonly/ltw/TestCase2571361.java | 9 ++------- .../testpass/msalonly/ltw/TestCase2571508.java | 7 ------- .../testpass/msalonly/ltw/TestCase2572249.java | 9 ++------- .../testpass/msalonly/ltw/TestCase2572280.java | 8 ++------ .../testpass/msalonly/ltw/TestCase2572283.java | 8 ++------ .../testpass/msalonly/ltw/TestCase2572294.java | 8 ++------ .../testpass/msalonly/ltw/TestCase2584409.java | 8 ++------ .../testpass/msalonly/ltw/TestCase2584410.java | 6 ------ .../testpass/msalonly/ltw/TestCase2584411.java | 6 ------ .../testpass/msalonly/ltw/TestCase2584412.java | 8 ++------ .../testpass/msalonly/ltw/TestCase2584414.java | 8 ++------ 12 files changed, 19 insertions(+), 76 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java index c741cee53..2de7e0ec7 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java @@ -26,8 +26,10 @@ import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; +import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; @@ -42,19 +44,13 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571345 @LTWTests @RunOnAPI29Minus +@SupportedBrokers(brokers = {BrokerLTW.class}) public class TestCase2571345 extends AbstractMsalBrokerTest { @Test public void test_2571345() throws Throwable{ final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - // Install new LTW app - final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); - brokerLTW.install(); - // Install new OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); oneAuthTestApp.uninstall(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java index 7be5ebda3..0a02ed4b7 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java @@ -26,6 +26,7 @@ import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; @@ -43,6 +44,7 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571361 @LTWTests @RunOnAPI29Minus +@SupportedBrokers(brokers = {BrokerLTW.class}) public class TestCase2571361 extends AbstractMsalBrokerTest { @Test @@ -50,13 +52,6 @@ public void test_2571361() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - // Install new LTW - final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); - brokerLTW.install(); - // AcquireToken interactively on OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); oneAuthTestApp.uninstall(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java index daab0d44b..18001240d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java @@ -49,13 +49,6 @@ public void test_2571508() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - // Install new Authenticator app - final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); - brokerMicrosoftAuthenticator.install(); - // Install old LTW final BrokerLTW brokerLTW = new BrokerLTW(BrokerLTW.OLD_BROKER_LTW_APK, BrokerLTW.BROKER_LTW_APK); brokerLTW.uninstall(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java index f8af326c3..82b8e61f3 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java @@ -28,6 +28,7 @@ import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -45,6 +46,7 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572249 @LTWTests @RunOnAPI29Minus +@SupportedBrokers(brokers = {BrokerLTW.class}) public class TestCase2572249 extends AbstractMsalBrokerTest { @Test @@ -52,13 +54,6 @@ public void test_2572249() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - // install updated LTW - final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); - brokerLTW.install(); - // install updated auth app final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); brokerMicrosoftAuthenticator.uninstall(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java index b2c4472bd..bade91ab4 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -39,6 +40,7 @@ // LTW has higher priority than CP // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572280 @LTWTests +@SupportedBrokers(brokers = {BrokerLTW.class}) public class TestCase2572280 extends AbstractMsalBrokerTest { @Test @@ -46,12 +48,6 @@ public void test_2572280() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); - brokerLTW.install(); - final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java index d8b552bd7..fd37a016d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -39,6 +40,7 @@ // LTW has higher priority than CP - Case2 // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572283 @LTWTests +@SupportedBrokers(brokers = {BrokerCompanyPortal.class}) public class TestCase2572283 extends AbstractMsalBrokerTest { @Test @@ -46,12 +48,6 @@ public void test_2572283() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); - brokerCompanyPortal.install(); - final BrokerLTW brokerLTW = new BrokerLTW(); brokerLTW.uninstall(); brokerLTW.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java index a0be23188..1caff19dd 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -40,18 +41,13 @@ // Authenticator has highest priority - Case1 (LTW, Auth, CP) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572294 @LTWTests +@SupportedBrokers(brokers = {BrokerLTW.class}) public class TestCase2572294 extends AbstractMsalBrokerTest { @Test public void test_2572294() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); - brokerLTW.install(); - final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java index a9ebfebf9..c4c49c16c 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -40,18 +41,13 @@ // Authenticator has highest priority - Case2 (LTW, CP, Auth) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584409 @LTWTests +@SupportedBrokers(brokers = {BrokerLTW.class}) public class TestCase2584409 extends AbstractMsalBrokerTest { @Test public void test_2584409() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); - brokerLTW.install(); - final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java index 4c96e277b..5af525434 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java @@ -46,12 +46,6 @@ public void test_2584410() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); - brokerMicrosoftAuthenticator.install(); - final BrokerLTW brokerLTW = new BrokerLTW(); brokerLTW.uninstall(); brokerLTW.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java index 8b0732e2b..0513f59a3 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java @@ -46,12 +46,6 @@ public void test_2584411() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); - brokerMicrosoftAuthenticator.install(); - final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java index 83b88ecae..ec34cd302 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -40,6 +41,7 @@ // Authenticator has highest priority - Case5 (CP, Auth, LTW) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584412 @LTWTests +@SupportedBrokers(brokers = {BrokerCompanyPortal.class}) public class TestCase2584412 extends AbstractMsalBrokerTest { @Test @@ -47,12 +49,6 @@ public void test_2584412() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); - brokerCompanyPortal.install(); - final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java index e974d23fe..7f47ed918 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -40,6 +41,7 @@ // Authenticator has highest priority - Case6 (CP, LTW, Auth) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584414 @LTWTests +@SupportedBrokers(brokers = {BrokerCompanyPortal.class}) public class TestCase2584414 extends AbstractMsalBrokerTest { @Test @@ -47,12 +49,6 @@ public void test_2584414() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); - mBroker.uninstall(); - - final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); - brokerCompanyPortal.install(); - final BrokerLTW brokerLTW = new BrokerLTW(); brokerLTW.uninstall(); brokerLTW.install(); From 3bff61eaa013fb1c46200a6e28c0297d3f26ef8d Mon Sep 17 00:00:00 2001 From: yixilin Date: Fri, 18 Aug 2023 17:30:38 +0800 Subject: [PATCH 06/21] remove msalTestApp.uninstall() --- .../automationapp/testpass/msalonly/basic/TestCase2517374.java | 1 - .../automationapp/testpass/msalonly/basic/TestCase2517381.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2571345.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2571361.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2571508.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2571565.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2571580.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2572249.java | 3 +-- .../automationapp/testpass/msalonly/ltw/TestCase2572280.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2572283.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2572294.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2579095.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2584409.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2584410.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2584411.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2584412.java | 1 - .../automationapp/testpass/msalonly/ltw/TestCase2584414.java | 1 - 17 files changed, 1 insertion(+), 18 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java index c2b179183..fdd3f6419 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java @@ -53,7 +53,6 @@ public void test_2517374 () throws Throwable { final String password = mLabAccount.getPassword(); MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java index e275508a2..65cb5d90a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java @@ -55,7 +55,6 @@ public void test_2517381 () throws Throwable { // install old MsalTestApp then acquires token interactively and silently MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.installOldApk(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java index 2de7e0ec7..e66abb0fd 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java @@ -75,7 +75,6 @@ public void test_2571345() throws Throwable{ // Install new MsalTestApp final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java index 0a02ed4b7..a394a6f7a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java @@ -80,7 +80,6 @@ public void test_2571361() throws Throwable { // Install new MsalTestApp final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java index 18001240d..350f4d280 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java @@ -78,7 +78,6 @@ public void test_2571508() throws Throwable { // Install new MSALTestApp final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java index 72537bfd8..fa9a4d08f 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java @@ -64,7 +64,6 @@ public void test_2571565() throws Throwable { // AcquireToken Interactively in MsalTestApp final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java index 3cd0cfdfb..342206c75 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java @@ -63,7 +63,6 @@ public void test_2571580() throws Throwable { // AcquireToken Interactively in MsalTestApp final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java index 82b8e61f3..b30cb549c 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java @@ -61,7 +61,6 @@ public void test_2572249() throws Throwable { // acquire token interactively in MsalTestApp final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); @@ -89,7 +88,7 @@ public void test_2572249() throws Throwable { Assert.assertNotNull(tokenMsal); // uninstall LTW - brokerLTW.uninstall(); + mBroker.uninstall(); // install OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java index bade91ab4..3d92e8489 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java @@ -53,7 +53,6 @@ public void test_2572280() throws Throwable { brokerCompanyPortal.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java index fd37a016d..18f018994 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java @@ -53,7 +53,6 @@ public void test_2572283() throws Throwable { brokerLTW.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java index 1caff19dd..2ff95b85a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java @@ -57,7 +57,6 @@ public void test_2572294() throws Throwable { brokerCompanyPortal.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java index ff540c772..a0606e07d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java @@ -90,7 +90,6 @@ public void test_2579095() throws Throwable { // install new MsalTestApp final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java index c4c49c16c..c302fd438 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java @@ -57,7 +57,6 @@ public void test_2584409() throws Throwable { brokerMicrosoftAuthenticator.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java index 5af525434..8e62ece49 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java @@ -55,7 +55,6 @@ public void test_2584410() throws Throwable { brokerCompanyPortal.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java index 0513f59a3..70b1a8371 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java @@ -55,7 +55,6 @@ public void test_2584411() throws Throwable { brokerLTW.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java index ec34cd302..c324ccd8b 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java @@ -58,7 +58,6 @@ public void test_2584412() throws Throwable { brokerLTW.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java index 7f47ed918..276f84fed 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java @@ -58,7 +58,6 @@ public void test_2584414() throws Throwable { brokerMicrosoftAuthenticator.install(); final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.uninstall(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); From b4842d4892bd96cb5918bb18af2fb64246181274 Mon Sep 17 00:00:00 2001 From: yixilin Date: Fri, 18 Aug 2023 17:48:31 +0800 Subject: [PATCH 07/21] move to package broker.ltw --- .../testpass/{msalonly => broker}/ltw/TestCase2571345.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2571361.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2571508.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2571565.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2571580.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2572249.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2572280.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2572283.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2572294.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2579095.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2584409.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2584410.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2584411.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2584412.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2584414.java | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2571345.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2571361.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2571508.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2571565.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2571580.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2572249.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2572280.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2572283.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2572294.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2579095.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2584409.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2584410.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2584411.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2584412.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2584414.java (99%) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java index e66abb0fd..bc0cbf48d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571361.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571361.java index a394a6f7a..c6fc05877 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571361.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571361.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java index 350f4d280..27d9fe58a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java index fa9a4d08f..c7b913d9b 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571565.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java index 342206c75..b97b52eba 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java index b30cb549c..1383b0f17 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import android.text.TextUtils; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java index 3d92e8489..a7ced8d2d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572283.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572283.java index 18f018994..66011249e 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572283.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572283.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java index 2ff95b85a..75f640af4 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java index a0606e07d..ff3e61d01 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584409.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584409.java index c302fd438..5ce6d7c73 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584409.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584409.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java index 8e62ece49..4d9ca7be5 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java index 70b1a8371..4f6755fd4 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584412.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584412.java index c324ccd8b..a42d93aa8 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584412.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584412.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584414.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584414.java index 276f84fed..a13aa21f0 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2584414.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584414.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; From d855b984b3d7abd665c6dcf94533b4752836ff49 Mon Sep 17 00:00:00 2001 From: yixilin Date: Fri, 18 Aug 2023 17:50:07 +0800 Subject: [PATCH 08/21] move ltw basic test case to package msalonly.ltw --- .../testpass/msalonly/{basic => ltw}/TestCase2517374.java | 2 +- .../testpass/msalonly/{basic => ltw}/TestCase2517381.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2517374.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/{basic => ltw}/TestCase2517381.java (99%) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java index fdd3f6419..03a54529c 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517374.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import android.util.Log; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java index 65cb5d90a..28907b855 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/basic/TestCase2517381.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.basic; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import android.text.TextUtils; From c0426982b72991cd6e2fb00da76f31c315881533 Mon Sep 17 00:00:00 2001 From: yixilin Date: Fri, 18 Aug 2023 17:52:25 +0800 Subject: [PATCH 09/21] revome unnecessary steps --- .../testpass/msalonly/ltw/TestCase2517374.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java index 03a54529c..c139c8e6d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java @@ -89,17 +89,6 @@ public void test_2517374 () throws Throwable { msalTestApp.handleBackButton(); List users = msalTestApp.getUsers(); Assert.assertTrue(users.size() == 1); - - // select POP from auth scheme spinner - msalTestApp.handleBackButton(); - msalTestApp.selectFromAuthScheme("POP"); - String SHRToken = msalTestApp.generateSHR(); - Assert.assertTrue(SHRToken != null && !SHRToken.isEmpty()); - - // validate toast message when remove account - msalTestApp.handleBackButton(); - final String msg = msalTestApp.removeUser(); - Assert.assertEquals("The account is successfully removed.", msg); } // if getLabQuery return null then will use getTempUserType to create account From 24674432b80828c0d0d634002a7b0cde42812ba5 Mon Sep 17 00:00:00 2001 From: yixilin Date: Sun, 20 Aug 2023 16:51:40 +0800 Subject: [PATCH 10/21] modify testcase2517374 --- .../testpass/msalonly/ltw/TestCase2517374.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java index c139c8e6d..0ae1f4a0a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java @@ -22,14 +22,9 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; -import android.util.Log; - -import androidx.test.uiautomator.UiObject; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; -import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; @@ -48,7 +43,7 @@ public class TestCase2517374 extends AbstractMsalBrokerTest { @Test - public void test_2517374 () throws Throwable { + public void test_2517374() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); @@ -88,7 +83,7 @@ public void test_2517374 () throws Throwable { // finally get users and validate the users msalTestApp.handleBackButton(); List users = msalTestApp.getUsers(); - Assert.assertTrue(users.size() == 1); + Assert.assertEquals(1, users.size()); } // if getLabQuery return null then will use getTempUserType to create account From 1abcf51e79d19f6889d5eaae8decf06de3f5ddc4 Mon Sep 17 00:00:00 2001 From: yixilin Date: Mon, 21 Aug 2023 16:40:36 +0800 Subject: [PATCH 11/21] remove unnecessary uninstall() --- .../automationapp/testpass/broker/ltw/TestCase2571345.java | 1 - .../automationapp/testpass/broker/ltw/TestCase2571361.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2571508.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2571565.java | 3 --- .../automationapp/testpass/broker/ltw/TestCase2571580.java | 3 --- .../automationapp/testpass/broker/ltw/TestCase2572249.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2572280.java | 1 - .../automationapp/testpass/broker/ltw/TestCase2572283.java | 1 - .../automationapp/testpass/broker/ltw/TestCase2572294.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2579095.java | 3 --- .../automationapp/testpass/broker/ltw/TestCase2584409.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2584410.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2584411.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2584412.java | 2 -- .../automationapp/testpass/broker/ltw/TestCase2584414.java | 2 -- 15 files changed, 30 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java index bc0cbf48d..13b5dc848 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java @@ -53,7 +53,6 @@ public void test_2571345() throws Throwable{ // Install new OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); - oneAuthTestApp.uninstall(); oneAuthTestApp.install(); oneAuthTestApp.launch(); oneAuthTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571361.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571361.java index c6fc05877..cea6c6717 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571361.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571361.java @@ -54,7 +54,6 @@ public void test_2571361() throws Throwable { // AcquireToken interactively on OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); - oneAuthTestApp.uninstall(); oneAuthTestApp.install(); oneAuthTestApp.launch(); oneAuthTestApp.handleFirstRun(); @@ -75,7 +74,6 @@ public void test_2571361() throws Throwable { // Install new Company Portal final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); // Install new MsalTestApp diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java index 27d9fe58a..5c4fc22e2 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java @@ -51,12 +51,10 @@ public void test_2571508() throws Throwable { // Install old LTW final BrokerLTW brokerLTW = new BrokerLTW(BrokerLTW.OLD_BROKER_LTW_APK, BrokerLTW.BROKER_LTW_APK); - brokerLTW.uninstall(); brokerLTW.install(); // AcquireToken interactively on OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); - oneAuthTestApp.uninstall(); oneAuthTestApp.install(); oneAuthTestApp.launch(); oneAuthTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java index c7b913d9b..9b3d63beb 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java @@ -54,12 +54,10 @@ public void test_2571565() throws Throwable { // Install legacy authenticator app final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(BrokerMicrosoftAuthenticator.OLD_AUTHENTICATOR_APK, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APK); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); // Install new LTW final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); brokerLTW.install(); // AcquireToken Interactively in MsalTestApp @@ -95,7 +93,6 @@ public void test_2571565() throws Throwable { // Install new oneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); - oneAuthTestApp.uninstall(); oneAuthTestApp.install(); oneAuthTestApp.launch(); oneAuthTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java index b97b52eba..753d53704 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java @@ -53,12 +53,10 @@ public void test_2571580() throws Throwable { // Install legacy authenticator app final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(BrokerMicrosoftAuthenticator.OLD_AUTHENTICATOR_APK, BrokerMicrosoftAuthenticator.AUTHENTICATOR_APK); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); // Install update LTW app final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); brokerLTW.install(); // AcquireToken Interactively in MsalTestApp @@ -94,7 +92,6 @@ public void test_2571580() throws Throwable { // Install updated OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); - oneAuthTestApp.uninstall(); oneAuthTestApp.install(); oneAuthTestApp.launch(); oneAuthTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java index 1383b0f17..3cfabdb45 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java @@ -56,7 +56,6 @@ public void test_2572249() throws Throwable { // install updated auth app final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); // acquire token interactively in MsalTestApp @@ -92,7 +91,6 @@ public void test_2572249() throws Throwable { // install OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); - oneAuthTestApp.uninstall(); oneAuthTestApp.install(); oneAuthTestApp.launch(); oneAuthTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java index a7ced8d2d..a70b28836 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java @@ -49,7 +49,6 @@ public void test_2572280() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); final MsalTestApp msalTestApp = new MsalTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572283.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572283.java index 66011249e..424414b56 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572283.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572283.java @@ -49,7 +49,6 @@ public void test_2572283() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); brokerLTW.install(); final MsalTestApp msalTestApp = new MsalTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java index 75f640af4..ca59aaffc 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java @@ -49,11 +49,9 @@ public void test_2572294() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); final MsalTestApp msalTestApp = new MsalTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java index ff3e61d01..cd52cd309 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java @@ -55,12 +55,10 @@ public void test_2579095() throws Throwable { // install legacy company portal final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(BrokerCompanyPortal.OLD_COMPANY_PORTAL_APK, BrokerCompanyPortal.COMPANY_PORTAL_APK); - brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); // install old OneAuthTestApp final OneAuthTestApp oldOneAuthTestApp = new OneAuthTestApp(); - oldOneAuthTestApp.uninstall(); oldOneAuthTestApp.installOldApk(); oldOneAuthTestApp.launch(); oldOneAuthTestApp.handleFirstRun(); @@ -82,7 +80,6 @@ public void test_2579095() throws Throwable { // install new Authenticator final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); // update Company Portal diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584409.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584409.java index 5ce6d7c73..55bafe6dc 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584409.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584409.java @@ -49,11 +49,9 @@ public void test_2584409() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); final MsalTestApp msalTestApp = new MsalTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java index 4d9ca7be5..a75ea5776 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java @@ -47,11 +47,9 @@ public void test_2584410() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); brokerLTW.install(); final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); final MsalTestApp msalTestApp = new MsalTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java index 4f6755fd4..a6268f1f6 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java @@ -47,11 +47,9 @@ public void test_2584411() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(); - brokerCompanyPortal.uninstall(); brokerCompanyPortal.install(); final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); brokerLTW.install(); final MsalTestApp msalTestApp = new MsalTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584412.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584412.java index a42d93aa8..d5415f22d 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584412.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584412.java @@ -50,11 +50,9 @@ public void test_2584412() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); brokerLTW.install(); final MsalTestApp msalTestApp = new MsalTestApp(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584414.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584414.java index a13aa21f0..484c02610 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584414.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584414.java @@ -50,11 +50,9 @@ public void test_2584414() throws Throwable { final String password = mLabAccount.getPassword(); final BrokerLTW brokerLTW = new BrokerLTW(); - brokerLTW.uninstall(); brokerLTW.install(); final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.uninstall(); brokerMicrosoftAuthenticator.install(); final MsalTestApp msalTestApp = new MsalTestApp(); From b6433de1c2a3c12f0c94e049c91cb8e389b5ce96 Mon Sep 17 00:00:00 2001 From: Yixi Lin Date: Thu, 24 Aug 2023 23:02:17 +0800 Subject: [PATCH 12/21] move test cases to ltw package under broker --- .../testpass/{msalonly => broker}/ltw/TestCase2517374.java | 2 +- .../testpass/{msalonly => broker}/ltw/TestCase2517381.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2517374.java (99%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{msalonly => broker}/ltw/TestCase2517381.java (99%) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517374.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517374.java index 0ae1f4a0a..5c6a4d53a 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517374.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517381.java similarity index 99% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517381.java index 28907b855..eaa852431 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517381.java @@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; import android.text.TextUtils; From 22390db3ec88200af5bf442ef1fe45e2245d031b Mon Sep 17 00:00:00 2001 From: yixilin Date: Tue, 29 Aug 2023 17:24:38 +0800 Subject: [PATCH 13/21] change sessionExpected to true --- .../msal/automationapp/testpass/broker/ltw/TestCase2571580.java | 2 +- .../msal/automationapp/testpass/broker/ltw/TestCase2572249.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java index 753d53704..0ba8fcf02 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java @@ -103,7 +103,7 @@ public void test_2571580() throws Throwable { .loginHint(username) .consentPageExpected(false) .speedBumpExpected(false) - .sessionExpected(false) + .sessionExpected(true) .expectingBrokerAccountChooserActivity(false) .expectingLoginPageAccountPicker(false) .enrollPageExpected(false) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java index 3cfabdb45..039adcd89 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java @@ -104,7 +104,7 @@ public void test_2572249() throws Throwable { .passwordPageExpected(false) .consentPageExpected(false) .speedBumpExpected(false) - .sessionExpected(false) + .sessionExpected(true) .expectingBrokerAccountChooserActivity(false) .expectingLoginPageAccountPicker(false) .enrollPageExpected(false) From 0d6ff31c5a3933037aaab993de77122112d630d9 Mon Sep 17 00:00:00 2001 From: yixilin Date: Tue, 29 Aug 2023 17:59:00 +0800 Subject: [PATCH 14/21] fix comments --- .../testpass/broker/ltw/TestCase2571580.java | 15 ++------------- .../testpass/broker/ltw/TestCase2572249.java | 17 ++--------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java index 0ba8fcf02..f5b49eac4 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java @@ -97,19 +97,8 @@ public void test_2571580() throws Throwable { oneAuthTestApp.handleFirstRun(); // AcquireToken Interactively in OneAuthTestApp, should not prompt for password - final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() - .broker(mBroker) - .prompt(PromptParameter.LOGIN) - .loginHint(username) - .consentPageExpected(false) - .speedBumpExpected(false) - .sessionExpected(true) - .expectingBrokerAccountChooserActivity(false) - .expectingLoginPageAccountPicker(false) - .enrollPageExpected(false) - .build(); - oneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); - oneAuthTestApp.confirmAccount(username); + oneAuthTestApp.handleUserNameInput(username); + oneAuthTestApp.handleSignInWithoutPrompt(); } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java index 039adcd89..33e21e5e5 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java @@ -97,21 +97,8 @@ public void test_2572249() throws Throwable { // sign in to OneAuthTestApp // should not prompt for password - final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() - .broker(mBroker) - .prompt(PromptParameter.LOGIN) - .loginHint(username) - .passwordPageExpected(false) - .consentPageExpected(false) - .speedBumpExpected(false) - .sessionExpected(true) - .expectingBrokerAccountChooserActivity(false) - .expectingLoginPageAccountPicker(false) - .enrollPageExpected(false) - .build(); - - oneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); - oneAuthTestApp.confirmAccount(username); + oneAuthTestApp.handleUserNameInput(username); + oneAuthTestApp.handleSignInWithoutPrompt(); } From 0be0b1fdc4990191a4cd1a616cb4495167af3a48 Mon Sep 17 00:00:00 2001 From: Yixi Lin Date: Tue, 29 Aug 2023 21:30:41 +0800 Subject: [PATCH 15/21] change testcase 2517374 and 2517381 to extends AbstractMsalUiTest class and also move them to msalonly.ltw package since they're not broker test cases --- .../ltw/TestCase2517374.java | 8 ++++---- .../ltw/TestCase2517381.java | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{broker => msalonly}/ltw/TestCase2517374.java (96%) rename msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/{broker => msalonly}/ltw/TestCase2517381.java (91%) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java similarity index 96% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517374.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java index 5c6a4d53a..6eac51450 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517374.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java @@ -20,8 +20,9 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; +import com.microsoft.identity.client.msal.automationapp.AbstractMsalUiTest; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -39,8 +40,7 @@ // Add a UI test on MsalTestApp // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2517374 @LTWTests -@SupportedBrokers(brokers = {BrokerCompanyPortal.class}) -public class TestCase2517374 extends AbstractMsalBrokerTest { +public class TestCase2517374 extends AbstractMsalUiTest { @Test public void test_2517374() throws Throwable { @@ -57,7 +57,7 @@ public void test_2517374() throws Throwable { .prompt(PromptParameter.SELECT_ACCOUNT) .loginHint(username) .sessionExpected(false) - .broker(mBroker) + .broker(null) .expectingBrokerAccountChooserActivity(false) .expectingProvidedAccountInBroker(false) .expectingLoginPageAccountPicker(false) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517381.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java similarity index 91% rename from msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517381.java rename to msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java index eaa852431..46758dac7 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2517381.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java @@ -20,10 +20,11 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; +package com.microsoft.identity.client.msal.automationapp.testpass.msalonly.ltw; import android.text.TextUtils; +import com.microsoft.identity.client.msal.automationapp.AbstractMsalUiTest; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -44,9 +45,8 @@ // Add a UI testcase with update scenarios on OneAuthTest and MsalTest apps // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2517381 @LTWTests -@SupportedBrokers(brokers = {BrokerCompanyPortal.class}) @RunOnAPI29Minus -public class TestCase2517381 extends AbstractMsalBrokerTest { +public class TestCase2517381 extends AbstractMsalUiTest { @Test public void test_2517381 () throws Throwable { @@ -63,7 +63,7 @@ public void test_2517381 () throws Throwable { .prompt(PromptParameter.SELECT_ACCOUNT) .loginHint(username) .sessionExpected(false) - .broker(mBroker) + .broker(null) .expectingBrokerAccountChooserActivity(false) .expectingProvidedAccountInBroker(false) .expectingLoginPageAccountPicker(false) @@ -93,7 +93,7 @@ public void test_2517381 () throws Throwable { oneAuthApp.handleFirstRun(); final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() - .broker(mBroker) + .broker(null) .prompt(PromptParameter.LOGIN) .loginHint(username) .consentPageExpected(false) @@ -119,6 +119,7 @@ public void test_2517381 () throws Throwable { msalTestApp.handleFirstRun(); // acquire token interactively and silently without prompting for creds + msalTestApp.handleUserNameInput(username); final String tokenAfterUpdatedMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); Assert.assertNotNull(tokenAfterUpdatedMsal); @@ -131,6 +132,14 @@ public void test_2517381 () throws Throwable { oneAuthApp.launch(); // acquire token without prompting for creds + oneAuthApp.handleUserNameInput(username); + oneAuthApp.selectFromAppConfiguration("com.microsoft.identity.LabsApi.Guest"); + oneAuthApp.handlePreferBrokerSwitchButton(); + oneAuthApp.handleSignInWithoutPrompt(); + + oneAuthApp.handleBackButton(); + + // acquire token silently without prompting for creds final String tokenAfterUpdatedOneAuth = oneAuthApp.acquireTokenSilent(); Assert.assertFalse(TextUtils.isEmpty(tokenAfterUpdatedOneAuth)); } From f17cf83185ffaa05aaec686773a9898e6e6860a2 Mon Sep 17 00:00:00 2001 From: Yixi Lin Date: Thu, 31 Aug 2023 22:54:34 +0800 Subject: [PATCH 16/21] add comment --- .../msal/automationapp/testpass/broker/ltw/TestCase2571565.java | 1 + 1 file changed, 1 insertion(+) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java index 9b3d63beb..9b0655cc6 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java @@ -50,6 +50,7 @@ public void test_2571565() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); + // To make sure the device is in clean slate, uninstall mBroker here. mBroker.uninstall(); // Install legacy authenticator app From c9c27f398915937a55cdfefc6f78d5099839a344 Mon Sep 17 00:00:00 2001 From: Yixi Lin Date: Tue, 5 Sep 2023 23:37:35 +0800 Subject: [PATCH 17/21] add supportbroker annotation for cases that install Authenticator first --- .../testpass/broker/ltw/TestCase2571508.java | 2 + .../testpass/broker/ltw/TestCase2571580.java | 1 + .../testpass/broker/ltw/TestCase2579095.java | 151 +++++++++--------- .../testpass/broker/ltw/TestCase2584410.java | 2 + .../testpass/broker/ltw/TestCase2584411.java | 2 + 5 files changed, 83 insertions(+), 75 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java index 5c4fc22e2..5c066b501 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java @@ -26,6 +26,7 @@ import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -43,6 +44,7 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571508 @LTWTests @RunOnAPI29Minus +@SupportedBrokers(brokers = {BrokerMicrosoftAuthenticator.class}) public class TestCase2571508 extends AbstractMsalBrokerTest { @Test public void test_2571508() throws Throwable { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java index f5b49eac4..df4a5a986 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java @@ -49,6 +49,7 @@ public void test_2571580() throws Throwable { final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); + // To make sure the device is in clean slate, uninstall mBroker here. mBroker.uninstall(); // Install legacy authenticator app diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java index cd52cd309..fab56da7b 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java @@ -45,81 +45,82 @@ @RunOnAPI29Minus public class TestCase2579095 extends AbstractMsalBrokerTest { - @Test - public void test_2579095() throws Throwable { - final String username = mLabAccount.getUsername(); - final String password = mLabAccount.getPassword(); - - mBroker.uninstall(); - - // install legacy company portal - final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(BrokerCompanyPortal.OLD_COMPANY_PORTAL_APK, - BrokerCompanyPortal.COMPANY_PORTAL_APK); - brokerCompanyPortal.install(); - - // install old OneAuthTestApp - final OneAuthTestApp oldOneAuthTestApp = new OneAuthTestApp(); - oldOneAuthTestApp.installOldApk(); - oldOneAuthTestApp.launch(); - oldOneAuthTestApp.handleFirstRun(); - - // acquire token interactively on OneAuthTestApp - final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() - .broker(mBroker) - .prompt(PromptParameter.LOGIN) - .loginHint(username) - .consentPageExpected(false) - .speedBumpExpected(false) - .sessionExpected(false) - .expectingBrokerAccountChooserActivity(false) - .expectingLoginPageAccountPicker(false) - .enrollPageExpected(false) - .build(); - oldOneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); - oldOneAuthTestApp.confirmAccount(username); - - // install new Authenticator - final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); - brokerMicrosoftAuthenticator.install(); - - // update Company Portal - brokerCompanyPortal.update(); - - // install new MsalTestApp - final MsalTestApp msalTestApp = new MsalTestApp(); - msalTestApp.install(); - msalTestApp.launch(); - msalTestApp.handleFirstRun(); - - // acquire token interactively on MsalTestApp and should not get prompt - final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() - .prompt(PromptParameter.SELECT_ACCOUNT) - .loginHint(username) - .sessionExpected(false) - .broker(mBroker) - .expectingBrokerAccountChooserActivity(false) - .expectingProvidedAccountInBroker(false) - .expectingLoginPageAccountPicker(false) - .expectingProvidedAccountInCookie(false) - .consentPageExpected(false) - .passwordPageExpected(false) - .speedBumpExpected(false) - .registerPageExpected(false) - .enrollPageExpected(false) - .staySignedInPageExpected(false) - .verifyYourIdentityPageExpected(false) - .howWouldYouLikeToSignInExpected(false) - .build(); - - msalTestApp.handleUserNameInput(username); - String tokenMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); - Assert.assertNotNull(tokenMsal); - - // getPackageName on MsalTestApp and should be Company Portal - msalTestApp.handleBackButton(); - final String activeBroker = msalTestApp.getActiveBrokerPackageName(); - Assert.assertEquals("Active broker pkg name : " + BrokerCompanyPortal.COMPANY_PORTAL_APP_PACKAGE_NAME, activeBroker); - } + @Test + public void test_2579095() throws Throwable { + final String username = mLabAccount.getUsername(); + final String password = mLabAccount.getPassword(); + + // To make sure the device is in clean slate, uninstall mBroker here. + mBroker.uninstall(); + + // install legacy company portal + final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(BrokerCompanyPortal.OLD_COMPANY_PORTAL_APK, + BrokerCompanyPortal.COMPANY_PORTAL_APK); + brokerCompanyPortal.install(); + + // install old OneAuthTestApp + final OneAuthTestApp oldOneAuthTestApp = new OneAuthTestApp(); + oldOneAuthTestApp.installOldApk(); + oldOneAuthTestApp.launch(); + oldOneAuthTestApp.handleFirstRun(); + + // acquire token interactively on OneAuthTestApp + final FirstPartyAppPromptHandlerParameters promptHandlerParametersOneAuth = FirstPartyAppPromptHandlerParameters.builder() + .broker(mBroker) + .prompt(PromptParameter.LOGIN) + .loginHint(username) + .consentPageExpected(false) + .speedBumpExpected(false) + .sessionExpected(false) + .expectingBrokerAccountChooserActivity(false) + .expectingLoginPageAccountPicker(false) + .enrollPageExpected(false) + .build(); + oldOneAuthTestApp.addFirstAccount(username, password, promptHandlerParametersOneAuth); + oldOneAuthTestApp.confirmAccount(username); + + // install new Authenticator + final BrokerMicrosoftAuthenticator brokerMicrosoftAuthenticator = new BrokerMicrosoftAuthenticator(); + brokerMicrosoftAuthenticator.install(); + + // update Company Portal + brokerCompanyPortal.update(); + + // install new MsalTestApp + final MsalTestApp msalTestApp = new MsalTestApp(); + msalTestApp.install(); + msalTestApp.launch(); + msalTestApp.handleFirstRun(); + + // acquire token interactively on MsalTestApp and should not get prompt + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() + .prompt(PromptParameter.SELECT_ACCOUNT) + .loginHint(username) + .sessionExpected(false) + .broker(mBroker) + .expectingBrokerAccountChooserActivity(false) + .expectingProvidedAccountInBroker(false) + .expectingLoginPageAccountPicker(false) + .expectingProvidedAccountInCookie(false) + .consentPageExpected(false) + .passwordPageExpected(false) + .speedBumpExpected(false) + .registerPageExpected(false) + .enrollPageExpected(false) + .staySignedInPageExpected(false) + .verifyYourIdentityPageExpected(false) + .howWouldYouLikeToSignInExpected(false) + .build(); + + msalTestApp.handleUserNameInput(username); + String tokenMsal = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); + Assert.assertNotNull(tokenMsal); + + // getPackageName on MsalTestApp and should be Company Portal + msalTestApp.handleBackButton(); + final String activeBroker = msalTestApp.getActiveBrokerPackageName(); + Assert.assertEquals("Active broker pkg name : " + BrokerCompanyPortal.COMPANY_PORTAL_APP_PACKAGE_NAME, activeBroker); + } @Override public LabQuery getLabQuery() { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java index a75ea5776..cc95267da 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -40,6 +41,7 @@ // Authenticator has highest priority - Case3 (Auth, LTW, CP) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584410 @LTWTests +@SupportedBrokers(brokers = {BrokerMicrosoftAuthenticator.class}) public class TestCase2584410 extends AbstractMsalBrokerTest { @Test public void test_2584410() throws Throwable { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java index a6268f1f6..0ecdbaa2c 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584411.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; @@ -40,6 +41,7 @@ // Authenticator has highest priority - Case4 (Auth, CP, LTW) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584411 @LTWTests +@SupportedBrokers(brokers = {BrokerMicrosoftAuthenticator.class}) public class TestCase2584411 extends AbstractMsalBrokerTest { @Test public void test_2584411() throws Throwable { From 54b63c4dadad50e0841d935ebb85280d6c40d246 Mon Sep 17 00:00:00 2001 From: Dean Xu Date: Fri, 22 Sep 2023 11:18:59 +0800 Subject: [PATCH 18/21] Handle browser first run in case 2517374&2517381 --- .../automationapp/testpass/msalonly/ltw/TestCase2517374.java | 2 +- .../automationapp/testpass/msalonly/ltw/TestCase2517381.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java index 6eac51450..1af987b7e 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517374.java @@ -72,7 +72,7 @@ public void test_2517374() throws Throwable { .howWouldYouLikeToSignInExpected(false) .build(); - String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, true); + String token = msalTestApp.acquireToken(username, password, promptHandlerParameters, mBrowser, true, true); Assert.assertNotNull(token); // then acquire token silently and validate the token diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java index 46758dac7..8cedd61ee 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/msalonly/ltw/TestCase2517381.java @@ -78,7 +78,7 @@ public void test_2517381 () throws Throwable { .howWouldYouLikeToSignInExpected(false) .build(); - String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal,true); + String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, mBrowser,true, true); Assert.assertNotNull(token); // then acquire token silently and validate the token From aa60490807847d8bb1991e54ab0f018e1aeed7b6 Mon Sep 17 00:00:00 2001 From: Dean Xu Date: Fri, 22 Sep 2023 11:20:20 +0800 Subject: [PATCH 19/21] update common for browser handle first run --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 1b77fe296..aa44c5c60 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 1b77fe2964cee8dd52122745848926961cdef67d +Subproject commit aa44c5c60a5cbcdccd72b80087ea711ce5ef0658 From 9b0e2896bf88c6dffa573080ee6671a8e901e2b9 Mon Sep 17 00:00:00 2001 From: Yixi Lin Date: Thu, 12 Oct 2023 15:57:02 +0800 Subject: [PATCH 20/21] revert common change --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index aa44c5c60..b54235828 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit aa44c5c60a5cbcdccd72b80087ea711ce5ef0658 +Subproject commit b54235828d20ba3fa88fe41a78062dac7f0e5851 From 5af863ba91c988ac6a8ce3c6cbc527423b384f6e Mon Sep 17 00:00:00 2001 From: Yixi Lin Date: Fri, 27 Oct 2023 15:22:52 +0800 Subject: [PATCH 21/21] update latest code --- .../testpass/broker/ltw/TestCase2571345.java | 3 +- .../testpass/broker/ltw/TestCase2571508.java | 21 +++++++--- .../testpass/broker/ltw/TestCase2571565.java | 2 + .../testpass/broker/ltw/TestCase2571580.java | 1 - .../testpass/broker/ltw/TestCase2572249.java | 3 -- .../testpass/broker/ltw/TestCase2572280.java | 2 + .../testpass/broker/ltw/TestCase2572294.java | 40 +++++++++---------- .../testpass/broker/ltw/TestCase2579095.java | 4 +- .../testpass/broker/ltw/TestCase2584410.java | 2 + 9 files changed, 46 insertions(+), 32 deletions(-) diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java index 13b5dc848..6c4505eb4 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571345.java @@ -29,7 +29,6 @@ import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; -import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; @@ -51,6 +50,8 @@ public void test_2571345() throws Throwable{ final String username = mLabAccount.getUsername(); final String password = mLabAccount.getPassword(); + mBroker.install(); + // Install new OneAuthTestApp final OneAuthTestApp oneAuthTestApp = new OneAuthTestApp(); oneAuthTestApp.install(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java index 5c066b501..b2e93eddf 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571508.java @@ -22,9 +22,11 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; +import com.microsoft.identity.client.msal.automationapp.AbstractMsalUiTest; import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure; import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; @@ -36,6 +38,7 @@ import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; import com.microsoft.identity.labapi.utilities.client.LabQuery; import com.microsoft.identity.labapi.utilities.constants.TempUserType; +import com.microsoft.identity.labapi.utilities.constants.UserType; import org.junit.Assert; import org.junit.Test; @@ -44,6 +47,7 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571508 @LTWTests @RunOnAPI29Minus +@RetryOnFailure @SupportedBrokers(brokers = {BrokerMicrosoftAuthenticator.class}) public class TestCase2571508 extends AbstractMsalBrokerTest { @Test @@ -82,11 +86,13 @@ public void test_2571508() throws Throwable { msalTestApp.launch(); msalTestApp.handleFirstRun(); + Assert.assertTrue(mBroker instanceof BrokerMicrosoftAuthenticator); + final MicrosoftStsPromptHandlerParameters promptHandlerParametersMsal = MicrosoftStsPromptHandlerParameters.builder() .prompt(PromptParameter.SELECT_ACCOUNT) .loginHint(username) .sessionExpected(false) - .broker(mBroker) + .broker(null) .expectingBrokerAccountChooserActivity(false) .expectingProvidedAccountInBroker(false) .expectingLoginPageAccountPicker(false) @@ -104,24 +110,27 @@ public void test_2571508() throws Throwable { // Add login hint as the username and Click on AcquireToken button // NOT prompted for credentials. msalTestApp.handleUserNameInput(username); - final String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); - Assert.assertNotNull(token); // Click on "Get Active Broker Pkg Name" button // return Authenticator app package name - msalTestApp.handleBackButton(); final String activeBroker = msalTestApp.getActiveBrokerPackageName(); Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); + msalTestApp.handleBackButton(); + + final String token = msalTestApp.acquireToken(username, password, promptHandlerParametersMsal, false); + Assert.assertNotNull(token); } @Override public LabQuery getLabQuery() { - return null; + return LabQuery.builder() + .userType(UserType.CLOUD) + .build(); } @Override public TempUserType getTempUserType() { - return TempUserType.BASIC; + return null; } @Override diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java index 9b0655cc6..727b9d5c1 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571565.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure; import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; @@ -43,6 +44,7 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2571565 @LTWTests @RunOnAPI29Minus +@RetryOnFailure public class TestCase2571565 extends AbstractMsalBrokerTest { @Test diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java index df4a5a986..787b56411 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2571580.java @@ -30,7 +30,6 @@ import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; -import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; import com.microsoft.identity.labapi.utilities.client.LabQuery; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java index 33e21e5e5..3d43d9724 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572249.java @@ -22,8 +22,6 @@ // THE SOFTWARE. package com.microsoft.identity.client.msal.automationapp.testpass.broker.ltw; -import android.text.TextUtils; - import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; @@ -33,7 +31,6 @@ import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerLTW; import com.microsoft.identity.client.ui.automation.broker.BrokerMicrosoftAuthenticator; -import com.microsoft.identity.client.ui.automation.interaction.FirstPartyAppPromptHandlerParameters; import com.microsoft.identity.client.ui.automation.interaction.PromptParameter; import com.microsoft.identity.client.ui.automation.interaction.microsoftsts.MicrosoftStsPromptHandlerParameters; import com.microsoft.identity.labapi.utilities.client.LabQuery; diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java index a70b28836..d8df6d981 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572280.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure; import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; @@ -40,6 +41,7 @@ // LTW has higher priority than CP // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2572280 @LTWTests +@RetryOnFailure @SupportedBrokers(brokers = {BrokerLTW.class}) public class TestCase2572280 extends AbstractMsalBrokerTest { diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java index ca59aaffc..e707d1847 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2572294.java @@ -86,28 +86,28 @@ public void test_2572294() throws Throwable { Assert.assertEquals("Active broker pkg name : " + BrokerMicrosoftAuthenticator.AUTHENTICATOR_APP_PACKAGE_NAME, activeBroker); } - @Override - public LabQuery getLabQuery() { - return null; - } + @Override + public LabQuery getLabQuery() { + return null; + } - @Override - public TempUserType getTempUserType() { - return TempUserType.BASIC; - } + @Override + public TempUserType getTempUserType() { + return TempUserType.BASIC; + } - @Override - public String[] getScopes() { - return new String[]{"User.read"}; - } + @Override + public String[] getScopes() { + return new String[]{"User.read"}; + } - @Override - public String getAuthority() { - return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); - } + @Override + public String getAuthority() { + return mApplication.getConfiguration().getDefaultAuthority().getAuthorityURL().toString(); + } - @Override - public int getConfigFileResourceId() { - return R.raw.msal_config_default; - } + @Override + public int getConfigFileResourceId() { + return R.raw.msal_config_default; + } } diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java index fab56da7b..cb06ebed2 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2579095.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure; import com.microsoft.identity.client.ui.automation.annotations.RunOnAPI29Minus; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.app.OneAuthTestApp; @@ -43,6 +44,7 @@ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2579095 @LTWTests @RunOnAPI29Minus +@RetryOnFailure public class TestCase2579095 extends AbstractMsalBrokerTest { @Test @@ -52,6 +54,7 @@ public void test_2579095() throws Throwable { // To make sure the device is in clean slate, uninstall mBroker here. mBroker.uninstall(); + final MsalTestApp msalTestApp = new MsalTestApp(); // install legacy company portal final BrokerCompanyPortal brokerCompanyPortal = new BrokerCompanyPortal(BrokerCompanyPortal.OLD_COMPANY_PORTAL_APK, @@ -87,7 +90,6 @@ public void test_2579095() throws Throwable { brokerCompanyPortal.update(); // install new MsalTestApp - final MsalTestApp msalTestApp = new MsalTestApp(); msalTestApp.install(); msalTestApp.launch(); msalTestApp.handleFirstRun(); diff --git a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java index cc95267da..80da7903e 100644 --- a/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java +++ b/msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/ltw/TestCase2584410.java @@ -25,6 +25,7 @@ import com.microsoft.identity.client.msal.automationapp.R; import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest; import com.microsoft.identity.client.ui.automation.annotations.LTWTests; +import com.microsoft.identity.client.ui.automation.annotations.RetryOnFailure; import com.microsoft.identity.client.ui.automation.annotations.SupportedBrokers; import com.microsoft.identity.client.ui.automation.app.MsalTestApp; import com.microsoft.identity.client.ui.automation.broker.BrokerCompanyPortal; @@ -41,6 +42,7 @@ // Authenticator has highest priority - Case3 (Auth, LTW, CP) // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2584410 @LTWTests +@RetryOnFailure @SupportedBrokers(brokers = {BrokerMicrosoftAuthenticator.class}) public class TestCase2584410 extends AbstractMsalBrokerTest { @Test