Skip to content
Snippets Groups Projects
Commit cd157197 authored by Rajab Natshah's avatar Rajab Natshah Committed by GitHub
Browse files

Issue #2905595: Optimization round for the automated functional acceptance testing

parent 75a89b7c
No related branches found
No related tags found
No related merge requests found
Showing
with 84 additions and 118 deletions
......@@ -9,11 +9,37 @@ cache:
- "$HOME/.selenium/cache"
php:
- 5.6
- 7.0
env:
- VERSION=8.x-4.x
env:
- AFATG=01-website-base-requirements
- AFATG=02-user-management
- AFATG=03-admin-managment
- AFATG=04-content-structure
- AFATG=05-content-management
matrix:
exclude:
# Automated Functional Acceptance Testing group: 01 website base requirements
- php: 7.0
env: AFATG=01-website-base-requirements
# Automated Functional Acceptance Testing group: 02 user management
- php: 7.0
env: AFATG=02-user-management
# Automated Functional Acceptance Testing group: 03 admin managment
- php: 7.0
env: AFATG=03-admin-managment
# Automated Functional Acceptance Testing group: 04 content structure
- php: 7.0
env: AFATG=04-content-structure
# Automated Functional Acceptance Testing group: 05 content-management
- php: 7.0
env: AFATG=05-content-management
dist: precise
addons:
......@@ -30,7 +56,7 @@ addons:
- xserver-xorg-core
mysql:
database: drupal
database: test_varbase4c
username: root
encoding: utf8
......@@ -40,68 +66,58 @@ before_install:
- composer self-update
- composer --version
# Composer Configurations.
- export PATH="$HOME/.composer/vendor/bin:$TRAVIS_BUILD_DIR/bin:$PATH"
- export COMPOSER_EXIT_ON_PATCH_FAILURE=1
# MySQL Configurations.
- mysql -e 'SET GLOBAL wait_timeout = 5400;'
- mysql -e "SHOW VARIABLES LIKE 'wait_timeout'"
# PHP Configurations.
- echo 'max_execution_time = 1200' >> drupal.php.ini;
- echo 'max_input_time = 180' >> drupal.php.ini;
- echo 'max_input_vars = 10000' >> drupal.php.ini;
- echo 'memory_limit = 2048M' >> drupal.php.ini;
- echo 'error_reporting = E_ALL' >> drupal.php.ini;
- echo 'post_max_size = 64M' >> drupal.php.ini;
- echo 'upload_max_filesize = 32M' >> drupal.php.ini;
- echo 'max_file_uploads = 40' >> drupal.php.ini;
- echo 'sendmail_path = /bin/true' >> drupal.php.ini;
- phpenv config-add drupal.php.ini
- echo 'max_execution_time = 1200' >> varbase.php.ini;
- echo 'max_input_time = 180' >> varbase.php.ini;
- echo 'max_input_vars = 10000' >> varbase.php.ini;
- echo 'memory_limit = 2048M' >> varbase.php.ini;
- echo 'error_reporting = E_ALL' >> varbase.php.ini;
- echo 'post_max_size = 64M' >> varbase.php.ini;
- echo 'upload_max_filesize = 32M' >> varbase.php.ini;
- echo 'max_file_uploads = 40' >> varbase.php.ini;
- echo 'sendmail_path = /bin/true' >> varbase.php.ini;
- phpenv config-add varbase.php.ini
- phpenv rehash
# Configure the display.
# Configure and run the virtual display.
- export DISPLAY=:0
- sh -e /etc/init.d/xvfb start
- Xvfb :0 -ac -screen 0 1366x768x24 &
- sleep 3 # give xvfb some time to start
# Print firefox version.
- firefox --version
- sleep 3
# Run selenium standalone server.
- SELENIUM="$HOME/.selenium/cache/selenium-server-standalone-2.53.1.jar";
- if [[ ! -f $SELENIUM ]]; then wget -O $SELENIUM http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar; fi
- java -jar $SELENIUM -port 4445 > /dev/null 2>&1 &
- echo "[ OK ] Starting Selenium on the 4445 port ..."
- composer global require phing/phing
install:
- phing build -Dversion=$VERSION -Dbranch=$TRAVIS_COMMIT
- phing install -Ddb.database=drupal
- if [ $VERSION != "HEAD" ]; then phing update; fi
before_script:
- git checkout $TRAVIS_COMMIT
## Build with the composer.
- composer install --no-interaction -vvv
## Install with drush.
- cd docroot
- drush site-install varbase --yes --site-name='Test Varbase4c' --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url="mysql://root:@localhost/test_varbase4c" varbase_multilingual_configuration.enable_multilingual=true varbase_extra_components.vmi=true varbase_extra_components.varbase_heroslider_media=true varbase_extra_components.varbase_carousels=true varbase_extra_components.varbase_search=true varbase_development_tools.varbase_development=true
- drush pm-enable vbp_text_and_image --yes
- drush config-set system.performance css.preprocess 0 --yes
- drush config-set system.performance js.preprocess 0 --yes
- drush config-set system.logging error_level all --yes
before_script:
- drush runserver --default-server=builtin 8080 &>/dev/null &
- sleep 5
# Install Varbase Development feature.
# Development Environment Modules and Features, make sure to disable this feature in production.
- drush -y en varbase_development -vvv
- drush -y en varbase_heroslider_media -vvv
- drush -y en varbase_carousels -vvv
- drush -y en varbase_search -vvv
- drush -y en vbp_text_and_image -vvv
script:
- cd ./profiles/varbase
- behat --strict tests/features/varbase/step1-init-tests/
- behat --strict tests/features/varbase/step2-apply-tests/
- behat --strict tests/features/varbase/step2-apply-tests/$AFATG
# - behat --strict tests/features/varbase/step3-cleanup-tests/ # no need as we build every time.
matrix:
fast_finish: true
fast_finish: true
\ No newline at end of file
......@@ -43,6 +43,7 @@ default:
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MarkupContext
- Drupal\DrupalExtension\Context\BatchContext
- Behatch\Context\SystemContext
- behatch:browser:
timeout: 1
- behatch:debug:
......@@ -93,7 +94,7 @@ default:
error_message_selector: '.messages.error'
success_message_selector: '.messages.status'
warning_message_selector: '.messages.warning'
Sanpi\Behatch\Extension: ~
Behatch\Extension: ~
emuse\BehatHTMLFormatter\BehatHTMLFormatterExtension:
name: html
renderer: Twig,Behat2
......
......@@ -9,7 +9,7 @@
<property name="db.host" value="localhost" />
<property name="db.user" value="root" />
<property name="db.password" value="" />
<property name="db.database" value="varbase" />
<property name="db.database" value="test_varbase4c" />
<property name="db.url" value="${db.type}://${db.user}:${db.password}@${db.host}/${db.database}" />
<property name="docroot" value="docroot" />
<property name="profile" value="${docroot}/profiles/varbase" />
......@@ -60,29 +60,6 @@
<filesync destinationDir="." rsyncPath="${rsync}" sourceDir="${profile}/" verbose="false" exclude="libraries,modules/contrib,behat.local.yml" />
</target>
<!-- Builds Varbase with Composer. -->
<target name="build" depends="env">
<if>
<equals arg1="${version}" arg2="HEAD" />
<then>
<exec command="${composer} install" passthru="true" />
</then>
<else>
<if>
<not>
<isset property="branch" />
</not>
<then>
<exec command="git rev-parse --abbrev-ref HEAD" outputProperty="branch" />
</then>
</if>
<exec command="git checkout ${version}" />
<exec command="${composer} install" passthru="true" />
<exec command="git checkout ${branch}" />
</else>
</if>
</target>
<!-- Prepares the docroot for installation via the UI. -->
<target name="preinstall" depends="uninstall">
<if>
......@@ -110,10 +87,11 @@
</if>
</target>
<!-- Installs Varbase and sets it up for development. -->
<target name="install" depends="env">
<!-- Install with drush site install -->
<target name="install-with-drush-site-install" depends="env">
<!-- Use passthru() when executing drush site-install so that we'll know if errors occur. -->
<exec command="${drush} site-install varbase --yes --site-name=Varbase4 --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url=${db.url} varbase_multilingual_configuration.enable_multilingual=true -vvv" dir="${docroot}" passthru="true" />
<exec command="${drush} site-install varbase --yes --site-name='Test Varbase4c' --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url=${db.url} varbase_multilingual_configuration.enable_multilingual=true varbase_extra_components.vmi=true varbase_extra_components.varbase_heroslider_media=true varbase_extra_components.varbase_carousels=true varbase_extra_components.varbase_search=true varbase_development_tools.varbase_development=true" dir="${docroot}" passthru="true" />
<exec command="${drush} en vbp_text_and_image --yes" dir="${docroot}" />
<exec command="${drush} config-set system.performance css.preprocess 0 --yes --format=boolean" dir="${docroot}" />
<exec command="${drush} config-set system.performance js.preprocess 0 --yes --format=boolean" dir="${docroot}" />
<exec command="${drush} config-set system.logging error_level all --yes" dir="${docroot}" />
......
......@@ -1344,11 +1344,9 @@ JS;
/**
* #varbase: To expand a field group by its id attribute.
*
* Example 1: I Expand the field "Field Group ID"
* @When I Expand the field :arg1
* Example #1: I expand the field "Field Group ID"
*
* @param $text
* @throws \InvalidArgumentException
* @When I expand the field :arg1
*/
public function iExpandThefield($fieldID) {
$js = <<<JS
......@@ -1360,12 +1358,11 @@ JS;
/**
* #varbase: To expand a select list by it's class attribute.
*
* @When I Expand the :nth select list :arg1
*
* @param $text
* @throws \InvalidArgumentException
*/
* Example #1: I expand the "1" select list "dropbutton-multiple"
*
* @When I expand the :nth select list :arg1
*/
public function iExpandTheSelectList($index, $listClassName) {
$js = <<<JS
var group = document.getElementsByClassName("{$listClassName}")[{$index}];
......@@ -1376,6 +1373,8 @@ JS;
/**
* #varbase: To scroll down in the current status of the page.
*
* Example #1: When I scrolldown
*
* @When I scrolldown
*/
......@@ -1384,7 +1383,9 @@ JS;
}
/**
* #varbase: To scroll up in the current status of the page.
* #varbase: To scroll up in the current status of the page, about 350 up
*
* Example #1: When I scrollup
*
* @When I scrollup
*/
......
......@@ -21,12 +21,11 @@ initialization and cleaning up after the test.
$ bin/behat features/varbase/step2-apply-tests
$ bin/behat features/varbase/step3-cleanup-tests
```
For more custom commands: [Varbase Automated Functional Testing](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/README.md)
## List of features in the step 1 init tests:
--------------------------------------------------------------------------------
* [Feature: Create default testing users.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step1-init-tests/1-create-default-testing-users.feature)
```
test_authenticated: { email: 'authenticated.test@vardot.com', password: 'dD.123123ddd' }
test_editor: { email: 'editor.test@vardot.com', password: 'dD.123123ddd' }
......@@ -35,43 +34,14 @@ test_site_admin: { email: 'site.admin.test@vardot.com', password: 'dD.123123ddd'
test_super_admin: { email: 'super.admin.test@vardot.com', password: 'dD.123123ddd' }
```
* [Feature: Add Arabic language if we do not have it to languages in the system.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step1-init-tests/2-add-arabic.feature)
## List of Features in the step 2 apply tests:
--------------------------------------------------------------------------------
* [01 - Feature: Website Base Requirements - User Registration - Only admins login](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/01-website-base-requirements_user-registration_only-admins-login_v4-0.feature)
* [02 - Feature: Website Base Requirements - User Roles - Simple Roles](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/02-website-base-requirements_user-roles_simple-roles_v4-0.feature)
* [03 - Feature: User Management - Standard User Management - Request new password](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/03-user-management_standard-user-managment_request-new-password_v4-0.feature)
* [04 - Feature: Website Base Requirements - Website Languages - All content translatable to all languages](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/04-website-base-requirements_website-languages_all-content-translatable-to-all-languages_v4-0.feature)
* [05 - Feature: User Management - Standard User Management - Admins can create users and assign a role to them](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/05-user-management_standard-user-management_admins-can-create-users-and-assign-role-them_v4-0.feature)
* [06 - Feature: Website Base Requirements - Website Languages - English](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/06-website-base-requirements_website-languages_english_v4-0.feature)
* [07 - Feature: User Management - Standard User Management - Login](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/07-user-management_standard-user-managment_login_v4-0.feature)
* [08 - Feature: Content Editing - Rich Text Editor - Convert URLs into links](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/08-content-editing_rich-text-editor_convert-urls-links_v4-0.feature)
* [09 - Feature: Content Editing - Rich Text Editor - Easy linking to internal content by searching for content by its titles](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/09-content-editing_rich-text-editor_easy-linking-internal-content-searching-content-by-its-titles-v4-0.feature)
* [10 - Feature: Content Editing - Rich Text Editor - Input formats](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/10-content-editing_rich-text-editor_input-formats-v4-0.feature)
* [11 - Feature: Content Structure Features - Basic Pages - Basic page](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/11-content-structure-features_basic-pages_basic-page_v4-0.feature)
* [12 - Feature: Content Structure Features - Basic Pages - Pages with pre-defined layouts](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/12-content-structure-features_basic-pages_pages-with-pre-defined-layouts_v4-0.feature)
* [13 - Feature: File & Media Management - Assets Management - Ability to embed existing media image library in the rich text editor](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/13-file-and-media-management_assets-management_ability-to-embed-existing-media-image-library-in-the-rich-text-editor_v4-0.feature)
* [14 - Feature: File & Media Management - Assets Management - Image media and their usage list page for site admins](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/14-file-and-media-management_assets-management_image-media-and-their-usage-list-page-for-admins_v4-0.feature)
* [15 - Feature: Support Requirements - Standard Support Navigation - Allow site super administrators to switch users and surf the site as that user.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/15-masquerade-allows-site-administrators-to-switch-users-and-surf-the-site-as-that-user.feature)
* [16 - Feature: Navigational Features - Breadcrumbs - Standard breadcrumbs](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/16-navigational-features_breadcrumbs_standard-breadcrumbs_v4-0.feature)
* [17 - Feature: Add default entityqueue module testing content and configuration.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/17-add-default-entityqueue-testing-content-and-config.feature)
* [18 - Feature: Module Requirements - Standard Entity Queue Management - Have the option to Reverse order in admin view.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/18-entityqueue-reverse-order-in-admin-view.feature)
* [19 - Feature: Module Requirements - Standard Entity Queue Management - Have Entityqueue tab inside the full content page and be able to Add to a queue or Remove from a queue](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/19-entityqueue-tab-for-content-types.feature)
* [20 - Feature: Module Requirements - Standard Back-End Navigation - Navigate through the Drupal admin with the keyboard for faster access](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/20-coffee-standard-back-end-navigation-navigate-through-drupal-admin-keyboard.feature)
* [21 - Feature: user requirements - Have persistent login options and configurations.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/21-persistent-login-testing.feature)
* [22 - Feature: User Management - Standard User Management - Admins can disable users](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/22-user-management_standard-user-managment_admins-can-disable-users_v4-0.feature)
* [23 - Feature: User Management - Standard User Management - Users with permission to assign roles may select which roles are available for assignment.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/23-roleassign-testing.feature)
* [24 - Feature: User Management - Standard User Management - Have fine-grained access control of user administrators protections with specific user, or all users in a role.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/24-userprotect-testing.feature)
* [25 - Feature: Landing Pages - Add any paragraph types to the page.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/25-landing-page_add-any-paragraph-type-to-the-page.feature)
* [26 - Feature: Content Structure Features - Landing Pages - Varbase text and image paragraphs.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step2-apply-tests/26-content-structure-features_anding-pages-varbase-text-and-image-paragraphs.feature)
## List of features in the step 2 cleanup tests:
## List of features in the step 3 cleanup tests:
--------------------------------------------------------------------------------
* [Feature: Delete default testing users.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step3-cleanup-tests/1-delete-default-testing-users.feature)
```
test_authenticated
test_editor
......@@ -79,6 +49,3 @@ test_content_admin
test_site_admin
test_super_admin
```
* [Feature: Delete Arabic language from the system.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step3-cleanup-tests/2-delete-arabic.feature)
* [Feature: Cleanup after entityqueue module tests.](https://github.com/Vardot/varbase/blob/8.x-4.x/tests/features/varbase/step3-cleanup-tests/3-cleanup-after-entityqueue-tests.feature)
# Varbase Gherkin features
# List of features in step 1
# initialization tests
\ No newline at end of file
Feature: user requirements - Have persistent login options and configurations.
Feature: User Management - Have persistent login options and configurations.
As a user which can login to the site.
I want to have the option to have "Remember Me" option on the user login form.
So I can persistent my login session independent of setting of a long session lifetime.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment