示例#1
0
 public function create(AcceptanceTester $I)
 {
     $clientEmail = $this->faker->safeEmail;
     $productKey = $this->faker->text(10);
     $amount = rand(1, 10);
     $I->wantTo('enter a payment');
     // create client
     $I->amOnPage('/clients/create');
     $I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
     $I->click('Save');
     $I->see($clientEmail);
     // create product
     $I->amOnPage('/products/create');
     $I->fillField(['name' => 'product_key'], $productKey);
     $I->fillField(['name' => 'notes'], $this->faker->text(80));
     $I->fillField(['name' => 'cost'], $this->faker->numberBetween(11, 20));
     $I->click('Save');
     $I->see($productKey);
     // 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->click('Save');
     $I->see($clientEmail);
     $I->amOnPage('/payments/create');
     $I->selectDropdown($I, $clientEmail, '.client-select .dropdown-toggle');
     $I->selectDropdownRow($I, 1, '.invoice-select .combobox-container');
     $I->fillField(['name' => 'amount'], $amount);
     $I->selectDropdown($I, 'Cash', '.payment-type-select .dropdown-toggle');
     $I->selectDataPicker($I, '#payment_date', 'now + 1 day');
     $I->fillField(['name' => 'transaction_reference'], $this->faker->text(12));
     $I->click('Save');
     $I->see('Successfully created payment');
     $I->seeInDatabase('payments', ['amount' => number_format($amount, 2)]);
 }
示例#2
0
 /**
  * Check a non-existing URL and check for our 404
  *
  * @param \AcceptanceTester $I
  */
 public function checkNotFoundResourceTest(\AcceptanceTester $I)
 {
     $I->wantTo('see that a non-existing URL request returns a valid 404 page.');
     $I->amOnPage('/derp-a-derp');
     $I->see('Well, this is kind of embarrassing!');
     $I->see('You have what we call in the business, a 404.');
 }
 public function it_validates_required_fields(AcceptanceTester $I)
 {
     $I->amOnRoute(LoginPage::$ROUTE);
     $I->submitForm(LoginPage::$formId, [], 'Login');
     $I->see('The username field is required.');
     $I->see('The password field is required.');
 }
示例#4
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);
 }
示例#5
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}");
 }
示例#6
0
 public function ensureThatHomePageWorks(AcceptanceTester $I)
 {
     $I->amOnPage(Url::toRoute('/site/index'));
     $I->see('My Company');
     $I->seeLink('About');
     $I->click('About');
     $I->see('This is the About page.');
 }
示例#7
0
 public function seeHomepage(\AcceptanceTester $I)
 {
     $I->wantTo('See the homepage');
     $I->lookForwardTo('See the homepage correctly');
     $I->see('Welcome to Eternal Deztiny');
     $I->see('About us');
     $I->see('Recruiting Criteria');
     $I->see('Clan Dynamics');
     $I->see('What are you waiting for? Apply!');
 }
示例#8
0
 public function seeMembers(\AcceptanceTester $I)
 {
     $I->am('guest user');
     $I->amGoingTo('Load the members section');
     $I->amOnPage('/');
     $I->click('Members');
     $I->seeInCurrentUrl('/members');
     $I->see('Name');
     $I->see('Role');
 }
 /**
  * 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['bolt_authtoken'] = $I->grabCookie('bolt_authtoken');
     $this->cookies['bolt_session'] = $I->grabCookie('bolt_session');
     $I->see('Dashboard');
     $I->see('Configuration', Locator::href('/bolt/users'));
     $I->see("You've been logged on successfully.");
 }
示例#10
0
 public function installNeno(AcceptanceTester $I)
 {
     $I->maximizeWindow();
     $I->am('Administrator');
     $I->installJoomla();
     $I->doAdministratorLogin();
     $I->setErrorReportingToDevelopment();
     $I->amOnPage("/administrator/");
     $I->click("Extensions");
     $I->click("Extension Manager");
     $I->click("Upload Package File");
     $path = $I->getConfiguration('repo_folder');
     // Installing library
     $I->installExtensionFromDirectory($path . 'lib_neno');
     // Installing Plugin
     $I->installExtensionFromDirectory($path . 'plg_system_neno');
     // Installing Component
     $I->installExtensionFromDirectory($path . 'com_neno');
     // Enabling plugin
     $I->enablePlugin('Neno plugin');
     // Going to Neno
     $I->click("Components");
     $I->wait(1);
     $I->click("Neno Translate");
     $I->wait(1);
     // Get started Screen
     $I->click('Get Started');
     $I->waitForJS('return jQuery.active == 0', 5);
     $I->wait(1);
     // First step - Source language
     $I->see('Next');
     $I->click(['xpath' => "//button[@type=\"button\"]"]);
     $I->wait(1);
     // Second step - Translation methods
     $I->click('Next');
     $I->waitForJS('return jQuery.active == 0', 5);
     // Third step- Install language(s)
     $I->wait(1);
     $I->click("//*[@id=\"add-languages-button\"]");
     $I->waitForJS("return jQuery.active == 0", 5);
     $I->waitForElementVisible(['class' => 'ar-AA'], 5);
     $I->wait(1);
     $I->click(['class' => 'ar-AA']);
     $I->see('Close', ['class' => 'close-button']);
     $I->click(['class' => 'close-button'], ['xpath' => "//*[@id=\"languages-modal\"]"]);
     $I->click(['xpath' => "(//button[@type=\"button\"])[4]"]);
     // Fourth step- Installing Neno
     $I->wait(1);
     $I->click("#backup-created-checkbox");
     $I->click("#proceed-button");
     // Fifth step- Installing Neno has been accomplish successfully
     //$I->waitForJS('return jQuery.installation == 1', 1000);
     $I->waitForElement(".icon-thumbs-up", 300);
     $I->doAdministratorLogout();
 }
 public function addShipmentToNewOrder(AcceptanceTester $I)
 {
     $I->addProductToCartAndCheckout();
     $orderId = $I->grabAttributeFrom('#new-order-number', 'data-order-id');
     $referenceNumber = $I->grabAttributeFrom('#new-order-number', 'data-reference-number');
     $I->amOnPage('/admin/order/view/' . $orderId);
     $I->see('Order #' . $referenceNumber);
     $I->see('Pending', '.order-status');
     $I->addShipmentTrackingCode();
     $I->buyShippingLabel();
 }
示例#12
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);
 }
示例#13
0
 public function login(AcceptanceTester $I)
 {
     $I->amOnPage(Url::toRoute('/site/login'));
     $I->see('Введите логин и пароль для входа в систему:');
     $I->fillField('LoginForm[username]', 'admin');
     $I->fillField('LoginForm[password]', 'admin');
     $I->click('login-button');
     $I->wait(2);
     // wait for button to be clicked
     $I->see('Главное меню');
 }
示例#14
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
     $I->setCookie('bolt_authtoken', $this->cookies['bolt_authtoken']);
     $I->setCookie('bolt_session', $this->cookies['bolt_session']);
     $I->amOnPage('/bolt/editcontent/pages/3');
     $I->see('This is the contact text');
     $I->selectOption('#statusselect', 'published');
     $I->click('Save', '#savecontinuebutton');
     $I->see('The changes to this Page have been saved.');
 }
 /**
  * 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.');
 }
示例#16
0
 public function submitCorrect(AcceptanceTester $I)
 {
     $I->logInAsANormalUser();
     $I->amOnPage('/challenges?category=' . to_permalink(CI_DEFAULT_CATEGORY_TITLE));
     $I->see(CI_DEFAULT_CHALLENGE_TITLE);
     $I->see(CI_DEFAULT_CHALLENGE_DESCRIPTION);
     $flag_field = '#flag-input-' . CI_DEFAULT_CHALLENGE_ID;
     $I->fillField($flag_field, CI_DEFAULT_CHALLENGE_FLAG);
     $I->click('#flag-submit-' . CI_DEFAULT_CHALLENGE_ID);
     $I->seeInCurrentUrl('status=correct');
     $I->dontSeeElement($flag_field);
 }
示例#17
0
 /**
  * @depends editNews
  */
 public function deleteNewsNoTickConfirmation(AcceptanceTester $I)
 {
     $I->logInAsAnAdmin();
     $I->amOnListNews();
     $I->click('Edit');
     $I->waitForText('Edit news item');
     $I->seeInCurrentUrl('/edit_news');
     $I->click('Delete news item');
     $I->see('Error');
     $I->see('Please confirm delete');
     $I->amOnListNews();
     $I->see('Edit');
 }
 public function ensureThatLoginWorks(AcceptanceTester $I)
 {
     $I->amOnPage(Url::toRoute('/user/login'));
     $I->see('Login', 'h1');
     $I->amGoingTo('try to login with correct credentials');
     $I->fillField('input[name="LoginForm[username]"]', 'admin');
     $I->fillField('input[name="LoginForm[password]"]', 'admin');
     $I->click('login-button');
     $I->wait(2);
     // wait for button to be clicked
     $I->expectTo('see user info');
     $I->see('Logout');
 }
 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 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');
 }
示例#22
0
 public function viewHomepage(AcceptanceTester $I)
 {
     $I->wantTo('view the homepage');
     $I->amOnPage('/');
     $I->see('Zen Kommerce');
     //$I->dontSeeHttpHeader('Set-Cookie');
 }
 /**
  * @param AcceptanceTester $I
  */
 public function startAConversation(AcceptanceTester $I)
 {
     $I->wantToTest('if I can start a conversation');
     $I->amOnPage('/messages');
     $I->click('#startConversation');
     $I->see('Send a message');
 }
示例#24
0
 /**
  * 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('/');
     $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]');
     // We should now be logged in an greeted!
     $I->see('Welcome to your new Bolt site');
 }
 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);
 }
 public function loginWithInvalidCredentials(AcceptanceTester $I)
 {
     $I->amOnPage('/login');
     $I->click('Login');
     $I->seeCurrentUrlEquals('/login');
     $I->see('Invalid Credentials', '.flash');
 }
示例#27
0
 function loginWithValidEMailPassword(\AcceptanceTester $I, \Page\Login $loginPage)
 {
     $I->wantTo("Check login with Valid Email and Password");
     $loginPage->loginWithEmailAndPassword('*****@*****.**', '123asdF');
     $I->waitForElement('div[class="infos"]');
     $I->amOnPage('#/activities');
     $I->see('Hi, Markus');
 }
示例#28
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::$検索条件_本会員);
 }
 public function authentication_パスワード認証(\AcceptanceTester $I)
 {
     $I->wantTo('EA0201-UC01-T01 パスワード認証');
     // _before()で正常系はテスト済み
     // 異常系のテスト
     $I->logoutAsAdmin();
     $I->submitForm('#form1', ['login_id' => "invalid", 'password' => "invalidpassword"]);
     $I->see('ログインできませんでした。', '.login-box #form1 .text-danger');
 }
示例#30
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);
 }