PHPackages                             vardot/varbase-behat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. vardot/varbase-behat

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

vardot/varbase-behat
====================

Varbase Behat is a standalone testing framework, with a set of Gherkin Features and custom Varbase Context with custom step definitions, and assets, which help with the automatic testing for Varbase websites https://www.vardot.com

30[1 issues](https://github.com/Vardot/varbase-behat/issues)Gherkin

Since Apr 20Pushed 8y ago3 watchersCompare

[ Source](https://github.com/Vardot/varbase-behat)[ Packagist](https://packagist.org/packages/vardot/varbase-behat)[ RSS](/packages/vardot-varbase-behat/feed)WikiDiscussions 8.x-4.x Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Varbase Behat
=============

[](#varbase-behat)

Varbase Behat is a standalone testing framework, with a set of Gherkin Features and custom Varbase Context with custom step definitions, and assets, which help with the automatic testing for Varbase websites

This page can help you to have all steps, which you need to run the Behat Gherkin Features to test a varbase website in your localhost machine.

Predefined request, you will need to have a running Varbase website:

- Apache/http/https server.
- PHP server, and have the mod\_rewrite enabled.
- MySQL server.
- Configure your PHP/MySQL to work well with Varbase, Have a look at  snippets.
- Download Varbase from  Drupal website.
- Install Varbase by following the Installing Varbase 7.x-3.x
-  documentation page.
- Download Varbase Behat:

After that you can go through the following steps.

---

1. If you have a Varbase testing site at this location

```
/var/www/html/testing/docroot

```

---

2. Download the latest Behat package from repository, and place it in the folder as below.

```
/var/www/html/testing/behat

```

---

3. Change the base url value in behat.varbase.yml file, to the domain or the local virtual domain.

```
  base_url:  'http://localhost/testing/docroot'

```

---

4. Go to ../behat/ Then run the following commands to install all required packages, Libraries from vendors.

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install

```

---

5. Open a new terminal window then start selenium2 at the port 4445. You can change the worker selenium robot server and the port number by changing the parameter.

```
    "wd_host: 127.0.0.1:4445/wd/hub"

```

in the behat.varbase.yml file. or you can get the selenium stand alone server from then you could run this command in the same location in the terminal

```
$ java -jar selenium-*.jar -port 4445

```

You can Install and configure selenium server to run on the selenium worker server by using our command.

```
$ sh ./tools/install-selenium-server/install-selenium-server-2.53.1.sh

```

---

6. Run the behat command at ../behat/

```
$ bin/behat features/varbase/step2-apply-tests/01-website-base-requirements_user-registration_only-admins-login_v4-0.feature

```

================================================================================

```
Feature: Website Base Requirements - User Registration - Only admins login
As an anonymous user
I will not be able to register as a user in the website
So that I will need a site admin or super admin to add me to the website

  Background:
    Given I am an anonymous user

  @local @development @staging @production
  Scenario: Check that create new account options does not appear for anonymous users.
     When I go to "/user"
      And I wait
     Then I should not see "Create new account"

  @local @development @staging @production
  Scenario: Check that only admin can create an account.
     When I go to "/user/register"
      And I wait
     Then I should see "Access denied"

  @local @development @staging @production
  Scenario: Verify that anonymous users cannot access admin pages.
     When I go to "/admin"
      And I wait
     Then I should see "Access denied"

3 scenarios (3 passed)
9 steps (9 passed)
0m2.21s (59.89Mb)

```

================================================================================

---

7. Run this command with the .feature file to run the Gherkin Script in it to the installed site.

```
$ bin/behat features/varbase/your-gherkin-feature.feature
$ bin/behat features/project-name/your-gherkin-feature.feature

```

---

8. Run this command to print all available step definitions

```
$ bin/behat -di

```

```
- use -dl to just list definition expressions.
- use -di to show definitions with extended info.
- use -d 'needle' to find specific definitions.

```

All Varbase custom step definitions are tagged with #varbase tag.

Example : after a run for bin/behat -di command.
================================================

[](#example--after-a-run-for--binbehat--di-command)

```
  default | Then /^I should see image with the "([^"]*)" title text$/
          | #varbase : To Find an image with the title text attribute.
          | Example 1: Then I should see image with the "Flag Earth" title text
          | at `VarbaseContext::iShouldSeeImageWithTheTitleText()`

  default | Then /^I should see image with the "([^"]*)" alt text$/
          | #varbase : To Find an image with the alt text attribute.
          | Example 1: Then I should see image with the "Flag Earth" alt text
          | at `VarbaseContext::iShouldSeeImageWithTheAltText()`

```

================================================================================

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.

    Example: ================================================================================

```
    $ bin/behat --tags '@development' features/varbase/

```

```
Which it will run Scenarios which has got the @development tag.

```

================================================================================

```
    $ bin/behat --tags '@staging' features/varbase/

```

```
Which it will run Scenarios which has got the @staging tag.

```

================================================================================

```
    $ bin/behat --tags '@production' features/varbase/

```

```
Which it will run Scenarios which has got the @production tag.

```

================================================================================

9. To see the report in HTML. Go and open this file in a browser. ../behat/reports/index.html You will see the latest report for latest run.

    if you want to custom a report you can add --format pretty --out std --format html --out reports/report-$( date '+%Y-%m-%d\_%H-%M-%S' )

    to format and select your output.

    Example:

```
    $ bin/behat features/example.feature --format pretty --out std --format html --out reports/report-$( date '+%Y-%m-%d_%H-%M-%S' )

```

10. If you want to run all Gherkin Features over a new Varbase site. You will need to create the list of Testing users, and Add French, and Arabic languages to the site.

    ---

    You can run the following command:
    ----------------------------------

    [](#you-can-run-the-following-command)

```
    $ bin/behat features/varbase/ --format pretty --out std  --format html  --out reports/report-$( date '+%Y-%m-%d_%H-%M-%S' )

```

```
After that you can see the report in the ../behat/reports folder.

If you want to run the test in steps, if you are not interested in the
initialization and cleaning up after the test.

```

```
    $ bin/behat features/varbase/step1-init-tests
    $ bin/behat features/varbase/step2-apply-tests
    $ bin/behat features/varbase/step3-cleanup-tests

```

11. If you want to test the installation process feature, you will need to use the 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

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1641992?v=4)[Rajab Natshah](/maintainers/Natshah)[@Natshah](https://github.com/Natshah)

![](https://www.gravatar.com/avatar/0a7204f4105511c0cbdfa7f4bf05ce8d7ddb14b26053a1b50e17895c23da12b4?d=identicon)[vardot-devops](/maintainers/vardot-devops)

---

Top Contributors

[![Natshah](https://avatars.githubusercontent.com/u/1641992?v=4)](https://github.com/Natshah "Natshah (255 commits)")[![moerazem](https://avatars.githubusercontent.com/u/122433?v=4)](https://github.com/moerazem "moerazem (8 commits)")

---

Tags

automatedbehatbehat3functional-testinggherkinvarbasevardot

### Embed Badge

![Health badge](/badges/vardot-varbase-behat/health.svg)

```
[![Health](https://phpackages.com/badges/vardot-varbase-behat/health.svg)](https://phpackages.com/packages/vardot-varbase-behat)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M360](/packages/dms-phpunit-arraysubset-asserts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
