Skip to content

Use new directory structure in documentation #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/06-ReusingTestCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ php vendor/bin/codecept generate:pageobject acceptance Login

> It is recommended to use page objects for acceptance testing only

This will create a `Login` class in `tests/_support/Page/Acceptance`.
This will create a `Login` class in `tests/Support/Page/Acceptance`.
The basic PageObject is nothing more than an empty class with a few stubs.

It is expected that you will populate it with the UI locators of a page it represents. Locators can be added as public properties:
Expand Down Expand Up @@ -210,7 +210,7 @@ Add action to StepObject class (ENTER to exit):
StepObject was created in /tests/acceptance/_support/Step/Acceptance/Admin.php
```

This will generate a class in `/tests/_support/Step/Acceptance/Admin.php` similar to this:
This will generate a class in `/tests/Support/Step/Acceptance/Admin.php` similar to this:

```php
<?php
Expand Down
4 changes: 2 additions & 2 deletions docs/07-BDD.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ Text values inside a scenarios can be set inside a `"""` block:
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
data: tests/Support/Data
helpers: tests/Support
envs: tests/_envs
"""
```
Expand Down
10 changes: 5 additions & 5 deletions docs/08-Customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Extensions have some basic methods you can use:
### Enabling Extension

Once you've implemented a simple extension class, you can require it in `tests/_bootstrap.php`,
load it with Composer's autoloader defined in `composer.json`, or store the class inside `tests/_support`dir.
load it with Composer's autoloader defined in `composer.json`, or store the class inside `tests/Support`dir.

You can then enable it in `codeception.yml`

Expand Down Expand Up @@ -320,7 +320,7 @@ For instance, for `nocleanup` group we prevent Doctrine2 module from wrapping te
```

A group class can be created with `php vendor/bin/codecept generate:group groupname` command.
Group classes will be stored in the `tests/_support/Group` directory.
Group classes will be stored in the `tests/Support/Group` directory.

A group class can be enabled just like you enable an extension class. In the file `codeception.yml`:

Expand Down Expand Up @@ -413,7 +413,7 @@ A group file can be included by its relative filename:
```yaml
groups:
# requiring a group file
slow: tests/_data/slow.txt
slow: tests/Support/Data/slow.txt

```

Expand All @@ -424,11 +424,11 @@ You can even specify patterns for loading multiple group files with a single def

```yaml
groups:
p*: tests/_data/p*
p*: tests/Support/Data/p*

```

This will load all found `p*` files in `tests/_data` as groups. Group names will be as follows p1,p2,...,pN.
This will load all found `p*` files in `tests/Support/Data` as groups. Group names will be as follows p1,p2,...,pN.

## Formats

Expand Down
6 changes: 3 additions & 3 deletions docs/09-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ modules:
dsn: 'PDO DSN HERE'
user: 'root'
password:
dump: tests/_data/your-dump-name.sql
dump: tests/Support/Data/your-dump-name.sql
cleanup: true # reload dump between tests
populate: true # load dump before all tests

Expand All @@ -66,7 +66,7 @@ modules:
password: ''
cleanup: true # run populator before each test
populate: true # run populator before all test
populator: 'mysql -u $user $dbname < tests/_data/dump.sql'
populator: 'mysql -u $user $dbname < tests/Support/Data/dump.sql'
```

See the [Db module reference](https://codeception.com/docs/modules/Db#SQL-data-dump) for more examples.
Expand Down Expand Up @@ -319,7 +319,7 @@ public function testCategoriesAreTheSame(AcceptanceTester $I, \Tests\Snapshot\Ca
}
```

On the first run, data will be obtained via `fetchData` method and saved to `tests/_data` directory in json format.
On the first run, data will be obtained via `fetchData` method and saved to `tests/Support/Data` directory in json format.
On next execution the obtained data will be compared with previously saved snapshot.

> To update a snapshot with new data, run tests in `--debug` mode.
Expand Down
16 changes: 8 additions & 8 deletions docs/12-ParallelExecution.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ public function parallelSplitTests()
$this->taskSplitTestFilesByGroups(5)
->projectRoot('.')
->testsFrom('tests/acceptance')
->groupsTo('tests/_data/paracept_')
->groupsTo('tests/Support/Data/paracept_')
->run();

/*
// Split your tests by single tests (alternatively)
$this->taskSplitTestsByGroups(5)
->projectRoot('.')
->testsFrom('tests/acceptance')
->groupsTo('tests/_data/paracept_')
->groupsTo('tests/Support/Data/paracept_')
->run();
*/
}
Expand All @@ -188,19 +188,19 @@ The output should be similar to this:

```
[Codeception\Task\SplitTestFilesByGroupsTask] Processing 33 files
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_1
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_2
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_3
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_4
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_5
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_1
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_2
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_3
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_4
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_5

```

Now we have group files. We should update `codeception.yml` to load generated group files. In our case we have groups: *paracept_1*, *paracept_2*, *paracept_3*, *paracept_4*, *paracept_5*.

```yaml
groups:
paracept_*: tests/_data/paracept_*
paracept_*: tests/Support/Data/paracept_*
```

Let's try to execute tests from the second group:
Expand Down
4 changes: 2 additions & 2 deletions docs/BDD.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ Text values inside a scenarios can be set inside a `"""` block:
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
data: tests/Support/Data
helpers: tests/Support
envs: tests/_envs
"""
```
Expand Down
10 changes: 5 additions & 5 deletions docs/Customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Extensions have some basic methods you can use:
### Enabling Extension

Once you've implemented a simple extension class, you can require it in `tests/_bootstrap.php`,
load it with Composer's autoloader defined in `composer.json`, or store the class inside `tests/_support`dir.
load it with Composer's autoloader defined in `composer.json`, or store the class inside `tests/Support`dir.

You can then enable it in `codeception.yml`

Expand Down Expand Up @@ -320,7 +320,7 @@ For instance, for `nocleanup` group we prevent Doctrine2 module from wrapping te
```

A group class can be created with `php vendor/bin/codecept generate:group groupname` command.
Group classes will be stored in the `tests/_support/Group` directory.
Group classes will be stored in the `tests/Support/Group` directory.

A group class can be enabled just like you enable an extension class. In the file `codeception.yml`:

Expand Down Expand Up @@ -413,7 +413,7 @@ A group file can be included by its relative filename:
```yaml
groups:
# requiring a group file
slow: tests/_data/slow.txt
slow: tests/Support/Data/slow.txt

```

Expand All @@ -424,11 +424,11 @@ You can even specify patterns for loading multiple group files with a single def

```yaml
groups:
p*: tests/_data/p*
p*: tests/Support/Data/p*

```

This will load all found `p*` files in `tests/_data` as groups. Group names will be as follows p1,p2,...,pN.
This will load all found `p*` files in `tests/Support/Data` as groups. Group names will be as follows p1,p2,...,pN.

## Formats

Expand Down
6 changes: 3 additions & 3 deletions docs/Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ modules:
dsn: 'PDO DSN HERE'
user: 'root'
password:
dump: tests/_data/your-dump-name.sql
dump: tests/Support/Data/your-dump-name.sql
cleanup: true # reload dump between tests
populate: true # load dump before all tests

Expand All @@ -66,7 +66,7 @@ modules:
password: ''
cleanup: true # run populator before each test
populate: true # run populator before all test
populator: 'mysql -u $user $dbname < tests/_data/dump.sql'
populator: 'mysql -u $user $dbname < tests/Support/Data/dump.sql'
```

See the [Db module reference](https://codeception.com/docs/modules/Db#SQL-data-dump) for more examples.
Expand Down Expand Up @@ -319,7 +319,7 @@ public function testCategoriesAreTheSame(AcceptanceTester $I, \Tests\Snapshot\Ca
}
```

On the first run, data will be obtained via `fetchData` method and saved to `tests/_data` directory in json format.
On the first run, data will be obtained via `fetchData` method and saved to `tests/Support/Data` directory in json format.
On next execution the obtained data will be compared with previously saved snapshot.

> To update a snapshot with new data, run tests in `--debug` mode.
Expand Down
16 changes: 8 additions & 8 deletions docs/ParallelExecution.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ public function parallelSplitTests()
$this->taskSplitTestFilesByGroups(5)
->projectRoot('.')
->testsFrom('tests/acceptance')
->groupsTo('tests/_data/paracept_')
->groupsTo('tests/Support/Data/paracept_')
->run();

/*
// Split your tests by single tests (alternatively)
$this->taskSplitTestsByGroups(5)
->projectRoot('.')
->testsFrom('tests/acceptance')
->groupsTo('tests/_data/paracept_')
->groupsTo('tests/Support/Data/paracept_')
->run();
*/
}
Expand All @@ -188,19 +188,19 @@ The output should be similar to this:

```
[Codeception\Task\SplitTestFilesByGroupsTask] Processing 33 files
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_1
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_2
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_3
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_4
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/_data/paracept_5
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_1
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_2
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_3
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_4
[Codeception\Task\SplitTestFilesByGroupsTask] Writing tests/Support/Data/paracept_5

```

Now we have group files. We should update `codeception.yml` to load generated group files. In our case we have groups: *paracept_1*, *paracept_2*, *paracept_3*, *paracept_4*, *paracept_5*.

```yaml
groups:
paracept_*: tests/_data/paracept_*
paracept_*: tests/Support/Data/paracept_*
```

Let's try to execute tests from the second group:
Expand Down
4 changes: 2 additions & 2 deletions docs/ReusingTestCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ php vendor/bin/codecept generate:pageobject acceptance Login

> It is recommended to use page objects for acceptance testing only

This will create a `Login` class in `tests/_support/Page/Acceptance`.
This will create a `Login` class in `tests/Support/Page/Acceptance`.
The basic PageObject is nothing more than an empty class with a few stubs.

It is expected that you will populate it with the UI locators of a page it represents. Locators can be added as public properties:
Expand Down Expand Up @@ -210,7 +210,7 @@ Add action to StepObject class (ENTER to exit):
StepObject was created in /tests/acceptance/_support/Step/Acceptance/Admin.php
```

This will generate a class in `/tests/_support/Step/Acceptance/Admin.php` similar to this:
This will generate a class in `/tests/Support/Step/Acceptance/Admin.php` similar to this:

```php
<?php
Expand Down