Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify that screenshots were taken when using TakeScreenhot in order to associate a screenshot with an action #2

Closed
stickleprojects opened this issue Nov 11, 2017 · 3 comments

Comments

@stickleprojects
Copy link

Hi
I'm trying to track the screenshot filenames to the appropriate action and wanted your thoughts on how this would be implemented.

Ive tried to locate examples of decorators communicating with each other and cant see any- and am unsure if this would create a hidden dependency because screenshot actor would have to "wrap" a reporting actor, in order for the reporting actor to get "notified" of the screenshot actions being taken.
I've used component design pattern to handle this in games but I dont think it follows the decorator pattern used throughout this app.

thoughts?

@Galad
Copy link
Owner

Galad commented Dec 6, 2017

Hello,

Thanks for you interest in this project :)
I don't think those features should be coupled because the way they are designed creates a pipeline for the actions execution, meaning we could enable, disable or order them any way we want.

So what I can propose is to add an optional IObserver<T> to the TakeScreenshot extension method, that would notifiy when a screenshot has been taken.

var observer =    new ConsoleObserver(); //an observer that writes in the console
var actor = new Actor("John")
                  .WithReporting(observer)
                  .TakeScreenshots(@"C:\Enablon\Screenshots", screenshotName, observer)

It would allow the notifications to end up in the same observer, meaning you would have the following output in the log.

Starting add an item
--- Starting Enter the value "milk"
--- Screenshot 1.jpg was taken
--- Ending Enter the value "milk"
--- Starting Click on some button
--- Screenshot 2.jpg was taken
--- Ending Click on some button
Ending add an item

Would that solution solve your issue ?

@Galad Galad closed this as completed Dec 6, 2017
@Galad Galad reopened this Dec 6, 2017
@stickleprojects
Copy link
Author

stickleprojects commented Dec 6, 2017 via email

@Galad
Copy link
Owner

Galad commented Dec 6, 2017

Sure go ahead!

@Galad Galad changed the title ReportingActor vs Screenshots Notify that screenshots were taken when using TakeScreenhot in order to associate a screenshot with an action Dec 6, 2017
@Galad Galad added this to TODO in tranquire May 8, 2018
@Galad Galad closed this as completed in 5eb25ff May 9, 2018
tranquire automation moved this from TODO to Done May 9, 2018
@Galad Galad added this to the v0.2.69-alpha milestone May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
tranquire
  
Done
Development

No branches or pull requests

2 participants