Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Navigate directly to a backend module #233

Merged
merged 3 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/screenshots/Classes/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,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
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function getSelectableActionsIds(): void
'actionsIdentifierIntroductionBackend',
'actionsIdentifierIntroductionUserSwitch',
'actionsIdentifierSitePackageBackend',
'actionsIdentifierStyleguideNavigation',
'actionsIdentifierNewsBackend',
'actionsIdentifierStyleguideScreenshots',
'actionsIdentifierStyleguideScreenshotsOfContentFrameOnly',
Expand Down