Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge eshop with aspire preview5 #15

Merged
merged 61 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
6603215
Update OrderQueries to use linq queries (#115)
AlmarAubel Feb 8, 2024
bf72068
try dependabot (#178)
danmoseley Feb 14, 2024
228aaf0
Update to aspire preview3 (#166)
BrennanConroy Feb 15, 2024
2db33ea
Fix typo "backet" (#171)
brunoaragao Feb 15, 2024
6c4663d
Bump xunit from 2.5.1 to 2.6.6 (#187)
dependabot[bot] Feb 15, 2024
9c312dd
Bump xunit.runner.visualstudio from 2.5.1 to 2.5.6 (#192)
dependabot[bot] Feb 15, 2024
894f461
Bump OpenTelemetry.Instrumentation.AspNetCore from 1.6.0-beta.2 to 1.…
dependabot[bot] Feb 15, 2024
5c98587
Bump OpenTelemetry.Instrumentation.Http from 1.6.0-beta.2 to 1.7.1 (#…
dependabot[bot] Feb 15, 2024
436a295
Bump MicrosoftExtensionsVersion from 8.0.0 to 8.2.0 (#188)
dependabot[bot] Feb 15, 2024
d37be1a
Bump OpenTelemetry.Exporter.OpenTelemetryProtocol (#191)
dependabot[bot] Feb 15, 2024
6d91b3b
Bump OpenTelemetry.Instrumentation.Runtime from 1.5.1 to 1.7.0 (#194)
dependabot[bot] Feb 15, 2024
00ca243
Bump OpenTelemetry.Instrumentation.GrpcNetClient (#189)
dependabot[bot] Feb 16, 2024
990c634
Bump Microsoft.NET.Test.Sdk from 17.7.2 to 17.9.0 (#186)
dependabot[bot] Feb 20, 2024
56fb097
Bump AspnetVersion from 8.0.1 to 8.0.2 (#199)
dependabot[bot] Feb 20, 2024
9a020ad
Update SDK required in global.json (#202)
sebastienros Feb 21, 2024
857fc5d
Aspire.AI.Azure.OpenAI integration (#153)
sebastienros Feb 21, 2024
b357d35
Bump Npgsql.EntityFrameworkCore.PostgreSQL from 8.0.0 to 8.0.2 (#205)
dependabot[bot] Feb 27, 2024
781cefe
Bump OpenTelemetry.Extensions.Hosting from 1.7.0-alpha.1 to 1.7.0 (#213)
dependabot[bot] Feb 27, 2024
74e67a1
Bump Dapper from 2.0.151 to 2.1.28 (#207)
dependabot[bot] Feb 27, 2024
9dea82e
Bump Microsoft.EntityFrameworkCore.Tools from 8.0.0 to 8.0.2 (#204)
dependabot[bot] Feb 27, 2024
74c09bb
Bump AspNetCore.HealthChecks.Uris from 7.0.0 to 8.0.0 (#206)
dependabot[bot] Feb 27, 2024
f12ce54
Bump Polly from 8.2.0 to 8.3.0 (#214)
dependabot[bot] Feb 27, 2024
1086d1c
Bump Duende.IdentityServer.EntityFramework, Duende.IdentityServer.Ent…
dependabot[bot] Feb 27, 2024
ca10e8e
Bump Duende.IdentityServer.AspNetIdentity, Duende.IdentityServer and …
dependabot[bot] Feb 27, 2024
d1c9134
Bump GrpcVersion from 2.59.0 to 2.61.0 (#212)
dependabot[bot] Feb 27, 2024
9e76b15
Bump Automapper from 12.0.1 to 13.0.1 (#217)
dependabot[bot] Feb 27, 2024
6369091
Deserialize message once (#201)
iem365-michael Mar 1, 2024
bafd891
Replaced Map forwarder with Yarp reverse Proxy for mobile BFF (#218)
SrushtiPasari94 Mar 8, 2024
28540c5
Updated CSS for good readability of the item number of shopping bags …
SrushtiPasari94 Mar 15, 2024
d661e89
Update to Aspire preview.4 (#227)
DamianEdwards Mar 18, 2024
fe686a5
Bump Dapper from 2.1.28 to 2.1.35 (#247)
dependabot[bot] Mar 18, 2024
a2c0b16
Bump Microsoft.SemanticKernel from 1.4.0 to 1.6.2 (#245)
dependabot[bot] Mar 18, 2024
d2998b4
Bump Polly from 8.3.0 to 8.3.1 (#243)
dependabot[bot] Mar 18, 2024
695130e
Bump MicrosoftExtensionsVersion from 8.2.0 to 8.3.0 (#242)
dependabot[bot] Mar 18, 2024
d193235
Bump AspnetVersion from 8.0.2 to 8.0.3 (#248)
dependabot[bot] Mar 18, 2024
4ea30a4
Bump Microsoft.Extensions.DependencyInjection.Abstractions (#246)
dependabot[bot] Mar 21, 2024
72445fd
Bump Microsoft.EntityFrameworkCore.Tools from 8.0.2 to 8.0.3 (#244)
dependabot[bot] Mar 21, 2024
5c20c45
Updated global using file namespace to have only core dependencies. (…
SrushtiPasari94 Mar 26, 2024
bd6f0d2
Playwright E2E test cases (#235)
SrushtiPasari94 Mar 26, 2024
300a4cd
Bump Microsoft.SemanticKernel from 1.6.2 to 1.6.3 (#256)
dependabot[bot] Mar 26, 2024
0ee9077
Readme notes for deploying to Azure with the AzureDeveloper cli (#177)
vhvb1989 Mar 26, 2024
15be262
Bump NSubstitute.Analyzers.CSharp from 1.0.15 to 1.0.17 (#193)
dependabot[bot] Mar 26, 2024
05b9ae0
Add .NET MAUI CI (#260)
jamesmontemagno Mar 27, 2024
17c76c7
Only enable Swagger UI under development mode (#267)
captainsafia Mar 29, 2024
0a3e501
Bump Duende.IdentityServer.Storage from 7.0.1 to 7.0.3 (#271)
dependabot[bot] Mar 29, 2024
7b9fa47
Bump Grpc.AspNetCore.Server.ClientFactory from 2.61.0 to 2.62.0 (#270)
dependabot[bot] Mar 30, 2024
2bb450f
Fix WebApps OpenAI usage (#269)
eerhardt Apr 1, 2024
57b73de
Fix product image urls in chat responses (#275)
stephentoub Apr 4, 2024
6ec190a
Bump xunit from 2.5.3 to 2.7.0 (#291)
dependabot[bot] Apr 8, 2024
c3f2e37
Bump OpenTelemetry.Instrumentation.Http from 1.7.1 to 1.8.0 (#289)
dependabot[bot] Apr 8, 2024
7338372
Bump coverlet.collector from 3.2.0 to 6.0.2 (#292)
dependabot[bot] Apr 8, 2024
db50c1b
Bump Microsoft.SemanticKernel from 1.6.3 to 1.7.1 (#285)
dependabot[bot] Apr 8, 2024
e2a200e
Bump OpenTelemetry.Instrumentation.Runtime from 1.7.0 to 1.8.0 (#286)
dependabot[bot] Apr 8, 2024
bca72ee
Bump AspNetCore.HealthChecks.Uris from 8.0.0 to 8.0.1 (#295)
dependabot[bot] Apr 8, 2024
3191ad6
Bump OpenTelemetry.Exporter.OpenTelemetryProtocol from 1.7.0 to 1.8.0…
dependabot[bot] Apr 8, 2024
1cdc5e8
Bump OpenTelemetry.Instrumentation.AspNetCore from 1.7.1 to 1.8.0 (#293)
dependabot[bot] Apr 8, 2024
046b301
Bump xunit.runner.visualstudio from 2.5.3 to 2.5.7 (#288)
dependabot[bot] Apr 8, 2024
92f1be4
Bump Duende.IdentityServer.Storage from 7.0.3 to 7.0.4 (#290)
dependabot[bot] Apr 8, 2024
0618455
Update to Aspire preview 5 (#257)
adityamandaleeka Apr 12, 2024
dae02f0
Merge remote-tracking branch 'tmp/main' into brecon/aprMerge
BrennanConroy Apr 12, 2024
afd500c
Updates for preview 5
BrennanConroy Apr 15, 2024
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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
registries:
public-nuget:
type: nuget-feed
url: https://api.nuget.org/v3/index.json
updates:
- package-ecosystem: nuget
directory: "/"
registries:
- public-nuget
schedule:
interval: weekly
open-pull-requests-limit: 15

48 changes: 48 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Playwright Tests for eShop
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'src/ClientApp/**'
- 'test/ClientApp.UnitTests/**'
- '.github/workflows/pr-validation-maui.yml'
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- 'src/ClientApp/**'
- 'test/ClientApp.UnitTests/**'
- '.github/workflows/pr-validation-maui.yml'
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Install Aspire
run: |
dotnet workload update
dotnet workload install aspire
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install chromium
- name: Run Playwright tests
run: npx playwright test
env:
ESHOP_USE_HTTP_ENDPOINTS: 1
USERNAME1: bob
PASSWORD: Pass123$
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
42 changes: 42 additions & 0 deletions .github/workflows/pr-validation-maui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: eShop Pull Request Validation - .NET MAUI

on:
pull_request:
branches:
- '**'
paths:
- 'src/ClientApp/**'
- 'test/ClientApp.UnitTests/**'
- '.github/workflows/pr-validation-maui.yml'
push:
branches:
- main
paths:
- 'src/ClientApp/**'
- 'test/ClientApp.UnitTests/**'
- '.github/workflows/pr-validation-maui.yml'

jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET (global.json)
uses: actions/setup-dotnet@v3

- name: Update Workloads
run: dotnet workload update

- name: Install Workloads
shell: pwsh
run: |
dotnet workload install android
dotnet workload install ios
dotnet workload install maccatalyst
dotnet workload install maui
- name: Build
run: dotnet build src/ClientApp/ClientApp.csproj

- name: Test
run: dotnet test tests/ClientApp.UnitTests/ClientApp.UnitTests.csproj
10 changes: 7 additions & 3 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ on:
pull_request:
paths-ignore:
- '**.md'
- 'src/ClientApp/**'
- 'test/ClientApp.UnitTests/**'
- '.github/workflows/pr-validation-maui.yml'
push:
branches:
- main
paths-ignore:
- '**.md'

- 'src/ClientApp/**'
- 'test/ClientApp.UnitTests/**'
- '.github/workflows/pr-validation-maui.yml'

jobs:
test:
runs-on: ubuntu-latest

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET (global.json)
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,12 @@ $RECYCLE.BIN/

# Vim temporary swap files
*.swp

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/
/user.json
.azure
4 changes: 0 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<ItemGroup>
<!-- https:/rabbitmq/rabbitmq-dotnet-client/issues/1410 is tracking fixing the one EventSource warning in RabbitMQ. -->
<IlcArg Include="--singlewarnassembly:RabbitMQ.Client" />

<!-- https:/dotnet/runtime/issues/94117 will fix the warnings coming from the ConfigBinder source generator in these assemblies. -->
<IlcArg Include="--singlewarnassembly:Aspire.RabbitMQ.Client" />
<IlcArg Include="--singlewarnassembly:Aspire.StackExchange.Redis" />
</ItemGroup>
</Target>

Expand Down
71 changes: 36 additions & 35 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<AspnetVersion>8.0.0</AspnetVersion>
<MicrosoftExtensionsVersion>8.0.0</MicrosoftExtensionsVersion>
<EfVersion>8.0.0</EfVersion>
<RuntimeVersion>8.0.0</RuntimeVersion>
<AspireVersion>8.0.0-preview.2.23619.3</AspireVersion>
<GrpcVersion>2.59.0</GrpcVersion>
<AspnetVersion>8.0.3</AspnetVersion>
<MicrosoftExtensionsVersion>8.3.0</MicrosoftExtensionsVersion>
<EfVersion>8.0.3</EfVersion>
<AspireVersion>8.0.0-preview.5.24201.12</AspireVersion>
<GrpcVersion>2.62.0</GrpcVersion>
<DuendeVersion>7.0.4</DuendeVersion>
</PropertyGroup>
<ItemGroup>
<!-- Version together with Aspire -->
<PackageVersion Include="Aspire.Azure.Messaging.ServiceBus" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Azure.CognitiveServices" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.RabbitMQ" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Redis" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Azure" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Azure.ApplicationInsights" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Azure.ServiceBus" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Npgsql" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.StackExchange.Redis" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Azure.AI.OpenAI" Version="$(AspireVersion)" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="$(AspireVersion)" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="$(AspireVersion)" />
<!-- Version together with ASP.NET -->
Expand All @@ -32,56 +39,50 @@
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="$(AspnetVersion)" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="$(MicrosoftExtensionsVersion)" />
<!-- Version together with EF -->
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="$(EfVersion)" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.15" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="Pgvector" Version="0.2.0" />
<PackageVersion Include="Pgvector.EntityFrameworkCore" Version="0.2.0" />
<!-- Version together with runtime -->
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(RuntimeVersion)" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<!-- Xabaril packages -->
<PackageVersion Include="AspNetCore.HealthChecks.NpgSql" Version="7.1.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI" Version="7.0.2" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="7.1.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="7.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.Uris" Version="7.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.Uris" Version="8.0.1" />
<!-- AI -->
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.12" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.0.1" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.7.1" />
<!-- Open Telemetry -->
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0-alpha.1" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0-alpha.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.6.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.EventCounters" Version="1.5.1-alpha.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.6.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.6.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.6.0-beta.3" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
<!-- VS Test -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<!-- Scaffolding -->
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0-rc.1.23461.3" />
<!-- Grpc -->
<PackageVersion Include="Grpc.AspNetCore" Version="$(GrpcVersion)" />
<PackageVersion Include="Grpc.AspNetCore.Server.ClientFactory" Version="$(GrpcVersion)" />
<PackageVersion Include="Grpc.Tools" Version="2.59.0" PrivateAssets="All" />
<PackageVersion Include="Grpc.Tools" Version="$(GrpcVersion)" PrivateAssets="All" />
<!-- Azure -->
<PackageVersion Include="AspNetCore.HealthChecks.AzureServiceBus" Version="7.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.AzureServiceBus" Version="8.0.0" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.0.0-beta.8" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.15.3" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.17.4" />
<!-- Miscellaneous -->
<PackageVersion Include="Automapper" Version="12.0.1" />
<PackageVersion Include="Dapper" Version="2.0.151" />
<PackageVersion Include="Automapper" Version="13.0.1" />
<PackageVersion Include="Dapper" Version="2.1.35" />
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageVersion Include="MediatR" Version="12.2.0" />
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageVersion Include="Polly" Version="8.0.0" />
<PackageVersion Include="Polly" Version="8.3.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="System.Reflection.TypeExtensions" Version="4.7.0" />
<PackageVersion Include="xunit" Version="2.5.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.1" />
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageVersion Include="Yarp.ReverseProxy" Version="2.1.0" />
</ItemGroup>
</Project>
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A reference .NET application implementing an eCommerce web site using a services
### Prerequisites

- Clone the eShop repository: https:/dotnet/eshopOnAzure
- (Windows only) Install Visual Studio. Visual Studio contains tooling support for .NET Aspire that you will want to have. [Visual Studio 2022 version 17.9 Preview](https://visualstudio.microsoft.com/vs/preview/).
- (Windows only) Install Visual Studio. Visual Studio contains tooling support for .NET Aspire that you will want to have. [Visual Studio 2022 version 17.10 Preview](https://visualstudio.microsoft.com/vs/preview/).
- During installation, ensure that the following are selected:
- `ASP.NET and web development` workload.
- `.NET Aspire SDK` component in `Individual components`.
Expand Down Expand Up @@ -47,7 +47,37 @@ Now listening on: http://localhost:18848

The sample catalog data is defined in [catalog.json](https:/dotnet/eShop/blob/main/src/Catalog.API/Setup/catalog.json). Those product names, descriptions, and brand names are fictional and were generated using [GPT-35-Turbo](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/chatgpt), and the corresponding [product images](https:/dotnet/eShop/tree/main/src/Catalog.API/Pics) were generated using [DALL·E 3](https://openai.com/dall-e-3).

### Contributing
## Use Azure Developer CLI

You can use the [Azure Developer CLI](https://aka.ms/azd) to run this project on Azure with only a few commands. Follow the next instructions:

- Install [azd](https://aka.ms/azure-dev/install).
- Log in `azd` (if you haven't done it before) to your Azure account:
```sh
azd auth login
```
- Initialize `azd` from the root of the repo.
```sh
azd init
```
- During init:
- Select `Use code in the current directory`. Azd will automatically detect the Dotnet Aspire project.
- Confirm `.Net (Aspire)` and continue.
- Select which services to expose to the Internet (exposing `webapp` is enough to test the sample).
- Finalize the initialization by giving a name to your environment.

- Create Azure resources and deploy the sample by running:
```sh
azd up
```
Notes:
- The operation takes a few minutes the first time it is ever run for an environment.
- At the end of the process, `azd` will display the `url` for the webapp. Follow that link to test the sample.
- You can run `azd up` after saving changes to the sample to re-deploy and update the sample.
- Report any issues to [azure-dev](https:/Azure/azure-dev/issues) repo.
- [FAQ and troubleshoot](https://learn.microsoft.com/azure/developer/azure-developer-cli/troubleshoot?tabs=Browser) for azd.

## Contributing

For more information on contributing to this repo, please read [the contribution documentation](./CONTRIBUTING.md) and [the Code of Conduct](CODE-OF-CONDUCT.md).

Expand Down
16 changes: 16 additions & 0 deletions e2e/AddItemTest.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { test, expect } from '@playwright/test';

test('Add item to the cart', async ({ page }) => {
await page.goto('/');

await expect(page.getByRole('heading', { name: 'Ready for a new adventure?' })).toBeVisible();
await page.getByRole('link', { name: 'Adventurer GPS Watch' }).click();
await page.getByRole('button', { name: 'Add to shopping bag' }).click();
await page.getByRole('link', { name: 'shopping bag' }).click();
await page.getByRole('heading', { name: 'Shopping bag' }).click();

await page.getByText('Total').nth(1).click();
await page.getByLabel('product quantity').getByText('1');

await expect.poll(() => page.getByLabel('product quantity').count()).toBeGreaterThan(0);
});
13 changes: 13 additions & 0 deletions e2e/BrowseItemTest.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test, expect } from '@playwright/test';

test('Browse Items', async ({ page }) => {
await page.goto('/');

await expect(page.getByRole('heading', { name: 'Ready for a new adventure?' })).toBeVisible();

await page.getByRole('link', { name: 'Adventurer GPS Watch' }).click();
await page.getByRole('heading', { name: 'Adventurer GPS Watch' }).click();

//Expect
await expect(page.getByRole('heading', { name: 'Adventurer GPS Watch' })).toBeVisible();
});
21 changes: 21 additions & 0 deletions e2e/RemoveItemTest.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { test, expect } from '@playwright/test';

test('Remove item from cart', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Ready for a new adventure?' })).toBeVisible();

await page.getByRole('link', { name: 'Adventurer GPS Watch' }).click();
await expect(page.getByRole('heading', { name: 'Adventurer GPS Watch' })).toBeVisible();

await page.getByRole('button', { name: 'Add to shopping bag' }).click();
await page.getByRole('link', { name: 'shopping bag' }).click();
await expect(page.getByRole('heading', { name: 'Shopping bag' })).toBeVisible();

await expect.poll(() => page.getByLabel('product quantity').count()).toBeGreaterThan(0);

await page.getByLabel('product quantity').fill('0');

await page.getByRole('button', { name: 'Update' }).click();

await expect(page.getByText('Your shopping bag is empty')).toBeVisible();
});
20 changes: 20 additions & 0 deletions e2e/login.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { test as setup, expect } from '@playwright/test';
import { STORAGE_STATE } from '../playwright.config';
import { assert } from 'console';

assert(process.env.USERNAME1, 'USERNAME1 is not set');
assert(process.env.PASSWORD, 'PASSWORD is not set');

setup('Login', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Ready for a new adventure?' })).toBeVisible();

await page.getByLabel('Sign in').click();
await expect(page.getByRole('heading', { name: 'Login' })).toBeVisible();

await page.getByPlaceholder('Username').fill(process.env.USERNAME1!);
await page.getByPlaceholder('Password').fill(process.env.PASSWORD!);
await page.getByRole('button', { name: 'Login' }).click();
await expect(page.getByRole('heading', { name: 'Ready for a new adventure?' })).toBeVisible();
await page.context().storageState({ path: STORAGE_STATE });
})
Loading
Loading