-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathtestSettings.yaml
More file actions
95 lines (95 loc) · 3.34 KB
/
testSettings.yaml
File metadata and controls
95 lines (95 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# yaml-embedded-languages: powerfx
locale: "en-US"
headless: false
recordVideo: true
extensionModules:
enable: true
allowPowerFxNamespaces:
- Preview
parameters:
enableDataverseFunctions: true
timeout: 1200000
browserConfigurations:
- browser: Chromium
channel: msedge
powerFxTestTypes:
- name: ControlName
value: |
{ControlName: Text}
- name: Options
value: |
[{Name: Text, Value: Number}]
- name: PassFailResult
value: |
{PassFail: Number}
- name: LookupValue
value: |
[{id: Text, name: Text, entityType: Text}]
- name: TestSetRecord
value: |
{cat_copilottestsetid: Text, cat_name: Text}
testFunctions:
- description: Wait until control is visible using Document Object Model (DOM) selector
code: |
WaitUntilVisible(control: Text): Void =
Preview.PlaywrightAction(Concatenate("//div[@data-id='", control, "']"), "wait");
- description: Get the options for a control using Power Fx control from Model Driven App (MDA)
code: |
GetOptions(control: ControlName): Options =
Preview.GetOptions(control);
- description: Select an option for a control using Power Fx control from MDA
code: |
SetOption(control: ControlName, option: Text): Void =
Preview.SetOptions(control, Table(First(Filter(GetOptions(control), Name = option))));
- description: Select single option for a control using Power Fx control from MDA
code: |
SetSingleOption(control: ControlName, option: Text): Void =
Preview.SetValueJson(control,
JSON(
First(
Filter(GetOptions(control), Name = option)
).Value
)
);
- description: Set text value for MDA control
code: |
SetTextValue(control: ControlName, textValue: Text): Void =
Preview.SetValueJson(control, JSON(textValue));
- description: Assert that the value of a control is as expected using Power Fx control from MDA
code: |
AssertValue(control: ControlName, expectedValue: Text): Void =
Assert(Preview.GetValue(control).Text = expectedValue);
- description: Get Identifier of save comamnd bar item
code: |
SaveForm(): Boolean = Preview.SaveForm();
- description: Get Identifier of New command bar item
code: |
NewRecord(): Text = "New";
- description: Get Identifier of save and close command bar item
code: |
SaveAndClose(): Text = "Save & Close";
- description: Save and close the form using Document Object Model (DOM) selector for command bar
code: |
CommandBarAction(name: Text): Void =
Preview.PlaywrightAction(Concatenate("//*[@aria-label='", name, "']"), "click");
- description: Check if option is in the collection
code: |
FindOptionMatch(option: Text, options: Options): Boolean =
CountRows(Filter(options, Name = option)) = 1
- description: Set lookup value for a control using Power Fx control from MDA
code: |
SetLookupValue(control: ControlName, json: Text): Void =
Preview.SetValueJson(control, json);
- description: Set lookup value for a control using Power Fx control from MDA
code: |
SetTestSetLookupValue(control: ControlName, item: TestSetRecord): Void =
SetLookupValue(
control,
JSON(
Table({
id: item.cat_copilottestsetid,
name: item.cat_name,
entityType: "cat_copilottestset"
})
)
)