Skip to content

Commit

Permalink
[FEATURE] Navigate directly to a backend module
Browse files Browse the repository at this point in the history
solves #232
  • Loading branch information
linawolf committed Nov 7, 2021
1 parent 58b000c commit 93ed637
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/screenshots/Classes/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,23 @@ public function createBasicConfig(): void
'_default' => [
['action' => 'resizeWindow', 'width' => 1024, 'height' => 768],
],
'actionsIdentifierStyleguideNavigation' => [
['include' => '_default'],
['action' => 'setScreenshotsDocumentationPath', 'path' => "StyleguideDocumentation"],
['action' => 'setScreenshotsImagePath', 'path' => "Images/StyleguideScreenshots"],
['action' => 'goToModule', 'module' => 'List', 'path' => ['styleguide TCA demo', 'elements rte']],
['action' => 'makeScreenshotOfWindow', 'fileName' => "StyleguideModuleList"],
['action' => 'goToModule', 'module' => 'Page'],
['action' => 'makeScreenshotOfWindow', 'fileName' => "StyleguideModulePage"],
['action' => 'goToRecord', "table" => "tx_styleguide_elements_basic", "uid" => 5],
['action' => 'makeScreenshotOfWindow', 'fileName' => "StyleguideModuleSomeRecord"],
['action' => 'goToModule', 'module' => 'Extensions'],
['action' => 'makeScreenshotOfWindow', 'fileName' => "StyleguideModuleExtensions"],
['action' => 'goToModule', 'module' => 'Reports', 'subModule' => 'Installed Services'],
['action' => 'makeScreenshotOfWindow', 'fileName' => 'StyleguideModuleReportsInstalledServices'],
['action' => 'goToModule', 'module' => 'Template', 'path' => ['styleguide TCA demo'], 'subModule' => 'Template Analyzer'],
['action' => 'makeScreenshotOfWindow', 'fileName' => 'StyleguideModuleTemplateAnalyzer'],
],
'actionsIdentifierStyleguideScreenshots' => [
['comment' => '********************************************************'],
['comment' => 'Take screenshots configured in a dummy screenshots.json.'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,34 @@ public function goToRecord(string $table = '', int $uid = -1): void
$this->scrollModuleBodyToTop();
}

/**
* Navigate directly to a TYPO3 backend module
*
* @param string $module
* @param array $pageTree
* @param string $subModule
* @throws \Exception
*/
public function goToModule(string $module = 'List', array $path = [], string $subModule = ''): void
{
if (!$this->_hasMainFrame()) {
$this->reloadBackend();
}
if (!$this->_isOnMainFrame() && $this->_hasMainFrame()) {
$this->switchToMainFrame();
}
$this->getWebDriver()->see($module);
$this->getWebDriver()->click($module);
if ($path !== []) {
$this->getTypo3PageTree()->openPageTreePath($path);
}
$this->switchToContentFrame();
if ($subModule !== '') {
$this->getWebDriver()->selectOption('select.t3-js-jumpMenuBox', $subModule);
}
$this->scrollModuleBodyToTop();
}

protected function resolveRecord(string $table, int $uid): array
{
$table = $table !== '' ? $table : $this->_getConfig('defaults')['table'];
Expand Down

0 comments on commit 93ed637

Please sign in to comment.