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 _grabLinks(AcceptanceTester $I)
 {
     $dragonsListUrl = "/wiki/Category:Dragons";
     $I->amOnPage($dragonsListUrl);
     $pages = 14;
     for ($i = 1; $i <= $pages; $i++) {
         $link = "/wiki/Category:Dragons?page={$i}";
         $I->amOnPage($link);
         $this->_grabLinksFromOnePage($I);
     }
     file_put_contents('dragons.json', json_encode($this->dragons, JSON_PRETTY_PRINT));
 }
 /**
  * @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');
 }
Beispiel #4
0
 public function testIfICantCreateAnEventWithoutBeingAuthenticated(AcceptanceTester $I)
 {
     $I->am('guest');
     $I->wantTo('see that i can\'t create an event');
     $I->amOnPage('event/create');
     $I->canSee('have to be logged in', '.alert-danger');
 }
 public function viewHomepage(AcceptanceTester $I)
 {
     $I->wantTo('view the homepage');
     $I->amOnPage('/');
     $I->see('Zen Kommerce');
     //$I->dontSeeHttpHeader('Set-Cookie');
 }
 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);
 }
 function loginSuccess(AcceptanceTester $I, \Page\Login $loginPage)
 {
     $loginPage->login('*****@*****.**', '123456');
     $I->amOnPage('/customer/account/index/');
     $I->see('Hello, alex sereda!', 'p.hello > strong');
     $loginPage->logout();
 }
 /**
  * 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');
 }
 public function testShowAction(AcceptanceTester $I)
 {
     $I->wantTo('too see inside the "Writing" workspace');
     $I->amOnPage('/workspace/writing');
     $I->see('Symfony book');
     $I->wait(3);
 }
Beispiel #10
0
 public function _before(\AcceptanceTester $I)
 {
     $I->am('guest user');
     $I->amGoingTo('Load the homepage');
     $I->amOnPage('/');
     $I->seeInCurrentUrl('/');
 }
Beispiel #11
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 loginWithInvalidCredentials(AcceptanceTester $I)
 {
     $I->amOnPage('/login');
     $I->click('Login');
     $I->seeCurrentUrlEquals('/login');
     $I->see('Invalid Credentials', '.flash');
 }
 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]);
 }
 /**
  * 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);
 }
Beispiel #15
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');
 }
Beispiel #16
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.');
 }
Beispiel #17
0
 /**
  * @test
  * it should render extended shortcode
  */
 public function it_should_render_extended_shortcode(\AcceptanceTester $I)
 {
     $content = 'Lorem ipsum [idlikethis]Some idea of mine[/idlikethis]';
     $I->havePostInDatabase(['post_name' => 'foo', 'post_content' => $content]);
     $I->amOnPage('/foo');
     $text = "Some idea of mine";
     $I->seeElement('.idlikethis-button[data-text="' . $text . '"] button');
 }
Beispiel #18
0
 private function editAnArticle(AcceptanceTester $I, $attributes)
 {
     $I->haveAuthor();
     $I->haveArticle();
     $I->amOnPage('/articles');
     $I->click('[href*=edit]');
     $this->submitTheForm($I, $attributes);
 }
 /**
  * Define custom actions here
  */
 function checkIfLogin(\AcceptanceTester $I)
 {
     //if ($I->loadSessionSnapshot('login')) return;
     $I->amOnPage('/login');
     $I->fillField(['name' => 'email'], Fixtures::get('username'));
     $I->fillField(['name' => 'password'], Fixtures::get('password'));
     $I->click('Let\'s go');
     //$I->saveSessionSnapshot('login');
 }
 public function comment(AcceptanceTester $I)
 {
     $I->wantTo('post a comment');
     $I->amOnPage('/Mikroblogi');
     $I->canSeeElement('.comment-submit');
     //        $I->submitForm('.comment-submit', ['text' => 'To jest unikalny komentarz']);
     //        $I->wait(1);
     //        $I->canSee('To jest unikalny komentarz');
 }
 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);
 }
 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);
 }
 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);
 }
Beispiel #24
0
 /**
  * Test that a user with no access rights to Dashboard gets redirected to
  * the hmoepage.
  *
  * Inspired by the Atari game Lemmings and the Eddie Vedder commment:
  * "Longest song title in the Pearl Jam catalogue", referencing the song
  * "Elderly Woman Behind the Counter in a Small Town", and the name of the
  * particular unit test method until Bolt 2.3…
  *
  * @param \AcceptanceTester $I
  */
 public function dashboardWithoutPermissionRedirectsToHomepageTest(\AcceptanceTester $I)
 {
     $I->wantTo('Set permissions/global/dashboard to empty and be redirected to the homepage');
     // Set up the browser
     $I->setCookie($this->tokenNames['authtoken'], $this->cookies[$this->tokenNames['authtoken']]);
     $I->setCookie($this->tokenNames['session'], $this->cookies[$this->tokenNames['session']]);
     $I->amOnPage('/bolt/file/edit/config/permissions.yml');
     $yaml = $I->getLemmingsPermissions();
     $I->fillField('#form_contents', $yaml);
     $token = $I->grabValueFrom('#form__token');
     $I->sendAjaxPostRequest('/bolt/file/edit/config/permissions.yml', ['form[_token]' => $token, 'form[contents]' => $yaml]);
     // Verify we go to the dashboard and end up on the homepage
     $I->amOnPage('/bolt');
     $I->see('A sample site');
     $I->see('Recent Pages');
     $I->dontSee('Recent Resources');
     $I->see('A Page I Made', 'h1');
     $I->see('Built with Bolt, tested with Codeception', 'footer');
 }
Beispiel #25
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');
 }
Beispiel #26
0
 public function isEditedPost(AcceptanceTester $I, UserSteps $userSteps)
 {
     $I->wantTo('check history for post which is edited');
     $userId = $userSteps->amRegularUser();
     $catId = $userSteps->haveCategory();
     $postId = $I->havePost(['title' => 'Some title', 'content' => 'Some content.', 'users_id' => $userId, 'categories_id' => $catId]);
     $I->havePostHistory(['posts_id' => $postId, 'users_id' => $userId, 'content' => 'Some content II.']);
     $I->amOnPage("/discussion/{$postId}/some-title");
     $I->see('edited');
 }
Beispiel #27
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();
 }
Beispiel #28
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);
 }
Beispiel #29
0
 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);");
         }
     }
 }
Beispiel #30
0
 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);
 }