Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="102.0.5005.6102" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="104.0.5112.7900" />
<PackageReference Include="SpecFlow" Version="3.9.69" />
<PackageReference Include="SpecFlow.NUnit" Version="3.9.69" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.9.69" />
Expand Down
13 changes: 10 additions & 3 deletions src/BlazorApp/Pages/Counter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>
<h1 data-automation-id="counter-page-label">Counter</h1>

<p role="status">Current count: @currentCount</p>
<p
role="status"
data-automation-id="counter-page-text">Current count: @currentCount
</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<button
class="btn btn-primary"
@onclick="IncrementCount"
data-automation-id="counter-page-button">Click me
</button>

@code {
private int currentCount = 0;
Expand Down
27 changes: 14 additions & 13 deletions src/BlazorApp/Pages/FetchData.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,34 @@
@using BlazorApp.Data
@inject WeatherForecastService ForecastService

<h1>Weather forecast</h1>
<h1 data-automation-id="forecast-page-header">Weather forecast</h1>

<p>This component demonstrates fetching data from a service.</p>
<p data-automation-id="forecast-page-paragraph">This component demonstrates fetching data from a service.</p>

@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<table class="table" data-automation-id="forecast-table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
<th data-automation-id="table-header-date">Date</th>
<th data-automation-id="table-header-temp-c">Temp. (C)</th>
<th data-automation-id="table-header-temp-f">Temp. (F)</th>
<th data-automation-id="table-header-summary">Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
@for (int i=0; i<forecasts.Length; i++)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
var forecast = forecasts[i];
<tr data-automation-id="table-row">
<td data-automation-id="table-cell">@forecast.Date.ToShortDateString()</td>
<td data-automation-id="table-cell">@forecast.TemperatureC</td>
<td data-automation-id="table-cell">@forecast.TemperatureF</td>
<td data-automation-id="table-cell">@forecast.Summary</td>
</tr>
}
</tbody>
Expand Down
34 changes: 34 additions & 0 deletions src/BlazorApp/Pages/Greetings.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@page "/greetings"

<PageTitle>Greetings</PageTitle>

<h2 data-automation-id="greetings-page-header">Here you can test input elements</h2>

<p data-automation-id="greetings-input-header">Enter your name:</p>

<div>
<input class="input-group-text" data-automation-id="greetings-page-input" @bind="username">
<button
class="btn btn-primary"
@onclick="ChangeUsername"
data-automation-id="greetings-page-button">
Say hello
</button>
</div>

<p style="display: @visibility" data-automation-id="greetings-page-paragraph">
Hello, @_userName!
</p>

@code {
private string _userName = string.Empty;

public string visibility = "none";
public string username = string.Empty;

private void ChangeUsername()
{
_userName = username;
visibility = "initial";
}
}
23 changes: 16 additions & 7 deletions src/BlazorApp/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

<PageTitle>Behavioral automation demo</PageTitle>

<h1>Hello, world!</h1>
<h1 data-automation-id="main-page-header">Behavioral automation demo</h1>
<div class="form-control-plaintext" data-automation-is="main-page-paragraph">
<p>Welcome to Behavioral.Automation demo app!</p>
<p>Here you can get familiar with different web elements, and try to</p>
<p>automate interaction with them using DemoBindings and DemoScenarios projects</p>
</div>
<div>
<p class="fw-bold" data-automation-id="main-elements-list-header">There are few types of web elements present in this app:</p>
<ul data-automation-id="main-elements-list">
<li>Button</li>
<li>Input</li>
<li>Table</li>
<li>Text</li>
<li>List</li>
</ul>
</div>

<label data-automation-id="label-simple-text">Behavioral automation demo</label>

Welcome to your new app.

<SurveyPrompt Title="test" />

<Counter IncrementAmount="10" />
5 changes: 0 additions & 5 deletions src/BlazorApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using BlazorApp.Data;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = WebApplication.CreateBuilder(args);

Expand Down
13 changes: 9 additions & 4 deletions src/BlazorApp/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<h1 class="navbar-brand">DemoApp</h1>
<h1 style="color: honeydew" class="navbar-brand" data-automation-id="navigation-app-label">DemoApp</h1>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
Expand All @@ -10,17 +10,22 @@
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All" data-automation-id="nav-link-home">
<span class="oi oi-home" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<NavLink class="nav-link" href="greetings" data-automation-id="nav-link-greetings">
<span class="oi oi-audio-spectrum" aria-hidden="true"></span> Greetings
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter" data-automation-id="nav-link-counter">
<span class="oi oi-plus" aria-hidden="true"></span> Counter
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="fetchdata">
<NavLink class="nav-link" href="fetchdata" data-automation-id="nav-link-fetch-data">
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
</NavLink>
</div>
Expand Down