Skip to content

Commit

Permalink
Add a just recipe to install Playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Dec 9, 2024
1 parent 444ea97 commit d5509e8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ jobs:
run: dotnet build -c Release --no-restore
working-directory: TeachingRecordSystem/tests/${{ matrix.project }}

- name: Check for Playwright
- name: Install Playwright if required
run: |
playwright_script=./bin/Release/net8.0/playwright.ps1
if [ -f $playwright_script ]; then
pwsh $playwright_script install chromium
if [[ "$PROJECT_NAME" =~ .*EndToEndTests ]]; then
pwsh ./bin/Release/net8.0/playwright.ps1 install chromium
fi
working-directory: TeachingRecordSystem/tests/${{ matrix.project }}
env:
PROJECT_NAME: ${{ matrix.project }}

- name: Run tests
uses: ./.github/workflows/actions/test
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ As well as NuGet packages, there are some client-side libraries required. A `jus
just restore
```

### Install Playwright

Playwright is used for end-to-end testing. Install it with a `just` recipe:
```shell
just install-playwright
```


### Database setup

Expand Down
6 changes: 5 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ default:
# Install local tools
install-tools:
@cd {{solution-root}} && dotnet tool restore
npm install -g sass
@npm install -g sass

# Restore dependencies
restore:
@cd {{solution-root}} && dotnet restore --locked-mode
@cd {{solution-root / "src" / "TeachingRecordSystem.SupportUi" }} && dotnet libman restore --verbosity quiet
@cd {{solution-root / "src" / "TeachingRecordSystem.AuthorizeAccess" }} && dotnet libman restore --verbosity quiet

# Install Playwright
install-playwright:
@cd {{solution-root / "tests" / "TeachingRecordSystem.AuthorizeAccess.EndToEndTests"}} && pwsh bin/Debug/net8.0/playwright.ps1 install chromium

# Run the trscli
cli *ARGS:
@dotnet {{solution-root / "src" / "TeachingRecordSystem.Cli" / "bin" / "Debug" / "net8.0" / "trscli.dll"}} {{ARGS}}
Expand Down

0 comments on commit d5509e8

Please sign in to comment.