-
Follow the deployment instructions to provision the infrastructure in your own Azure subscription.
-
Ensure that you have the following installed on your local machine:
-
Login to AZ CLI using the details of the service principal previously created:
az login --service-principal -u <clientId> -p <clientSecret> --tenant <tenantId>
-
Git clone your forked repository to your local machine.
git clone <FORKED-REPO-URL> <PATH-TO-A-LOCAL-FOLDER>
-
Run the Products API locally:
- Open a cmd window and navigate to the
src/ContosoTraders.Api.Products
folder. - Run
dotnet user-secrets set "KeyVaultEndpoint" "https://contosotraderskv<SUFFIX>.vault.azure.net/"
. Replace<SUFFIX>
with the value used in the github repository variable. - Run
dotnet build && dotnet run
. This will start the web API athttps://localhost:62300/swagger
. - Note that your browser may show you a warning about insecure connection which you can safely ignore.
- Open a cmd window and navigate to the
-
Run the Carts API locally:
- Open a cmd window and navigate to the
src/ContosoTraders.Api.Carts
folder. - Run
dotnet user-secrets set "KeyVaultEndpoint" "https://contosotraderskv<SUFFIX>.vault.azure.net/"
. Replace<SUFFIX>
with the value used in the github repository variable. - Run
dotnet build && dotnet run
. This will start the web API athttps://localhost:62400/swagger
. - Note that your browser may show you a warning about insecure connection which you can safely ignore.
- Open a cmd window and navigate to the
-
Run the UI locally:
- Open a cmd window and navigate to the
src/ContosoTraders.Ui.Website
folder. - Run
npm install
. - Set the following environment variables:
set REACT_APP_APIURL=https://localhost:62300/v1
set REACT_APP_APIURLSHOPPINGCART=https://localhost:62400/v1
set REACT_APP_BASEURLFORPLAYWRIGHTTESTING=http://localhost:3000
(note: This endpoint ishttp://
and NOThttps://
)set REACT_APP_B2CCLIENTID=<B2C-CLIENT-ID>
(note: This step is optional. Replace<B2C-CLIENT-ID>
with the output of the command:az ad app list --display-name contoso-traders-cloud-testing-app<SUFFIX> --query "[].appId" -o tsv
)
- Run
npm run start
. This will start the UI onhttp://localhost:3000
. - Note that your browser may show you a warning about insecure connection which you can safely ignore.
- Open a cmd window and navigate to the
-
Run the Playwright UI tests locally:
- Ensure that you have executed step #7 above and launched the UI locally.
- Open a cmd window and navigate to the
src/ContosoTraders.Ui.Website
folder. - Run
npx playwright install --with-deps
. - Run
npx playwright test
. - The Playwright UI tests will run for a few minutes and a HTML report will be displayed at the end.