/**
  * @param Admin $I
  * @param Formhandler $formhandler
  */
 public function checkThatBrowserSideValidationsWorkAndSaveRecord(Admin $I, Formhandler $formhandler)
 {
     $I->click(self::$listViewRecordSelector . ' a[data-original-title="Edit record"]');
     $I->waitForText('Edit Form', 3, 'h1');
     $fieldTests = ['input_1' => [['This is a demo text with 2 numbers #!', 'This is a demo text with 2 numbers #!']], 'input_2, size=10' => [['This is a demo text with 2 numbers #!', 'This is a demo text with 2 numbers #!']], 'input_3 max=4' => [['Kasper', 'Kasp']], 'input_4 eval=alpha' => [['Kasper = TYPO3', 'Kasper  TYPO']], 'input_5 eval=alphanum' => [['Kasper = TYPO3', 'Kasper  TYPO3']], 'input_6 eval=date' => [['29-01-2016', '29-01-2016', '1454025600'], ['13-13-2016', '13-01-2017', '1484265600'], 'check valid leap year input' => ['29-02-2016', '29-02-2016', '1456704000'], 'check invalid leap year transformation' => ['29-02-2015', '01-03-2015', '1425168000']], 'input_8 eval=double2' => [['12.335', '12.34'], ['12,335', '12.34'], ['1.1', '1.10'], ['TYPO3', '3.00'], ['3TYPO', '3.00']], 'input_9 eval=int' => [['12.335', '12'], ['12,9', '12'], ['TYPO3', '0'], ['3TYPO', '3']], 'input_10 eval=is_in, is_in=abc123' => [['abcd1234', 'abc123'], ['Kasper TYPO3', 'a3']], 'input_11 eval=lower' => [['Kasper TYPO3!', 'kasper typo3!']], 'input_12 eval=md5' => [['Kasper TYPO3!', '748469dd64911af8df8f9a3dcb2c9378'], 'check that whitespace is not trimmed' => ['Kasper TYPO3! ', '265e09df9b9b08ab1f946510f510d3ef']], 'input_13 eval=nospace' => [[' Kasper TYPO3! ', 'KasperTYPO3!']], 'input_15 eval=num' => [['12.335', '12335'], ['12,9', '129'], ['TYPO3', '3'], ['3TYPO', '3']], 'input_16 eval=password' => [['Kasper', '********', 'Kasper']], 'input_17 eval=time' => [['13:30', '13:30', '48600'], ['123', '12:03', '43380'], ['12345', '12:34', '45240'], ['12:04+5', '12:09', '43740'], ['12:09-3', '12:06', '43560']], 'input_18 eval=timesec' => [['13:30:00', '13:30:00', '48600'], ['12345', '12:34:05', '45245'], ['12:04:04+5', '12:09:04', '43744']], 'input_19 eval=trim' => [[' Kasper ', 'Kasper'], [' Kasper TYPO3 ', 'Kasper TYPO3']], 'input_23 eval=upper' => [['Kasper TYPO3!', 'KASPER TYPO3!']], 'input_24 eval=year' => [['2016', '2016'], ['12', '2012'], 'Invalid character is converted to current year' => ['Kasper', date('Y')]], 'input_25 eval=int, default=0, range lower=-2, range upper=2' => [['Kasper TYPO3', '0'], ['2', '2'], ['-1', '-1'], ['-3', '-3'], ['3', '3']]];
     foreach ($fieldTests as $fieldKey => $testData) {
         $formhandler->fillSeeDeleteInputField($formhandler->getContextForFormhandlerField($fieldKey), $testData);
     }
 }
Example #2
0
 /**
  * @param Admin $I
  */
 public function checkIfTheShowAllLinkPointsToTheListViewWithSearchResults(Admin $I)
 {
     $I->fillField('#live-search-box', 'fileadmin');
     $I->waitForElementVisible(self::$topBarModuleSelector . ' ' . Topbar::$dropdownListSelector);
     $I->canSee('fileadmin/ (auto-created)', self::$topBarModuleSelector);
     $I->click('.t3js-live-search-show-all', self::$topBarModuleSelector);
     $I->switchToIFrame('content');
     $I->waitForElementVisible('form[name="dblistForm"]');
     $I->canSee('fileadmin/ (auto-created)');
 }
 /**
  * @param Admin $I
  */
 public function selectingAModuleDoesHighlightIt(Admin $I)
 {
     $I->seeNumberOfElements('#web .typo3-module-menu-item-link', [2, 20]);
     $I->wantTo('check that the second element has no "active" class\'');
     $I->cantSeeElement('#web #web_list.active');
     $I->click('#web #web_list .typo3-module-menu-item-link');
     $I->wantTo('see that the second element has an "active" class');
     $I->canSeeElement('#web #web_list.active');
 }
Example #4
0
 /**
  * @depends canSeeModuleInTopbar
  * @param Admin $I
  */
 public function seeStyleguideInHelpModule(Admin $I)
 {
     $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
     $I->canSee('Styleguide', self::$topBarModuleSelector);
     $I->click('Styleguide', self::$topBarModuleSelector);
     $I->switchToIFrame('content');
     $I->see('TYPO3 CMS Backend Styleguide', 'h1');
 }
 /**
  * @param Admin $I
  */
 public function tryToTest(Admin $I)
 {
     $I->see('admin', '#typo3-cms-backend-backend-toolbaritems-usertoolbaritem');
 }
Example #6
0
 /**
  * @param Admin $I
  */
 public function checkIfTypo3LogoIsLinked(Admin $I)
 {
     $I->seeElement('#typo3-topbar .typo3-topbar-site-logo', ['href' => 'https://typo3.org/']);
 }
 /**
  * @param Admin $I
  */
 public function tryToTest(Admin $I)
 {
     // Select page module
     $I->wantToTest('Add a page with page module');
     $I->click('Page');
     // New page from root page
     $typo3NavigationContainer = '#typo3-navigationContainer';
     $I->waitForElement($typo3NavigationContainer);
     $rootNode = 'a.x-tree-node-anchor > span';
     $rootNodeIcon = '#extdd-1 > span.t3js-icon.icon.icon-size-small.icon-state-default.icon-apps-pagetree-root';
     $contextMenuNew = '#typo3-pagetree-contextmenu > ul > li.x-menu-list-item:nth-of-type(2) > a > span.x-menu-item-text';
     $I->waitForElement($rootNode);
     $I->click($rootNodeIcon);
     $I->waitForElement($contextMenuNew);
     $I->click($contextMenuNew);
     // Switch to content frame
     $I->switchToIFrame('content');
     // New page select position wizard
     $I->click('i[title="Insert the new page here"]');
     // FormEngine new page record
     $saveButton = 'body > div > div.module-docheader.t3js-module-docheader > div.module-docheader-bar.module-docheader-bar-buttons.t3js-module-docheader-bar.t3js-module-docheader-bar-buttons > div.module-docheader-bar-column-left > div > div > button:nth-child(1)';
     $I->waitForElement($saveButton);
     // Check empty
     $I->amGoingTo('check empty error');
     $I->click($saveButton);
     $I->wait(2);
     $editControllerDiv = '#EditDocumentController > div';
     $generalTab = $editControllerDiv . ' > div:nth-child(1) > ul > li';
     $classString = $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) use($generalTab) {
         return $webdriver->findElement(\WebDriverBy::cssSelector($generalTab))->getAttribute('class');
     });
     $I->assertContains('has-validation-error', $classString);
     // Add page
     $pageTitle = $editControllerDiv . ' > div:nth-child(1) > div > div.tab-pane:nth-child(1) > fieldset:nth-child(2) > div > div:nth-child(1) > div > div.form-control-wrap > div > input';
     $I->fillField($pageTitle, 'Testpage');
     $I->click($saveButton);
     $I->waitForElement($pageTitle);
     $I->assertEquals('Testpage', $I->grabValueFrom($pageTitle), 'Value in input field.');
     $I->switchToIFrame();
     // Check tree
     $I->waitForElement($typo3NavigationContainer);
     $pageInTree = '#typo3-pagetree-tree > div > div > ul > div > li > ul > li > div > a > span';
     $I->assertEquals('Testpage', $I->grabTextFrom($pageInTree), 'Value in tree.');
     // And delete page from tree
     $pageInTreeIcon = '#typo3-pagetree-tree > div > div > ul > div > li > ul > li > div > span.t3js-icon.icon.icon-size-small.icon-state-default.icon-apps-pagetree-page-default';
     $pageActions = '#typo3-pagetree-contextmenu > ul > li:nth-child(8) > a > span.x-menu-item-text';
     $delete = '#typo3-pagetree-contextmenu-sub1 > ul > li:nth-child(6) > a > span.x-menu-item-text';
     $I->click($pageInTreeIcon);
     $I->waitForElement('#typo3-pagetree-contextmenu');
     $I->waitForElement($pageActions);
     $I->moveMouseOver($pageActions);
     $I->waitForElement('#typo3-pagetree-contextmenu-sub1');
     $I->click($delete);
     $yesButtonPopup = '#main > div.x-window.x-window-plain.x-window-dlg > div.x-window-bwrap > div.x-window-bl > div > div > div > div.x-panel-fbar.x-small-editor.x-toolbar-layout-ct > table > tbody > tr > td.x-toolbar-left > table > tbody > tr > td:nth-child(2) > table > tbody > tr:nth-child(2) > td.x-btn-mc > em > button';
     $I->waitForElement($yesButtonPopup);
     $I->click($yesButtonPopup);
     $I->wait(2);
     $I->cantSee('Testpage');
 }
 /**
  * @depends checkIfInstallingAnExtensionWithBackendModuleAddsTheModuleToTheModuleMenu
  * @param Admin $I
  */
 public function checkIfUninstallingAnExtensionWithBackendModuleRemovesTheModuleFromTheModuleMenu(Admin $I)
 {
     $I->switchToIFrame();
     $I->canSeeElement('#system_BeuserTxBeuser');
     $I->switchToIFrame('content');
     $I->fillField('Tx_Extensionmanager_extensionkey', 'beuser');
     $I->waitForElementVisible('//*[@id="typo3-extension-list"]/tbody/tr[@id="beuser"]');
     $I->click('a[data-original-title="Deactivate"]', '//*[@id="typo3-extension-list"]/tbody/tr[@id="beuser"]');
     $I->waitForElementVisible('#Tx_Extensionmanager_extensionkey ~button.close', 1);
     $I->click('#Tx_Extensionmanager_extensionkey ~button.close');
     $I->switchToIFrame();
     $I->cantSeeElement('#system_BeuserTxBeuser');
 }
 /**
  * @param Admin $I
  */
 public function checkThatPageModuleHasAHeadline(Admin $I)
 {
     $I->click('Page');
     $I->switchToIFrame('content');
     $I->canSee('Web>Page module', 'h4');
 }
 /**
  * @param Admin $I
  */
 protected function clickBookmarkDropdownToggleInTopbar(Admin $I)
 {
     $I->switchToIFrame();
     $I->click(Topbar::$dropdownToggleSelector, self::$topBarModuleSelector);
 }
Example #11
0
 /**
  * @depends createASchedulerTask
  * @param Admin $I
  * @param ModalDialog $modalDialog
  */
 public function canDeleteTask(Admin $I, ModalDialog $modalDialog)
 {
     $I->wantTo('See a delete button for a task');
     $I->seeElement('//a[contains(@title, "Delete")]');
     $I->click('//a[contains(@title, "Delete")]');
     $I->wantTo('Cancel the delete dialog');
     $modalDialog->clickButtonInDialog('Cancel');
     $I->switchToIFrame('content');
     $I->wantTo('Still see and can click the Delete button as the deletion has been canceled');
     $I->click('//a[contains(@title, "Delete")]');
     $modalDialog->clickButtonInDialog('OK');
     $I->switchToIFrame('content');
     $I->see('The task was successfully deleted.');
     $I->see('No tasks defined yet');
 }