Skip to content

Commit 1a22cc1

Browse files
Document Parts system
Explaining the "part" system, see Codeception/Codeception#6026
1 parent b7dc227 commit 1a22cc1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Codeception/Module/WebDriver.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,27 @@
228228
* firefox_profile: '~/firefox-profiles/codeception-profile.zip.b64'
229229
* ```
230230
*
231+
* ## Loading Parts from other Modules
232+
*
233+
* While all Codeception modules are designed to work stand-alone, it's still possible to load *several* modules at once. To use e.g. the [Asserts module](https://codeception.com/docs/modules/Asserts) in your acceptance tests, just load it like this in your `acceptance.suite.yml`:
234+
*
235+
* ```yaml
236+
* modules:
237+
* enabled:
238+
* - WebDriver
239+
* - Asserts
240+
* ```
241+
*
242+
* However, when loading a framework module (e.g. [Symfony](https://codeception.com/docs/modules/Symfony)) like this, it would lead to a conflict: When you call `$I->amOnPage()`, Codeception wouldn't know if you want to access the page using WebDriver's `amOnPage()`, or Symfony's `amOnPage()`. That's why possibly conflicting modules are separated into "parts". Here's how to load just the "services" part from e.g. Symfony:
243+
* ```yaml
244+
* modules:
245+
* enabled:
246+
* - WebDriver
247+
* - Symfony:
248+
* part: services
249+
* ```
250+
* To find out which parts each module has, look at the "Parts" header on the module's page.
251+
*
231252
* ## Usage
232253
*
233254
* ### Locating Elements

0 commit comments

Comments
 (0)