Skip to content

Commit

Permalink
feat: adds playwright (#38)
Browse files Browse the repository at this point in the history
closes #37
  • Loading branch information
DavidCardoso authored May 15, 2024
1 parent 66f42c1 commit 3a71355
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Tools via **Unix Command Line Interface** with no installation and just using **
- [Ookla Speedtest CLI](#ookla-speedtest-cli)
- [Google Cloud CLI](#google-cloud-cli)
- [Graph Viz for docker compose](#graph-viz-for-docker-compose)
- [Playwright](#playwright)
- [Author](#author)
- [Contributors](#contributors)

Expand Down Expand Up @@ -396,6 +397,10 @@ gcloud help
gcloud storage ls
```
> [gcloud CLI overview](https://cloud.google.com/sdk/gcloud).
> [gcloud auth login](https://cloud.google.com/sdk/gcloud/reference/auth/login).
### Graph Viz for docker compose
This will create a dependency graph in `display` only, `dot`, or `image` formats
Expand Down Expand Up @@ -423,9 +428,17 @@ docker-compose-viz render --output-format=image
docker-compose-viz render --output-format=image --output-file=graph.png
```
> [gcloud CLI overview](https://cloud.google.com/sdk/gcloud).
### Playwright
> [gcloud auth login](https://cloud.google.com/sdk/gcloud/reference/auth/login).
```shell
playwright # it will open the /bin/bash inside the container
# then you can run the other test related commands
npx playwright install chromium
npm run test
# etc...
```
> For more info, please check its [official documentation](https://playwright.dev/docs/docker).
## Author
Expand Down
13 changes: 13 additions & 0 deletions bin/playwright
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

IMAGE=mcr.microsoft.com/playwright:v1.44.0-jammy
WORKDIR=/app

# should be executed from your working directory
docker run -it --rm \
--volume $PWD:$WORKDIR \
--workdir $WORKDIR \
--network="host" \
--ipc=host \
$IMAGE "${@}"
9 changes: 8 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ install_docker-compose-viz() {
sudo ln -sf ${BASEDIR}/bin/docker-compose-viz /usr/local/bin/docker-compose-viz
}

install_playwright() {
show_msg "Activating playwright..."
sudo ln -sf ${BASEDIR}/bin/playwright /usr/local/bin/playwright
}

install_all() {
install_aws
install_node
Expand All @@ -154,14 +159,15 @@ install_all() {
install_speedtest
install_gcloud
install_docker-compose-viz
install_playwright
}

# Main

show_begin

PS3="Choose an option: "
select opt in ALL aws node yarn yarn-berry serverless terraform speedtest gcloud docker-compose-viz EXIT; do
select opt in ALL aws node yarn yarn-berry serverless terraform speedtest gcloud docker-compose-viz playwright EXIT; do
case ${opt} in
ALL) install_all ;;
aws) install_aws ;;
Expand All @@ -173,6 +179,7 @@ select opt in ALL aws node yarn yarn-berry serverless terraform speedtest gcloud
speedtest) install_speedtest ;;
gcloud) install_gcloud ;;
docker-compose-viz) install_docker-compose-viz ;;
playwright) install_playwright ;;
EXIT) show_msg "Bye o/" ;;
*) show_help "Error: incorrect option." && exit 2 ;;
esac
Expand Down

0 comments on commit 3a71355

Please sign in to comment.