public function updateInvoiceDesign(AcceptanceTester $I)
 {
     $I->wantTo('Design my invoice');
     $I->amOnPage('/settings/invoice_design');
     $I->click('select#invoice_design_id');
     $I->click('select#invoice_design_id option:nth-child(2)');
     $I->fillField('#font_size', 10);
     $I->click('#primary_color + .sp-replacer');
     $I->executeJS('$("#primary_color").val("#7364b6")');
     $I->executeJS('$(".sp-container:nth-child(1) .sp-choose").click()');
     $I->click('#secondary_color + .sp-replacer');
     $I->executeJS('$("#secondary_color").val("#aa6709")');
     $I->executeJS('$(".sp-container:nth-child(2) .sp-choose").click()');
     /*
     $I->fillField(['name' => 'labels_item'], $this->faker->text(6));
     $I->fillField(['name' => 'labels_description'], $this->faker->text(12));
     $I->fillField(['name' => 'labels_unit_cost'], $this->faker->text(12));
     $I->fillField(['name' => 'labels_quantity'], $this->faker->text(8));
     
     $I->uncheckOption('#hide_quantity');
     $I->checkOption('#hide_paid_to_date');
     */
     $I->click('Save');
     $I->wait(3);
     $I->seeInDatabase('accounts', ['font_size' => 10]);
 }
 public function cloneInvoice(AcceptanceTester $I)
 {
     $I->wantTo('clone an invoice');
     $I->amOnPage('/invoices/1/clone');
     $invoiceNumber = $I->grabAttributeFrom('#invoice_number', 'value');
     $I->executeJS('submitAction()');
     $I->wait(1);
     $I->see($invoiceNumber);
 }
 public function topページ_初期表示(\AcceptanceTester $I)
 {
     $I->wantTo('EA0101-UC01-T01 TOPページ 初期表示');
     // TOP画面に現在の受注状況、お知らせ、売り上げ状況、ショップ状況が表示されている
     $I->see('受注状況', TopPage::$受付状況);
     $I->see('お知らせ', TopPage::$お知らせ);
     $I->see('売り上げ状況', TopPage::$売上状況);
     $I->see('ショップ状況', TopPage::$ショップ状況);
     // 新規受付をクリックすると受注管理画面に遷移することを確認
     $I->click(TopPage::$受付状況_新規受付);
     $I->see('受注マスター', self::ページタイトル);
     $I->goToAdminPage();
     // 購入された商品が受注管理画面のページにて反映されていることを確認
     $config = Fixtures::get('config');
     $findOrders = Fixtures::get('findOrders');
     $NewOrders = array_filter($findOrders(), function ($Order) use($config) {
         return $Order->getOrderStatus()->getId() == $config['order_new'];
     });
     $I->see(count($NewOrders), TopPage::$受付状況_新規受付数);
     // FIXME [issue] ソート順が指定されていないのでテストが失敗する
     // https://github.com/EC-CUBE/ec-cube/issues/1908
     // // 入金待ちをクリックすると「受注管理>入金待ち」のページに遷移することを確認
     // $I->click(TopPage::$受付状況_入金待ち);
     // $I->see('受注マスター', self::ページタイトル);
     // $I->seeInField(OrderManagePage::$検索条件_受注ステータス, '2'/*入金待ち*/);
     // $I->goToAdminPage();
     //
     // // 入金済みをクリックすると「受注管理>入金済み」のページに遷移することを確認
     // $I->click(TopPage::$受付状況_入金済み);
     // $I->see('受注マスター', self::ページタイトル);
     // $I->seeInField(OrderManagePage::$検索条件_受注ステータス, '6'/*入金済み*/);
     // $I->goToAdminPage();
     //
     // // 取り寄せ中をクリックすると「受注管理>取り寄せ」のページに遷移することを確認
     // $I->click(TopPage::$受付状況_取り寄せ中);
     // $I->see('受注マスター', self::ページタイトル);
     // $I->seeInField(OrderManagePage::$検索条件_受注ステータス, '4'/*取り寄せ中*/);
     // $I->goToAdminPage();
     // お知らせの記事をクリックすると設定されたURLに遷移することを確認
     $I->executeJS('document.querySelector("iframe.link_list_wrap").setAttribute("name", "news_frame")');
     $I->switchToIFrame("news_frame");
     $I->click(['css' => '.news_area .link_list .tableish a:nth-child(3)']);
     $I->switchToNewWindow();
     $I->seeInTitle("全商品 / ECサイト構築・リニューアルは「ECオープンプラットフォームEC-CUBE」");
     $I->switchToWindow();
     $I->switchToIFrame();
     // ショップ情報の在庫切れ商品をクリックすると商品管理ページに遷移することを確認
     $I->click(TopPage::$ショップ状況_在庫切れ商品);
     $I->see('商品マスター', self::ページタイトル);
     $I->goToAdminPage();
     // ショップ情報の会員数をクリックすると会員管理に遷移することを確認
     $I->click(TopPage::$ショップ状況_会員数);
     $I->see('会員マスター', self::ページタイトル);
     $I->dontSeeCheckboxIsChecked(CustomerManagePage::$検索条件_仮会員);
     $I->seeCheckboxIsChecked(CustomerManagePage::$検索条件_本会員);
 }
示例#4
0
 private function CanopyScrapeCest(\AcceptanceTester $I)
 {
     foreach ($this->categories as $category) {
         $I->amOnPage("{$category}/popular");
         $I->waitForElement('.analytics--track-to-amazon', 100);
         try {
             $I->click('.LoadMoreButton');
         } catch (\Exception $e) {
         }
         /*
         $I->wait(5);
         $I->executeJS("window.scrollTo(0,0)");
         $items = $I->grabMultiple('.analytics--track-to-amazon', 'href');
         foreach($items as $item){
             $temp = explode('=',$item);
             $this->db->real_query("INSERT INTO `canopy_item_list` (`id`, `item_slug`, `from_where`, `sent_at`, `created_at`) VALUES (NULL, '{$temp[0]}=', '{$category}', NULL, CURRENT_TIMESTAMP);");
         }
         $I->executeJS("$('.ProductCard').remove()");
         $I->executeJS("window.scrollTo(0,document.body.scrollHeight)");
         $I->waitForElement('.product-card', 100);
         */
         $items = true;
         while ($items) {
             try {
                 $rand_sec = rand(3, 6);
                 $I->wait($rand_sec);
                 // remove for faster scrape
                 $I->executeJS("window.scrollTo(0,0)");
                 $items = $I->grabMultiple('.analytics--track-to-amazon', 'href');
                 foreach ($items as $item) {
                     $temp = explode('=', $item);
                     $this->db->real_query("INSERT INTO `canopy_item_list` (`id`, `item_slug`, `from_where`, `sent_at`, `created_at`) VALUES (NULL, '{$temp[0]}=', '{$category}', NULL, CURRENT_TIMESTAMP);");
                 }
                 $I->executeJS("\$('.ProductCard').remove()");
                 $I->executeJS("window.scrollTo(0,document.body.scrollHeight)");
                 $I->waitForElement('.product-card', 100);
             } catch (\Exception $e) {
                 break;
             }
         }
     }
 }
示例#5
0
 /**
  * @depends checkFormCreateMaterial
  */
 public function addCreateMaterialFromSelect2(AcceptanceTester $I)
 {
     $I->executeJS('window.scrollTo(0,0);');
     $I->chooseValueFromSelect2('Material[id_matvid]', 'ШКАФ', 'шка');
     $I->fillField('Material[material_name]', 'Шкаф для одежды');
     $I->fillField('Material[material_inv]', '1000001');
     $I->seeElement('//input[@name="Material[material_number]" and @disabled]');
     $I->chooseValueFromGrid('Material[id_izmer]', 'шт', 'izmergrid_gw');
     $I->fillField('Material[material_price]', '1200.15');
     $I->fillField('Material[material_serial]', 'ABCD123');
     $I->fillField('material_release-material-material_release', '01.01.2005');
     $I->executeJS('window.scrollTo(0,200);');
     $I->chooseValueFromSelect2('Material[id_schetuchet]', '101.34, НОВЫЙ СЧЕТ', '101');
     $I->chooseValueFromSelect2('Mattraffic[id_mol]', 'ИВАНОВ ИВАН ИВАНОВИЧ, ТЕРАПЕВТ, ТЕРАПЕВТИЧЕСКОЕ, ПОЛИКЛИНИКА 1', 'ива');
     $I->see('Создать');
     $I->click('//button[contains(text(), "Создать")]');
     $I->wait(2);
     $I->seeElement('//td[text()="ПОЛИКЛИНИКА 1"]' . '/preceding-sibling::td[text()="ТЕРАПЕВТ"]' . '/preceding-sibling::td[text()="ИВАНОВ ИВАН ИВАНОВИЧ"]' . '/preceding-sibling::td[text()="1.000"]' . '/preceding-sibling::td[text()="Приход"]' . '/preceding-sibling::td/button[@title="Удалить"]');
     $I->see('Обновить');
     $I->click('//button[contains(text(), "Обновить")]');
     $I->wait(2);
     $I->seeElement(['id' => 'materialgrid_gw']);
     $I->seeElement('//td[text()="Нет"]' . '/preceding-sibling::td[text()="1200.15"]' . '/preceding-sibling::td[text()="шт"]' . '/preceding-sibling::td[text()="1.000"]' . '/preceding-sibling::td[text()="1000001"]' . '/preceding-sibling::td[text()="Шкаф для одежды"]' . '/preceding-sibling::td[text()="ШКАФ"]' . '/preceding-sibling::td[text()="Основное средство"]' . '/preceding-sibling::td/a[@title="Карта материальной ценности"]');
 }
示例#6
0
$I->fillField('order_zip02', '0001');
$I->selectOption('select[name=order_pref]', '北海道');
$I->fillField('order_addr01', '札幌市');
$I->fillField('order_addr02', '123');
$I->fillField('order_tel01', '00');
$I->fillField('order_tel02', '0000');
$I->fillField('order_tel03', '0000');
$I->fillField('order_email', '*****@*****.**');
$I->fillField('order_email02', '*****@*****.**');
$I->click('input[name="order_sex"][value="1"]');
$I->click('上記のお届け先のみに送る');
$I->click('input[name="payment_id"][value="5"]');
$I->click('次へ');
$I->click('次へ');
$I->waitForElement('#WP_checkoutBox', 5);
$I->executeJS('WebPay.testMode = true');
$I->see('クレジットカード決済');
$I->click('カードで支払う');
$I->fillField('#WP_cardNumber', '4242 4242 4242 4242');
$I->selectOption('#WP_expMonth', '12');
$I->selectOption('#WP_expYear', '19');
$I->fillField('#WP_name', 'TEST TEST');
$I->fillField('#WP_cvc', '123');
$I->pushMockChargeResponse(['captured' => true]);
$I->click('#WP_sendButton');
$I->waitForText('Test shopの商品をご購入いただき、ありがとうございました', 5);
$I->loadRequest();
$I->seeInData('amount', 2782);
$I->seeInData('card');
$I->seeInData('currency', 'jpy');
$I->seeInData('description', '1');
示例#7
0
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('log in');
$I->amOnPage('/');
$I->switchToIFrame('topframe');
$I->fillField('login', 'admin');
$I->fillField('passwort', 'admin');
$I->executeJS('parent.setTimeout(window.stop, 3000)');
$I->click('input[type=submit][value=Login]');
$I->seeElement('frame[name=chat]');
<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('Edit User Profile');
$I->amOnPage('/signup');
$user_time = time();
$I->fillField('#username', 'johndoe' . $user_time);
$I->fillField('#email', 'johndoe' . $user_time . '@gmail.com');
$I->fillField('#password', 'password');
$I->fillField('#password_confirmation', 'password');
$I->click('.form-signin button');
$I->reloadPage();
$I->click('.user-menu-desktop');
$I->wait(2);
$I->executeJS('return $(".user-menu-desktop").parent().addClass("open")');
$I->waitForElement('.user-profile-link-desktop', 10);
// secs
$I->click('.user-profile-link-desktop');
$I->click('.edit-user-profile');
$I->fillField('#username', 'bobsburgers');
$I->wait(2);
$I->fillField('#email', '*****@*****.**');
$I->wait(2);
$I->attachFile('input[name="avatar"]', 'bobsburgersavatar.jpg');
$I->click('.submit-update-profile');
$I->wait(2);
$I->see('successful');
 function selectDataPicker(\AcceptanceTester $I, $element, $date = 'now')
 {
     $date = strtotime($date) * 1000;
     $I->executeJS(sprintf('$(\'%s\').datepicker(\'update\', new Date(%s))', $element, $date));
 }
示例#10
0
 /**
  * Test that the can dismiss WP Easy Mode completely
  *
  * @before reset
  * @before login
  * @before validateWizard
  *
  * @after reactivateCodeception
  * @after reset
  *
  * @param \AcceptanceTester $I
  */
 public function canDismissPlugin(AcceptanceTester $I)
 {
     $I->wantTo('Dismiss WP Easy Mode');
     // This is a workaround to acceptPopup in headless mode
     $I->executeJS('window.confirm = function(){ return true; }');
     $this->stepStart($I, false);
     Debug::debug('Exiting the wizard ...');
     $I->waitForElementNotVisible('.wpem-step-1 form', 15);
     // Redirected back to the WP Admin
     $I->seeInCurrentUrl('/wp-admin/');
     $I->see('Dashboard');
     $I->canSeeSetting('wpem_opt_out', 1);
     $I->canSeeSetting('wpem_done', 1);
     $I->canSeeSetting('wpem_log');
     $I->canSeePluginInactive('search-engine-visibility/sev.php');
     $I->canSeePluginInactive('sidekick/sidekick.php');
     $I->canSeePluginInactive('wp101-video-tutorial/wp101-video-tutorial.php');
     $I->amOnPage(self_admin_url('customize.php'));
     $I->canSeeElement('.change-theme');
     $I->waitForElementNotVisible('.wp-pointer', 5);
     $I->cantSee('Congratulations!');
 }
 public function systeminfo_セキュリティ管理SSL(\AcceptanceTester $I)
 {
     $I->wantTo('EA0804-UC01-T04 セキュリティ管理 - SSL強制');
     $testConfig = Fixtures::get('test_config');
     $I->amOnUrl('http://' . $testConfig['hostname'] . '/');
     $I->assertRegExp('/^http:\\/\\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされない');
     $config = Fixtures::get('config');
     $I->amOnUrl('https://' . $testConfig['hostname'] . '/' . $config['admin_route'] . '/setting/system/security');
     $I->checkOption(['id' => 'admin_security_force_ssl']);
     $I->click('#aside_column div div div div div button');
     // httpでアクセスしたらhttpsにリダイレクトされる
     $I->amOnUrl('http://' . $testConfig['hostname'] . '/');
     $I->assertRegExp('/^https:\\/\\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされる');
     // 後続テストのために戻しておく
     $I->amOnUrl('https://' . $testConfig['hostname'] . '/' . $config['admin_route'] . '/setting/system/security');
     $I->uncheckOption(['id' => 'admin_security_force_ssl']);
     $I->click('#aside_column div div div div div button');
 }
示例#12
0
 /**
  * Grab amount of el-ts selected by JQuery
  * 
  * @param   AcceptanceTester    $I
  * @param   string              $JQerySelector
  * @return  string              Amount of elements
  */
 public function grabCCSAmount($I, $JQerySelector)
 {
     $script = "\$('<p id=uniqueidunique></p>').text(\$('{$JQerySelector}').length).appendTo('body')";
     $I->executeJS($script);
     $amount = $I->grabTextFrom("#uniqueidunique");
     return $amount;
 }