Skip to content

Commit

Permalink
Updated extending, features and getting_started.md
Browse files Browse the repository at this point in the history
  • Loading branch information
barbaragr committed Sep 18, 2024
1 parent a084aa3 commit 47a0447
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions doc/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

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 `EzSystems\Behat\API\ContentData\FieldTypeData\FieldTypeDataProviderInterface` and tag the service with the `ezplatform.behat.fieldtype_data_provider` tag.
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.

Example service definition:
```
App\CustomFieldTypeProvider:
tags: ['ezplatform.behat.fieldtype_data_provider']
tags: ['ibexa.behat.fieldtype_data_provider']
```
Example class implementing the interface:
```
<?php
namespace App;
use EzSystems\Behat\API\ContentData\FieldTypeData\AbstractFieldTypeDataProvider;
use Ibexa\Behat\API\ContentData\FieldTypeData\AbstractFieldTypeDataProvider;
class CustomFieldTypeProvider extends AbstractFieldTypeDataProvider
{
Expand All @@ -34,21 +34,21 @@ class CustomFieldTypeProvider extends AbstractFieldTypeDataProvider
```

- ## Support for custom Limitations
If you want to create Roles with permissions containing custom Limitations, you need to implement `EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface` and tag your service with the `ezplatform.behat.limitation_parser` tag. This will allow you to parse values passed in Gherkin tables into Limitation objects.
If you want to create Roles with permissions containing custom Limitations, you need to implement `Ibexa\Behat\API\Context\LimitationParser\LimitationParserInterface` and tag your service with the `ibexa.behat.limitation_parser` tag. This will allow you to parse values passed in Gherkin tables into Limitation objects.

Example service definition:
```
App\CustomLimitationParser:
tags: ['ezplatform.behat.limitation_parser']
tags: ['ibexa.behat.limitation_parser']
```
Example class implementing the interface:
```
<?php
namespace App;
use eZ\Publish\API\Repository\Values\User\Limitation;
use EzSystems\Behat\API\Context\LimitationParser\LimitationParserInterface
use Ibexa\Contracts\Core\Repository\Values\User\Limitation;
use Ibexa\Behat\API\Context\LimitationParser\LimitationParserInterface
use CustomLimitation;
class CustomLimitationParser implements LimitationParserInterface
Expand Down
6 changes: 3 additions & 3 deletions doc/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Use the [TestContext](../src/lib/API/Context/TestContext.php) to log in to the R

### Browser examples

Look at [AdminUI feature files](https://github.com/ezsystems/ezplatform-admin-ui/tree/master/features/standard) to see example browser tests for AdminUI. If you want to reuse these Steps in your code in addition to the Context that defines them you also need to include:
Look at [AdminUI feature files](https://github.com/ibexa/admin-ui/tree/4.6/features/standard) to see example browser tests for AdminUI. If you want to reuse these Steps in your code in addition to the Context that defines them you also need to include:
- `Ibexa\Behat\Browser\Context\Hooks`
- `Ibexa\Behat\Browser\Context\BrowserContext`

#### Improved drag and drop

Selenium does not support drag and drop interactions between iframes. To achieve that you can use the `UtilityContext::moveWithHover` method (which also supports hover simulation between the actions). See the [drag-mock documentation](https://github.com/andywer/drag-mock#browser) (the library we use behind the scenes) for more information.

Before you start using that you need to inject the [drag-mock script](../Resources/public/js/scripts/drag-mock.js) into your templates: one way of doing this is described in [Webpack Encore configuration doc](https://doc.ezplatform.com/en/latest/guide/bundles/#configuration-from-a-bundle). For an example see [ez.config.manager.js](../src/bundle/Resources/encore/ez.config.manager.js).
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

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.testing.override_configuration` parameter to `false`.
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`.
4 changes: 2 additions & 2 deletions doc/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Getting started

eZ Platform BehatBundle is a bundle created to make development of [Behat](https://behat.org/en/latest/) tests for eZ Platform 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 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).

# How can I use BehatBundle in my project?

Expand All @@ -15,7 +15,7 @@ This bundle has higher testing levels (system testing and acceptance testing) in

# More reading

eZ Platform uses following libraries for Behat Development:
Ibexa uses following libraries for Behat Development:
- [Behat](https://behat.org/en/latest/) as a BDD framework for PHP
- [Mink](http://mink.behat.org/en/latest/) as browser driver abstraction
- [Faker](https://github.com/fzaninotto/Faker) for random data generation
Expand Down

0 comments on commit 47a0447

Please sign in to comment.