Skip to content

Commit

Permalink
Support TOM select when clicking a type of service
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Aug 5, 2024
1 parent 791c54d commit a06ff6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
27 changes: 6 additions & 21 deletions tests/webtests/EntityDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,9 @@ public function test_delete_a_published_test_entity()
$crawler = self::$pantherClient->request('GET', "/entity/delete/published/1/a8e7cffd-0409-45c7-a37a-000000000000");

$pageTitle = $crawler->filter('.page-container h1');

$this->assertEquals('Delete entity', $pageTitle->text());

$form = $crawler->filter('.page-container')
->selectButton('Delete')
->form();

self::$pantherClient->submit($form);
self::$pantherClient->wait(2);
self::findBy('#dashboard_bundle_delete_entity_type_delete')->click();
self::$pantherClient->waitForVisibility('.service-status-entities-table-title', 10);
self::assertOnPage('Your entity is deleted');
}

Expand All @@ -82,13 +76,8 @@ public function test_delete_a_unpublished_production_entity()
$pageTitle = $crawler->filter('.page-container h1');

$this->assertEquals('Delete entity', $pageTitle->text());

$form = $crawler->filter('.page-container')
->selectButton('Delete')
->form();

self::$pantherClient->submit($form);
self::$pantherClient->wait(2);
self::findBy('#dashboard_bundle_delete_entity_type_delete')->click();
self::$pantherClient->waitForVisibility('.service-status-entities-table-title', 10);
self::assertOnPage('Your entity is deleted');

}
Expand All @@ -115,12 +104,8 @@ public function test_request_delete_a_published_production_entity_jira_not_avail
$pageTitle = $crawler->filter('.page-container h1');
$this->assertEquals('Delete entity', $pageTitle->text());

$form = $crawler->filter('.page-container')
->selectButton('Delete')
->form();

self::$pantherClient->submit($form);
self::$pantherClient->wait(2);
self::findBy('#dashboard_bundle_delete_entity_type_delete')->click();
self::$pantherClient->waitForVisibility('.service-status-entities-table-title', 10);
$this->assertOnPage(
'Oops, creating the delete request failed. Our ticket service might have been offline. Please try again at a later time.'
);
Expand Down
2 changes: 1 addition & 1 deletion tests/webtests/EntityEditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function test_it_loads_xml_from_textarea()
self::fillFormField($formElement, '#dashboard_bundle_entity_type_attributes_organizationAttribute_motivation', 'foo');
self::fillFormField($formElement, '#dashboard_bundle_entity_type_attributes_personalCodeAttribute_motivation', 'foo');
// Also check a type of service (as they are mandatory)
self::findBy('label[for="dashboard_bundle_entity_type_metadata_typeOfService_4"]')->click();
self::findBy('option.decorated:nth-child(4)')->click();
self::findBy('#dashboard_bundle_entity_type_publishButton')->click();

$pageTitle = self::$pantherClient->refreshCrawler()->filter('h1')->first()->text();
Expand Down
1 change: 1 addition & 0 deletions tests/webtests/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ protected static function assertNotOnPage(string $expectation, Crawler $crawler

protected static function findBy(string $cssSelector): WebDriverElement
{
self::$pantherClient->waitForVisibility($cssSelector, 10);
return self::$pantherClient->findElement(WebDriverBy::cssSelector($cssSelector));
}

Expand Down

0 comments on commit a06ff6c

Please sign in to comment.