-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from openeuropa/EWPP-0000-test-fix
EWPP-0000: Assert machine name is correctly set during tests.
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,7 +225,7 @@ public function testCorporateContactForm(): void { | |
// Add remaining field values and submit form. | ||
$this->fillCorporateFields(); | ||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been added.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been added.'); | ||
|
||
// Assert the values are saved. | ||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
|
@@ -246,7 +246,7 @@ public function testCorporateContactForm(): void { | |
|
||
// Go through the edit process. | ||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been updated.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been updated.'); | ||
|
||
// Assert the values are saved. | ||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
|
@@ -261,7 +261,7 @@ public function testCorporateContactForm(): void { | |
$value = '<front>'; | ||
$element->setValue($value); | ||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been updated.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been updated.'); | ||
|
||
// Make sure the saved value is the one expected. | ||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
|
@@ -282,7 +282,7 @@ public function testCorporateContactForm(): void { | |
$value = 'Privacy page (' . $node->id() . ')'; | ||
$element->setValue($value); | ||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been updated.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been updated.'); | ||
|
||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
$element = $page->findField($field_name); | ||
|
@@ -298,7 +298,7 @@ public function testCorporateContactForm(): void { | |
$this->assertFalse($alternative_language_element->isChecked()); | ||
|
||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been updated.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been updated.'); | ||
|
||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
$element = $page->findField($field_name); | ||
|
@@ -351,7 +351,7 @@ public function testNoCorporateValues(): void { | |
$this->fillCoreContactFields(); | ||
|
||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been added.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been added.'); | ||
|
||
// Assert the values are saved. | ||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
|
@@ -388,7 +388,7 @@ public function testCorporateDefaultTransition(): void { | |
// Add remaining field values and submit form. | ||
$this->fillCorporateFields(); | ||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been added.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been added.'); | ||
|
||
// Assert the values are saved. | ||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
|
@@ -408,7 +408,7 @@ public function testCorporateDefaultTransition(): void { | |
$this->assertFieldsVisible(FALSE); | ||
|
||
$page->pressButton('Save'); | ||
$assert->pageTextContains('Contact form Test form has been updated.'); | ||
$assert->pageTextContains('Contact form OE Corporate Form has been updated.'); | ||
|
||
// Assert no corporate values are saved. | ||
$this->drupalGet('admin/structure/contact/manage/oe_corporate_form'); | ||
|
@@ -444,10 +444,10 @@ protected function fillCoreContactFields(): void { | |
/** @var \Behat\Mink\Element\DocumentElement $page */ | ||
$page = $this->getSession()->getPage(); | ||
|
||
$page->fillField('label', 'Test form'); | ||
$page->fillField('recipients', '[email protected]'); | ||
$page->fillField('label', 'OE Corporate Form'); | ||
// Overcome machine name not being accessible. | ||
$this->getSession()->executeScript('jQuery("#edit-id").val("oe_corporate_form");'); | ||
$this->assertSession()->waitForText('Machine name: oe_corporate_form'); | ||
$page->fillField('recipients', '[email protected]'); | ||
} | ||
|
||
/** | ||
|