Skip to content

[dev-v5] [Playwright] Update the way to test a value - #2966

Merged
Denis Voituron (dvoituron) merged 2 commits into
dev-v5from
users/dvoituron/dev-v5/playwright-update-sample
Nov 25, 2024
Merged

Denis Voituron (dvoituron) merged 2 commits into
dev-v5from
users/dvoituron/dev-v5/playwright-update-sample

Conversation

@dvoituron

Copy link
Copy Markdown
Collaborator

[dev-v5] [Playwright] Update the way to test a value

After a discussion with Adrien Clerbois (@AClerbois) we update the sample, using data-testid attribute.
This Assertions.Expect method will retry several times, until the value is ‘1’.
The default timeout for assertions in Playwright is 5 seconds

// Arrange
var page = await WaitOpenPageAsync($"/button/default", openDevTools: false);

// Act
await page.ClickAsync("fluent-button");

// Assert
await Assertions.Expect(page.GetByTestId("current-value"))
                .ToContainTextAsync("1");

@github-actions

github-actions Bot commented Nov 22, 2024 •

Copy link
Copy Markdown

✅ All tests passed successfully

Details on your Workflow / Core Tests page.

@github-actions

github-actions Bot commented Nov 22, 2024 •

Copy link
Copy Markdown

Summary - Unit Tests Code Coverage

Summary
Generated on: 11/25/2024 - 21:49:37
Coverage date: 11/25/2024 - 21:49:31
Parser: Cobertura
Assemblies: 1
Classes: 33
Files: 39
Line coverage: 98.9% (723 of 731)
Covered lines: 723
Uncovered lines: 8
Coverable lines: 731
Total lines: 3496
Branch coverage: 92.8% (478 of 515)
Covered branches: 478
Total branches: 515
Method coverage: Feature is only available for sponsors
Tag: 2040_12019392798

Coverage

Microsoft.FluentUI.AspNetCore.Components - 98.9%
Name Line Branch
Microsoft.FluentUI.AspNetCore.Components 98.9% 92.8%
Microsoft.FluentUI.AspNetCore.Components.Extensions.EnumExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.FluentInputExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentButton 100% 89.5%
Microsoft.FluentUI.AspNetCore.Components.FluentComponentBase 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentGrid 100% 90%
Microsoft.FluentUI.AspNetCore.Components.FluentGridItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentIcon`1 100% 95.8%
Microsoft.FluentUI.AspNetCore.Components.FluentInputBase`1 100% 83.3%
Microsoft.FluentUI.AspNetCore.Components.FluentInputImmediateBase`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentJSModule 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLabel 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLayout 100% 71.4%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutHamburger 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutItem 100% 89.2%
Microsoft.FluentUI.AspNetCore.Components.FluentListBase`1 93.3% 94.7%
Microsoft.FluentUI.AspNetCore.Components.FluentOption 91.6% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSelect`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentText 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTextInput 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Icon 100% 91.1%
Microsoft.FluentUI.AspNetCore.Components.IconFromImage 100%
Microsoft.FluentUI.AspNetCore.Components.IconInfo 100%
Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1 60%
Microsoft.FluentUI.AspNetCore.Components.Migration.AppearanceExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.FluentInputAppearanceExt
ensions
83.3% 75%
Microsoft.FluentUI.AspNetCore.Components.Utilities.AddTag 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.CssBuilder 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Debounce 100% 83.3%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Identifier 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.IdentifierContext 100% 75%
Microsoft.FluentUI.AspNetCore.Components.Utilities.InlineStyleBuilder 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.Utilities.InternalDebounce.Dispatc
herTimerExtensions
95.7% 75%
Microsoft.FluentUI.AspNetCore.Components.Utilities.StyleBuilder 100% 100%

@AClerbois

Copy link
Copy Markdown
Collaborator

I agree this change 👍

@dvoituron
Denis Voituron (dvoituron) merged commit 029eacc into dev-v5 Nov 25, 2024
@dvoituron
Denis Voituron (dvoituron) deleted the users/dvoituron/dev-v5/playwright-update-sample branch November 25, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants