@@ -46,7 +46,7 @@ public void DeviceCodeFlowADTest(String environment) throws Exception {
46
46
build ();
47
47
48
48
Consumer <DeviceCode > deviceCodeConsumer = (DeviceCode deviceCode ) -> {
49
- runAutomatedDeviceCodeFlow (deviceCode , user );
49
+ runAutomatedDeviceCodeFlow (deviceCode , user , environment );
50
50
};
51
51
52
52
IAuthenticationResult result = pca .acquireToken (DeviceCodeFlowParameters
@@ -70,7 +70,7 @@ public void DeviceCodeFlowADFSv2019Test(String environment) throws Exception {
70
70
build ();
71
71
72
72
Consumer <DeviceCode > deviceCodeConsumer = (DeviceCode deviceCode ) -> {
73
- runAutomatedDeviceCodeFlow (deviceCode , user );
73
+ runAutomatedDeviceCodeFlow (deviceCode , user , environment );
74
74
};
75
75
76
76
IAuthenticationResult result = pca .acquireToken (DeviceCodeFlowParameters
@@ -83,7 +83,7 @@ public void DeviceCodeFlowADFSv2019Test(String environment) throws Exception {
83
83
Assert .assertFalse (Strings .isNullOrEmpty (result .accessToken ()));
84
84
}
85
85
86
- private void runAutomatedDeviceCodeFlow (DeviceCode deviceCode , User user ){
86
+ private void runAutomatedDeviceCodeFlow (DeviceCode deviceCode , User user , String environment ){
87
87
boolean isRunningLocally = true ;//!Strings.isNullOrEmpty(
88
88
//System.getenv(TestConstants.LOCAL_FLAG_ENV_VAR));
89
89
@@ -123,6 +123,15 @@ private void runAutomatedDeviceCodeFlow(DeviceCode deviceCode, User user){
123
123
} else {
124
124
SeleniumExtensions .performADLogin (seleniumDriver , user );
125
125
}
126
+
127
+ if (environment .equals (AzureEnvironment .AZURE ) && !isADFS2019 ) {
128
+ //Login flow for azurecloud environment has an extra "Stay signed in?" page after authentication
129
+ continueBtn = SeleniumExtensions .waitForElementToBeVisibleAndEnable (
130
+ seleniumDriver ,
131
+ new By .ById (continueButtonId ));
132
+ continueBtn .click ();
133
+ }
134
+
126
135
} catch (Exception e ){
127
136
if (!isRunningLocally ){
128
137
SeleniumExtensions .takeScreenShot (seleniumDriver );
0 commit comments