Files
blog.stevanfreeborn.com/test/Blog.Tests/EndToEnd/HomeTests.cs
T
Stevan Freeborn d25e5d4944 feat: add site header (#2)
* tests: setup initial infra for end to end tests

* tests: rework end to end host

* tests: remove need for bang operator

* tests: correct header component tests

* docs: add README.md to blog directory with instructions on setting up local dev environment with and without docker

* docs: update non-developer run command

* feat: finish layout of header

* feat: add favicon

* tests: setup test coverage

* chore: update workflow with missing playwright step

* chore: add install command
2024-04-08 23:34:32 -05:00

32 lines
866 B
C#

namespace Blog.Tests.EndToEnd;
[TestFixture]
public class HomeTests : BlogTest
{
[Test]
public async Task Home_WhenNavigatedTo_ItShouldDisplayCorrectPageTitle()
{
await Page.GotoAsync("/");
var title = await Page.TitleAsync();
title.Should().Be("journal - A blog by Stevan Freeborn");
}
[Test]
public async Task Home_WhenNavigatedTo_ItShouldCorrectSiteTitle()
{
await Page.GotoAsync("/");
var message = Page.GetByRole(AriaRole.Heading, new () { Name = "journal" });
await Expect(message).ToBeVisibleAsync();
}
[Test]
public async Task Home_WhenNavigatedTo_ItShouldDisplayWrittenByAttribution()
{
await Page.GotoAsync("/");
var message = Page.GetByText("by");
var image = Page.GetByAltText("Stevan Freeborn");
await Expect(message).ToBeVisibleAsync();
await Expect(image).ToBeVisibleAsync();
}
}