Skip to content

Commit

Permalink
Enable PowerApps MDA Classic Input controls for Custom Pages with Tes…
Browse files Browse the repository at this point in the history
…t Engine Support
  • Loading branch information
v-raghulraja committed Dec 19, 2024
1 parent 1a55580 commit 2539ba0
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
testSuite:
testSuiteName: ComboBox Data Load
testSuiteDescription: Load data into Combobox1
persona: User1
appLogicalName: NotNeeded
onTestSuiteStart: |
= Experimental.SimulateDataverse({
Action: "Query",
Entity: "cr693_combotable",
Then: Table(
{
'cr693_name': "Item 1",
'cr693_id': 3,
'cr693_combotableid': "8cd3faaa-97ac-4e78-8b71-16c82cabb856",
'createdon': "2024-12-02T17:52:45Z"
},
{
'cr693_name': "RR2",
'cr693_id': 4,
'cr693_combotableid': "ff58de6c-905d-457d-846b-3e0b2aa4c5fd",
'createdon': "2024-12-02T17:54:45Z"
},
{
'cr693_name': "RR3",
'cr693_id': 5,
'cr693_combotableid': "ff58de6c-905d-457d-846b-3e0b2aa4c5fe",
'createdon': "2024-12-02T17:54:45Z"
}
)
});
testCases:
- testCaseName: Load ComboBox Data
testCaseDescription: Verify data loaded into Combobox1
testSteps: |
= SetProperty(Combobox1.SelectedItems, Table(First(Combobox1.Items)));
Assert(CountRows(Combobox1.SelectedItems)=1, "True");
- testCaseName: Test ComboBox Search Functionality
testCaseDescription: Verify that the ComboBox can filter items based on the search query.
testSteps: |
= SetProperty(Combobox1.SelectedItems, Table());
SetProperty(Combobox1.SearchText, "Nonexistent");
Assert(CountRows(Combobox1.SelectedItems) = 0, "Expected no items to match the search query 'Nonexistent'.");
- testCaseName: Test ComboBox Multi-Search Functionality
testCaseDescription: Verify that the ComboBox can filter items based on multiple search queries.
testSteps: |
= SetProperty(Combobox1.SelectedItems, Table());
SetProperty(Combobox1.SearchText, "Item");
SetProperty(Combobox1.SearchText, "RR2");
Assert(CountRows(Filter(Combobox1.Items, "Item" in cr693_name || "RR2" in cr693_name)) = 2, "Expected two items to match the search queries 'Item' and 'RR2'.");
- testCaseName: Test ComboBox SelectMultiple
testCaseDescription: Verify that the ComboBox can select multiple items.
testSteps: |
= SetProperty(Combobox1.SelectMultiple, true);
SetProperty(Combobox1.SelectedItems, Table(First(Combobox1.Items), Last(Combobox1.Items)));
Assert(CountRows(Combobox1.SelectedItems) = 2, "Expected two items to be selected.");
testSettings:
headless: false
locale: "en-US"
recordVideo: true
extensionModules:
enable: true
browserConfigurations:
- browser: Chromium
channel: msedge
timeout: 480000

environmentVariables:
users:
- personaName: User1
emailKey: user1Email
passwordKey: NotNeeded
3 changes: 0 additions & 3 deletions src/testengine.provider.canvas/PowerAppFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@ public async Task<bool> SetPropertyAsync(ItemPath itemPath, FormulaValue value)
return await SetPropertyRecordAsync(itemPath, (RecordValue)value);
case (TableType):
return await SetPropertyTableAsync(itemPath, (TableValue)value);
case (ColorType):
objectValue = ((ColorValue)value).Value;
break;
default:
throw new ArgumentException("SetProperty must be a valid type.");
}
Expand Down
17 changes: 1 addition & 16 deletions src/testengine.provider.mda/ModelDrivenApplicationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -729,20 +729,5 @@ private static string GetQueryParametersForTestUrl(string tenantId, string addit
{
return $"?tenantId={tenantId}&source=testengine{additionalQueryParams}";
}

private string ConvertTableValueToJson(TableValue tableValue)
{
var list = new List<Dictionary<string, object>>();
foreach (var record in tableValue.Rows)
{
var dict = new Dictionary<string, object>();
foreach (var field in record.Value.Fields)
{
dict[field.Name] = field.Value.ToObject();
}
list.Add(dict);
}
return JsonConvert.SerializeObject(list, Formatting.Indented);
}
}
}
}

0 comments on commit 2539ba0

Please sign in to comment.