diff --git a/tests/test.bats b/tests/test.bats index a231687..5b196b0 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -18,23 +18,57 @@ teardown() { [ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} } +check_services() { + echo "# Checking services" >&3 + echo "# Checking if Aljibe is installed" >&3 + ddev get --installed | grep "aljibe" + echo "# Checking if Aljibe Assistant is installed" >&3 + ddev get --installed | grep "aljibe-assistant" + echo "# Checking if Adminer is installed" >&3 + ddev get --installed | grep "adminer" + echo "# Checking if BackstopJS is installed" >&3 + ddev get --installed | grep "backstopjs" + echo "# Checking if lighthouse is installed" >&3 + ddev get --installed | grep "lighthouse" + echo "# Checking if mkdocs is installed" >&3 + ddev get --installed | grep "mkdocs" + echo "# Checking if pa11y is installed" >&3 + ddev get --installed | grep "pa11y" + echo "# Checking if redis is installed" >&3 + ddev get --installed | grep "redis" + echo "# Checking if selenium is installed" >&3 + ddev get --installed | grep "selenium" + echo "# Checking if unlighthouse is installed" >&3 + ddev get --installed | grep "unlighthouse" +} + +# Check if the project is browsable with wget +check_project_browse() { + echo "# Checking if the project is browsable" >&3 + wget -qO- https://${PROJNAME}.ddev.site | grep "Welcome!" +} + + @test "install from directory" { set -eu -o pipefail cd ${TESTDIR} echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 ddev get ${DIR} - ddev restart - + ddev restart >/dev/null ddev aljibe-assistant --auto + check_services + check_project_browse } @test "install from release" { set -eu -o pipefail cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) echo "# ddev get drud/ddev-addon-template with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 - ddev get drud/ddev-addon-template + ddev get metadrop/ddev-aljibe ddev restart >/dev/null - # Do something useful here that verifies the add-on - # ddev exec "curl -s elasticsearch:9200" | grep "${PROJNAME}-elasticsearch" + ddev aljibe-assistant --auto + + check_services + check_project_browse }