Skip to content

Commit

Permalink
Fix DCF option ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitc1 committed Feb 19, 2025
1 parent 72c9198 commit edceb1f
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
package com.microsoft.identity.client.msal.automationapp.testpass.broker.brokerapi;


import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.UiObject;
import androidx.test.uiautomator.UiObjectNotFoundException;
import androidx.test.uiautomator.UiSelector;

import com.microsoft.identity.client.msal.automationapp.R;
import com.microsoft.identity.client.msal.automationapp.testpass.broker.AbstractMsalBrokerTest;
Expand Down Expand Up @@ -104,11 +103,7 @@ public void checkForDcfOption(@Nullable final String tenantId) {

// Apparently, there are two UI objects with exact text "Sign-in options", one is a button the other is a view
// Have to specify the search to button class
final UiDevice device =
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());

final UiObject optionsObject = device.findObject(new UiSelector()
.text("Sign-in options").className("android.widget.Button"));
final UiObject optionsObject = UiAutomatorUtils.obtainUiObjectWithTextAndClassType("Sign-in options", Button.class);

try {
optionsObject.click();
Expand Down

0 comments on commit edceb1f

Please sign in to comment.