SpecFlowOSS / SpecFlow.Actions

BSD 3-Clause "New" or "Revised" License
57 stars 53 forks source link

Handle appWorkingDir same way as app in specflow.actions.json #102

Closed DrunkenDeveloper closed 2 years ago

DrunkenDeveloper commented 2 years ago

This adds conversion of a referential path to a full path for appWorkingDir capability when set in specflow.actions.json.

See: #101

SabotageAndi commented 2 years ago

With this change, both config values are handled the same. Sure you want that? Also what happens if you specify both at the same time?

DrunkenDeveloper commented 2 years ago

Unfortunaly I'm not in range of a notebook or similar till monday. But then I'll try top prepare an example to make clear what I want to achieve.

DrunkenDeveloper commented 2 years ago

Hi @SabotageAndi,

you can find a little demo here: https://github.com/DrunkenDeveloper/SpecFlowDemo

The application tries to read the content of the Test.txt file when the button is clicked, with a relative path. And set the content to the label.

In the 'FormElement.cs' class of the WorkingDirTest.SpecFlow.Steps project are two implementations. The first implementation uses the injected AppDriver, as I think it's the way it should be used, which is created with the contests of the 'specflow.actions.json' file. The working directory is not the directory of the app to test, and therefore the test fails.

In the second implementation, I initialized the Appium driver manually. There I can set the appWorkingDir the same way as the app path and the test succeeds.

I hope you understand what I mean.

SabotageAndi commented 2 years ago

Thanks for the example @DrunkenDeveloper! Now I got it. I merge it and upload a new NuGet package tomorrow.

DrunkenDeveloper commented 2 years ago

Thanks