Skip to content

Commit 5c83904

Browse files
committed
Небольшие правки
1 parent a0c819b commit 5c83904

File tree

13 files changed

+78
-83
lines changed

13 files changed

+78
-83
lines changed

src/Controls.Extensions/Controls.Extensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<Title>Playwright.ReactUI.Controls.Extensions</Title>
2424
<AssemblyVersion>1.0.0.0</AssemblyVersion>
2525
<FileVersion>1.0.0</FileVersion>
26-
<Version>3.1.0</Version>
26+
<Version>3.1.1</Version>
2727
<Authors>Evgeniy Ivanov</Authors>
2828
<Product>Playwright.ReactUI.Controls.Extensions</Product>
2929
<PackageReadmeFile>README-Controls.Extensions.md</PackageReadmeFile>

src/Controls.Extensions/FxInputExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static async Task AppendTextAsync(
5959

6060
public static async Task WaitToBeAutoAsync(
6161
this FxInput fxInput,
62-
LocatorAssertionsToBeVisibleOptions? options = default
62+
LocatorAssertionsToBeHiddenOptions? options = default
6363
) => await fxInput.ExpectV2().ToBeAutoAsync(options).ConfigureAwait(false);
6464

6565
public static async Task WaitNotToBeAutoAsync(

src/Controls/Assertions/FxInputAssertionsV2.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ public async Task ToBeFocusedAsync(LocatorAssertionsToBeFocusedOptions? options
3838
public async Task NotToBeFocusedAsync(LocatorAssertionsToBeFocusedOptions? options = default)
3939
=> await fxInput.InputLocator.Expect().Not.ToBeFocusedAsync(options).ConfigureAwait(false);
4040

41-
public async Task ToBeAutoAsync(LocatorAssertionsToBeVisibleOptions? options = default)
42-
=> await fxInput.AutoButtonLocator.Expect().Not.ToBeVisibleAsync(options).ConfigureAwait(false);
41+
public async Task ToBeAutoAsync(LocatorAssertionsToBeHiddenOptions? options = default)
42+
{
43+
await fxInput.WaitForAsync().ConfigureAwait(false);
44+
await fxInput.AutoButtonLocator.Expect().ToBeHiddenAsync(options).ConfigureAwait(false);
45+
}
4346

4447
public async Task NotToBeAutoAsync(LocatorAssertionsToBeVisibleOptions? options = default)
4548
=> await fxInput.AutoButtonLocator.Expect().ToBeVisibleAsync(options).ConfigureAwait(false);

src/Controls/Controls.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<Title>Playwright.ReactUI.Controls</Title>
2525
<AssemblyVersion>1.0.0.0</AssemblyVersion>
2626
<FileVersion>1.0.0</FileVersion>
27-
<Version>3.1.0</Version>
27+
<Version>3.1.1</Version>
2828
<Authors>Evgeniy Ivanov</Authors>
2929
<Product>Playwright.ReactUI.Controls</Product>
3030
<PackageReadmeFile>README-Controls.md</PackageReadmeFile>

src/Controls/Dropdown.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,12 @@ private async Task<ILocator> GetMenuItemsLocatorAsync()
127127
}
128128

129129
private async Task<ILocator> GetPortalContainerAsync()
130-
{
131-
await OpenDropdownIfNeededAsync().ConfigureAwait(false);
132-
return await portal.GetContainerAsync().ConfigureAwait(false);
133-
}
134-
135-
private async Task OpenDropdownIfNeededAsync()
136130
{
137131
if (!await IsMenuOpenedAsync().ConfigureAwait(false))
138132
{
139133
await ButtonLocator.ClickAsync().ConfigureAwait(false);
140134
}
135+
136+
return await portal.GetContainerAsync().ConfigureAwait(false);
141137
}
142138
}

src/Controls/DropdownMenu.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,13 @@ private async Task<ILocator> GetMenuItemsLocatorAsync()
137137
}
138138

139139
private async Task<ILocator> GetPortalContainerAsync()
140-
{
141-
await OpenDropdownIfNeededAsync().ConfigureAwait(false);
142-
return await portal.GetContainerAsync().ConfigureAwait(false);
143-
}
144-
145-
private async Task OpenDropdownIfNeededAsync()
146140
{
147141
if (!await IsMenuOpenedAsync().ConfigureAwait(false))
148142
{
149143
await ButtonLocator.ClickAsync().ConfigureAwait(false);
150144
}
145+
146+
return await portal.GetContainerAsync().ConfigureAwait(false);
151147
}
152148

153149
private async Task SelectFirstByTextAsync(ILocator item, bool isMenuClosedAfterSelect = true)

src/Controls/Kebab.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ public async Task<bool> IsDisabledAsync(LocatorGetAttributeOptions? options = de
2727
public async Task<bool> IsMenuOpenedAsync()
2828
=> await portal.IsVisibleAsync().ConfigureAwait(false);
2929

30-
public async Task SelectByTextAsync(string text, LocatorClickOptions? options = default)
30+
public async Task SelectFirstByTextAsync(string text, LocatorClickOptions? options = default)
3131
{
3232
var item = await GetMenuItemsLocatorAsync(text).ConfigureAwait(false);
33-
await item.ClickAsync(options).ConfigureAwait(false);
33+
await item.First.ClickAsync(options).ConfigureAwait(false);
3434
}
3535

36-
public async Task SelectByTextAsync(Regex regex, LocatorClickOptions? options = default)
36+
public async Task SelectFirstByTextAsync(Regex regex, LocatorClickOptions? options = default)
3737
{
3838
var item = await GetMenuItemsLocatorAsync(regex).ConfigureAwait(false);
39-
await item.ClickAsync(options).ConfigureAwait(false);
39+
await item.First.ClickAsync(options).ConfigureAwait(false);
4040
}
4141

4242
public async Task SelectByIndexAsync(int index, LocatorClickOptions? options = default)

src/Controls/Paging.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public class Paging : ControlBase
1111
{
1212
private readonly Label nextPage;
1313

14-
public Paging(ILocator context)
15-
: base(context)
14+
public Paging(ILocator rootLocator)
15+
: base(rootLocator)
1616
{
1717
Pages = new ControlList<Page>(
18-
context,
18+
rootLocator,
1919
locator => locator.Locator("[data-tid='Paging__pageLinkWrapper']"),
2020
x => new Page(x));
21-
nextPage = new Label(context.Locator("[data-tid='Paging__forwardLink']"));
21+
nextPage = new Label(rootLocator.Locator("[data-tid='Paging__forwardLink']"));
2222
}
2323

2424
public ControlList<Page> Pages { get; }

src/Tests/Controls/DateInputTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public async Task GetValue_Return_Empty_When_DateInput_Value_Is_Empty()
116116
public async Task Fill_New_Value()
117117
{
118118
var dateInput = await GetDateInputAsync("default").ConfigureAwait(false);
119+
await dateInput.NativeInputLocator.Expect().ToBeEmptyAsync().ConfigureAwait(false);
119120

120121
await dateInput.FillAsync("02.01.2024").ConfigureAwait(false);
121122

src/Tests/Controls/FxInputTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public async Task IsAuto_Return_True_WHen_FxInput_In_AutoMode()
6464
}
6565

6666
[Test]
67-
public async Task IsAuto_Return_False_When_FxInput_In_AutoMode()
67+
public async Task IsAuto_Return_False_When_FxInput_In_Default_Mode()
6868
{
6969
var fxInput = await GetFxInputAsync("default").ConfigureAwait(false);
7070

0 commit comments

Comments
 (0)