Skip to content

Commit

Permalink
Merge pull request #41 from Lombiq/issue/OSOE-403
Browse files Browse the repository at this point in the history
OSOE-403: Remove unused extension method
  • Loading branch information
dministro authored Nov 7, 2022
2 parents 78644fa + 1640c60 commit af1e7b7
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions Lombiq.ChartJs.Tests.UI/Extensions/UITestContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using Lombiq.HelpfulLibraries.OrchardCore.Mvc;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium;
using System.Drawing;
using System.IO;
using System.Threading.Tasks;

namespace Lombiq.ChartJs.Tests.UI.Extensions;
Expand All @@ -19,16 +16,4 @@ public static Task GoToBalanceAsync(this UITestContext context) =>

public static Task GoToHistoryAsync(this UITestContext context) =>
context.GoToAsync<SampleController>(controller => controller.History(null, null));

/// <summary>
/// Takes a screenshot of an element.
/// </summary>
public static Bitmap TakeScreenshotImage(this UITestContext context, IWebElement element)
{
var screen = context.TakeScreenshot();
using var screenRaw = new MemoryStream(screen.AsByteArray);
using var screenImage = (Bitmap)Image.FromStream(screenRaw);

return screenImage.Clone(new Rectangle(element.Location, element.Size), screenImage.PixelFormat);
}
}

0 comments on commit af1e7b7

Please sign in to comment.