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

Remove performance overhead of taking screenshots #19

Closed
Galad opened this issue Apr 24, 2018 · 1 comment
Closed

Remove performance overhead of taking screenshots #19

Galad opened this issue Apr 24, 2018 · 1 comment

Comments

@Galad
Copy link
Owner

Galad commented Apr 24, 2018

Currently, taking a screenshot saves it directly to a file.
This cost a lot of time, and it is not often necessary to save them to a file when the test pass.

Selenium screenshots can remain in memory until it is decided by the user that it needs them.

In that effect, we would have an additional overload of TakeScreenshot:

actor.TakeScreenshot(@"C:\Screenshots", "Test1", out var saveToFileObserver);
actor.When(Click.On(button));
actor.When(Click.On(otherButton));
// screenshots are not saved on the disk
saveToFileObserver.OnNext(Unit.Default);
// screenshots are saved
@Galad
Copy link
Owner Author

Galad commented Apr 28, 2018

The final version takes an observer instead of returning one:

actor.TakeScreenshot("Test1", new SaveScreenshotsToFileOnComplete(@"C:\Screenshots"));
actor.When(Click.On(button));
actor.When(Click.On(otherButton));
// screenshots are not saved on the disk
saveToFileObserver.OnComplete();
// screenshots are saved

@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
None yet
Development

No branches or pull requests

1 participant