Skip to content

Commit

Permalink
CI: Update Selenium Images + Small test adjustments. (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasnorre authored Mar 9, 2024
1 parent 4c7d37e commit f515e8b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 31 deletions.
29 changes: 16 additions & 13 deletions .devbox/.ddev/docker-compose.selenium.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# To execute this docker-compose yml file use `docker-compose -f <file_name> up`
# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-beta-channel.yml up`
# Add the `-d` flag at the end for detached execution
version: '3.6'
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-beta-channel.yml down`
version: "3"
services:
selenium-hub:
image: selenium/hub:3.141.59-20200326
container_name: selenium-hub
ports:
- "4444:4444"

chrome:
image: selenium/node-chrome:3.141.59-20200326
volumes:
- /dev/shm:/dev/shm
image: selenium/node-chrome:latest
shm_size: 2gb
depends_on:
- selenium-hub
environment:
- HUB_HOST=selenium-hub
- HUB_PORT=4444
- SE_EVENT_BUS_HOST=selenium-hub
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443

selenium-hub:
image: selenium/hub:latest
container_name: selenium-hub
ports:
- "4442:4442"
- "4443:4443"
- "4444:4444"
2 changes: 1 addition & 1 deletion Tests/Acceptance/BackendModule/BackendModuleCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function signInSuccessfully(Admin $I): void
public function canSeeCrawlerModule(Admin $I): void
{
$I->loginAsAdmin();
$I->canSee('Crawler', '#web_site_crawler');
$I->canSee('Crawler', '[data-modulemenu-identifier="web_site_crawler"]');
}

public function canSelectCrawlerModuleStartCrawling(BackendModule $I, Admin $adminStep, PageTree $pageTree): void
Expand Down
4 changes: 2 additions & 2 deletions Tests/Acceptance/BackendModule/CrawlerConfigurationCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

class CrawlerConfigurationCest
{
public function canCreateCrawlerConfigration(BackendModule $I, Admin $adminStep, PageTree $pageTree): void
public function canCreateCrawlerConfiguration(BackendModule $I, Admin $adminStep, PageTree $pageTree): void
{
$adminStep->loginAsAdmin();
$I->click('#web_list');
$I->click('[data-moduleroute-identifier="web_list"]');
// Due to slow response time.
$I->waitForElementNotVisible('#nprogress', 120);
$I->waitForElement('#typo3-pagetree-treeContainer', 120);
Expand Down
6 changes: 5 additions & 1 deletion Tests/Acceptance/Support/Step/Acceptance/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class Admin extends \AcceptanceTester
public function loginAsAdmin(): void
{
$I = $this;
$I->amOnPage('/typo3');
if ($I->tryToSeeCookie('be_typo_user')) {
return;
}

$I->amOnPage('/typo3/login');
$I->waitForText('Login', 30);
$I->fillField('#t3-username', 'admin');
$I->fillField('#t3-password', 'password');
Expand Down
25 changes: 12 additions & 13 deletions Tests/Acceptance/Support/Step/Acceptance/BackendModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@

class BackendModule extends \AcceptanceTester
{
public function openCrawlerBackendModule(Admin $I, PageTree $pageTree): void
{
$I->click('#web_site_crawler');
// Due to slow response time.
$I->waitForElementNotVisible('#nprogress', 120);
$I->waitForElement('#typo3-pagetree-treeContainer', 120);
$pageTree->openPath(['Welcome']);
// Due to slow response time.
$I->waitForElementNotVisible('#nprogress', 120);
$I->switchToContentFrame();
$I->waitForText('Crawl', 10);
}

public function openCrawlerBackendModuleStartCrawling(Admin $I, PageTree $pageTree): void
{
$this->openCrawlerBackendModule($I, $pageTree);
Expand Down Expand Up @@ -70,4 +57,16 @@ public function addProcessOnProcess(Admin $I, PageTree $pageTree): void
$I->waitForElementNotVisible('#nprogress', 120);
$I->waitForText('New process has been started');
}
private function openCrawlerBackendModule(Admin $I, PageTree $pageTree): void
{
$I->click('[data-moduleroute-identifier="web_site_crawler"]');
// Due to slow response time.
$I->waitForElementNotVisible('#nprogress', 120);
$I->waitForElement('#typo3-pagetree-treeContainer', 120);
$pageTree->openPath(['Welcome']);
// Due to slow response time.
$I->waitForElementNotVisible('#nprogress', 120);
$I->switchToContentFrame();
$I->waitForText('Crawl', 10);
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
},
"autoload-dev": {
"psr-4": {
"AOE\\Crawler\\Tests\\": "Tests"
"AOE\\Crawler\\Tests\\": "Tests",
"TYPO3\\CMS\\Core\\Tests\\": ".Build/vendor/typo3/cms-core/Tests"
}
},
"config": {
Expand Down

0 comments on commit f515e8b

Please sign in to comment.