You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ Installing the NuGet package creates a _power-apps-bindings.yml_ file in your pr
55
55
```yaml
56
56
url: SPECFLOW_POWERAPPS_URL # mandatory
57
57
useProfiles: false # optional - defaults to false if not set
58
+
deleteTestData: true # optional - defaults to true if not set
58
59
browserOptions: # optional - will use default EasyRepro options if not set
59
60
browserType: Chrome
60
61
headless: true
@@ -138,6 +139,8 @@ These bindings look for a corresponding JSON file in a _data_ folder in the root
138
139
with a difference.json
139
140
```
140
141
142
+
The deleteTestData property in the power-apps-bindings.yml file can be set to specify whether you want records created via these bindings to be deleted after a scenario has ran. You may wish to override the default value and retain these e.g. to aid in diagnosing failures.
143
+
141
144
If you are using the binding which creates data as someone other than the current user, you will need the following configuration to be present:
142
145
143
146
- a user with a matching alias in the `users` array that has the `username` set
// Try to dispose, and catch web driver errors that can occur on disposal. Retry the disposal if these occur. Trap the final exception and continue the disposal process.
217
+
varpolly=Policy
218
+
.Handle<WebDriverException>()
219
+
.Retry(3,(ex,i)=>
220
+
{
221
+
Console.WriteLine(ex.Message);
222
+
})
223
+
.ExecuteAndCapture(()=>
224
+
{
225
+
xrmApp?.Dispose();
218
226
219
-
// Ensuring that the driver gets disposed. Previously we were left with orphan processes and were unable to clean up profile folders.
220
-
driver?.Dispose();
227
+
// Ensuring that the driver gets disposed. Previously we were left with orphan processes and were unable to clean up profile folders. We cannot rely on xrmApp.Dispose to properly dispose of the web driver.
scriptBuilder.AppendLine($@"var recordRepository = new {LibraryNamespace}.CurrentUserRecordRepository(Xrm.WebApi.online);
43
-
var metadataRepository = new {LibraryNamespace}.MetadataRepository(Xrm.WebApi.online);
44
-
var deepInsertService = new {LibraryNamespace}.DeepInsertService(metadataRepository, recordRepository);");
42
+
scriptBuilder.AppendLine($@"top.recordRepository = new {LibraryNamespace}.CurrentUserRecordRepository(Xrm.WebApi.online);
43
+
top.metadataRepository = new {LibraryNamespace}.MetadataRepository(Xrm.WebApi.online);
44
+
top.deepInsertService = new {LibraryNamespace}.DeepInsertService(top.metadataRepository, top.recordRepository);");
45
45
46
46
if(!string.IsNullOrEmpty(authToken))
47
47
{
48
48
scriptBuilder.AppendLine(
49
-
$@"var appUserRecordRepository = new {LibraryNamespace}.AuthenticatedRecordRepository(metadataRepository, '{authToken}');
50
-
var dataManager = new {LibraryNamespace}.DataManager(recordRepository, deepInsertService, [new {LibraryNamespace}.FakerPreprocessor()], appUserRecordRepository);");
49
+
$@"top.appUserRecordRepository = new {LibraryNamespace}.AuthenticatedRecordRepository(top.metadataRepository, '{authToken}');
50
+
top.dataManager = new {LibraryNamespace}.DataManager(top.recordRepository, top.deepInsertService, [new {LibraryNamespace}.FakerPreprocessor()], top.appUserRecordRepository);");
51
51
}
52
52
else
53
53
{
54
54
scriptBuilder.AppendLine(
55
-
$"var dataManager = new {LibraryNamespace}.DataManager(recordRepository, deepInsertService, [new {LibraryNamespace}.FakerPreprocessor()]);");
55
+
$"top.dataManager = new {LibraryNamespace}.DataManager(top.recordRepository, top.deepInsertService, [new {LibraryNamespace}.FakerPreprocessor()]);");
56
56
}
57
57
58
-
scriptBuilder.AppendLine($"{TestDriverReference} = new {LibraryNamespace}.Driver(dataManager);");
58
+
scriptBuilder.AppendLine($"{TestDriverReference} = new {LibraryNamespace}.Driver(top.dataManager);");
Copy file name to clipboardExpand all lines: bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/Capgemini.PowerApps.SpecFlowBindings.UiTests.csproj
0 commit comments