Skip to content

Commit e813769

Browse files
authored
Merge pull request #2242 from MicrosoftDocs/test-studio-canvas-app
Test studio canvas app
2 parents dc59b99 + 35d08de commit e813769

29 files changed

+607
-3
lines changed

powerapps-docs/maker/TOC.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@
418418
href: ./canvas-apps/functions/object-app.md
419419
- name: Asin
420420
href: ./canvas-apps/functions/function-trig.md
421+
- name: Assert
422+
href: ./canvas-apps/functions/function-assert.md
421423
- name: AsType
422424
href: ./canvas-apps/functions/function-astype-istype.md
423425
- name: Atan
@@ -660,6 +662,8 @@
660662
href: ./canvas-apps/functions/function-set.md
661663
- name: SetFocus
662664
href: ./canvas-apps/functions/function-setfocus.md
665+
- name: SetProperty
666+
href: ./canvas-apps/functions/function-setproperty.md
663667
- name: ShowColumns
664668
href: ./canvas-apps/functions/function-table-shaping.md
665669
- name: Shuffle
@@ -700,6 +704,8 @@
700704
href: ./canvas-apps/functions/function-dateadd-datediff.md
701705
- name: Today
702706
href: ./canvas-apps/functions/function-now-today-istoday.md
707+
- name: Trace
708+
href: ./canvas-apps/functions/function-trace.md
703709
- name: Trim
704710
href: ./canvas-apps/functions/function-trim.md
705711
- name: TrimEnds
@@ -792,6 +798,12 @@
792798
href: ./canvas-apps/set-aspect-ratio-portrait-landscape.md
793799
- name: Create responsive layout
794800
href: ./canvas-apps/create-responsive-layout.md
801+
- name: Test an app with Test Studio
802+
items:
803+
- name: Test Studio Overview
804+
href: ./canvas-apps/test-studio.md
805+
- name: Working with Test Studio
806+
href: ./canvas-apps/working-with-test-studio.md
795807
- name: Customize a SharePoint list form
796808
items:
797809
- name: Make basic changes

powerapps-docs/maker/canvas-apps/formula-reference.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: powerapps
77
ms.topic: reference
88
ms.custom: canvas
99
ms.reviewer: tapanm
10-
ms.date: 08/15/2019
10+
ms.date: 12/19/2019
1111
ms.author: gregli
1212
search.audienceType:
1313
- maker
@@ -45,6 +45,8 @@ Other elements include:
4545

4646
**[Asin](functions/function-trig.md)** – Returns the arcsine of a number, in radians.
4747

48+
**[Assert](functions/function-assert.md)** – Evaluates to true or false in a test.
49+
4850
**[AsType](functions/function-astype-istype.md)** – Treats a record reference as a specific entity type.
4951

5052
**[Atan](functions/function-trig.md)** – Returns the arctangent of a number, in radians.
@@ -301,6 +303,8 @@ Other elements include:
301303

302304
**[SetFocus](functions/function-setfocus.md)** – Moves input focus to a specific control.
303305

306+
**[SetPropertry](functions/function-setproperty.md)** – Simulates interactions with input controls.
307+
304308
**[ShowColumns](functions/function-table-shaping.md)** – Returns a table with only selected columns.
305309

306310
**[Shuffle](functions/function-shuffle.md)** – Randomly reorders the records of a table.
@@ -344,6 +348,8 @@ Other elements include:
344348

345349
**[Today](functions/function-now-today-istoday.md)** – Returns the current date/time value.
346350

351+
**[Trace](functions/function-trace.md)** - Provide additional information in your test results.
352+
347353
**[Trim](functions/function-trim.md)** – Removes extra spaces from the ends and interior of a string of text.
348354

349355
**[TrimEnds](functions/function-trim.md)** – Removes extra spaces from the ends of a string of text only.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Assert function | Microsoft Docs
3+
description: Reference information, including syntax, for the Assert function in Power Apps Test Studio
4+
author: tapanm-msft
5+
manager: kvivek
6+
ms.service: powerapps
7+
ms.topic: reference
8+
ms.custom: canvas
9+
ms.reviewer: tapanm
10+
ms.date: 12/19/2018
11+
ms.author: aheneay
12+
search.audienceType:
13+
- maker
14+
search.app:
15+
- PowerApps
16+
---
17+
# Assert function in Power Apps Test Studio
18+
19+
An assertion is a condition or an expression that evaluates to true or false in a test. If the expression returns false, the test case will fail. Assertions are used to validate the expected result of a test or test step, against the actual result and to fail the test if the condition is false. Assertions can be used to validate the state of controls in your app such as label values, list box selections and other control properties.
20+
21+
Assertion messages, for both passed and failed assertions, are also contained in a Traces table in the TestCaseResult record.
22+
23+
## Syntax
24+
25+
*Assert(expression, message)*
26+
27+
- *Expression* – Required. An expression that evaluates to true or false.
28+
- *Message* – Not Required. A message that describes the assertion failure.
29+
30+
31+
## Examples
32+
33+
```Assert(lblResult.Text = "Success", "lblResult value Expected : Success , Actual : " & lblResult.Text)```<br>
34+
```Assert(ListBox1.Selected.Value = "Success", "ListBox1 selection Expected : Success, Actual : " & ListBox1.Selected.Value)```<br>
35+
```Assert(kudosAfterTest = kudosBeforeTest + 1, "Kudos count. Expected : " & kudosBeforeTest + 1 & " Actual :" & kudosAfterTest)```
36+
37+
### See Also
38+
39+
[Test Studio Overview](../test-studio.md) <br>
40+
[Working with Test Studio](../working-with-test-studio.md)

powerapps-docs/maker/canvas-apps/functions/function-select.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: powerapps
77
ms.topic: reference
88
ms.custom: canvas
99
ms.reviewer: tapanm
10-
ms.date: 06/11/2018
10+
ms.date: 01/08/2020
1111
ms.author: gregli
1212
search.audienceType:
1313
- maker
@@ -26,21 +26,45 @@ If you want one or more controls in the gallery to perform different actions fro
2626

2727
**Select** queues the target **OnSelect** for later processing, which may happen after the current formula has finished being evaluated. **Select** doesn't cause the target **OnSelect** to evaluate immediately, nor does **Select** wait for **OnSelect** to finish being evaluated.
2828

29-
**Select** can't cross the boundaries of container controls, such as a gallery or a form. Controls within a container control can only be the subject of a **Select** function in formulas that are inside the same container control. You can't use **Select** across screens.
29+
You can't use **Select** across screens.
3030

3131
You can use **Select** only with controls that have an **OnSelect** property.
3232

3333
You can use **Select** only in [behavior formulas](../working-with-formulas-in-depth.md).
3434

3535
A control can't **Select** itself directly or indirectly through other controls.
3636

37+
The select function can also be used with a gallery. For example, it can be used to specify the row or column to select in a gallery and the control to select within that row or column of the gallery. When you select a row or column, the gallery selection changes and the **OnSelect** formula on the gallery control is evaluated. If a control within the row or column is provided, the **OnSelect** formula for the child control will be evaluated.
38+
3739
## Syntax
3840
**Select**( *Control* )
3941

4042
* *Control* – Required. The control to select on behalf of the user.
4143

44+
**Select**( *Control, Row or column, Child Control* )
45+
46+
- *Control* – Required. The control to select on behalf of the user.
47+
- *Row or column* – Not required. The number of row or column (starting with 1) in a gallery control to select on behalf of the user.
48+
- *Child Control* - Not required. The child control of the control identified in the 'control' parameter to select.
49+
4250
## Examples
4351

52+
- *Button*
53+
54+
```Select(button1)```
55+
56+
- *Gallery*
57+
58+
```Select(Gallery1, 1)```
59+
60+
Simulates a user selecting row 1 or column 1 in Gallery1.
61+
62+
- *Gallery*
63+
64+
```Select(Gallery1, 1, ChildControl1)```
65+
66+
Simulates a user selecting ChildConttrol1 in row 1 or column 1 of Gallery1.
67+
4468
#### Basic usage
4569

4670
1. Add a **[Button](../controls/control-button.md)** control, and rename it **Button1** if it has a different name.
@@ -86,3 +110,12 @@ A control can't **Select** itself directly or indirectly through other controls.
86110
Use individual controls in the gallery to take actions that differ from the gallery's default action.
87111

88112
![An animation that shows the default value of the OnSelect property for a gallery control, as well as a control that takes a different action](media/function-select/gallery-select.gif)
113+
114+
7. On the same screen, add a **Button** control, and set its **OnSelect** property to this formula:
115+
116+
**Select( Gallery1,2,Image1 )**
117+
118+
8. While holding down the Alt key, select the button.
119+
120+
A **Image Selected** notification appears across the top of your app. The button click simulated selecting the image in row 2 of the gallery.
121+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: SetProperty function | Microsoft Docs
3+
description: Reference information, including syntax, for the SetProperty function in Power Apps Test Studio
4+
author: tapanm-msft
5+
manager: kvivek
6+
ms.service: powerapps
7+
ms.topic: reference
8+
ms.custom: canvas
9+
ms.reviewer: tapanm
10+
ms.date: 12/19/2018
11+
ms.author: aheneay
12+
search.audienceType:
13+
- maker
14+
search.app:
15+
- PowerApps
16+
---
17+
# SetProperty function in Power Apps Test Studio
18+
19+
The SetProperty function simulates interactions with input controls as if the user had entered or set a value on the control. This function is only available if you are writing tests in the Power Apps Test Studio. The following properties can be set using the SetProperty function.
20+
21+
## Syntax
22+
23+
*SetProperty(Control Property, value)*
24+
25+
- *Control Property* – Required. The control property to set on behalf of the user.
26+
- *Value* – Required. The value of the property to set on behalf of the user.
27+
28+
## Examples
29+
30+
| Control | Property | Example expression
31+
| :- | :- | :-
32+
| TextInput | Text | ```SetProperty(TextInput1.Text, "Sample text")```
33+
| RichTextEditor | HtmlText | ```SetProperty(RichTextEditor1.HtmlText, "<p>Sample text</p>")```
34+
| Toggle | Value | ```SetProperty(Toggle1.Value, false)```
35+
| Checkbox | Value | ```SetProperty(Checkbox1.Value, false)```
36+
| Slider | Value | ```SetProperty(Slider1.Value, 10)```
37+
| Rating | Value | ```SetProperty(Rating1.Value, 5)```
38+
| DatePicker | SelectedDate | ```SetProperty(DatePicker1.SelectedDate, Date(2020,3,10))```
39+
| Radio | Selected | ```SetProperty(Radio1.Selected, "Yes")```
40+
| Radio | SelectedText | ```SetProperty(Radio1.SelectedText, "Yes")```
41+
| Dropdown | Selected | ```SetProperty(Dropdown1.Selected, {Value:"Sample value"})```
42+
| Dropdown | SelectedText | ```SetProperty(Dropdown1.SelectedText, {Value:"Sample value"})```
43+
| Combobox | Selected | ```SetProperty(Dropdown1.Selected, {Value:"Sample value"})```
44+
| Combobox | SelectedItems | ```SetProperty(ComboBox1.SelectedItems, Table({Value:"Sample value"},({Value:"Sample value"}))```
45+
| ListBox | Selected | ```SetProperty(Listbox1.Selected, {'Value':"Sample value"})```
46+
| ListBox | SelectedItems | ```SetProperty(Listbox1.SelectedItems, Table({Value:"Sample value"},({Value:"Sample value"}))```
47+
48+
### See Also
49+
50+
[Test Studio Overview](../test-studio.md) <br>
51+
[Working with Test Studio](../working-with-test-studio.md)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Trace function | Microsoft Docs
3+
description: Reference information, including syntax, for the Trace function in Power Apps Test Studio
4+
author: tapanm-msft
5+
manager: kvivek
6+
ms.service: powerapps
7+
ms.topic: reference
8+
ms.custom: canvas
9+
ms.reviewer: tapanm
10+
ms.date: 12/19/2018
11+
ms.author: aheneay
12+
search.audienceType:
13+
- maker
14+
search.app:
15+
- PowerApps
16+
---
17+
# Trace function
18+
19+
When used with Test Studio, Trace is an optional expression that can be used to provide additional information in your test results from the **OnTestCaseComplete** event. Trace event messages, as well as any messages for both passed and failed assertions, are contained in a Traces table in the TestCaseResult record. The Traces table has two properties, Message and Timestamp.
20+
21+
If you have allowed your app to send telemetry data to Azure Application Insights, the Trace function can also be used to send custom event or diagnostic information to your Application Insights resource. You can inspect this data in Application Insights to help diagnose problems or understand usage of your apps and features. Trace information used in Tests will also be recorded in Application Insights. All Trace messages can also be viewed in the Power Apps Monitor tool, which will help in debugging or identifying issues for real-time diagnostic sessions for your app.
22+
23+
## Syntax
24+
25+
*Trace(message, severity, custom_record )*
26+
27+
- *Message* – Required. The information to be traced. In tests, this creates a record in the Traces table in the TestCaseResult record.
28+
- *Severity* - Optional. The severity level of the Trace recorded in Application Insights. Options are Information, Warning or Error.
29+
- *custom_record* - Optional. A record containing custom data that will be recorded in Application Insights.
30+
31+
32+
### See Also
33+
34+
[Test Studio Overview](../test-studio.md) <br>
35+
[Working with Test Studio](../working-with-test-studio.md)
25.1 KB
Loading
7.08 KB
Loading
8.67 KB
Loading
2.31 KB
Loading

0 commit comments

Comments
 (0)