Skip to content
Merged
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
24 changes: 16 additions & 8 deletions commands/host/1x-playwright-install
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,25 @@ echo -e "${GREEN}Installing playwright (within DDEV):${NC}"
ddev add-on get lullabot/ddev-playwright --version 0.5.0
ddev restart

[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync
# Make sure we have a test/playwright-folder.
ddev exec -d /var/www/html/ "mkdir -p test/playwright"
# Empty JSON so the `ddev install-playwright` actually installs.
[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync
ddev exec -d /var/www/html/test/playwright 'echo "{}" > ./package.json'
# Only create an empty package.json if it doesn't exist.
if [ ! -f "$DDEV_APPROOT/test/playwright/package.json" ]; then
[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync
# Make sure we have a test/playwright-folder.
ddev exec -d /var/www/html/ "mkdir -p test/playwright"
# Empty JSON so the `ddev install-playwright` actually installs.
[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync
ddev exec -d /var/www/html/test/playwright 'echo "{}" > ./package.json'
fi

[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync
# Install playwright *inside* the ddev container (see lullabot/ddev-playwright)
ddev install-playwright

[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync
# Use our forked starterkit https://github.com/1xINTERNET/create-dxp-playwright to scaffold.
ddev exec -d /var/www/html/test/playwright "npx --yes 1xINTERNET/create-dxp-playwright --version='~1.58' --quiet"

if [ ! -f "$DDEV_APPROOT/test/playwright/package-lock.json" ]; then
# Use our forked starterkit https://github.com/1xINTERNET/create-dxp-playwright to scaffold.
ddev exec -d /var/www/html/test/playwright "npx --yes 1xINTERNET/create-dxp-playwright --version='~1.58' --quiet"
else
echo "Notice: because of an existing test/playwright/package-lock.js, we have NOT (re-)installed 1xINTERNET/create-dxp-playwright!"
fi