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');
 }
示例#3
0
 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);
     }
 }
示例#4
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);
 }
 public function _before(AcceptanceTester $I)
 {
     $I->wantTo('Enable the ST, TM, MT Plugins');
     $I->loginAsAdmin();
     //Only if Run this test Seperately
     $I->amGoingTo('ST, TM, Media');
     $I->amOnPluginsPage();
     //In order that the activatePlugin() works, the webdriver needs to be in Plugins page
     $I->activatePlugin('wpml-string-translation');
     $I->wait(1);
     $I->activatePlugin('wpml-translation-management');
     $I->wait(1);
     $I->activatePlugin('wpml-media');
     //to be checked because it shows error
 }
 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);
 }
 /**
  * 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);
 }
示例#8
0
 /**
  * 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);
 }
 public function testShowAction(AcceptanceTester $I)
 {
     $I->wantTo('too see inside the "Writing" workspace');
     $I->amOnPage('/workspace/writing');
     $I->see('Symfony book');
     $I->wait(3);
 }
 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]);
 }
示例#11
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}");
 }
示例#12
0
 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 write(AcceptanceTester $I)
 {
     $I->wantTo('write a message');
     $I->amOnPage('/Mikroblogi');
     $I->submitForm('.microblog-submit', ['text' => 'Testowy wpis na mikroblogu']);
     $I->wait(1);
     $I->canSee('Testowy wpis na mikroblogu');
 }
示例#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);
 }
示例#15
0
 public function ensureThatHomePageWorks(AcceptanceTester $I)
 {
     $I->amOnPage(Url::toRoute('/site/index'));
     $I->see('My Company');
     $I->seeLink('About');
     $I->click('About');
     $I->wait(2);
     // wait for page to be opened
     $I->see('This is the About page.');
 }
示例#16
0
 public function i_can_create_a_new_user(\AcceptanceTester $I)
 {
     $I->clickNode('#creatorcreator-933e76acb06dec2ba6c31ba9c058a4e9-node');
     $I->click('button[data-creator-attribute-name="Name"]');
     $I->waitForElement('#dvs-sidebar-field-form', self::WAIT_TIME);
     $I->fillField('text', 'tester');
     $I->click('a[data-breadcrumb-id="0"]');
     $I->wait(1);
     $I->click('button[data-creator-attribute-name="Email"]');
     $I->waitForElement('#dvs-sidebar-field-form', self::WAIT_TIME);
     $I->fillField('text', '*****@*****.**');
     $I->click('a[data-breadcrumb-id="0"]');
     $I->wait(1);
     $I->click('button[data-creator-attribute-name="Password"]');
     $I->waitForElement('#dvs-sidebar-field-form', self::WAIT_TIME);
     $I->fillField('text', 'password');
     $I->click('button.dvs-sidebar-save-group');
     $I->wait(self::WAIT_TIME);
     $I->seeInDatabase('users', array('email' => '*****@*****.**'));
 }
示例#17
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('Главное меню');
 }
示例#18
0
 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));
 }
示例#19
0
 private function AmazonScrapeCest(\AcceptanceTester $I)
 {
     $result = $this->db->query("SELECT * FROM `canopy_item_list`");
     //$result = $this->db->query("SELECT * FROM `canopy_item_list` GROUP BY `from_where`");
     //$urls = array('http://www.amazon.com/dp/B00HDGJY8S/?tag=','http://www.amazon.com/dp/B00R4O97ZE/?tag=','http://www.amazon.com/dp/B004LRPVM0/?tag=','http://www.amazon.com/dp/B00MKAJP0E/?tag=','http://www.amazon.com/dp/B00KCG10T2/?tag=','http://www.amazon.com/dp/B00JD2LKD2/?tag=','http://www.amazon.com/dp/1477800670/?tag=','http://www.amazon.com/dp/B001797M6S/?tag=','http://www.amazon.com/dp/0316378216/?tag=','http://www.amazon.com/dp/1616892323/?tag=','http://www.amazon.com/dp/B00LW3RCW8?tag=');
     while ($row = $result->fetch_assoc()) {
         $temp = explode('/', $row['item_slug']);
         $id = $temp[4];
         $item_info['title'] = '';
         $item_info['price'] = '';
         $item_info['image_data'] = '';
         $I->amOnPage("dp/{$id}");
         try {
             $I->waitForElement('#productTitle', 10);
             $item_info['title'] = $this->db->real_escape_string($I->grabTextFrom('#productTitle'));
         } catch (\Exception $e) {
         }
         try {
             $item_info['price'] = $I->grabTextFrom('#priceblock_ourprice');
         } catch (\Exception $e) {
             try {
                 $item_info['price'] = $I->grabTextFrom('.header-price');
             } catch (\Exception $e) {
                 try {
                     $item_info['price'] = $I->grabTextFrom('#buybox .a-color-price');
                 } catch (\Exception $e) {
                     try {
                         $item_info['price'] = $I->grabTextFrom('#unqualifiedBuyBox .a-color-price');
                     } catch (\Exception $e) {
                     }
                 }
             }
         }
         try {
             $item_info['image_data'] = $I->grabAttributeFrom('#imgTagWrapperId img', 'data-a-dynamic-image');
         } catch (\Exception $e) {
             try {
                 $item_info['image_data'] = $I->grabAttributeFrom('#mainImageContainer img', 'data-a-dynamic-image');
             } catch (\Exception $e) {
                 try {
                     $item_info['image_data'] = $I->grabAttributeFrom('#img-canvas img', 'data-a-dynamic-image');
                 } catch (\Exception $e) {
                 }
             }
         }
         $sql = "UPDATE `canopy_item_list` SET `title`='{$item_info['title']}',`price`='{$item_info['price']}',`image_data`='{$item_info['image_data']}' WHERE `item_slug`='{$row['item_slug']}'";
         //codecept_debug($sql);
         $this->db->real_query($sql);
         $rand_sec = rand(3, 6);
         $I->wait($rand_sec);
         // remove for faster scrape
     }
 }
示例#20
0
 public function topページ_カテゴリ検索(\AcceptanceTester $I)
 {
     $I->wantTo('EF0101-UC02-T01 TOPページ カテゴリ検索');
     $I->amOnPage('/');
     // カテゴリを選択、そのまま続けて子カテゴリを選択する
     $I->moveMouseOver(['css' => '#category .category-nav li:nth-child(2)']);
     $I->wait(3);
     $I->click('#header #category ul li:nth-child(2) ul li:nth-child(1) a');
     // 商品一覧の上部に、選択されたカテゴリとその親カテゴリのリンクが表示される
     $I->see('調理器具', '#topicpath ol');
     $I->see('パーコレーター', '#item_list');
 }
示例#21
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();
 }
示例#22
0
 public function createTimerTask(AcceptanceTester $I)
 {
     $description = $this->faker->text(100);
     $I->wantTo('create a timed task');
     $I->amOnPage('/tasks/create');
     $I->seeCurrentUrlEquals('/tasks/create');
     $I->fillField('#description', $description);
     $I->click('Start');
     $I->wait(rand(2, 5));
     $I->click('Stop');
     $I->click('Save');
     $I->seeInDatabase('tasks', ['description' => $description]);
 }
 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');
 }
示例#24
0
 public function signUpAndGoPro(AcceptanceTester $I)
 {
     $userEmail = $this->faker->safeEmail;
     $userPassword = $this->faker->password;
     $I->wantTo('test purchasing a pro plan');
     $I->amOnPage('/invoice_now');
     $I->click('Sign Up');
     $I->wait(1);
     $I->checkOption('#terms_checkbox');
     $I->fillField(['name' => 'new_first_name'], $this->faker->firstName);
     $I->fillField(['name' => 'new_last_name'], $this->faker->lastName);
     $I->fillField(['name' => 'new_email'], $userEmail);
     $I->fillField(['name' => 'new_password'], $userPassword);
     $I->click('Save');
     $I->wait(1);
     $I->amOnPage('/dashboard');
     $I->click('Upgrade');
     $I->wait(1);
     $I->click('#changePlanButton');
     $I->wait(1);
     $I->click('Pay Now');
     $I->wait(1);
     $I->fillField(['name' => 'address1'], $this->faker->streetAddress);
     $I->fillField(['name' => 'address2'], $this->faker->streetAddress);
     $I->fillField(['name' => 'city'], $this->faker->city);
     $I->fillField(['name' => 'state'], $this->faker->state);
     $I->fillField(['name' => 'postal_code'], $this->faker->postcode);
     $I->selectDropdown($I, 'United States', '.country-select .dropdown-toggle');
     $I->fillField(['name' => 'card_number'], '4242424242424242');
     $I->fillField(['name' => 'cvv'], '1234');
     $I->selectOption('#expiration_month', 12);
     $I->selectOption('#expiration_year', date('Y'));
     $I->click('.btn-success');
     $I->wait(1);
     $I->see('Successfully applied payment');
     $I->amOnPage('/dashboard');
     $I->dontSee('Go Pro');
 }
示例#25
0
 public function contactFormCanBeSubmitted(AcceptanceTester $I)
 {
     $I->amGoingTo('submit contact form with correct data');
     $I->fillField('#contactform-name', 'tester');
     $I->fillField('#contactform-email', '*****@*****.**');
     $I->fillField('#contactform-subject', 'test subject');
     $I->fillField('#contactform-body', 'test content');
     $I->fillField('#contactform-verifycode', 'testme');
     $I->click('contact-button');
     $I->wait(2);
     // wait for button to be clicked
     $I->dontSeeElement('#contact-form');
     $I->see('Thank you for contacting us. We will respond to you as soon as possible.');
 }
 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);
 }
示例#27
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;
             }
         }
     }
 }
 public function _before(AcceptanceTester $I)
 {
     $I->wantTo('Further Configure WC');
     $I->loginAsAdmin();
     //Only if Run this test Seperately
     //////////////////////
     $I->amGoingTo('Configure the Selling Country');
     $I->amOnPage('/wp-admin/admin.php?page=wc-settings');
     $I->click('#select2-chosen-2');
     $I->fillField('#s2id_autogen2_search', 'Αττική');
     $I->click('.select2-match');
     //////////////////////
     $I->amGoingTo('Configure the Default Currency');
     $I->click('#select2-chosen-7');
     $I->fillField('#s2id_autogen7_search', 'Euro');
     $I->click('.select2-result-label');
     $I->click('Save changes');
     //////////////////////
     $I->wait(3);
 }
示例#29
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->wait(1);
     //$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('table.invoice-table tbody tr:nth-child(1) .tt-selectable');
     $I->click('Save');
     $I->wait(1);
     $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->wait(1);
     $I->see('Successfully created payment');
     $I->seeInDatabase('payments', ['amount' => number_format($amount, 2)]);
 }
 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');
     //////////////////////
     // WCML Activation
     $I->amOnPage('/wp-admin/plugins.php');
     $I->see('Plugins');
     $I->click('Activate', '#woocommerce-multilingual');
     $I->wait(2);
     //////////////////////
     // WCML configuration
     $I->amOnPage('/wp-admin/admin.php?page=wpml-wcml&tab=status');
     $I->see('WooCommerce Multilingual');
     $I->click('Create missing translations');
     $I->click('Translate URLs');
 }