Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -x |
| 4 | set -e |
| 5 | |
| 6 | REPO=`pwd` |
| 7 | cd /tmp |
| 8 | rm -rf drupal-twig-test |
| 9 | composer create-project --no-interaction drupal/recommended-project:9.1.x-dev drupal-twig-test |
| 10 | cd drupal-twig-test |
| 11 | (cd vendor/twig && rm -rf twig && ln -sf $REPO twig) |
| 12 | php ./web/core/scripts/drupal install --no-interaction demo_umami > output |
| 13 | perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output |
| 14 | source output |
| 15 | #echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php |
| 16 | |
| 17 | wget https://get.symfony.com/cli/installer -O - | bash |
| 18 | export PATH="$HOME/.symfony/bin:$PATH" |
| 19 | symfony server:start -d --no-tls |
| 20 | |
| 21 | curl -OLsS https://get.blackfire.io/blackfire-player.phar |
| 22 | chmod +x blackfire-player.phar |
| 23 | cat > drupal-tests.bkf <<EOF |
| 24 | name "Drupal tests" |
| 25 | |
| 26 | scenario |
| 27 | name "homepage" |
| 28 | set name "admin" |
| 29 | set pass "pass" |
| 30 | |
| 31 | visit url('/') |
| 32 | expect status_code() == 200 |
| 33 | click link('Articles') |
| 34 | expect status_code() == 200 |
| 35 | click link('Dairy-free and delicious milk chocolate') |
| 36 | expect body() matches "/Dairy\-free milk chocolate is made in largely the same way as regular chocolate/" |
| 37 | expect status_code() == 200 |
| 38 | click link('Log in') |
| 39 | expect status_code() == 200 |
| 40 | submit button("Log in") |
| 41 | param name name |
| 42 | param pass pass |
| 43 | expect status_code() == 303 |
| 44 | follow |
| 45 | expect status_code() == 200 |
| 46 | click link('Structure') |
| 47 | expect status_code() == 200 |
| 48 | EOF |
| 49 | ./blackfire-player.phar run drupal-tests.bkf --endpoint=`symfony var:export SYMFONY_DEFAULT_ROUTE_URL` --variable name=$DRUPAL_Username --variable pass=$DRUPAL_Password |
| 50 | symfony server:stop |