Skip to content

Commit 3a71355

Browse files
authored
feat: adds playwright (#38)
closes #37
1 parent 66f42c1 commit 3a71355

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Tools via **Unix Command Line Interface** with no installation and just using **
2626
- [Ookla Speedtest CLI](#ookla-speedtest-cli)
2727
- [Google Cloud CLI](#google-cloud-cli)
2828
- [Graph Viz for docker compose](#graph-viz-for-docker-compose)
29+
- [Playwright](#playwright)
2930
- [Author](#author)
3031
- [Contributors](#contributors)
3132

@@ -396,6 +397,10 @@ gcloud help
396397
gcloud storage ls
397398
```
398399
400+
> [gcloud CLI overview](https://cloud.google.com/sdk/gcloud).
401+
402+
> [gcloud auth login](https://cloud.google.com/sdk/gcloud/reference/auth/login).
403+
399404
### Graph Viz for docker compose
400405
401406
This will create a dependency graph in `display` only, `dot`, or `image` formats
@@ -423,9 +428,17 @@ docker-compose-viz render --output-format=image
423428
docker-compose-viz render --output-format=image --output-file=graph.png
424429
```
425430
426-
> [gcloud CLI overview](https://cloud.google.com/sdk/gcloud).
431+
### Playwright
427432
428-
> [gcloud auth login](https://cloud.google.com/sdk/gcloud/reference/auth/login).
433+
```shell
434+
playwright # it will open the /bin/bash inside the container
435+
# then you can run the other test related commands
436+
npx playwright install chromium
437+
npm run test
438+
# etc...
439+
```
440+
441+
> For more info, please check its [official documentation](https://playwright.dev/docs/docker).
429442
430443
## Author
431444

bin/playwright

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
set -e
3+
4+
IMAGE=mcr.microsoft.com/playwright:v1.44.0-jammy
5+
WORKDIR=/app
6+
7+
# should be executed from your working directory
8+
docker run -it --rm \
9+
--volume $PWD:$WORKDIR \
10+
--workdir $WORKDIR \
11+
--network="host" \
12+
--ipc=host \
13+
$IMAGE "${@}"

setup.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ install_docker-compose-viz() {
144144
sudo ln -sf ${BASEDIR}/bin/docker-compose-viz /usr/local/bin/docker-compose-viz
145145
}
146146

147+
install_playwright() {
148+
show_msg "Activating playwright..."
149+
sudo ln -sf ${BASEDIR}/bin/playwright /usr/local/bin/playwright
150+
}
151+
147152
install_all() {
148153
install_aws
149154
install_node
@@ -154,14 +159,15 @@ install_all() {
154159
install_speedtest
155160
install_gcloud
156161
install_docker-compose-viz
162+
install_playwright
157163
}
158164

159165
# Main
160166

161167
show_begin
162168

163169
PS3="Choose an option: "
164-
select opt in ALL aws node yarn yarn-berry serverless terraform speedtest gcloud docker-compose-viz EXIT; do
170+
select opt in ALL aws node yarn yarn-berry serverless terraform speedtest gcloud docker-compose-viz playwright EXIT; do
165171
case ${opt} in
166172
ALL) install_all ;;
167173
aws) install_aws ;;
@@ -173,6 +179,7 @@ select opt in ALL aws node yarn yarn-berry serverless terraform speedtest gcloud
173179
speedtest) install_speedtest ;;
174180
gcloud) install_gcloud ;;
175181
docker-compose-viz) install_docker-compose-viz ;;
182+
playwright) install_playwright ;;
176183
EXIT) show_msg "Bye o/" ;;
177184
*) show_help "Error: incorrect option." && exit 2 ;;
178185
esac

0 commit comments

Comments
 (0)