/**
  * 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);
 }
示例#2
0
 /**
  * @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();
 }
示例#3
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 grabDragonInfo(AcceptanceTester $I)
 {
     $this->dragons = json_decode(file_get_contents('dragons.json'));
     foreach ($this->dragons as $index => $dragonName) {
         if (in_array($dragonName, array_keys($this->dragonInfo))) {
             continue;
         }
         $I->wantTo("Read data of dragon {$dragonName}");
         $I->amOnPage("/wiki/{$dragonName}");
         $I->waitForElementVisible("#WikiaPageHeader > div > div.header-column.header-title");
         try {
             $I->see("Article {$dragonName} was not found");
         } catch (\Exception $e) {
             unset($this->dragons[$index]);
             continue;
         }
         $isClassicDragon = true;
         try {
             $I->seeElement("#mw-content-text > table.infobox.Template > tbody");
         } catch (\Exception $e) {
             $isClassicDragon = false;
         }
         if ($isClassicDragon) {
             $dragon = new Dragon();
             $dragon->name = $dragonName;
             $dragon->fishPerHour = $I->grabTextFrom("//*[@id=\"mw-content-text\"]/table[1]/tbody/tr[td//text()[contains(., 'Fish.png')]]/td[2]");
             $dragon->woodPerHour = $I->grabTextFrom("//*[@id=\"mw-content-text\"]/table[1]/tbody/tr[td//text()[contains(., 'Wood.png')]]/td[2]");
             try {
                 $dragon->collectionTime = $I->grabTextFrom("//*[@id=\"mw-content-text\"]/table[1]/tbody/tr[td//text()[contains(., 'Time.png')]]/td[2]");
             } catch (\Exception $e) {
                 $dragon->collectionTime = "TODO: add";
             }
             $dragon->iron = $I->grabTextFrom("//*[@id=\"mw-content-text\"]/table[1]/tbody/tr[td//text()[contains(., 'Iron-Icon.png')]]/td[2]");
             if ($dragon->iron != "Cannot Collect") {
                 $dragon->ironCollectionTime = $I->grabTextFrom("//*[@id=\"mw-content-text\"]/table[1]/tbody/tr[td//text()[contains(., 'Time.png')]][2]/td[2]");
             } else {
                 $dragon->ironCollectionTime = "Cannot Collect";
             }
             try {
                 $dragon->battleRange = $I->grabTextFrom("//*[@id=\"mw-content-text\"]/table[1]/tbody/tr[td//text()[contains(., 'Range_Icon.png')]]/td[2]");
             } catch (\Exception $e) {
                 $dragon->battleRange = "TODO: add";
             }
             $this->dragonInfo[$dragonName] = $dragon;
         } else {
             $this->dragonInfo[$dragonName] = "Not classic dragon.";
         }
     }
 }
 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);
 }
示例#6
0
 private function unlikePostOnCard(\AcceptanceTester $I)
 {
     $I->wantTo('unlike post on card');
     $I->amOnPage('/');
     // card
     $I->waitForElement('a.unlike-post[data-id="560"]', 10);
     $pre_like_count = $I->grabTextFrom('.like-post-count[data-id="560"]');
     $I->click('a.unlike-post[data-id="560"]');
     $I->waitForElementVisible('a.like-post[data-id="560"]', 10);
     $I->waitForElementNotVisible('a.unlike-post[data-id="560"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="560"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
     $I->amOnPage('/post/560');
     $I->waitForElement('.like-post-count[data-id="560"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="560"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
 }
示例#7
0
 private function unlikePostOnCard(\AcceptanceTester $I)
 {
     codecept_debug('unlikePostOnCard');
     $I->amOnPage('/' . $this->user_slug . '/postgroups/' . $this->postgroup_slug);
     // card
     $I->waitForElement('.btn.unlike-post[data-id="' . $this->post_id . '"]', 10);
     $pre_like_count = $I->grabTextFrom('.like-post-count[data-id="' . $this->post_id . '"]');
     $I->click('.btn.unlike-post[data-id="' . $this->post_id . '"]');
     $I->waitForElementVisible('.btn.like-post[data-id="' . $this->post_id . '"]', 10);
     $I->waitForElementNotVisible('.btn.unlike-post[data-id="' . $this->post_id . '"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="' . $this->post_id . '"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
     $I->amOnPage('/post/' . $this->post_id);
     $I->waitForElement('.like-post-count[data-id="' . $this->post_id . '"]', 10);
     $post_like_count = $I->grabTextFrom('.like-post-count[data-id="' . $this->post_id . '"]');
     $I->assertEquals($pre_like_count, $post_like_count + 1);
 }
示例#8
0
<?php

// @group mandatory
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that JavaScript works');
$I->amGoingTo('check javascript with a modal');
$I->amOnPage('/en-us');
$I->dontSee('#infoModal');
$I->click('footer .pull-left a');
$I->waitForElementVisible('#infoModal', 3);
$I->seeElement('#infoModal');
$I->makeScreenshot('modal');
$I->click('#infoModal .close');
$I->dontSee('#infoModal');
示例#9
0
 protected function stepCustomizer(AcceptanceTester $I)
 {
     Debug::debug('Viewing the theme Customizer ...');
     $I->canSeeInCurrentUrl('wp-admin/customize.php');
     $I->waitForElementVisible('.wp-pointer', 5);
     $I->canSee('Congratulations!');
     $I->cantSeeElement('.change-theme');
     $I->click('.wpem-pointer .button-primary');
     $I->canSeeElement('#wpem-overlay');
     $I->click('.wpem-overlay-control span');
     $I->cantSeeElement('#wpem-overlay');
     $I->click('.wpem-pointer .button-secondary');
     $I->cantSeeElement('.wp-pointer');
     $I->wait(1);
     $I->reloadPage();
     $I->waitForElementNotVisible('.wp-pointer', 5);
     $I->cantSee('Congratulations!');
     $I->cantSeeElement('.change-theme');
     $I->canSeeSetting('wpem_done', 1);
     $I->canSeeSetting('wpem_log');
 }
示例#10
0
 /**
  * Checking current parameters in frontend 
  * first time goes "processing order" page by clicking, other times goes to "processing order" page immediately
  * if you want to skip verifying of some parameters type null
  * verify one payment if string or many if array transmitted
  * 
  * @version 1.1
  * 
  * @param object            $I              Controller
  * @param string            $DeliveryName           Delivery name
  * @param string            $description    Description
  * @param float|int|string  $price          Delivery price
  * @param float|int|string  $freefrom       Delivery free from
  * @param string            $message        Delivery sum specified message
  * @param string|array      $pays           Delivery Payment methods, which will included, if passed string : "_" - delimiter for few methods
  * @param string            $selectpay      Pass to select method, confirm the order and verify payment
  * @return void
  */
 protected function CheckInFrontEnd(AcceptanceTester $I, $DeliveryName, $description = null, $price = null, $freefrom = null, $message = null, $pays = null, $selectpay = null)
 {
     static $WasCalled = FALSE;
     if (!$WasCalled) {
         $I->amOnPage('/shop/product/mobilnyi-telefon-sony-xperia-v-lt25i-black');
         /**
          * @var string buy          button "buy"
          * @var string basket       button "into basket"
          * @var string $Attribute1  class of "buy" button
          */
         $buy = "//div[@class='frame-prices-buy f-s_0']//form/div[3]";
         //button "buy"
         $basket = "//div[@class='frame-prices-buy f-s_0']//form/div[2]";
         //button "into basket"
         $Attribute1 = $I->grabAttributeFrom($buy, 'class');
         //class of "buy" button
         //$Attribute2 = $I->grabAttributeFrom($basket,'class');              //class of "into basket" button
         $I->wait(5);
         $Attribute1 == 'btn-buy-p btn-buy' ? $I->click($buy) : $I->click($basket);
         $I->waitForElementVisible("//*[@id='popupCart']");
         $I->wait(3);
         $I->click(".btn-cart.btn-cart-p.f_r");
     } else {
         $I->amOnPage("/shop/cart");
     }
     $WasCalled = TRUE;
     $present = FALSE;
     $I->waitForText('Оформление заказа');
     $DeliveriesInProcessingOrderPageAmount = $I->grabClassCount($I, 'name-count');
     for ($j = 1; $j <= $DeliveriesInProcessingOrderPageAmount; ++$j) {
         $GrabbedName = $I->grabTextFrom("//div[@class='frame-radio']/div[{$j}]//span[@class='text-el']");
         if ($GrabbedName == $DeliveryName) {
             $present = TRUE;
             break;
         }
     }
     $present ? $I->assertEquals($DeliveryName, $GrabbedName) : $I->fail("Delivery method isn't present in front end");
     if ($description) {
         $GrabbedDescription = $I->grabAttributeFrom("//div[@class='frame-radio']/div[{$j}]//span[@class='icon_ask']", 'data-title');
         $I->assertEquals($GrabbedDescription, $description, "description is the same as desired");
     }
     if ($price) {
         $GrabbedPrice = $I->grabTextFrom("//div[@class='frame-radio']/div[{$j}]/div[@class='help-block']/div[1]");
         $GrabbedPrice = preg_replace('/[^0-9.]*/u', '', $GrabbedPrice);
         $price = ceil($price);
         $I->assertEquals($GrabbedPrice, $price, "price is the same as desired");
     }
     if ($freefrom) {
         $Grabbedfreefrom = $I->grabTextFrom("//div[@class='frame-radio']/div[{$j}]/div[@class='help-block']/div[2]");
         $Grabbedfreefrom = preg_replace('/[^0-9.]*/u', '', $Grabbedfreefrom);
         $freefrom = ceil($freefrom);
         $I->assertEquals($Grabbedfreefrom, $freefrom, "price is the same as desired");
     }
     if ($message) {
         $Cmessage = $I->grabTextFrom("//div[@class='frame-radio']/div[{$j}]/div[@class='help-block']");
         $I->comment($Cmessage);
         $I->assertEquals($Cmessage, $message, "price specified messege is the same as desired");
     }
     if ($pays) {
         //            $JQScrollToclick = "$('html,body').animate({scrollTop:$('div.frame-radio>div:nth-child($j)').offset().top});";
         $I->scrollToElement($I, "div[class=\\'frame-radio\\'] div:nth-child(1) span[class=\\'text-el\\']");
         //scroll for click
         $I->wait(5);
         $I->click("//div[@class='frame-radio']/div[{$j}]//span[@class='text-el']");
         $I->scrollToElement($I, '.frame-payment.p_r');
         if ($pays == 'off') {
             $I->waitForText('Нет способов оплаты', NULL, '//div[@class="frame-form-field"]/div[@class="help-block"]');
             $I->see('Нет способов оплаты', '//div[@class="frame-form-field"]/div[@class="help-block"]');
         } else {
             $I->waitForElementVisible("#cuselFrame-paymentMethod");
             $I->click(".cuselText");
             foreach ((array) $pays as $key => $pay) {
                 $GrabbedPay = $I->grabTextFrom("//div[@id='cusel-scroll-paymentMethod']/span[{$key}+1]");
                 $I->assertEquals($GrabbedPay, $pay);
             }
         }
     }
     if (isset($selectpay)) {
         //$JQScrollToclick = "$('html,body').animate({scrollTop:$('div.frame-radio>div:nth-child($j)').offset().top});";
         $I->scrollToElement($I, "div[class=\\'frame-radio\\'] div:nth-child(1) span[class=\\'text-el\\']");
         //scroll for click
         $I->wait(5);
         $I->click("//div[@class='frame-radio']/div[{$j}]//span[@class='text-el']");
         $I->scrollToElement($I, '.frame-payment.p_r');
         $I->wait(5);
         $I->click("#cuselFrame-paymentMethod");
         //White spaces added to method in "select"
         //Read text ,trim then verify , if true click
         $I->grabTextFrom("{$cssOrXPathOrRegex}");
         $I->click(" " . $selectpay . " ");
         $I->wait(5);
     }
 }
示例#11
0
 /**
  * Validate that we can see and fill the social widget
  *
  * @before login
  * @param \AcceptanceTester $I
  */
 public function validateWidgetSocialForm(AcceptanceTester $I)
 {
     $I->wantTo('Validate social widget form in widgets.php');
     $I->amOnPage(admin_url('widgets.php'));
     $I->canSee('Social Profiles', ['css' => '.widget h3']);
     $selector = '#widget-list div[id$=wpcw_social-__i__]';
     $I->click(['css' => "{$selector} .widget-title"]);
     $I->waitForElementVisible(['css' => "{$selector} .widgets-chooser-actions .button-primary"]);
     $I->click(['css' => "{$selector} .widgets-chooser-actions .button-primary"]);
     $selector = '#sidebar-1 div[id*=wpcw_social]';
     $I->waitForElementVisible(['css' => "{$selector} .widget-inside"], 3);
     /**
      * Fill all fields
      */
     $I->fillField(['css' => "{$selector} form .title input"], 'Acceptance tests social');
     $this->selectSocialIcon($I, 'facebook', $selector);
     $this->selectSocialIcon($I, 'twitter', $selector);
     // Let's test reordering so facebook should be first
     $I->dragAndDrop(['css' => "{$selector} form p.facebook .wpcw-widget-sortable-handle"], ['css' => "{$selector} .wpcw-widget-social .icons"]);
     /**
      * Submit widget form
      */
     $I->click(['css' => "{$selector} form input.button-primary"]);
     // Wait for all ajax request to finish
     $I->waitForJS('return jQuery.active == 0;', 5);
 }
示例#12
0
#use dmstr\modules\pages\tests\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Pages works');
#$loginPage = LoginPage::openBy($I);
#$I->see('Sign in', 'h3');
#$I->amGoingTo('try to login with correct credentials');
#$loginPage->login('admin', 'admin');
$I->amGoingTo('try to view and create pages');
$I->amOnPage('/pages');
$I->wait(1);
$I->see('Nodes', '.kv-heading-container');
$I->makeScreenshot('success-pages-index');
$I->click('.kv-create-root');
#$I->waitForElementNotVisible('.form-vertical');
$I->waitForElementVisible('.form-vertical');
#$I->wait(3); // only for selenium
$I->see('General');
$I->see('Route');
$I->fillField('#tree-domain_id', uniqid('test-'));
$I->fillField('#tree-name', 'Test');
$I->click('Save');
$I->waitForElementVisible('.kv-tree');
$I->click('.kv-node-detail');
$I->waitForElementVisible('#pages-detail-panel h3');
$I->see('Test', '#pages-detail-panel h3');
$I->makeScreenshot('success-pages-create-root');
$I->click('#w0-detail');
$I->click('.kv-create');
$I->waitForElementVisible('.form-vertical');
$nodeId = uniqid('node-');