Skip to content

Commit

Permalink
[TASK] Adust acceptance tests for new tab structure
Browse files Browse the repository at this point in the history
  • Loading branch information
astehlik committed Jul 3, 2023
1 parent f72eb87 commit 3a19030
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Tests/Acceptance/Backend/ContentCreationCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ public function html5MediaCanBeCreated(BackendTester $I, PageTree $pageTree, Mod
$I->waitForElement($headerInputSelector);
$I->fillField($headerInputSelector, 'Testheader');

// Switch to tab "Media"
$I->click('.typo3-TCEforms > ' . $this->buildTabSelector(2));

$I->click('Create new');

$I->waitForElement('div[data-title="Media file"] select[name$="[type]"]');

// Tab "Meta data"
$I->click('div[data-foreign-table="tx_html5mediakit_domain_model_media"] ' . $this->buildTabSelector(3));

$I->fillField('div[data-title="Media file"] input[data-formengine-input-name$="[caption]"]', 'The caption');

$I->click('Save');
Expand All @@ -51,8 +57,19 @@ public function html5MediaCanBeCreated(BackendTester $I, PageTree $pageTree, Mod

$I->seeInField($headerInputSelector, 'Testheader');

// Switch to tab "Media"
$I->click('.typo3-TCEforms > ' . $this->buildTabSelector(2));

$I->click('#data-1-tt_content-1-tx_html5mediakit_media-tx_html5mediakit_domain_model_media-1_label');
$I->waitForElement('div[data-title="Media file"] select[name$="[type]"]');
$I->seeInField('div[data-title="Media file"] input[data-formengine-input-name$="[caption]"]', 'The caption');
}

private function buildTabSelector(int $tabNumber): string
{
return sprintf(
'div[role="tabpanel"] > ul.nav-tabs > li.t3js-tabmenu-item:nth-child(%d) > a',
$tabNumber
);
}
}

0 comments on commit 3a19030

Please sign in to comment.