[BUGFIX] Fix broken acceptance tests 48/51648/4
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Sun, 12 Feb 2017 21:40:32 +0000 (22:40 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 12 Feb 2017 23:28:07 +0000 (00:28 +0100)
Acceptance tests for Template module are fixed
- seems that element with #ts-overview is not rendered any more
  when showing table on installation root (pid 0)
- the correct id of the site root ("styleguide TCA demo") is #extdd-3
- fix scheduler tests after tooltip were added
  (title => data-original-title)
- adapt tests after context menu refactoring

Resolves: #79771
Releases: master

Change-Id: I48879315b81267ae65ef92003c5034cbb62d576e
Reviewed-on: https://review.typo3.org/51648
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/Acceptance/Backend/Page/AddPageInPageModuleCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Scheduler/TasksCest.php
typo3/sysext/core/Tests/Acceptance/Backend/Template/TemplateCest.php

index 24c05f0..8eb5140 100644 (file)
@@ -46,11 +46,18 @@ class AddPageInPageModuleCest
         $typo3NavigationContainer = '.scaffold-content-navigation-component';
         $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';
+        $rootNodeIcon = '#extdd-1 .icon-apps-pagetree-root';
+        $rootNodeContextMenuMore = '#contentMenu0 a.list-group-item-submenu';
+        //create new wizard
+        $contextMenuNew = '#contentMenu1 .list-group-item[data-callback-action=newPageWizard]';
+
         $I->waitForElement($rootNode);
         $I->click($rootNodeIcon);
-        $I->waitForElement($contextMenuNew);
+        $I->waitForElementVisible($rootNodeContextMenuMore);
+
+        $I->wait(1);
+        $I->click($rootNodeContextMenuMore);
+        $I->waitForElementVisible($contextMenuNew);
         $I->click($contextMenuNew);
 
         // Switch to content frame
@@ -93,18 +100,14 @@ class AddPageInPageModuleCest
         $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';
+        $pageInTreeIcon = '#typo3-pagetree-tree .icon-apps-pagetree-page-default';
+        $delete = '#contentMenu0 .list-group-item[data-callback-action=deleteRecord]';
         $I->click($pageInTreeIcon);
-        $I->waitForElement('#typo3-pagetree-contextmenu');
-        $I->waitForElement($pageActions);
-        $I->moveMouseOver($pageActions);
-        $I->waitForElement('#typo3-pagetree-contextmenu-sub1');
+        $I->waitForElement($delete);
         $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);
+        $yesButtonInPopup = '.modal-dialog button[name=delete]';
+        $I->waitForElement($yesButtonInPopup);
+        $I->click($yesButtonInPopup);
         $I->wait(2);
         $I->cantSee('Testpage');
     }
index b86034d..38d8724 100644 (file)
@@ -63,7 +63,7 @@ class TasksCest
     public function canRunTask(Admin $I)
     {
         // run the task
-        $I->click('//a[contains(@title, "Run task")]');
+        $I->click('a[data-original-title="Run task"]');
         $I->waitForText('Executed: System Status Update');
         $I->seeElement('.tx_scheduler_mod1 .disabled');
         $I->see('disabled');
@@ -75,7 +75,7 @@ class TasksCest
      */
     public function canEditTask(Admin $I)
     {
-        $I->click('//a[contains(@title, "Edit")]');
+        $I->click('//a[contains(@data-original-title, "Edit")]');
         $I->waitForText('Edit task');
         $I->seeInField('#task_SystemStatusUpdateNotificationEmail', 'test@local.typo3.org');
         $I->fillField('#task_SystemStatusUpdateNotificationEmail', 'foo@local.typo3.org');
@@ -92,11 +92,11 @@ class TasksCest
     public function canEnableAndDisableTask(Admin $I)
     {
         $I->wantTo('See a enable button for a task');
-        $I->click('//a[contains(@title, "Enable")]', '#tx_scheduler_form');
+        $I->click('//a[contains(@data-original-title, "Enable")]', '#tx_scheduler_form');
         $I->dontSeeElement('.tx_scheduler_mod1 .disabled');
         $I->dontSee('disabled');
         $I->wantTo('See a disable button for a task');
-        $I->click('//a[contains(@title, "Disable")]');
+        $I->click('//a[contains(@data-original-title, "Disable")]');
         $I->seeElement('.tx_scheduler_mod1 .disabled');
         $I->see('disabled');
     }
@@ -109,13 +109,13 @@ class TasksCest
     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->seeElement('//a[contains(@data-original-title, "Delete")]');
+        $I->click('//a[contains(@data-original-title, "Delete")]');
         $I->wantTo('Cancel the delete dialog');
         $modalDialog->clickButtonInDialog('Cancel');
         $I->switchToIFrame('list_frame');
         $I->wantTo('Still see and can click the Delete button as the deletion has been canceled');
-        $I->click('//a[contains(@title, "Delete")]');
+        $I->click('//a[contains(@data-original-title, "Delete")]');
         $modalDialog->clickButtonInDialog('OK');
         $I->switchToIFrame('list_frame');
         $I->see('The task was successfully deleted.');
index 74bfd3b..35feee4 100644 (file)
@@ -59,9 +59,8 @@ class TemplateCest
         $I->wantTo('show templates overview on website root page (uid = 1 and pid = 0)');
         $I->switchToIFrame();
         // click on website root page
-        $I->click('#extdd-2');
+        $I->click('#extdd-3');
         $I->switchToIFrame('list_frame');
-        $I->waitForElementVisible('#ts-overview');
         $I->waitForElement('#TypoScriptTemplateModuleController');
         $I->see('No template');
         $I->see('There was no template on this page!');
@@ -85,9 +84,8 @@ class TemplateCest
     {
         $I->wantTo('create a new site template');
         $I->switchToIFrame();
-        $I->click('#extdd-2');
+        $I->click('#extdd-3');
         $I->switchToIFrame('list_frame');
-        $I->waitForElementVisible('#ts-overview');
         $I->waitForElement('#TypoScriptTemplateModuleController');
         $I->click("//input[@name='newWebsite']");
         $I->waitForElement('#TypoScriptTemplateModuleController');