当前位置: 首页>>代码示例>>PHP>>正文


PHP AcceptanceTester::waitForElement方法代码示例

本文整理汇总了PHP中AcceptanceTester::waitForElement方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::waitForElement方法的具体用法?PHP AcceptanceTester::waitForElement怎么用?PHP AcceptanceTester::waitForElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AcceptanceTester的用法示例。


在下文中一共展示了AcceptanceTester::waitForElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _before

 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");
 }
开发者ID:helgatheviking,项目名称:woocommerce-multilingual,代码行数:26,代码来源:1003Cest.php

示例2: _before

 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');
 }
开发者ID:helgatheviking,项目名称:woocommerce-multilingual,代码行数:26,代码来源:1001Cest.php

示例3: logIn

 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"]', 'brconsulting79@gmail.com');
     $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);
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:10,代码来源:TwitterFollowerCest.php

示例4: logIn

 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"]', 'sam.macad@gmail.com');
     $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);
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:11,代码来源:WaneloSpamCest.php

示例5: submitTheForm

 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');
 }
开发者ID:CENTRUM21,项目名称:laravel-apz,代码行数:7,代码来源:ArticleCest.php

示例6: clickDropdown

 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);
 }
开发者ID:AlexeyLem,项目名称:sendsayadmin,代码行数:16,代码来源:AcceptanceTester.php

示例7: loginWithValidEMailPassword

 function loginWithValidEMailPassword(\AcceptanceTester $I, \Page\Login $loginPage)
 {
     $I->wantTo("Check login with Valid Email and Password");
     $loginPage->loginWithEmailAndPassword('mueller@mdesigns.at', '123asdF');
     $I->waitForElement('div[class="infos"]');
     $I->amOnPage('#/activities');
     $I->see('Hi, Markus');
 }
开发者ID:suj24,项目名称:TestDemo,代码行数:8,代码来源:LoginTestCest.php

示例8: installNeno

 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();
 }
开发者ID:andresmaeso,项目名称:neno,代码行数:55,代码来源:01-InstallNenoCest.php

示例9: CanopyScrapeCest

 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;
             }
         }
     }
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:42,代码来源:CanopyScrapeCest.php

示例10: i_can_create_a_new_user

 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', 'testemail@lbm.co');
     $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' => 'testemail@lbm.co'));
 }
开发者ID:alpas29,项目名称:cms,代码行数:20,代码来源:CreateNewUserCest.php

示例11: GetEtsyShops

 private function GetEtsyShops(\AcceptanceTester $I)
 {
     for ($pg = 1060; $pg <= 1250; $pg++) {
         $I->amOnPage("/search/shops?page=" . $pg);
         $I->waitForElement('.shopname', 100);
         $shops = $I->grabMultiple('.shopname');
         foreach ($shops as $shop) {
             $this->db->real_query("INSERT INTO `etsy_store_list` (`id`, `store_slug`, `from_where`, `sent_at`, `created_at`) VALUES (NULL, '{$shop}', '{$pg}', NULL, CURRENT_TIMESTAMP);");
         }
     }
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:11,代码来源:EtsySpamCest.php

示例12: i_can_save_this_model

 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));
 }
开发者ID:alpas29,项目名称:cms,代码行数:11,代码来源:EditPageVersionModelCest.php

示例13: AmazonScrapeCest

 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
     }
 }
开发者ID:bbig979,项目名称:shoppyst,代码行数:53,代码来源:AmazonScrapeCest.php

示例14: AcceptanceTester

<?php

use schmunk42\giiant\tests\_pages\LoginPage;
#new schmunk42\giiant\tests\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that crud works with access rules');
$I->amOnPage('/crud/actor');
$I->dontSee('Actor', 'h2');
$I->makeScreenshot('crud-actor-login');
$I->see('Sign in', 'h3');
$I->amGoingTo('try to login with correct credentials');
// TODO: use LoginPage
$username = 'admin';
$password = 'admin';
$I->fillField('input[name="login-form[login]"]', $username);
$I->fillField('input[name="login-form[password]"]', $password);
$I->click('Sign in');
$I->waitForElement('#link-logout', 5);
#LoginPage::openBy($I);
#$loginPage = LoginPage::openBy($I);
#$loginPage->login('admin', 'admin');
$I->see('Actor', 'h2');
$I->makeScreenshot('crud-actor');
开发者ID:febfeb,项目名称:yii2-basic-ready,代码行数:23,代码来源:CrudCept.php

示例15: AcceptanceTester

<?php

/**
* @package     redCORE
* @subpackage  Cept
* @copyright   Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved.
* @license     GNU General Public License version 2 or later; see LICENSE.txt
*/
// Load the Step Object Page
$I = new \AcceptanceTester($scenario);
$I = new AcceptanceTester($scenario);
$I->wantTo('Uninstall redCORE Extension');
$I->doAdministratorLogin();
$I->amOnPage('/administrator/index.php?option=com_installer&view=manage');
$I->waitForText('Extensions: Manage', 30, ['css' => 'H1']);
$I->fillField('#filter_search', 'redCORE - component');
$I->click(['xpath' => "//button[@type='submit' and @data-original-title='Search']"]);
$I->waitForElement(['id' => 'manageList']);
$I->click(['xpath' => "//input[@id='cb0']"]);
$I->click(['xpath' => "//div[@id='toolbar-delete']/button"]);
$I->waitForText('Uninstalling the component was successful', 30, ['id' => 'system-message-container']);
$I->see('Uninstalling the component was successful', ['id' => 'system-message-container']);
$I->fillField(['id' => 'filter_search'], 'redCORE - component');
$I->click(['xpath' => "//button[@type='submit' and @data-original-title='Search']"]);
$I->waitForText('There are no extensions installed matching your query.', 30, ['class' => 'alert-no-items']);
$I->see('There are no extensions installed matching your query.', ['class' => 'alert-no-items']);
开发者ID:thangredweb,项目名称:redCORE,代码行数:26,代码来源:ZZ-UninstallExtensionCept.php


注:本文中的AcceptanceTester::waitForElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。