From 3aceeda3b2cd71e05eced669285f01b4d7713c97 Mon Sep 17 00:00:00 2001 From: Julio Date: Wed, 18 Dec 2019 11:17:21 +0100 Subject: [PATCH] Install chamilo using behat --- .travis.yml | 19 ++---------- tests/behat/features/actionInstall.feature | 29 +++++++++++++++++++ .../features/bootstrap/FeatureContext.php | 2 -- ...Reports.feature => companyReports.feature} | 0 4 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 tests/behat/features/actionInstall.feature rename tests/behat/features/{accessCompanyReports.feature => companyReports.feature} (100%) diff --git a/.travis.yml b/.travis.yml index bb670b8db3..e1147e2c58 100755 --- a/.travis.yml +++ b/.travis.yml @@ -64,34 +64,20 @@ before_install: - php -ini | grep memory_limit - sudo cat /etc/hosts - # Install Chash, a database, and then install Chamilo - - git clone https://github.com/chamilo/chash - - cd chash - - git log -1 # check chash version - - composer install - #- php -d phar.readonly=0 createPhar.php - #- chmod +x chash.phar - #- sudo mv chash.phar /usr/local/bin/chash - # Download chamilo - - php -d date.timezone="Europe/Paris" $TRAVIS_BUILD_DIR/chash/bin/console chash:chamilo_install $CHAMILO_VERSION $TRAVIS_BUILD_DIR --download-package --no-interaction --only-download-package - cd $TRAVIS_BUILD_DIR - pwd # Install vendors - - travis_wait 45 composer update - - composer analyse - # Install chamilo - - php -d date.timezone="Europe/Paris" $TRAVIS_BUILD_DIR/chash/bin/console chash:chamilo_install $CHAMILO_VERSION $TRAVIS_BUILD_DIR --no-interaction --sitename="Chamilo" --site_url="http://$VHOST_URL/" --institution="Chamilo" --institution_url="https://chamilo.org" --encrypt_method="sha1" --firstname="John" --lastname="Doe" --language="english" --driver="pdo_mysql" --host="localhost" --port="3306" --dbname="chamilo" --dbuser="root" --permissions_for_new_directories="0777" --permissions_for_new_files="0666" --linux-user="www-data" --linux-group="www-data" --username="admin" --password="admin" --email="admin@example.com" --phone="555-5555" + - composer install --prefer-source --no-interaction --dev # Install bundle js/css - php bin/console assets:install # Permissions - sudo chmod -R 777 var public + - composer analyse # Dump js routes - php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json - # Install third party js/css libraries - yarn install - ./node_modules/.bin/encore dev - # Check chamilo status - - php -d date.timezone="Europe/Paris" $TRAVIS_BUILD_DIR/chash/bin/console chash:chamilo_status # Permissions - sudo chown -R www-data:www-data $TRAVIS_BUILD_DIR - sudo chown -R 775 $TRAVIS_BUILD_DIR @@ -108,6 +94,7 @@ script: - cd tests/behat - pwd # - travis_wait 45 ../../vendor/behat/behat/bin/behat -v + - ../../vendor/behat/behat/bin/behat features/actioninstall.feature - ../../vendor/behat/behat/bin/behat features/adminFillUsers.feature - ../../vendor/behat/behat/bin/behat features/course.feature - ../../vendor/behat/behat/bin/behat features/createUser.feature diff --git a/tests/behat/features/actionInstall.feature b/tests/behat/features/actionInstall.feature new file mode 100644 index 0000000000..e9dcc1c798 --- /dev/null +++ b/tests/behat/features/actionInstall.feature @@ -0,0 +1,29 @@ +@administration +Feature: Install portal + + Scenario: See the company reports link on the admin page + Given I am on "/main/install" + Then I should see "Step1 – Installation Language" + Then I press "Next" + Then I should see "Step2 – Requirements" + Then I press "New installation" + Then I should see "Step3 – Licence" + Then I check the "accept_licence" radio button + Then I press "license-next" + Then I should see "Step4 – Database settings" + Then I fill in the following: + | dbUsernameForm | root | + | dbPassForm | root | + | dbNameForm | master | + Then I press "step3" + Then I should see "Database driver: pdo_mysql" + Then I press "step4" + Then I should see "Step5 – ConfigurationSettings" + Then I fill in the following: + | passForm | admin | + Then I press "step5" + Then I should see "Last check before install" + Then I press "Install chamilo" + Then wait for the page to be loaded + Then I should see "Installation process execution" + diff --git a/tests/behat/features/bootstrap/FeatureContext.php b/tests/behat/features/bootstrap/FeatureContext.php index de0b60e651..8069eed4e3 100644 --- a/tests/behat/features/bootstrap/FeatureContext.php +++ b/tests/behat/features/bootstrap/FeatureContext.php @@ -280,8 +280,6 @@ class FeatureContext extends MinkContext { // Just in case wait that ckeditor is loaded $this->getSession()->wait(2000); - - $this->getSession()->executeScript( " var textarea = $('textarea'); diff --git a/tests/behat/features/accessCompanyReports.feature b/tests/behat/features/companyReports.feature similarity index 100% rename from tests/behat/features/accessCompanyReports.feature rename to tests/behat/features/companyReports.feature