コード例 #1
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function addIssueComment(FunctionalTester $I)
 {
     $comment = 'Comment 1';
     $fileName1 = 'upload1.txt';
     $fileName2 = 'upload2.txt';
     $I->am('Manager User');
     $I->wantTo('add new comment to a project issue with attachments');
     $manager = $I->createUser(1, 3);
     $I->amLoggedAs($manager);
     $issue = $I->createIssue(1, $manager);
     $project = $issue->project;
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeResponseCodeIs(200);
     $uri = $I->getApplication()->url->action('Project\\IssueController@postUploadAttachment', ['project' => $project]);
     $I->submitFormWithFileToUri('.new-comment form', $uri, ['upload' => [$fileName1, $fileName2]], ['comment' => $comment]);
     $I->seeResponseCodeIs(200);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->see($comment, '.comment .content');
     $I->seeLink($fileName1);
     $I->seeLink($fileName2);
     $I->see($fileName1, '.attachments');
     $I->see($fileName2, '.attachments');
     $attachments = $issue->comments->first()->attachments;
     foreach ($attachments as $attachment) {
         $I->amOnAction('Project\\IssueController@getDisplayAttachment', ['project' => $project, 'issue' => $issue, 'attachment' => $attachment]);
         $I->seeResponseCodeIs(200);
     }
 }
コード例 #2
0
ファイル: AdminLoginCest.php プロジェクト: yii2mod/base
 public function checkAdminPanel(FunctionalTester $I)
 {
     $I->submitForm($this->formId, $this->formParams('*****@*****.**', '123123'));
     $I->see('Logout (admin)', 'form button[type=submit]');
     $I->seeLink('Administration');
     $I->click('Administration');
     $I->see('Users');
     $I->seeLink('CMS');
     $I->seeLink('RBAC');
     $I->seeLink('Settings Storage');
     $I->seeLink('Cron Schedule Log');
 }
コード例 #3
0
ファイル: ProjectCest.php プロジェクト: oliverpool/tinyissue
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function viewAssignedTo(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('view issues assigned to logged user');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     $I->amLoggedAs($developer1);
     $project1 = $I->createProject(1);
     $issue1 = $I->createIssue(1, $admin, $developer1, $project1);
     $issue2 = $I->createIssue(2, $admin, $developer1, $project1);
     $issue3 = $I->createIssue(3, $admin, null, $project1);
     $I->amOnAction('ProjectController@getAssigned', ['project' => $project1]);
     $I->seeLink($issue1->title);
     $I->seeLink($issue2->title);
     $I->dontSeeLink($issue3->title);
 }
コード例 #4
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function viewIssues(FunctionalTester $I)
 {
     $I->am('Manager User');
     $I->expectTo('view issues in all projects');
     $user = $I->createUser(1, 3);
     $admin = $I->createUser(2, 4);
     $project1 = $I->createProject(1);
     $project2 = $I->createProject(2, [$user]);
     $issue1 = $I->createIssue(1, $admin, null, $project1);
     $issue2 = $I->createIssue(2, $admin, null, $project2);
     $comment1 = $I->createComment(1, $admin, $issue2);
     $I->amLoggedAs($user);
     $I->amOnAction('HomeController@getIndex');
     $I->see($project2->name, '#sidebar .project');
     $I->dontSee($project1->name, '#sidebar .project');
     $I->click($project2->name);
     $I->seeCurrentActionIs('ProjectController@getIndex', ['project' => $project2]);
     $I->seeLink($issue2->title);
     $I->dontSeeLink($issue1->title);
     $I->click($issue2->title);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2]);
     $I->see($comment1->comment, '#comment' . $comment1->id . ' .content');
     $I->amOnAction('Project\\IssueController@getNew', ['project' => $project1]);
     $I->seeResponseCodeIs(200);
     $I->click(trans('tinyissue.projects'));
     $I->see($project1->name);
     $I->see($project2->name);
 }
コード例 #5
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateProject(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('edit an existing project details');
     $project = $I->createProject(1);
     $admin = $I->createUser(1, 4);
     $I->amLoggedAs($admin);
     $I->amOnAction('ProjectController@getEdit', ['project' => $project]);
     $I->selectOption('status', Project::STATUS_ARCHIVED);
     $I->click(trans('tinyissue.update'));
     $I->seeCurrentActionIs('ProjectsController@getIndex');
     $I->dontSeeLink('Project 1');
     $I->amOnAction('ProjectsController@getIndex', ['status' => Project::STATUS_ARCHIVED]);
     $I->seeLink('Project 1');
 }
コード例 #6
0
ファイル: IssueCest.php プロジェクト: oliverpool/tinyissue
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function cantEditClosedIssue(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('not be able to edit closed issue');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $issue = $I->createIssue(1, $admin, $developer1, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->click('Issue 1', '.edit-issue');
     $I->seeCurrentActionIs('Project\\IssueController@getEdit', ['project' => $project, 'issue' => $issue]);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->click(trans('tinyissue.close_issue'), '.close-issue');
     $I->seeLink(trans('tinyissue.reopen_issue'));
     $I->click('Issue 1', '.edit-issue');
     $I->seeResponseCodeIs(200);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->see(trans('tinyissue.cant_edit_closed_issue'));
 }
コード例 #7
0
 public function issueFilterUrl(FunctionalTester $I)
 {
     $I->am('Normal User');
     $I->wantTo('view an issue with a content containing another issue number.');
     $I->expectTo('see link in the issue number.');
     $I->lookForwardTo('be redirected to the another issue.');
     $developer1 = $I->createUser(1, 2);
     // developer
     $user1 = $I->createUser(2, 1);
     // user
     $project = $I->createProject(1, [$developer1, $user1]);
     $issue1 = $I->createIssue(1, $developer1, null, $project);
     $issue2 = $I->createIssue(2, $developer1, null, $project);
     $issue1->body = 'See issue #' . $issue2->id;
     $issue1->save();
     $I->amLoggedAs($user1);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue1]);
     $I->seeLink('issue #' . $issue2->id);
     $I->click('issue #' . $issue2->id);
     $I->seeResponseCodeIs(200);
     $I->see($issue2->title);
     $I->dontSee($issue1->title);
 }
<?php

$I = new FunctionalTester($scenario);
$I->am('a member');
$I->wantTo('look at activity on the activity page');
$I->loginNormalMember();
$I->amOnPage('activity');
$I->see('Activity Log');
$I->seeLink('Previous');
コード例 #9
0
ファイル: HomeCept.php プロジェクト: AntoninSlejska/yii-test
<?php

/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('My Company');
$I->seeLink('Grid');
$I->click('Grid');
$I->see('Reservations');
コード例 #10
0
<?php

/**
 * @var \Codeception\Scenario $scenario
 */
$I = new FunctionalTester($scenario);
$I->wantTo('login as regular user');
$I->amOnPage('/');
$I->click('Log In/Sign Up');
$I->seeInCurrentUrl('/session/index');
$I->see('Log In', "//*[@id='login-header']");
$I->see("Don't have an account yet?", "//*[@id='signup-header']");
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'phalcon');
$I->click('Login');
$I->seeInCurrentUrl('/session/start');
$I->see('Welcome Phalcon Demo');
$I->seeLink('Log Out');
コード例 #11
0
ファイル: HomeCept.php プロジェクト: shubnikofff/mobiles
<?php

/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('Телепорт');
$I->seeLink('Телефонный справочник');
$I->click('Телефонный справочник');
$I->see('Congratulations!');
コード例 #12
0
<?php

$I = new FunctionalTester($scenario);
$I->reloadFixtures();
/* MESSAGES LIST */
$I->wantTo('see messages list');
$I->amOnPage('/message');
$I->seeResponseCodeIs(200);
$I->see('Messages');
$I->see('Search', 'div.panel form button.btn-info');
$I->see('Status overview');
$I->seeLink('ID');
$I->seeLink('Created');
$I->seeLink('Type');
$I->seeLink('Status');
$I->see('Action');
$I->seeLink('Details');
$I->see('1.502', 'table tfoot');
# buttons
$I->seeLink('', '/message/set-status');
// for status buttons
# buttons: item with "Ready" status
$I->dontSeeElement('table#results tr.status-new a.btn-success span.glyphicon-check');
$I->seeElement('table#results tr.status-new a.btn-primary span.glyphicon-play');
$I->seeElement('table#results tr.status-new a.btn-warning span.glyphicon-pause');
$I->seeElement('table#results tr.status-new a.btn-danger span.glyphicon-remove');
$I->seeElement('table#results tr.status-new div.icon-button-placeholder-xs');
# buttons: item with "Halted" status
$I->seeElement('table#results tr.status-halted a.btn-primary span.glyphicon-play');
$I->seeElement('table#results tr.status-halted a.btn-success span.glyphicon-check');
$I->dontSeeElement('table#results tr.status-halted a.btn-warning span.glyphicon-pause');
コード例 #13
0
ファイル: UserCest.php プロジェクト: Okipa/una.app
 public function access_to_my_profile(FunctionalTester $I)
 {
     $I->am('Admin');
     $I->wantTo('access to my profile page');
     $I->expectTo('see my profile page');
     /***************************************************************************************************************
      * run test
      **************************************************************************************************************/
     $I->amOnPage('/');
     $I->seeCurrentRouteIs('home');
     $I->click(trans('template.front.header.my_account'));
     $I->seeCurrentRouteIs('dashboard.index');
     $I->click(trans('template.back.header.my_profile'));
     $I->seeCurrentRouteIs('users.profile');
     $I->see(trans('breadcrumbs.admin'), '.breadcrumb');
     $I->seeLink(trans('breadcrumbs.admin'), route('dashboard.index'));
     $I->see(strip_tags(trans('breadcrumbs.users.profile')), '.breadcrumb');
     $I->assertFileNotExists('photo');
     $I->seeOptionIsSelected('gender', config('user.gender_key.male'));
     $I->seeInField('last_name', $this->_user->last_name);
     $I->seeInField('first_name', $this->_user->first_name);
     $I->seeInField('birth_date', Carbon::createFromFormat('Y-m-d', $this->_user->birth_date)->format('d/m/Y'));
     $I->seeInField('phone_number', $this->_user->phone_number);
     $I->seeInField('email', $this->_user->email);
     $I->seeInField('address', $this->_user->address);
     $I->seeInField('zip_code', $this->_user->zip_code);
     $I->seeInField('city', $this->_user->city);
     $I->seeInField('country', $this->_user->country);
     $I->seeInField('password', '');
     $I->seeInField('password_confirmation', '');
     $I->dontSee(trans('users.page.label.status_id'));
     $I->dontSee(trans('users.page.label.board_id'));
     $I->dontSee(trans('users.page.label.role'));
     $I->dontSee(trans('users.page.label.activation'));
 }
コード例 #14
0
ファイル: HomeCept.php プロジェクト: anmaslov/start-page
<?php

/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('Start page');
$I->seeLink('Statistics');
$I->click('Statistics');
$I->see('Statistics');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('Test block');
/*$I->amOnPage(['block/edit-user-block','id'=>'2']);
$I->see('Test block');
*/
コード例 #15
0
<?php

$I = new FunctionalTester($scenario);
$I->reloadFixtures();
$I->wantTo('see the scheduled processes list');
$I->amOnPage('/schedules');
$I->seeResponseCodeIs(200);
$I->see('Schedules', 'h1');
$I->seeLink('Create new');
$I->see('Cron time definition consists of five values', '.well');
$I->see('ID', 'th');
$I->see('Cron', 'th');
$I->see('Type', 'th');
$I->see('Description', 'th');
$I->see('Last run at', 'th');
$I->seeLink('Edit');
$I->seeLink('Delete');
コード例 #16
0
<?php

/*
 * This file is part of the Terabyte yii2-extension.
 *
 * (c) Terabyte yii2-extension <http://github.com/tecnologiaterabyte>
 * For the full copyright and license information, please view the LICENSE.md
 * file that was distributed with this source code.
 *
 * @link http://www.tecnologiaterabyte.com
 * @author Wilmer Arámbula <*****@*****.**>
 * @copyright (c) 2014 Asoc. Coop. Tecnologia Terabyte 124, RL.
 * @Extension: [yii2-adminlte].
 * @Tests App Functional [HomeCept].
 * @since 1.0
 */
/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see(yii::$app->params['WebName']);
$I->seeLink(yii::t('adminlte', 'About Us'));
$I->click(yii::t('adminlte', 'About Us'));
$I->see(yii::t('adminlte', 'This is the About page. You may modify the following file to customize its content:'), 'div');
コード例 #17
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateIssue(FunctionalTester $I)
 {
     $I->am('Developer User');
     $I->expectTo('edit an existing project issue details');
     $user = $I->createUser(1, 2);
     $admin = $I->createUser(2, 4);
     $project = $I->createProject(1, [$user]);
     $issue = $I->createIssue(1, $admin, null, $project);
     $I->amLoggedAs($user);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->click($issue->title, '.edit-issue');
     $I->seeCurrentActionIs('Project\\IssueController@getEdit', ['project' => $project, 'issue' => $issue]);
     $newTitle = $issue->title . ' update';
     $I->fillField('title', $newTitle);
     $I->click(trans('tinyissue.update_issue'));
     $I->seeResponseCodeIs(200);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeLink($newTitle);
 }
コード例 #18
0
ファイル: HomeCept.php プロジェクト: phundament/app
<?php

// @group optional
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('Phundament 4');
$I->seeLink('About');
$I->click('About');
$I->see('This is the About page.');
コード例 #19
0
ファイル: HomeCest.php プロジェクト: yii2mod/base
 public function checkOpen(FunctionalTester $I)
 {
     $I->amOnPage(\Yii::$app->homeUrl);
     $I->seeLink('About Us');
     $I->seeLink('Contact');
 }
コード例 #20
0
ファイル: HomeCest.php プロジェクト: Okipa/una.app
 public function access_to_slide_edit_page(FunctionalTester $I)
 {
     $I->am('Admin');
     $I->wantTo('access to slide edit page');
     $I->expectTo('see the slide edit page with fields filled with the slide data');
     /***************************************************************************************************************
      * settings
      **************************************************************************************************************/
     // we create the admin role
     $admin_role = $this->_createAdminRole();
     // we attach it to the logged user
     $admin_role->users()->attach($this->_user);
     // we create a slide
     $this->_createSlide();
     /***************************************************************************************************************
      * run test
      **************************************************************************************************************/
     $I->amOnPage('/');
     $I->seeCurrentRouteIs('home');
     $I->click(trans('template.front.header.my_account'));
     $I->seeCurrentRouteIs('dashboard.index');
     $I->click(trans('template.back.header.home'));
     $I->seeCurrentRouteIs('home.edit');
     $I->click('edit_' . $this->_slide->id);
     $I->seeCurrentRouteIs('slides.edit', ['id' => $this->_slide->id]);
     $I->see(trans('breadcrumbs.admin'), '.breadcrumb');
     $I->seeLink(trans('breadcrumbs.admin'), route('dashboard.index'));
     $I->see(trans('breadcrumbs.home.edit'), '.breadcrumb');
     $I->seeLink(trans('breadcrumbs.home.edit'), route('home.edit'));
     $I->see(strip_tags(trans('breadcrumbs.slides.edit', ['slide' => $this->_slide->title])), '.breadcrumb');
     $I->see(strip_tags(trans('home.page.title.slide.edit', ['slide' => $this->_slide->title])), 'h2');
     $I->seeInField('title', $this->_slide->title);
     $I->seeInField('quote', $this->_slide->quote);
     $I->seeInField('position', $this->_slide->position);
     $I->seeOptionIsSelected('#input_previous_slide_id', 'X - ' . trans('home.page.label.slide.first'));
     $I->seeCheckboxIsChecked('#input_active');
 }
コード例 #21
0
ファイル: UserCest.php プロジェクト: oliverpool/tinyissue
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function viewIssues(FunctionalTester $I)
 {
     $I->am('Developer User');
     $I->wantTo('view issues assigned to logged user in all projects');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     $I->amLoggedAs($developer1);
     $project1 = $I->createProject(1, [$developer1]);
     $issue1 = $I->createIssue(1, $admin, $developer1, $project1);
     $issue2 = $I->createIssue(2, $admin, $developer1, $project1);
     $issue3 = $I->createIssue(3, $developer1, $developer1, $project1);
     $project2 = $I->createProject(2, [$developer1]);
     $issue4 = $I->createIssue(4, $admin, $developer1, $project2);
     $issue5 = $I->createIssue(5, $admin, $developer1, $project2);
     $issue6 = $I->createIssue(6, $admin, null, $project2);
     $I->amOnAction('HomeController@getIndex');
     $I->click(trans('tinyissue.your_issues'));
     $I->seeLink($issue1->title);
     $I->seeLink($issue2->title);
     $I->seeLink($issue3->title);
     $I->seeLink($issue4->title);
     $I->seeLink($issue5->title);
     $I->dontSeeLink($issue6->title);
 }
コード例 #22
0
ファイル: PermissionCest.php プロジェクト: Okipa/una.app
 public function access_to_role_edit_page(FunctionalTester $I)
 {
     $I->am('Admin');
     $I->wantTo('access to permission edit page');
     $I->expectTo('see the permission edit page with fields filled with the role data');
     /***************************************************************************************************************
      * settings
      **************************************************************************************************************/
     // we create the admin role
     $admin = $this->_createAdminRole();
     // we attach it to the logged user
     $admin->users()->attach($this->_user);
     /***************************************************************************************************************
      * run test
      **************************************************************************************************************/
     $I->amOnPage('/');
     $I->seeCurrentRouteIs('home');
     $I->click(trans('template.front.header.my_account'));
     $I->seeCurrentRouteIs('dashboard.index');
     $I->click(trans('template.back.header.permissions'));
     $I->seeCurrentRouteIs('permissions.index');
     $I->click('edit_' . $admin->id);
     $I->seeCurrentRouteIs('permissions.edit', ['id' => $admin->id]);
     $I->see(trans('breadcrumbs.admin'), '.breadcrumb');
     $I->seeLink(trans('breadcrumbs.admin'), route('home'));
     $I->see(strip_tags(trans('breadcrumbs.permissions.edit', ['role' => $admin->name])), '.breadcrumb');
     $I->seeLink(trans('breadcrumbs.permissions.index'), route('permissions.index'));
     $I->see(strip_tags(trans('permissions.page.title.edit', ['role' => $admin->name])), 'h2');
     $I->seeInField('name_fr', $admin->translate('fr')->name);
     $I->seeInField('name_en', $admin->translate('en')->name);
     $I->seeInField('slug', $admin->slug);
     $I->seeInField('position', $admin->position);
     $I->seeInField('parent_role_id', 0);
 }
コード例 #23
0
ファイル: HomeCept.php プロジェクト: kansey/yii2albom
<?php

/* @var $scenario Codeception\Scenario */
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
$I->see('My Company');
$I->seeLink('Home');
$I->click('Home');
$I->see('Congratulations');
$I->seeLink('SignUp');
$I->click('SignUp');
$I->see('Signup');
$I->seeLink('Login');
$I->click('Login');
$I->see('Login');
コード例 #24
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function closeIssue(FunctionalTester $I)
 {
     $I->am('Developer User');
     $I->wantTo('close an opened issue');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $I->amOnAction('Project\\IssueController@getNew', ['project' => $project]);
     $issue = $I->createIssue(1, $admin, $developer1, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->click(trans('tinyissue.close_issue'), '.close-issue');
     $I->seeLink(trans('tinyissue.reopen_issue'));
     $I->click(trans('tinyissue.reopen_issue'));
     $I->dontSeeLink(trans('tinyissue.reopen_issue'));
     $I->seeLink(trans('tinyissue.close_issue'));
 }