Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
barbaragr committed Sep 19, 2024
1 parent d946303 commit bdf1853
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions doc/extending.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Extending BehatBundle
# Extending Behat

There are two extension points:
- ## Support for custom Field Types
If you want BehatBundle to support your custom Field Type when generating Content items you need to implement `Ibexa\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface` and tag the service with the `ibexa.behat.fieldtype_data_provider` tag.
If you want Behat to support your custom Field Type when generating Content items you need to implement `Ibexa\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface` and tag the service with the `ibexa.behat.fieldtype_data_provider` tag.

Example service definition:
```
Expand Down
10 changes: 5 additions & 5 deletions doc/features.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# BehatBundle features
# Behat features

## Example usages

### API examples
See [BehatBundle examples](https://github.com/ibexa/behat/tree/master/features/examples) to see how to use Behat sentences to:
See [Behat examples](https://github.com/ibexa/behat/tree/master/features/examples) to see how to use Behat sentences to:
- create Languages, Content items, Content Types
- create Users with complex permissions
- create given YAML configuration

### Logging into the repository

Use the [TestContext](../src/lib/API/Context/TestContext.php) to log in to the Repository and perform API calls as given user. You can tag your scenario with `@admin` to be automatically logged in as admin user before the scenario starts.
Use the [TestContext](../src/lib/API/Context/TestContext.php) to log in to the Repository and perform API calls as given user.

### Browser examples

Expand All @@ -24,7 +24,7 @@ Selenium does not support drag and drop interactions between iframes. To achieve

Before you start using that you need to inject the [drag-mock script](../src/bundle/Resources/public/js/scripts/drag-mock.js) into your templates: one way of doing this is described in [Webpack Encore configuration doc](https://doc.ibexa.co/en/4.6/administration/back_office/back_office_elements/importing_assets_from_bundle/#configuration-from-a-bundle). For an example see [ez.config.manager.js](../src/bundle/Resources/encore/ez.config.manager.js).

## BehatBundle extension
## Behat extension

### SiteAccess awareness

Expand All @@ -36,4 +36,4 @@ Use the `Ibexa\Behat\Browser\Context\DebuggingContext` Context class to access b

## Default testing configuration

BehatBundle might override some settings with values that are needed for testing. If you want to disable this behaviour you should set the `ibexa.behat.override_configuration` parameter to `false`.
Behat might override some settings with values that are needed for testing. If you want to disable this behaviour you should set the `ibexa.behat.override_configuration` parameter to `false`.
6 changes: 3 additions & 3 deletions doc/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Getting started

Ibexa BehatBundle is a bundle created to make development of [Behat](https://behat.org/en/latest/) tests for Ibexa DXP easier and quicker. If you're new to Behat you can get familiar with it by browsing [Behat's documentation](https://docs.behat.org/en/latest/guides.html).
Ibexa behat repository was created to make development of [Behat](https://behat.org/en/latest/) tests for Ibexa DXP easier and quicker. If you're new to Behat you can get familiar with it by browsing [Behat's documentation](https://docs.behat.org/en/latest/guides.html).

# How can I use BehatBundle in my project?
# How can I use Behat in my project?

This bundle has higher testing levels (system testing and acceptance testing) in mind. You can use it to:
This repository has higher testing levels (system testing and acceptance testing) in mind. You can use it to:
* put your system under test in the desired state
- create necessary Content Types, Content items, Users etc.
- create required YAML configuration using code
Expand Down
13 changes: 7 additions & 6 deletions doc/running_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Configuration

In order to use BehatBundle you need to use `behat` Symfony environment (which is defined in Ibexa by default). It is also recommended to run in enabled debug mode, which gives you more detailed browser screenshots in case of failure.
In order to use behat you need to use `behat` Symfony environment (which is defined in Ibexa by default). It is also recommended to run in enabled debug mode, which gives you more detailed browser screenshots in case of failure.

The standard behat configuration file is [behat_ibexa_oss.yaml](https://github.com/ibexa/behat/blob/4.6/behat_ibexa_oss.yaml), located in ibexa/behat directory. There you can:
- in the `Behat\MinkExtension` section:
Expand All @@ -21,8 +21,9 @@ If you want to run browser tests you need to have Selenium Server runnning. One

Another way is to use the Selenium Server Docker container and setting it up manually. Look at [manifest.json file](https://github.com/ibexa/recipes-dev/blob/master/ibexa/docker/4.6/manifest.json#L23) for the currently used version.

It can be set up using:
`docker run -p 4444:4444 -p 5900:5900 --shm-size=1gb -d --name=containerName selenium/standalone-chrome-debug:3.141.59`
It can be set up using examples from [docker-selenium](https://github.com/SeleniumHQ/docker-selenium)
Example for Chrome would be:
`docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:latest`

Where:
- 4444 is the port where Selenium Server will be accessible
Expand All @@ -35,7 +36,7 @@ After the container is set up correctly you need to adjust the configuration of

### Running standard Behat tests

BehatBundle comes with a wrapper for the standard Behat runner: [ibexabehat](https://github.com/ibexa/behat/blob/4.6/bin/ibexabehat) to make running tests in parallel easier.
Behat comes with a wrapper for the standard Behat runner: [ibexabehat](https://github.com/ibexa/behat/blob/4.6/bin/ibexabehat) to make running tests in parallel easier.

Use:
```
Expand All @@ -53,10 +54,10 @@ Running Behat feature files in parallel (on the available number of CPUs) is the

## Existing test profiles and suites

By convention profiles and suites are defined in the `behat_suites.yml` file in each bundle, if they exist. See [BehatBundle suites](../behat_suites.yml) and [AdminUI suites](https://github.com/ibexa/admin-ui/blob/4.6/behat_suites.yml) for examples.
By convention profiles and suites are defined in the `behat_suites.yml` file in each bundle, if they exist. See [Behat suites](../behat_suites.yml) and [AdminUI suites](https://github.com/ibexa/admin-ui/blob/4.6/behat_suites.yml) for examples.

In order to run them, execute:
- `bin/ibexabehat --profile=behat --suite=examples` (BehatBundle usage examples)
- `bin/ibexabehat --profile=behat --suite=examples` (behat usage examples)
- `bin/ibexabehat --profile=adminui --suite=adminui` (all AdminUI tests)

## Previewing browser tests
Expand Down

0 comments on commit bdf1853

Please sign in to comment.