Skip to content

Commit 7931f4b

Browse files
authored
[BREAKING] Rename ClickCount to Count (#2600)
1 parent 975c86d commit 7931f4b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/PuppeteerSharp.Tests/ClickTests/ClickTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public async Task ShouldSelectTheTextByTripleClicking()
127127
const string text = "This is the text that we are going to try to select. Let's see how it goes.";
128128
await Page.Keyboard.TypeAsync(text);
129129
await Page.ClickAsync("textarea");
130-
await Page.ClickAsync("textarea", new ClickOptions { ClickCount = 2 });
131-
await Page.ClickAsync("textarea", new ClickOptions { ClickCount = 3 });
130+
await Page.ClickAsync("textarea", new ClickOptions { Count = 2 });
131+
await Page.ClickAsync("textarea", new ClickOptions { Count = 3 });
132132
Assert.AreEqual(text, await Page.EvaluateFunctionAsync<string>(@"() => {
133133
const textarea = document.querySelector('textarea');
134134
return textarea.value.substring(
@@ -258,7 +258,7 @@ await Page.EvaluateExpressionAsync(@"{
258258
});
259259
}");
260260
var button = await Page.QuerySelectorAsync("button");
261-
await button.ClickAsync(new ClickOptions { ClickCount = 2 });
261+
await button.ClickAsync(new ClickOptions { Count = 2 });
262262
Assert.True(await Page.EvaluateExpressionAsync<bool>("double"));
263263
Assert.AreEqual("Clicked", await Page.EvaluateExpressionAsync<string>("result"));
264264
}

lib/PuppeteerSharp/Cdp/CdpMouse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public override Task DownAsync(ClickOptions options = null)
132132
{
133133
Type = MouseEventType.MousePressed,
134134
Modifiers = _keyboard.Modifiers,
135-
ClickCount = options.ClickCount,
135+
ClickCount = options.Count,
136136
Buttons = (int)state.Buttons,
137137
Button = options.Button,
138138
X = state.Position.X,
@@ -163,7 +163,7 @@ public override Task UpAsync(ClickOptions options = null)
163163
{
164164
Type = MouseEventType.MouseReleased,
165165
Modifiers = _keyboard.Modifiers,
166-
ClickCount = options.ClickCount,
166+
ClickCount = options.Count,
167167
Buttons = (int)state.Buttons,
168168
Button = options.Button,
169169
X = state.Position.X,

lib/PuppeteerSharp/Input/ClickOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ClickOptions
1313
/// <summary>
1414
/// Defaults to 1. See https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail.
1515
/// </summary>
16-
public int ClickCount { get; set; } = 1;
16+
public int Count { get; set; } = 1;
1717

1818
/// <summary>
1919
/// The button to use for the click. Defaults to <see cref="MouseButton.Left"/>.

0 commit comments

Comments
 (0)