diff --git a/scripts/apply-tests.sh b/scripts/apply-tests.sh deleted file mode 100644 index d27917694d7c938117f3881ad94811df605deada..0000000000000000000000000000000000000000 --- a/scripts/apply-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase Apply tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase/step2-apply-tests --format pretty --out std --format html --out tests/reports/varbase-apply-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/check-tests.sh b/scripts/check-tests.sh deleted file mode 100644 index 1f507dd8ddf945b946ee955f69bad7190ab1418d..0000000000000000000000000000000000000000 --- a/scripts/check-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase check tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase --tags '@check' --format pretty --out std --format html --out tests/reports/varbase-check-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/cleanup-tests.sh b/scripts/cleanup-tests.sh deleted file mode 100644 index 182acaf2c38e915b067288be994159ad6c712736..0000000000000000000000000000000000000000 --- a/scripts/cleanup-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase Cleanup tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase/step3-cleanup-tests --format pretty --out std --format html --out tests/reports/varbase-cleanup-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/full-development-tests.sh b/scripts/full-development-tests.sh deleted file mode 100644 index 8cf0d4fe3d97951051493271ed7245c3f09ced6f..0000000000000000000000000000000000000000 --- a/scripts/full-development-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase Full Development tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase --tags '@development' --format pretty --out std --format html --out tests/reports/varbase-full-development-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/full-local-tests.sh b/scripts/full-local-tests.sh deleted file mode 100644 index 8309a3e5a333301be42a65cf4957d6b60772d0ef..0000000000000000000000000000000000000000 --- a/scripts/full-local-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase Full local tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase --tags '@local' --format pretty --out std --format html --out tests/reports/varbase-full-local-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/full-production-tests.sh b/scripts/full-production-tests.sh deleted file mode 100644 index 2a32aecf5cc482f6ed75551c549d317ab9c3aee1..0000000000000000000000000000000000000000 --- a/scripts/full-production-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase Full Production tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase --tags '@production' --format pretty --out std --format html --out tests/reports/varbase-full-production-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/full-staging-tests.sh b/scripts/full-staging-tests.sh deleted file mode 100644 index 08a2ae23f7b1f1ce89e3cdd95512bbdb2b89ff33..0000000000000000000000000000000000000000 --- a/scripts/full-staging-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase Full Staging tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase --tags '@staging' --format pretty --out std --format html --out tests/reports/varbase-full-staging-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/full-tests.sh b/scripts/full-tests.sh deleted file mode 100644 index 4ce8459d4cfc32d56dd1d6f5859f0490a3462449..0000000000000000000000000000000000000000 --- a/scripts/full-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase Full tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase --format pretty --out std --format html --out tests/reports/varbase-full-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/scripts/init-tests.sh b/scripts/init-tests.sh deleted file mode 100644 index 11bcc2d0a606b517d115641083245c52318e7a89..0000000000000000000000000000000000000000 --- a/scripts/init-tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo "Varbase init tests"; -cd docroot/profiles/varbase; -../../../bin/behat tests/features/varbase/step1-init-tests --format pretty --out std --format html --out tests/reports/varbase-init-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); diff --git a/tests/README.md b/tests/README.md index f8ffec58c99af4a50b994aed8d6952e2f26e5928..f4ec94424f9a9bfcb3a4fac3eb2d4cdff7025b38 100644 --- a/tests/README.md +++ b/tests/README.md @@ -11,8 +11,10 @@ To test varbase 8.x-4.x in the right way you will need to build varbase using the composer. +## Create a Varbase project with [Composer](https://getcomposer.org/download/): + ``` -composer create-project Vardot/varbase-build:8.4.0-beta5 PROJECT_DIR_NAME --stability beta --no-interaction +composer create-project vardot/varbase-project:8.4.x-dev PROJECT_DIR_NAME --stability dev --no-interaction ``` -------------------------------------------------------------------------------- @@ -214,3 +216,88 @@ $ ../../../bin/behat -di varbase Install config file, as you can see in the following command. $ ../../../bin/behat --config=behat.varbase-install.yml tools/install-varbase/default-installation.feature + +# Automated testing +To run the automated testing with behat you will need to change the [ wd_host and base_url ] settings in the +[ behat.varbase.yml ] file to go with your project configuration and the selenium server. + +``` + Behat\MinkExtension: + files_path: "%paths.base%/tests/assets/" + goutte: ~ + selenium2: + wd_host: 127.0.0.1:4445/wd/hub + capabilities: + browser: 'firefox' + # browser: 'chrome' + # browser: 'phantomjs' + nativeEvents: true + base_url: 'http://127.0.0.1:8080' + browser_name: 'firefox' + # browser_name: 'chrome' + # browser_name: 'phantomjs' + javascript_session: selenium2 +``` + +Testing scenarios are tagged with the Behat tags of: + +@local = Local +@development = Development server. +@staging = Staging and testing server. +@production = Production live server. + +So that we only run bin/behat --tags with the right tag for the environment. + +Run the varbase check tests. Only to check, without any changes to the website. +``` +cd docroot/profiles/varbase; +../../../bin/behat tests/features/varbase --tags '@check' --format pretty --out std --format html --out tests/reports/varbase-check-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +``` + +Run the varbase full local tests. which developers could test all scenarios in their local machine environment. +``` +cd docroot/profiles/varbase; +../../../bin/behat tests/features/varbase --tags '@local' --format pretty --out std --format html --out tests/reports/varbase-full-local-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +``` + +Run the varbase full development tests. which developers could test scenarios on the website at the development environment. +``` +cd docroot/profiles/varbase; +../../../bin/behat tests/features/varbase --tags '@development' --format pretty --out std --format html --out tests/reports/varbase-full-development-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +``` + +Run the varbase full staging tests. which developers could test scenarios on the website at the staging environment. +``` +cd docroot/profiles/varbase; +../../../bin/behat tests/features/varbase --tags '@staging' --format pretty --out std --format html --out tests/reports/varbase-full-staging-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +``` + +Run the varbase full production only tests. not to change anything with test scenarios on the production environment. +``` +cd docroot/profiles/varbase; +../../../bin/behat tests/features/varbase --tags '@production' --format pretty --out std --format html --out tests/reports/varbase-full-production-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +``` + +Run the varbase full tests. init, apply, then cleanup. +``` +cd docroot/profiles/varbase; +../../../bin/behat tests/features/varbase/step1-init-tests --format pretty --out std --format html --out tests/reports/varbase-init-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +../../../bin/behat tests/features/varbase/step2-apply-tests --format pretty --out std --format html --out tests/reports/varbase-apply-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +../../../bin/behat tests/features/varbase/step3-cleanup-tests --format pretty --out std --format html --out tests/reports/varbase-cleanup-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +``` + +Run the varbase full tests. Which equivalent to varbase-init-tests, varbase-apply-tests, varbase-cleanup-tests +``` +cd docroot/profiles/varbase; +../../../bin/behat tests/features/varbase --format pretty --out std --format html --out tests/reports/varbase-full-tests-report-$( date '+%Y-%m-%d_%H-%M-%S' ); +``` + +We could run behat tests with this set +Go to [ PROJECT_DIR_NAME/docroot/profiles/varbase ] in the terminal then you could run the following command: +``` +$ ../../../bin/behat tests/features/varbase + +``` + +Then you will be able to open the full report for the automated test in a web browser at the following path: +[ PROJECT_DIR_NAME/docroot/profiles/varbase/tests/reports ]