示例#1
0
 function loginWrongEmail(AcceptanceTester $I, \Page\Login $loginPage)
 {
     $I->reloadPage();
     $loginPage->login();
     $loginPage->loginInvalid('*****@*****.**', '123456');
     $I->see('Invalid login or password.', 'li.error-msg');
     $I->comment('Expected result: Please enter a valid email address.');
 }
示例#2
0
 private function unlikeComponent(\AcceptanceTester $I)
 {
     codecept_debug('unlikeComponent');
     $I->wait($this->fill_placeholder_wait);
     $pre_like_count = $I->grabTextFrom('.likes-count');
     $I->click('.ion-ios-heart');
     $I->waitForElement('.ion-ios-heart-outline', 10);
     $post_like_count = $I->grabTextFrom('.likes-count');
     $I->assertNotEquals($pre_like_count, $post_like_count);
     $I->wait($this->send_to_server_wait);
     $I->reloadPage();
     $I->wait($this->fill_placeholder_wait);
     $reload_like_count = $I->grabTextFrom('.likes-count');
     $I->assertEquals($reload_like_count, $post_like_count);
 }
示例#3
0
 /**
  * @param AcceptanceTester $I
  */
 public function testFindRafflerWinner(AcceptanceTester $I)
 {
     $I->amOnPage('/');
     $visits = mt_rand(50, 1000);
     $I->seeElement('h1');
     $i = 0;
     while ($visits > $i++) {
         $I->reloadPage();
         $I->seeElement('h1');
     }
     $winner = $I->grabTextFrom('h1');
     $file = fopen("/vagrant/winner.txt", "w");
     fwrite($file, PHP_EOL . "The winner is: " . $winner . PHP_EOL);
     fclose($file);
 }
 public function topページ_新着情報(\AcceptanceTester $I)
 {
     $I->wantTo('EF0101-UC01-T02 TOPページ 新着情報');
     $I->amOnPage('/');
     // 各新着情報の箇所を押下する
     // Knowhow: javascriptでclick eventハンドリングしている場合はclick('表示文字列')では探せない
     $I->click('#news_area .newslist dt');
     // 押下された新着情報のセクションが広がり、詳細情報、リンクが表示される
     $I->see('一人暮らしからオフィスなどさまざまなシーンで あなたの生活をサポートするグッズをご家庭へお届けします!', '#news_area .newslist dd');
     // 「詳しくはこちら」リンクを押下する
     $today = new DateTime();
     $I->haveInDatabase('dtb_news', array('news_id' => rand(999, 9999), 'news_date' => $today->format('Y-m-d 00:00:00'), 'news_title' => 'タイトル1', 'news_comment' => 'コメント1', 'creator_id' => 1, 'news_url' => 'http://www.ec-cube.net', 'rank' => 2, 'create_date' => $today->format('Y-m-d 00:00:00'), 'update_date' => $today->format('Y-m-d 00:00:00')));
     $I->reloadPage();
     $I->click('#news_area .newslist dt');
     $I->see('詳しくはこちら', '#news_area .newslist dd');
     $I->click('#news_area .newslist dd a');
     $I->seeInTitle('ECサイト構築・リニューアルは「ECオープンプラットフォームEC-CUBE」');
 }
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('Login as admin and test admin functionality');
$I->amOnPage('/signin');
$I->fillField('#email', '*****@*****.**');
$I->fillField('#password', 'password');
$I->click('.btn-signin');
$I->reloadPage();
$I->click('.user-menu-desktop');
$I->click('.admin_link_desktop');
$I->see('Admin Functionality');
$I->seeElement('.fa-picture-o');
$I->click('[data-section="comments"]');
$I->seeElement('.fa-comments');
$I->click('[data-section="users"]');
$I->seeElement('.fa-user');
$I->click('[data-section="categories"]');
$I->seeElement('.fa-list');
$I->click('[data-section="pages"]');
$I->seeElement('.fa-file');
$I->click('[data-section="settings"]');
$I->seeElement('.fa-cog');
$I->click('[data-section="custom_code"]');
$I->seeElement('.fa-code');
示例#6
0
 private function unlikePostOnPopup(\AcceptanceTester $I)
 {
     $I->wantTo('unlike post on popup');
     $I->amOnPage('/');
     // popup click
     $I->waitForElement('.post[data-id="560"]', 10);
     $I->click('.post[data-id="560"]');
     $I->waitForElementVisible('.modal-content', 10);
     $pre_like_count = $I->grabTextFrom('.modal-content .like-post-count[data-id="560"]');
     $I->click('.modal-content a.unlike-post[data-id="560"]');
     $I->waitForElementVisible('.modal-content a.like-post[data-id="560"]', 10);
     $I->waitForElementNotVisible('.modal-content a.unlike-post[data-id="560"]', 10);
     $post_like_count = $I->grabTextFrom('.modal-content .like-post-count[data-id="560"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
     $I->reloadPage();
     $I->waitForElement('.like-post-count[data-id="560"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="560"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
 }
示例#7
0
 private function unlikePostOnPopup(\AcceptanceTester $I)
 {
     codecept_debug('unlikePostOnPopup');
     $I->amOnPage('/' . $this->user_slug . '/postgroups/' . $this->postgroup_slug);
     // popup click
     $I->waitForElement('.post[data-id="' . $this->post_id . '"]', 10);
     $I->click('.post[data-id="' . $this->post_id . '"]');
     $I->waitForElement('.modal-content .btn.unlike-post[data-id="' . $this->post_id . '"]', 10);
     $pre_like_count = $I->grabTextFrom('.modal-content .like-post-count[data-id="' . $this->post_id . '"]');
     $I->click('.modal-content .btn.unlike-post[data-id="' . $this->post_id . '"]');
     $I->waitForElementVisible('.modal-content .btn.like-post[data-id="' . $this->post_id . '"]', 10);
     $I->waitForElementNotVisible('.modal-content .btn.unlike-post[data-id="' . $this->post_id . '"]', 10);
     $post_like_count = $I->grabTextFrom('.modal-content .like-post-count[data-id="' . $this->post_id . '"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
     $I->reloadPage();
     $I->waitForElement('.like-post-count[data-id="' . $this->post_id . '"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="' . $this->post_id . '"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
 }
示例#8
0
 protected function stepCustomizer(AcceptanceTester $I)
 {
     Debug::debug('Viewing the theme Customizer ...');
     $I->canSeeInCurrentUrl('wp-admin/customize.php');
     $I->waitForElementVisible('.wp-pointer', 5);
     $I->canSee('Congratulations!');
     $I->cantSeeElement('.change-theme');
     $I->click('.wpem-pointer .button-primary');
     $I->canSeeElement('#wpem-overlay');
     $I->click('.wpem-overlay-control span');
     $I->cantSeeElement('#wpem-overlay');
     $I->click('.wpem-pointer .button-secondary');
     $I->cantSeeElement('.wp-pointer');
     $I->wait(1);
     $I->reloadPage();
     $I->waitForElementNotVisible('.wp-pointer', 5);
     $I->cantSee('Congratulations!');
     $I->cantSeeElement('.change-theme');
     $I->canSeeSetting('wpem_done', 1);
     $I->canSeeSetting('wpem_log');
 }