private function EtsySpamCest(\AcceptanceTester $I) { $I->amOnPage("/"); $I->waitForElement('//*[@id="sign-in"]', 100); $I->click('//*[@id="sign-in"]'); $I->wait(3); $I->fillField('input#username-existing', 'sammacad'); $I->fillField('input#password-existing', '1!2@3#4$5%'); $I->click('//*[@id="signin-button"]'); $I->waitForElement('.user-nav'); // send spam $result = $this->db->query("SELECT * FROM `etsy_user_list` WHERE `sent_at` is null"); while ($row = $result->fetch_array()) { $shop = $row['from_where']; $temp = explode('/', $row['user_slug']); $user = $temp[sizeof($temp) - 1]; $I->amOnPage("/people/{$user}"); $I->click('//*[@id="tabbed-navigation-list"]/li[4]/a'); $I->waitForElement('//*[@id="conversation-send-form"]/div[2]/div[2]/input', 100); $I->fillField('//*[@id="conversation-send-form"]/div[2]/div[2]/input', "Hi {$user}"); $I->fillField('//*[@id="conversation-send-form"]/div[2]/div[2]/textarea', "Dear {$user}, I read your review on Etsy's {$shop} shop. How was your experience with them? We are creating a community for Etsy shoppers just like you! Please visit http://storeplore.com and get early access!"); $this->db->real_query("UPDATE `etsy_user_list` SET `sent_at`= CURRENT_TIMESTAMP WHERE `user_slug` = '" . $row['user_slug'] . "'"); $I->click('//*[@id="conversation-send-form"]/div[3]/div/button'); $rand_sec = rand(80, 120); $I->wait($rand_sec); } }
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]); }
/** * Clear cache work only at admin panel * @param AcceptanceTester $I Controller */ public static function ClearAllCach($I) { $I->amOnPage('/admin'); $I->click(NavigationBarPage::$System); $I->click(NavigationBarPage::$SystemClearAllCach); $I->wait(3); }
/** * Tests One Page Checkout * * @group checkout * * @param $I \AcceptanceTester * * @depends testAddProductToCart */ public function testOnePageCheckout(AT $I) { $I->am('Guest Customer'); $I->wantTo('use One Page Checkout'); $I->lookForwardTo('experience flawless checkout'); $I->amGoingTo('place an order as a guest'); $I->amOnPage(Page\Checkout::$URL); $I->amGoingTo('select the checkout type'); $I->selectOption(Page\Checkout::$radioTypeGuest, 'guest'); $I->click(Page\Checkout::$continueButton); $I->amGoingTo('fill my address'); $I->fillField(Page\Checkout::$billingFirstname, $this->getConfig('firstname')); $I->fillField(Page\Checkout::$billingLastname, $this->getConfig('lastname')); $I->fillField(Page\Checkout::$billingEmail, $this->getConfig('email')); $I->selectOption(Page\Checkout::$billingCountryId, $this->getConfig('country_id')); $I->fillField(Page\Checkout::$billingStreet1, $this->getConfig('street')); $I->fillField(Page\Checkout::$billingPostcode, $this->getConfig('postcode')); $I->fillField(Page\Checkout::$billingCity, $this->getConfig('city')); $I->fillField(Page\Checkout::$billingTelephone, $this->getConfig('phone')); $I->click('button', Page\Checkout::$billingAddressContainer); $I->amGoingTo('select shipping method'); $I->waitForElementVisible(Page\Checkout::$shippingButtonsContainer); $I->selectOption(Page\Checkout::$shippingMethodInput, Page\Checkout::$shippingMethod); $I->click('button', Page\Checkout::$shippingButtonsContainer); $I->waitForElementVisible(Page\Checkout::$paymentButtonsContainer); // $I->amGoingTo('select payment method'); // $I->click(Page\Checkout::$paymentMethod); $I->click('button', Page\Checkout::$paymentButtonsContainer); $I->waitForElementVisible(Page\Checkout::$checkoutReviewContainer); $I->amGoingTo('review and finish my order'); $I->click('button', Page\Checkout::$checkoutReviewContainer); $I->wait(7); }
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); }
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)]); }
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}"); }
public function doAddMenuOptionValue(\AcceptanceTester $I, $num, $name, $price, $quantity) { $I->click('#tfoot .action .btn-primary'); $I->selectOption("#option-value{$num} select", $name); $I->fillField("menu_options[1][option_values][{$num}][price]", $price); $I->fillField("menu_options[1][option_values][{$num}][quantity]", $quantity); $I->click("#option-value{$num} label.btn:not(.active)"); }
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::$検索条件_本会員); }
private function logIn(\AcceptanceTester $I) { $I->amOnPage("/"); $I->waitForElement('//*[@id="doc"]/div[1]/div/div[1]/div[2]/button', 100); $I->click('//*[@id="doc"]/div[1]/div/div[1]/div[2]/button'); $I->fillField('//*[@id="signin-email"]', '*****@*****.**'); $I->fillField('//*[@id="signin-password"]', 'lovelove79'); $I->click('//*[@id="login-dialog-dialog"]/div[2]/div[2]/div[2]/form/input[1]'); $I->waitForElement('.bird-topbar-etched', 100); }
public function i_can_save_this_model(\AcceptanceTester $I) { $value = $I->generateRandomString(); $I->clickNode('#model0-node'); $I->click('.dvs-sidebar-elements button'); $I->waitForElement('#dvs-sidebar-field-form', 5); $I->fillField('text', $value); $I->click('button.dvs-sidebar-save-group'); $I->wait(10); $I->seeInDatabase('dvs_test_models', array('id' => 1, 'name' => $value)); }
private function logIn(\AcceptanceTester $I) { $I->amOnPage("/"); $I->waitForElement('//*[@id="welcome"]/div[1]/div[1]/a[2]', 100); $I->click('//*[@id="welcome"]/div[1]/div[1]/a[2]'); $I->waitForElement('//*[@id="signin-login-field"]', 100); $I->fillField('//*[@id="signin-login-field"]', '*****@*****.**'); $I->fillField('//*[@id="signin-password-field"]', '1!2@3#4$5%'); $I->click('//*[@id="new_user"]/div[2]/input'); $I->waitForElement('//*[@id="navbar-user-dynamic"]/ul/li[2]/a[1]/img', 100); }
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); }
/** * @depends deleteNewsNoTickConfirmation */ public function deleteNewsTickConfirmation(AcceptanceTester $I) { $I->logInAsAnAdmin(); $I->amOnListNews(); $I->click('Edit'); $I->waitForText('Edit news item'); $I->seeInCurrentUrl('/edit_news'); $I->checkOption('#delete_confirmation'); $I->click('Delete news item'); $I->seeInCurrentUrl('/list_news'); $I->dontSee('Edit'); }
/** * 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 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 register(\AcceptanceTester $I) { $I->amGoingTo('register'); $I->amOnPage('/auth/register'); $I->fillField('name', 'codeception'); $I->fillField('password', 'acceptance'); $I->fillField('email', '*****@*****.**'); $I->click('submit'); $I->see('Registered successfully!'); $I->seeLink('Go back to Home'); $I->click('Go back to Home'); $I->seeInCurrentUrl('/'); }
private function submitTheForm(AcceptanceTester $I, $attributes) { $I->waitForElement('form', 2); $I->fillField('form #title', $attributes['title']); $I->fillField('form #content', $attributes['content']); $I->click('form .btn-primary'); }
/** * 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'); }
/** * @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'); }
public function administratorCreateCategoryWithoutTitleFails(AcceptanceTester $I) { $I->am('Administrator'); $I->wantToTest('Category creation in /administrator/ without title'); $I->doAdministratorLogin(); $I->amGoingTo('Navigate to Categories page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_categories&extension=com_weblinks'); $I->waitForText('Weblinks: Categories', '30', ['css' => 'h1']); $I->expectTo('see categories page'); $I->amGoingTo('try to save a category with empty title and it should fail'); $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.add')\"]"]); $I->waitForText('Weblinks: New Category', '30', ['css' => 'h1']); $I->click(['xpath' => "//button[@onclick=\"Joomla.submitbutton('category.apply')\"]"]); $I->expectTo('see an error when trying to save a category without title'); $I->see('Invalid field: Title', ['id' => 'system-message-container']); }
public function clickDropdown($title, $text) { if (is_array($text)) { $text = $text['link']; } if (is_array($title)) { $title = $title['link']; } $I = new \AcceptanceTester($this->scenario); $I->waitForElement(Page::$pageLoaded, 60); $I->click("//div[contains(@class,'dropdown__toggle')][contains(text(), '{$title}')]"); $I->waitForElement("//div[contains(@class, 'dropdown_opened')]", 30); $I->waitForElementVisible("//div[contains(@class,'navigation_vertical')]/a[contains(text(),'{$text}')]", 30); $I->click("//div[contains(@class,'navigation_vertical')]/a[contains(text(),'{$text}')]"); $I->waitForElement(Page::$pageLoaded, 60); }
public function loginWithInvalidCredentials(AcceptanceTester $I) { $I->amOnPage('/login'); $I->click('Login'); $I->seeCurrentUrlEquals('/login'); $I->see('Invalid Credentials', '.flash'); }
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.'); }
public function i_can_edit_the_users_email(\AcceptanceTester $I) { $I->clickNode('#attribute3-node'); $I->fillField('text', '*****@*****.**'); $I->click('button.dvs-sidebar-save-group'); $I->wait(self::WAIT_TIME); $I->seeInDatabase('users', array('email' => '*****@*****.**')); }
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 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, '最終ログイン日時が正しい'); }
/** * @depends installCmc */ public function initializeCmcSettings(\AcceptanceTester $I) { $I->doAdministratorLogin(); $I->comment('Mailchimp API Key from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); $key = $I->getConfiguration('api_key'); $I->amGoingTo('Navigate to CMC page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_cmc&view=cpanel'); // Wait for text dashboard - wait for text not working $I->waitForElementVisible('#ctitle'); $I->checkForPhpNoticesOrWarnings(); // Options $I->click('Options'); $I->waitForText('Configuration', '30', ['css' => 'h1']); $I->fillField(['id' => 'jform_api_key'], $key); $I->click('Save & Close'); // Basck in the dashboard $I->waitForElementVisible('#ctitle'); $I->doAdministratorLogout(); }
public function _before(AcceptanceTester $I) { // Login Procedure $I->wantTo('Further Configure WC'); $I->amOnPage('/wp-admin/'); $I->fillField('#user_login', 'admin'); $I->fillField('#user_pass', '123456'); $I->click('Log In'); $I->see('Dashboard'); ////////////////////// // Create Product $I->amOnPage('/wp-admin/post-new.php?post_type=product'); $I->see('Add New Product'); $I->fillField('Product name', 'Test Product'); $I->fillField('.mce-edit-arear', 'Test Product'); $I->fillField('_regular_price', '10'); $I->click('#publish'); $I->wait(2); }
public function editTask(AcceptanceTester $I) { $description = $this->faker->text(100); $I->wantTo('edit a task'); $I->amOnPage('/tasks/1/edit'); $I->seeCurrentUrlEquals('/tasks/1/edit'); $I->fillField('#description', $description); $I->click('Save'); $I->seeInDatabase('tasks', ['description' => $description]); }