public function testShowAction(AcceptanceTester $I)
 {
     $I->wantTo('too see inside the "Writing" workspace');
     $I->amOnPage('/workspace/writing');
     $I->see('Symfony book');
     $I->wait(3);
 }
 /**
  * Tests that form manager opens on the new form page
  *
  * @since 7.0
  * @param \GLM\Tests\Acceptance\AcceptanceTester $I The current actor.
  */
 public function formManagerOpensNewForm(AcceptanceTester $I)
 {
     $I->wantTo('Ensure the form manager opens in the new form page');
     $I->amOnPage(admin_url('post-new.php?post_type=ccf_form'));
     $I->click('Manage Form');
     $I->see('Click on a field to edit it');
 }
 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]);
 }
Esempio n. 4
0
 function loginWithoutEmail(\AcceptanceTester $I, \Page\Login $loginPage)
 {
     $I->wantTo("Check login with No Email and Valid Password");
     $loginPage->loginWithPasswordOnly('debby');
     $I->seeElement('div[class = "control-group email error"]');
     $I->dontSeeInCurrentUrl('activities');
 }
Esempio n. 5
0
 public function testAPI(AcceptanceTester $I)
 {
     $I->wantTo('test the API');
     $data = new stdClass();
     $data->contact = new stdClass();
     $data->contact->email = $this->faker->safeEmail;
     $clientId = $this->createEntity('client', $data);
     $this->listEntities('client');
     $data = new stdClass();
     $data->client_id = $clientId;
     $data->description = $this->faker->realText(100);
     $this->createEntity('task', $data);
     $this->listEntities('task');
     $lineItem = new stdClass();
     $lineItem->qty = $this->faker->numberBetween(1, 10);
     $lineItem->cost = $this->faker->numberBetween(1, 10);
     $data = new stdClass();
     $data->client_id = $clientId;
     $data->invoice_items = [$lineItem];
     $invoiceId = $this->createEntity('invoice', $data);
     $this->listEntities('invoice');
     $data = new stdClass();
     $data->invoice_id = $invoiceId;
     $data->amount = 1;
     $this->createEntity('payment', $data);
     $this->listEntities('payment');
     $this->listEntities('account');
 }
Esempio n. 6
0
 public function testIfICantCreateAnEventWithoutBeingAuthenticated(AcceptanceTester $I)
 {
     $I->am('guest');
     $I->wantTo('see that i can\'t create an event');
     $I->amOnPage('event/create');
     $I->canSee('have to be logged in', '.alert-danger');
 }
 public function _before(AcceptanceTester $I)
 {
     $I->wantTo('Install and Configure WC');
     $I->loginAsAdmin();
     //Only if Run this test Seperately
     $I->amGoingTo('Activate Woocommerce Plugin');
     $I->amOnPluginsPage();
     //In order that the activatePlugin() works, the webdriver needs to be in Plugins page
     $I->activatePlugin('woocommerce');
     $I->amGoingTo('Run Woocommerce Setup');
     $I->waitForElement(".button-primary", 20);
     $I->click("Let's Go!");
     $I->waitForElement(".button-primary", 15);
     $I->click("Continue");
     $I->wait(1);
     $I->click("Continue");
     $I->wait(1);
     $I->click("Continue");
     $I->wait(1);
     $I->checkOption('#woocommerce_enable_cod');
     $I->click("Continue");
     $I->waitForElement(".button-secondary", 15);
     $I->click("No thanks");
     $I->wait(1);
     $I->click("Return to the WordPress Dashboard");
 }
 public function _before(AcceptanceTester $I)
 {
     $I->wantTo('Install WPML');
     $I->loginAsAdmin();
     $I->amGoingTo('Activate WPML Plugins');
     $I->amOnPluginsPage();
     //In order that the activatePlugin() works, the webdriver needs to be in Plugins page
     $I->activatePlugin('wpml-multilingual-cms');
     $I->amGoingTo('Configure WPML');
     $I->click('No thanks, I will configure myself');
     $I->click('Next');
     //Let's English as Default language
     $I->checkOption('Greek');
     $I->wait(1);
     $I->click('Next');
     $I->wait(5);
     $I->checkOption('form input[name=icl_lang_sel_footer]');
     $I->waitForElement(".button-primary", 15);
     $I->wait(1);
     $I->click('Next');
     $I->wait(3);
     $I->waitForElement(".button-primary", 15);
     $I->click('Remind me later');
     $I->wait(5);
     $I->click('Finish');
 }
 public function testShowAction(AcceptanceTester $I)
 {
     $I->wantTo('too see inside the dashboard area');
     $I->amOnPage('/dashboard');
     $I->see('a placeholder for dashboard');
     $I->wait(3);
 }
Esempio n. 10
0
 public function createExpense(AcceptanceTester $I)
 {
     $I->wantTo('Create an expense');
     $vendorName = $this->faker->name;
     $clientEmail = $this->faker->safeEmail;
     $amount = $this->faker->numberBetween(10, 20);
     // create vendor
     $I->amOnPage('/vendors/create');
     $I->fillField(['name' => 'name'], $vendorName);
     $I->click('Save');
     $I->see($vendorName);
     $vendorId = $I->grabFromDatabase('vendors', 'id', ['name' => $vendorName]);
     // create client
     $I->amOnPage('/clients/create');
     $I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
     $I->click('Save');
     $I->see($clientEmail);
     // create expense
     $I->amOnPage('/expenses/create');
     $I->fillField(['name' => 'amount'], $amount);
     $I->selectDropdown($I, $vendorName, '.vendor-select .dropdown-toggle');
     $I->selectDropdown($I, $clientEmail, '.client-select .dropdown-toggle');
     $I->click('Save');
     $I->seeInDatabase('expenses', ['vendor_id' => $vendorId]);
     // invoice expense
     $I->executeJS('submitAction(\'invoice\')');
     $I->click('Save');
     $I->wait(1);
     $I->see($clientEmail);
     $I->see($amount);
 }
Esempio n. 11
0
 public function viewHomepage(AcceptanceTester $I)
 {
     $I->wantTo('view the homepage');
     $I->amOnPage('/');
     $I->see('Zen Kommerce');
     //$I->dontSeeHttpHeader('Set-Cookie');
 }
Esempio n. 12
0
 public function taxRates(AcceptanceTester $I)
 {
     $I->wantTo('test tax rates');
     $clientEmail = $this->faker->safeEmail;
     $productKey = $this->faker->text(10);
     $itemTaxRate = $this->faker->randomFloat(2, 5, 15);
     $itemTaxName = $this->faker->word();
     $invoiceTaxRate = $this->faker->randomFloat(2, 5, 15);
     $invoiceTaxName = $this->faker->word();
     $itemCost = $this->faker->numberBetween(1, 20);
     $total = $itemCost;
     $total += round($itemCost * $itemTaxRate / 100, 2);
     $total += round($itemCost * $invoiceTaxRate / 100, 2);
     // create tax rates
     $I->amOnPage('/tax_rates/create');
     $I->fillField(['name' => 'name'], $itemTaxName);
     $I->fillField(['name' => 'rate'], $itemTaxRate);
     $I->click('Save');
     $I->see($itemTaxName);
     $I->amOnPage('/tax_rates/create');
     $I->fillField(['name' => 'name'], $invoiceTaxName);
     $I->fillField(['name' => 'rate'], $invoiceTaxRate);
     $I->click('Save');
     $I->see($invoiceTaxName);
     // enable line item taxes
     $I->amOnPage('/settings/tax_rates');
     $I->checkOption('#invoice_item_taxes');
     $I->click('Save');
     // create product
     $I->amOnPage('/products/create');
     $I->fillField(['name' => 'product_key'], $productKey);
     $I->fillField(['name' => 'notes'], $this->faker->text(80));
     $I->fillField(['name' => 'cost'], $itemCost);
     $I->selectOption('select[name=default_tax_rate_id]', $itemTaxName . ' ' . $itemTaxRate . '%');
     $I->click('Save');
     $I->wait(1);
     $I->see($productKey);
     // create client
     $I->amOnPage('/clients/create');
     $I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
     $I->click('Save');
     $I->see($clientEmail);
     // create invoice
     $I->amOnPage('/invoices/create');
     $I->selectDropdown($I, $clientEmail, '.client_select .dropdown-toggle');
     $I->fillField('table.invoice-table tbody tr:nth-child(1) #product_key', $productKey);
     $I->selectOption('#taxRateSelect', $invoiceTaxName . ' ' . $invoiceTaxRate . '%');
     $I->wait(2);
     // check total is right before saving
     $I->see("\${$total}");
     $I->click('Save');
     $I->wait(1);
     $I->see($clientEmail);
     // check total is right after saving
     $I->see("\${$total}");
     $I->amOnPage('/invoices');
     // check total is right in list view
     $I->see("\${$total}");
 }
Esempio n. 13
0
 public function comment(AcceptanceTester $I)
 {
     $I->wantTo('post a comment');
     $I->amOnPage('/Mikroblogi');
     $I->canSeeElement('.comment-submit');
     //        $I->submitForm('.comment-submit', ['text' => 'To jest unikalny komentarz']);
     //        $I->wait(1);
     //        $I->canSee('To jest unikalny komentarz');
 }
Esempio n. 14
0
 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);
 }
 /**
  * Login the admin user using his email
  *
  * @param \AcceptanceTester $I
  */
 public function loginAdminUserTest(\AcceptanceTester $I)
 {
     $I->wantTo('log into the backend as Admin with email');
     $I->loginWithEmailAs($this->user['admin']);
     $this->saveLogin($I);
     $I->see('Dashboard');
     $I->see('Configuration', Locator::href('/bolt/users'));
     $I->see("You've been logged on successfully.");
 }
 public function authentication_最終ログイン日時確認(\AcceptanceTester $I)
 {
     $I->wantTo('EA0201-UC01-T01 最終ログイン日時確認');
     $I->click(['css' => '.navbar-menu .dropdown-toggle']);
     $loginText = $I->grabTextFrom(['css' => '.navbar-menu .dropdown-menu']);
     $lastLogin = preg_replace('/.*(\\d{4}\\/\\d{2}\\/\\d{2} \\d{2}:\\d{2}).*/s', '$1', $loginText);
     // 表示されるログイン日時では秒数がわからないため、タイミングによっては1分ちょっと変わる
     $I->assertTrue(strtotime('now') - strtotime($lastLogin) < 70, '最終ログイン日時が正しい');
 }
Esempio n. 17
0
 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::$検索条件_本会員);
 }
Esempio n. 18
0
 public function isEditedPost(AcceptanceTester $I, UserSteps $userSteps)
 {
     $I->wantTo('check history for post which is edited');
     $userId = $userSteps->amRegularUser();
     $catId = $userSteps->haveCategory();
     $postId = $I->havePost(['title' => 'Some title', 'content' => 'Some content.', 'users_id' => $userId, 'categories_id' => $catId]);
     $I->havePostHistory(['posts_id' => $postId, 'users_id' => $userId, 'content' => 'Some content II.']);
     $I->amOnPage("/discussion/{$postId}/some-title");
     $I->see('edited');
 }
Esempio n. 19
0
 /**
  * Search for the 'About' page record.
  *
  * @param \AcceptanceTester $I
  */
 public function omnisearchTest(\AcceptanceTester $I)
 {
     $I->wantTo("Search for the 'About' page as the 'author' user");
     // Set up the browser
     $this->setLoginCookies($I);
     $I->amOnPage('/bolt/omnisearch');
     $I->fillField('.col-md-8 .form-control', 'About');
     $I->click('Search', '.col-md-8 [type="submit"]');
     $I->seeLink('Edit', '/bolt/editcontent/pages/2');
 }
 /**
  * Login the admin user using his email
  *
  * @param \AcceptanceTester $I
  */
 public function loginAdminUserTest(\AcceptanceTester $I)
 {
     $I->wantTo('log into the backend as Admin with email');
     $I->loginWithEmailAs($this->user['admin']);
     $this->cookies[$this->tokenNames['authtoken']] = $I->grabCookie($this->tokenNames['authtoken']);
     $this->cookies[$this->tokenNames['session']] = $I->grabCookie($this->tokenNames['session']);
     $I->see('Dashboard');
     $I->see('Configuration', Locator::href('/bolt/users'));
     $I->see("You've been logged on successfully.");
 }
Esempio n. 21
0
 /**
  * Publish the 'Contact' page.
  *
  * @param \AcceptanceTester $I
  */
 public function publishContactPageTest(\AcceptanceTester $I)
 {
     $I->wantTo("Publish the 'Contact' page with 'templatefields' as 'manager' user");
     // Set up the browser
     $this->setLoginCookies($I);
     $I->amOnPage('/bolt/editcontent/pages/3');
     $I->seeInSource('This is the contact text');
     $I->selectOption('#statusselect', 'published');
     $I->click('Save', '#savecontinuebutton');
     $I->see('The changes to the Page have been saved.');
 }
Esempio n. 22
0
 public function viewProductFromTagPage(AcceptanceTester $I)
 {
     $I->wantTo('view a product from tag page');
     $I->amOnPage('/t');
     $tagName = $I->grabTextFrom("//div[contains(@class,'tag-name')][1]");
     $I->click("//div[contains(@class,'tag-container')][1]//a");
     $I->see($tagName);
     $productName = $I->grabTextFrom("//div[contains(@class,'product-name')][1]");
     $I->click("//div[contains(@class,'product-container')][1]//a");
     $I->see($productName);
 }
 public function tryToTransferFundsBetweenMembers(AcceptanceTester $I)
 {
     $I->am('ewallet member');
     $I->wantTo('pay a debt');
     $I->lookForwardTo('transfer funds to my friend');
     $I->amOnPage(TransferFundsPage::$formPage);
     $I->selectOption(TransferFundsPage::$toMember, 'Luis Montealegre');
     $I->fillField(TransferFundsPage::$amount, 5);
     $I->click(TransferFundsPage::$transfer);
     $I->seeCurrentUrlMatches('/' . TransferFundsPage::$transferPage . '/');
     $I->seeElement(TransferFundsPage::$successMessage);
 }
Esempio n. 24
0
 public function seeNavBar(\AcceptanceTester $I)
 {
     $I->wantTo('See the navbar links');
     $I->seeLink('News');
     $I->seeLink('Members');
     $I->seeLink('Warlog');
     $I->seeLink('Media');
     $I->seeLink('Live');
     $I->seeLink('Apply Now');
     $I->seeLink('Login');
     $I->seeLink('Register');
 }
 public function failOnEmptyHeadersInspecificationTest(AcceptanceTester $I)
 {
     $I->wantTo('fail when creating a specification with invalid headers');
     $request = new Request();
     $request->setUrl(new Condition('isEqualTo', '/the/request/url'));
     $response = (new Response())->setHeaders('potato');
     $specification = new Expectation();
     $specification->setRequest($request)->setResponse($response);
     $I->haveHttpHeader('Content-Type', 'application/json');
     $I->sendPOST('/__phiremock/expectations', $specification);
     $I->seeResponseCodeIs(500);
 }
 /**
  * Create an 'About' page record.
  *
  * @param \AcceptanceTester $I
  */
 public function editAboutPageTest(\AcceptanceTester $I)
 {
     $I->wantTo("Edit the 'About' page as the 'author' user");
     // Set up the browser
     $I->setCookie('bolt_authtoken', $this->cookies['bolt_authtoken']);
     $I->setCookie('bolt_session', $this->cookies['bolt_session']);
     $I->amOnPage('/bolt');
     $I->see('Edit', 'a');
     $I->click('Edit', 'a');
     $I->click('Save Page', '#savecontinuebutton');
     $I->see('The changes to the Page have been saved.');
 }
 public function logsInUserWithProperCredentials(AcceptanceTester $I)
 {
     $I->am('Site Owner');
     $I->wantTo('login to a password-protected area');
     $I->lookForwardTo('perform administrative tasks');
     $I->amOnPage('/admin');
     $I->seeCurrentUrlEquals('/login');
     $I->fillField('email', '*****@*****.**');
     $I->fillField('password', '1234');
     $I->click('Login');
     $I->seeCurrentUrlEquals('/admin');
     $I->see('Admin Area', 'h1');
 }
 public function addProductToCartAndCheckoutFailsFormValidation(AcceptanceTester $I)
 {
     $I->wantTo('add a product to the cart and checkout fails form validation');
     $I->addProductToCart();
     $I->estimateShippingAndTax();
     $I->click('Secure Checkout');
     $I->see('Order Summary');
     $I->enterCheckoutDetails();
     $badZipcode = 'xyz';
     $I->fillField('Zipcode', $badZipcode);
     $I->click('Place your order');
     $I->see('Must be a valid 5 digit postal code');
 }
 public function testWeddingCardCartpageContain(AcceptanceTester $I)
 {
     $I->wantTo('Check If Shopping Cart page contains ');
     $I->amOnPage('/shopping-cart');
     $I->see('SHOPPING CART');
     $I->see('Hình');
     $I->see('Tên thiệp');
     $I->see('Số lượng');
     $I->see('Hành Động');
     $I->see('Giá');
     $I->see('Tổng Cộng');
     $I->see('Đặt Hàng');
 }
 /**
  * Create the first site user
  *
  * @param \AcceptanceTester $I
  */
 public function createFirstUserTest(\AcceptanceTester $I)
 {
     $I->wantTo('create the first user');
     // Ensure we're on the first user page
     $I->amOnPage('/bolt/userfirst');
     $I->see('Please create the first user');
     // Fill in the form and submit
     $I->fillField('form[username]', $this->user['admin']['username']);
     $I->fillField('form[password]', $this->user['admin']['password']);
     $I->fillField('form[password_confirmation]', $this->user['admin']['password']);
     $I->fillField('form[email]', $this->user['admin']['email']);
     $I->fillField('form[displayname]', $this->user['admin']['displayname']);
     $I->click('button[type=submit]');
 }