<?php $I = new AcceptanceTester($scenario); $I->wantTo('ensure that User create work'); // ADMIN $I->login(); $I->go(['/user/user/create']); $I->testForm('#user-form', 'User', [], ['username' => 'admin', 'owner_id' => 'asd', 'email' => 123, 'phone' => 'DN', 'password' => '', 'notify' => 'DN', 'permissions[]' => 'uploader']); $I->testForm('#user-form', 'User', ['username' => 'test', 'owner_id' => '1', 'email' => '*****@*****.**', 'phone' => '+79125675656', 'password' => 'admin', 'notify' => '1', 'permissions[]' => 'partner']); $I->seeElement('.alert-success'); //CUSTOMER $I->customerLogin(); $I->go(['/user/user/create']); $I->testForm('#user-form', 'User', [], ['username' => 'admin', 'owner_id' => 3, 'email' => 123, 'phone' => 'DN', 'password' => '', 'notify' => 'DN', 'permissions[]' => 'root']); $I->testForm('#user-form', 'User', ['username' => 'test1', 'owner_id' => '2', 'email' => 'test1@test1.test1', 'phone' => '+79125675656', 'password' => 'admin', 'notify' => '1', 'permissions[]' => 'partner']); $I->seeElement('.alert-success');
<?php $I = new AcceptanceTester($scenario); $I->wantTo('add a new address field with custom options.'); $I->login('tester', 'test'); $I->amOnPage('/wp/wp-admin/post.php?post=4&action=edit'); $I->click('+ Add Field'); $I->fillField('.field-label', 'acf address custom test field'); $I->selectOption('form select.field-type', 'address'); $I->wait(2); $I->seeElement('.acf-address-1-row'); $I->wantTo('make changes to the default address settings.'); // has the form ${obj.id}-${widgetCount} $I->uncheckOption('#street2-1'); $I->wait(1); // has the form ${obj.id}-li-movable-${widgetCount} $I->dontSeeElement('#street2-li-movable-1'); $I->click('#publish'); $I->see('Field group updated.'); $I->wantTo('make sure my changes were persisted.'); $I->dontSeeCheckboxIsChecked('#street2-1'); $I->dontSeeElement('#street2-li-movable-1');
<?php $I = new AcceptanceTester($scenario); $I->wantTo('Create a 2 test courses'); $I->login('admin', 'pepito.P0', 'Admin User'); $I->createCourse('Test Course Sec.1 2015', '1349-S-TICS331-1-1-2015', 'QA / QA Invierno 2015'); $I->createCourse('Test Course Sec.2 2015', '1349-S-TICS331-2-1-2015', 'QA / QA Invierno 2015');
<?php $I = new AcceptanceTester($scenario); $I->login('alumno3', 'pepito.P0', 'ALUMNO 3'); $I->amOnPage('/user/profile.php?id=188'); $I->see('chat'); $courses = $I->grabMultiple('list');
$I->seeElement('.alert-success'); // CUSTOMER $I->partnerLogin(); $I->go(['/material/item/create']); // wrong data $I->attachFile('#item-file', 'mmc.pdf'); // small dpi $I->testForm('#item-form', 'Item', ['owner_id' => 123], ['file' => 123, 'type' => 123, 'valid_from' => '28/12/2015', 'valid_to' => '2015-12-28']); // correct data $I->attachFile('#item-file', 'material.jpg'); $I->testForm('#item-form', 'Item', ['file' => 'material.jpg', 'type' => 0, 'description' => 'asdasd', 'valid_from' => date('Y-m-d'), 'valid_to' => date('Y-m-d')]); $I->seeElement('.alert-success'); // PARTNER // no upload role $partner = \bariew\yii2Tools\tests\FixtureManager::get('user_user', 'test_partner1'); $I->login($partner->username, 'admin'); $I->go(['/material/item/create']); $I->seeElement('.alert-danger'); // correct data $partner = \bariew\yii2Tools\tests\FixtureManager::get('user_user', 'example_partner1'); $I->login($partner->username, 'admin'); $I->go(['/material/item/create']); $I->dontSeeElement('.alert-danger'); // wrong data $I->attachFile('#item-file', 'mmc.pdf'); // small dpi $I->testForm('#item-form', 'Item', ['owner_id' => 123], ['file' => 123, 'type' => 123, 'valid_from' => '28/12/2015', 'valid_to' => '2015-12-28']); // correct data $I->attachFile('#item-file', 'material.jpg'); $I->testForm('#item-form', 'Item', ['file' => 'material.jpg', 'type' => 0, 'description' => 'asdasd', 'valid_from' => date('Y-m-d'), 'valid_to' => date('Y-m-d')]); $I->seeElement('.alert-success');
<?php $I = new AcceptanceTester($scenario); $I->login('alu1', 'pepito.P0', 'a l'); $I->click('Mi perfil'); $I->click('Ver perfil'); $I->grabFromCurrentUrl('/id=(\\d+)/');
public function it_try_to_login_with_unexisted_user(AcceptanceTester $I) { $I->login(); $I->see('email'); }
public function _before(AcceptanceTester $I) { $I->login('admin', '123'); }