Skip to content

Cleanup after actions in UI #23

Description

@r-erema

Hello. I run my acceptance test via selenium and webdriver, it creates a user order(row in db) by UI.
I have cleanup: true in config, then I expect that the dump will cleanup database with created order(according codeception documentation).

Either I do something wrong or the plugin(or codeception) does not cleanup.
My test:

public function testCreateOrder(AcceptanceTester $I, Example $example): void {
 $config =\Codeception\Configuration::config();
 $I->loginIfNotAuthorized(
    $config['users']['admin_full']['login'],
    $config['users']['admin_full']['password'],
    $config['users']['admin_full']['auth_cookie_value'] ?? null
 );
 $I->amOnPage('/services/new/');
 $I->selectOption('select#installment_payment_type', $example['installment_payment_type_friendly']);
 $I->selectOption('select#installment_term_type', $example['installment_term_type_friendly']);
 $I->click('Create order');
}

And config:

...
modules:
    enabled:
        - Codeception\Extension\MultiDb
    config:
        Codeception\Extension\MultiDb:
            connectors:
                connector_1:
                    dsn: "mysql:host=localhost;port=3306;dbname=db;charset=utf8"
                    user: 'sites_db_access'
                    password: '****'
                    dump: 'tests/_data/dump.sql'
                    populate: true
                    cleanup: true
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions