Skip to content

Commit 1df7e03

Browse files
mohitc1Mohit
andauthored
Fix TestCase2519809 , Fixes AB#3577207 (#3080)
Fixes [AB#3577207](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3577207) The failure is due to change ([Refactor device registration to use protocol types and controller from common, Fixes AB#3512895 by mchand_microsoft · Pull Request #138 · identity-authnz-teams/ad-accounts-for-android](https://github.com/identity-authnz-teams/ad-accounts-for-android/pull/138)) made in BrokerHost app as part of change done to create device registration APIs in common. In the change I changed showing no device registration records from "[]" to "There are no device registration records." UI automation expects "[]", hence the test failed. Fixing it by updating UI test case step to verify the string "There are no device registration records." instead of "[]". This is better than reverting to "[]", given the message is more friendly for manual testing --------- Co-authored-by: Mohit <mchand@microsoft.com>
1 parent ef16828 commit 1df7e03

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

uiautomationutilities/src/main/java/com/microsoft/identity/client/ui/automation/broker/MultipleWpjApiFragment.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ public class MultipleWpjApiFragment extends AbstractBrokerHost {
6161
private static final String GET_DEVICE_TOKEN_BUTTON_ID = "button_mwpj_get_device_token";
6262
private static final String GET_BLOB_BUTTON_ID = "button_mwpj_get_blob";
6363

64+
/**
65+
* This must match the message shown when getAllRecords is called but there are no device registration records in BrokerHost app.
66+
*/
67+
private static final String NO_DEVICE_REGISTRATION_RECORDS_MESSAGE = "There are no device registration records.";
68+
6469
private final BrokerHost brokerHost;
6570

6671
public MultipleWpjApiFragment(@NonNull final BrokerHost brokerHost) {
@@ -103,6 +108,9 @@ public List<Map<String, String>> getAllRecords() {
103108
final List<Map<String, String>> records = new ArrayList<>();
104109
clickButton(GET_ALL_RECORDS_BUTTON_ID);
105110
final String dialogBoxText = dismissDialogBoxAndGetText();
111+
if (NO_DEVICE_REGISTRATION_RECORDS_MESSAGE.equals(dialogBoxText)) {
112+
return records;
113+
}
106114
final String dialogBoxTextNoBrackets = dialogBoxText
107115
.replace("[", "")
108116
.replace("]", "");

0 commit comments

Comments
 (0)