Power Apps Test Engine Power Fx 機能 (プレビュー)

[このトピックはプレリリース ドキュメントであり、変更されることがあります。]

テスト フレームワークには関数がいくつか定義されています。

Assert

Assert(BooleanExpression)

Assert(BooleanExpression, Message)

ブール値として評価される Power Fx 式に Assert 関数が取り込まれます。 返された値が false の場合、テストは失敗します。

アサ―トの例

Assert(Label1.Text = "1");

Assert(Label1.Text = "1", "Checking that the Label1 text is set to 1");

スクリーンショット

Screenshot(fileNameOfScreenshot)

この関数は、現時点でのアプリのスクリーンショットをキャプチャします。 スクリーンショット ファイルは、指定された名前でテスト出力フォルダーに保存されます。

注: JPEG ファイルと PNG ファイルのみがサポートされています。

スクリーンショットの例

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)

この関数は、Power Apps の 関数の選択 と同じ機能があります。

ネストされたギャラリーを操作する場合は、Index() を選択関数内で使用します。

例の選択

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

SetProperty(control.propertyName, propertyValue)

この関数は、Power Apps の SetProperty 関数 と同じ機能があります。

ネストされたギャラリーを操作する場合は、Index()SetProperty 関数内で使用します。

SetProperty の例

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

Wait(Control, Property, Value)

この関数は、コントロールのプロパティが指定された値と等しくなるまで待機します。

待機の例

Wait(Label1, "Text", "0")

参照

Power Apps Test Engine の概要 (プレビュー)
Power Apps Test Engine YAML 形式 (プレビュー)

注意

ドキュメントの言語設定についてお聞かせください。 簡単な調査を行います。 (この調査は英語です)

この調査には約 7 分かかります。 個人データは収集されません (プライバシー ステートメント)。