Skip to content

Commit

Permalink
Allow toggling of Jira failure simulation
Browse files Browse the repository at this point in the history
And adjust other webtests to the new Fixtures created for the surfconext
representative page
  • Loading branch information
MKodde committed Jun 19, 2024
1 parent 3b762cd commit 928e35b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public function shouldFailCreateIssue(): void
$this->failIssueCreation = true;
$this->storeData();
}
public function shouldNotFailCreateIssue(): void
{
$this->loadData();
$this->failIssueCreation = false;
$this->storeData();
}

public function findByManageIds(array $manageIds): IssueCollection
{
Expand Down
1 change: 1 addition & 0 deletions tests/webtests/EntityDetailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function test_render_details_of_removal_requested_manage_entity()
);

$issueType = 'spd-delete-production-entity';
$this->jiraIssueRepository->shouldNotFailCreateIssue();
$this->createjiraTicket($entityId, $issueType);

$this->switchToService('SURFnet');
Expand Down
2 changes: 1 addition & 1 deletion tests/webtests/ServiceCreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public function test_empty_institution_id_field_is_allowed()
self::fillFormField($form, 'input[name="dashboard_bundle_service_type[teams][teamManagerEmail]"]', '[email protected]');
self::findBy('#dashboard_bundle_service_type_save')->click();
$services = $this->getServiceRepository()->findAll();
$this->assertCount(3, $services);
$this->assertCount(4, $services);
}
}
8 changes: 5 additions & 3 deletions tests/webtests/ServiceSwitcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ public function test_switcher_lists_all_services_for_administrators()
$crawler = self::$pantherClient->request('GET', '/service/create');

$options = $crawler->filter('select#service-switcher option');
$this->assertCount(3, $options, 'Expecting 2 services in service switcher (excluding empty option)');
$this->assertCount(4, $options, 'Expecting 3 services in service switcher (excluding empty option)');

$crawler->filter('.service-switcher form')->click();
$ibuildings = "//li[contains(@id,'select2-service-switcher-result-')][1]";
$surf = "//li[contains(@id,'select2-service-switcher-result-')][2]";
$acme = "//li[contains(@id,'select2-service-switcher-result-')][1]";
$ibuildings = "//li[contains(@id,'select2-service-switcher-result-')][2]";
$surf = "//li[contains(@id,'select2-service-switcher-result-')][3]";

$this->assertEquals('Acme Corporation [acme.com]', $crawler->findElement(WebDriverBy::xpath($acme))->getText());
$this->assertEquals('Ibuildings B.V. [ibuildings.nl]', $crawler->findElement(WebDriverBy::xpath($ibuildings))->getText());
$this->assertEquals('SURFnet [surf.nl]', $crawler->findElement(WebDriverBy::xpath($surf))->getText());
}
Expand Down

0 comments on commit 928e35b

Please sign in to comment.