Skip to content

Commit

Permalink
Implement AppMode tests (hardkoded#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok authored Jun 24, 2018
1 parent 6574f23 commit 6940d59
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
30 changes: 30 additions & 0 deletions lib/PuppeteerSharp.Tests/PuppeteerTests/AppModeTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;

namespace PuppeteerSharp.Tests.PuppeteerTests
{
[Collection("PuppeteerLoaderFixture collection")]
public class AppModeTests : PuppeteerBaseTest
{
public AppModeTests(ITestOutputHelper output) : base(output) { }

[Fact]
public async Task ShouldWork()
{
var options = TestConstants.DefaultBrowserOptions();
options.AppMode = true;

using (var browser = await Puppeteer.LaunchAsync(options, TestConstants.ChromiumRevision, TestConstants.LoggerFactory))
using (var page = await browser.NewPageAsync())
{
Assert.Equal(121, await page.EvaluateExpressionAsync<int>("11 * 11"));
}
}
}
}
6 changes: 5 additions & 1 deletion lib/PuppeteerSharp/LaunchOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public class LaunchOptions : IBrowserOptions
/// <summary>
/// If set to true, sets Headless = false, otherwise, enables automation.
/// </summary>
/// <remarks>
/// AppMode won't neither add the argument '--remote-debugging-pipe' nor implement Pipes
/// due to limitations in .NET see <see href="https://github.com/dotnet/corefx/issues/30575"/>
/// </remarks>
public bool AppMode { get; set; }

/// <summary>
Expand Down Expand Up @@ -73,4 +77,4 @@ public class LaunchOptions : IBrowserOptions
/// </summary>
public bool LogProcess { get; set; }
}
}
}

0 comments on commit 6940d59

Please sign in to comment.