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

Add a just recipe to install Playwright #1742

Merged
merged 1 commit into from
Dec 19, 2024
Merged
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
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 @@ -82,6 +82,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
Loading