title | description | author | ms.author | ms.date | ms.reviewer | ms.topic | contributors | |||
---|---|---|---|---|---|---|---|---|---|---|
Power Apps Test Engine Power Fx functions (preview) |
Describes Power Fx functions you can use with Power Apps Test Engine. |
pvillads |
pvillads |
08/11/2023 |
jdaly |
article |
|
[!INCLUDE cc-beta-prerelease-disclaimer]
There are several functions defined for the test framework.
Assert(BooleanExpression)
Assert(BooleanExpression, Message)
The Assert
function takes in a Power Fx expression that should evaluate to a boolean value. If the value returned is false, the test fails.
Assert(Label1.Text = "1");
Assert(Label1.Text = "1", "Checking that the Label1 text is set to 1");
Screenshot(fileNameOfScreenshot)
This function captures a screenshot of the app at the current point in time. The screenshot file is saved to the test output folder and with the name provided.
Note: Only jpeg and png files are supported.
Screenshot("buttonClicked.png")
Select(control)
Select(control, row or column)
Select(control, row or column, child control)
Select(Index(gallerycontrol.AllItems, row or column).child control)
This function has the same functionality as the Power Apps Select function.
When working with a nested gallery, use Index() within the select function.
Select(Button1)
Select(Gallery1,1)
Select(Gallery1,1,Button1)
Select(Index(Gallery1.AllItems, 2).Icon2)
Select(Index(Index(Gallery1.AllItems, 1).Gallery2.AllItems, 4).Icon3);
SetProperty(control.propertyName, propertyValue)
This function has the same functionality as the Power Apps SetProperty function.
When working with a nested gallery, use Index() within the SetProperty
function.
SetProperty(TextInput.Text, "Say Something")
SetProperty(Dropdown1.Selected, {Value:"2"})
SetProperty(ComboBox1.SelectedItems, Table({Value:"1"},{Value:"2"}))
SetProperty(Index(Gallery1.AllItems, 1).TextInput1.Text, "Change the text input")
Select(Index(Index(Gallery1.AllItems, 1).Gallery2.AllItems, 1).TextInput1.Text, "Change the text input")
Wait(Control, Property, Value)
This function waits for the property of the control to equal the specified value.
Wait(Label1, "Text", "0")
Power Apps Test Engine overview (preview)
Power Apps Test Engine YAML format (preview)
[!INCLUDE footer-banner]