Skip to content

Commit

Permalink
[TASK] Account for double click pagetree timeout in acceptance tests
Browse files Browse the repository at this point in the history
The page tree in TYPO3 v11 and v12 has a default timeout of 300ms for
click events to be processed (in order to wait for double-click
detection). This caused race conditions in tests since code that
waited for #nprogress to hide after clicking on the pagetree
did not have anything to wait for (yet), because the progress
loaded was only triggered 300ms later, when the click was detected
to not be a double click event and the content frame was started
to be updated.

Also remove wait timeout that were implicitly added for the same
issue, but were spread throughout the test cases.

Resolves: #103473
Releases: 12.4, 11.5
Change-Id: Ie9c9aff8c8a36581555a9ad352fb98b3d446ba42
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83576
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benjamin Franzke <ben@bnf.dev>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
  • Loading branch information
bnf committed Mar 23, 2024
1 parent 0598521 commit 80fe1fa
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 6 deletions.
Expand Up @@ -32,7 +32,6 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void
$I->waitForElement('#typo3-pagetree-tree .nodes .node', 5);
$pageTree->openPath(['styleguide frontend demo']);
$I->switchToContentFrame();
$I->wait(1);
$I->waitForElementVisible('select[name=actionMenu]');
$I->selectOption('select[name=actionMenu]', 'Layout');
$I->wait(1);
Expand Down
Expand Up @@ -38,7 +38,6 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void
$I->waitForElement('#typo3-pagetree-tree .nodes .node', 5);
$pageTree->openPath(['styleguide frontend demo']);
$I->switchToContentFrame();
$I->wait(1);
$I->waitForElementVisible('select[name=actionMenu]');
$I->selectOption('select[name=actionMenu]', 'Layout');
$I->wait(1);
Expand Down
Expand Up @@ -36,7 +36,6 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void
$I->waitForElement('#typo3-pagetree-tree .nodes .node', 5);
$pageTree->openPath(['styleguide frontend demo']);
$I->switchToContentFrame();
$I->wait(1);
$I->waitForElementVisible('select[name=actionMenu]');
$I->selectOption('select[name=actionMenu]', 'Layout');
$I->wait(1);
Expand Down
Expand Up @@ -37,7 +37,6 @@ public function _before(ApplicationTester $I, PageTree $pageTree): void
$I->waitForElement('#typo3-pagetree-tree .nodes .node', 5);
$pageTree->openPath(['styleguide frontend demo']);
$I->switchToContentFrame();
$I->wait(1);
$I->waitForElementVisible('select[name=actionMenu]');
$I->selectOption('select[name=actionMenu]', 'Layout');
$I->wait(1);
Expand Down
Expand Up @@ -39,7 +39,6 @@ public function recordsCanBeExported(ApplicationTester $I, PageTree $pageTree, M
$I->click('List');
$I->waitForElementNotVisible('#nprogress');
$pageTree->openPath(['styleguide TCA demo']);
$I->wait(0.2);
$I->switchToContentFrame();
$I->canSee('Download');
$I->click('typo3-recordlist-record-download-button');
Expand Down
Expand Up @@ -39,7 +39,6 @@ public function notesEntryCanBeEdited(ApplicationTester $I, PageTree $pageTree):
$I->click('List');
$I->waitForElementNotVisible('#nprogress');
$pageTree->openPath(['styleguide TCA demo']);
$I->wait(0.2);
$I->switchToContentFrame();

$I->click('.module-docheader .btn[title="Create new record"]');
Expand Down
Expand Up @@ -79,6 +79,9 @@ public function openPath(array $path)
} while ($toggled);

parent::openPath($path);

// pagetree has 300ms timeout for double click detection, wait 350ms to wait for the click to have happened
$this->tester->wait(0.35);
}

/**
Expand Down

0 comments on commit 80fe1fa

Please sign in to comment.