blob: a25d886f8fd1eee4d69283c1badb284a967ef166 [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001#!/bin/bash
2
3set -x
4set -e
5
6REPO=`pwd`
7cd /tmp
8rm -rf drupal-twig-test
9composer create-project --no-interaction drupal/recommended-project:9.1.x-dev drupal-twig-test
10cd drupal-twig-test
11(cd vendor/twig && rm -rf twig && ln -sf $REPO twig)
12php ./web/core/scripts/drupal install --no-interaction demo_umami > output
13perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output
14source output
15#echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php
16
17wget https://get.symfony.com/cli/installer -O - | bash
18export PATH="$HOME/.symfony/bin:$PATH"
19symfony server:start -d --no-tls
20
21curl -OLsS https://get.blackfire.io/blackfire-player.phar
22chmod +x blackfire-player.phar
23cat > drupal-tests.bkf <<EOF
24name "Drupal tests"
25
26scenario
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
48EOF
49./blackfire-player.phar run drupal-tests.bkf --endpoint=`symfony var:export SYMFONY_DEFAULT_ROUTE_URL` --variable name=$DRUPAL_Username --variable pass=$DRUPAL_Password
50symfony server:stop