diff --git a/tests/module/simple_gmap_stress_test/config/install/core.entity_form_display.node.simple_gmap_stress_test.default.yml b/tests/module/simple_gmap_stress_test/config/install/core.entity_form_display.node.simple_gmap_stress_test.default.yml
index b1378ef..6734ed1 100644
--- a/tests/module/simple_gmap_stress_test/config/install/core.entity_form_display.node.simple_gmap_stress_test.default.yml
+++ b/tests/module/simple_gmap_stress_test/config/install/core.entity_form_display.node.simple_gmap_stress_test.default.yml
@@ -3,6 +3,7 @@ langcode: en
status: true
dependencies:
config:
+ - field.field.node.simple_gmap_stress_test.field_blank
- field.field.node.simple_gmap_stress_test.field_map1
- field.field.node.simple_gmap_stress_test.field_map2
- field.field.node.simple_gmap_stress_test.field_xss
@@ -20,6 +21,14 @@ content:
region: content
settings: { }
third_party_settings: { }
+ field_blank:
+ weight: 124
+ settings:
+ size: 60
+ placeholder: ''
+ third_party_settings: { }
+ type: string_textfield
+ region: content
field_map1:
weight: 121
settings:
diff --git a/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.default.yml b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.default.yml
index f0a5525..1ce05f7 100644
--- a/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.default.yml
+++ b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.default.yml
@@ -3,6 +3,7 @@ langcode: en
status: true
dependencies:
config:
+ - field.field.node.simple_gmap_stress_test.field_blank
- field.field.node.simple_gmap_stress_test.field_map1
- field.field.node.simple_gmap_stress_test.field_map2
- field.field.node.simple_gmap_stress_test.field_xss
@@ -15,6 +16,25 @@ targetEntityType: node
bundle: simple_gmap_stress_test
mode: default
content:
+ field_blank:
+ weight: 104
+ label: above
+ settings:
+ include_map: true
+ include_static_map: false
+ include_link: false
+ include_text: false
+ iframe_height: '200'
+ iframe_width: '200'
+ static_scale: 1
+ zoom_level: 14
+ link_text: 'View larger map'
+ map_type: m
+ langcode: en
+ apikey: ''
+ third_party_settings: { }
+ type: simple_gmap
+ region: content
field_map1:
weight: 101
label: above
@@ -25,12 +45,12 @@ content:
iframe_width: '200'
iframe_height: '200'
static_scale: 1
- link_text: 'View larger map'
+ link_text: 'use_address'
zoom_level: 14
map_type: m
langcode: en
- include_link: false
- include_text: false
+ include_link: true
+ include_text: true
third_party_settings: { }
type: simple_gmap
region: content
diff --git a/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.teaser.yml b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.teaser.yml
index 5a4d183..deddc79 100644
--- a/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.teaser.yml
+++ b/tests/module/simple_gmap_stress_test/config/install/core.entity_view_display.node.simple_gmap_stress_test.teaser.yml
@@ -4,6 +4,10 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
+ - field.field.node.simple_gmap_stress_test.field_map1
+ - field.field.node.simple_gmap_stress_test.field_map2
+ - field.field.node.simple_gmap_stress_test.field_xss
+ - field.field.node.simple_gmap_stress_test.field_blank
- node.type.simple_gmap_stress_test
module:
- user
@@ -15,4 +19,8 @@ content:
links:
weight: 100
region: content
-hidden: { }
+hidden:
+ field_map1: true
+ field_map2: true
+ field_xss: true
+ field_blank: true
diff --git a/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_blank.yml b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_blank.yml
new file mode 100644
index 0000000..03183bb
--- /dev/null
+++ b/tests/module/simple_gmap_stress_test/config/install/field.field.node.simple_gmap_stress_test.field_blank.yml
@@ -0,0 +1,19 @@
+uuid: fd3bf43d-992f-4e33-9eb5-0499ae0fb47a
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_blank
+ - node.type.simple_gmap_stress_test
+id: node.simple_gmap_stress_test.field_blank
+field_name: field_blank
+entity_type: node
+bundle: simple_gmap_stress_test
+label: blank
+description: 'A blank field - which tests populate to demonstrate the operation of the formatter''s setting form.'
+required: false
+translatable: false
+default_value: { }
+default_value_callback: ''
+settings: { }
+field_type: string
diff --git a/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_blank.yml b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_blank.yml
new file mode 100644
index 0000000..8a4ea5a
--- /dev/null
+++ b/tests/module/simple_gmap_stress_test/config/install/field.storage.node.field_blank.yml
@@ -0,0 +1,21 @@
+uuid: 7e3622d2-508a-4896-8848-2152f8db5ee5
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+id: node.field_blank
+field_name: field_blank
+entity_type: node
+type: string
+settings:
+ max_length: 255
+ is_ascii: false
+ case_sensitive: false
+module: core
+locked: false
+cardinality: 1
+translatable: true
+indexes: { }
+persist_with_no_fields: false
+custom_storage: false
diff --git a/tests/module/simple_gmap_stress_test/simple_gmap_stress_test.info.yml b/tests/module/simple_gmap_stress_test/simple_gmap_stress_test.info.yml
new file mode 100644
index 0000000..114db32
--- /dev/null
+++ b/tests/module/simple_gmap_stress_test/simple_gmap_stress_test.info.yml
@@ -0,0 +1,7 @@
+name: simple_gmap_stress_test
+type: module
+description: 'Provides a stress_test content entity.'
+package: Custom
+core: 8.x
+dependencies:
+ - simple_gmap
diff --git a/tests/module/simple_gmap_stress_test/stress_test.info.yml b/tests/module/simple_gmap_stress_test/stress_test.info.yml
index 114db32..d5e5651 100644
--- a/tests/module/simple_gmap_stress_test/stress_test.info.yml
+++ b/tests/module/simple_gmap_stress_test/stress_test.info.yml
@@ -4,4 +4,4 @@ description: 'Provides a stress_test content entity.'
package: Custom
core: 8.x
dependencies:
- - simple_gmap
+ - simple_gmap
\ No newline at end of file
diff --git a/tests/src/Functional/StressTest.php b/tests/src/Functional/StressTest.php
index 92235a8..2b864ff 100644
--- a/tests/src/Functional/StressTest.php
+++ b/tests/src/Functional/StressTest.php
@@ -6,7 +6,7 @@ use Drupal\node\Entity\NodeType;
use Drupal\Tests\BrowserTestBase;
/**
- * Tests the entity form checkbox output respects flag access control.
+ * Tests simple_gmap formatter.
*
* @group flag
*/
@@ -16,9 +16,10 @@ class StressTest extends BrowserTestBase {
* {@inheritdoc}
*/
public static $modules = [
+ 'node',
+ 'simple_gmap_stress_test',
'system',
'user',
- 'node',
];
/**
@@ -51,11 +52,11 @@ class StressTest extends BrowserTestBase {
}
/**
- * Tests the access to the flag checkbox in the node edit form.
+ * Make assertions about the stress test page.
*/
public function testCheckboxAccess() {
// Get the node edit form.
- $this->drupalGet("node/" . $this->node->id());
+ $this->drupalGet('node/' . $this->node->id());
$this->assertSession()->pageTextContains('XYZ', 'The field was as expected..');
}
diff --git a/tests/src/FunctionalJavascript/SimpleGmapTest.php b/tests/src/FunctionalJavascript/SimpleGmapTest.php
index c4afb90..c1bc1b6 100644
--- a/tests/src/FunctionalJavascript/SimpleGmapTest.php
+++ b/tests/src/FunctionalJavascript/SimpleGmapTest.php
@@ -3,6 +3,7 @@
namespace Drupal\Tests\simple_gmap\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+use Drupal\node\Entity\Node;
/**
* Creates a page to look at to test the Simple Google Maps module.
@@ -29,12 +30,15 @@ class SimpleGmapTest extends JavascriptTestBase {
* @var array
*/
public static $modules = [
- 'simple_gmap',
'node',
+ // TODO can I remove menu_ui?
+ // (see node.type.simple_gmap_stress_test.yml)
+ 'menu_ui',
+ 'path',
'field',
'field_ui',
+ 'simple_gmap_stress_test',
'text',
- 'block',
'user',
];
@@ -44,249 +48,120 @@ class SimpleGmapTest extends JavascriptTestBase {
protected function setUp() {
parent::setUp();
- $this->drupalCreateContentType(['type' => 'article']);
- drupal_static_reset();
- \Drupal::entityManager()->clearCachedDefinitions();
- \Drupal::service('router.builder')->rebuild();
- \Drupal::service('entity.definition_update_manager')->applyUpdates();
-
- $admin_user = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
+ // Create and login as an authenticated user.
+ $auth_user = $this->drupalCreateUser([
+ 'access content',
'administer node display',
- 'create article content',
]);
- $this->drupalLogin($admin_user);
+ $this->drupalLogin($auth_user);
- // Make sure local tasks and page title are showing.
- $this->drupalPlaceBlock('local_tasks_block');
- $this->drupalPlaceBlock('page_title_block');
+ // Create a stress test node with three fields where the default values
+ // will exercise the formatter.
+ $this->node = Node::create([
+ 'type' => 'simple_gmap_stress_test',
+ 'title' => 'A three field node',
+ ]);
+ $this->node->save();
}
/**
- * Creates the test pages.
+ * Fill out the settings form for the 'blank' field on the stress test page.
+ *
+ * The make assertions about the population of the blank settings
+ * summary column of the fields display table.
*/
- public function testModule() {
+ public function testSettingsForm() {
$session = $this->getSession();
$assert_session = $this->assertSession();
- $field1 = 'map1';
- $field2 = 'map2';
- $field3 = 'xss';
-
- $address1 = 'Eiffel Tower';
- $address2 = "Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K";
- $address2entities = "Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K";
- $address3 = ' Empire State Building';
-
- // Add three text fields to the Article content type.
- $this->drupalGet('admin/structure/types/manage/article/fields/add-field');
- $this->drupalPostForm(NULL, [
- 'new_storage_type' => 'string',
- ], 'Save and continue');
- // This opens up the page again with field errors for name and label.
- $this->drupalPostForm(NULL, [
- 'label' => $field1,
- 'field_name' => $field1,
- ], 'Save and continue');
- $this->drupalPostForm(NULL, [], 'Save field settings');
- $this->drupalPostForm(NULL, [], 'Save settings');
-
- $this->drupalGet('admin/structure/types/manage/article/fields/add-field');
- $this->drupalPostForm(NULL, [
- 'new_storage_type' => 'string',
- ], 'Save and continue');
- $this->drupalPostForm(NULL, [
- 'label' => $field2,
- 'field_name' => $field2,
- ], 'Save and continue');
- $this->drupalPostForm(NULL, [], 'Save field settings');
- $this->drupalPostForm(NULL, [], 'Save settings');
-
- $this->drupalGet('admin/structure/types/manage/article/fields/add-field');
- $this->drupalPostForm(NULL, [
- 'new_storage_type' => 'string',
- ], 'Save and continue');
- $this->drupalPostForm(NULL, [
- 'label' => $field3,
- 'field_name' => $field3,
- ], 'Save and continue');
- $this->drupalPostForm(NULL, [], 'Save field settings');
- $this->drupalPostForm(NULL, [], 'Save settings');
-
- // Set the formatter for all of the fields.
- $this->drupalGet('admin/structure/types/manage/article/display');
-
- // Ensure each field is set to the new field formatter.
- foreach ([$field1, $field2, $field3] as $field) {
- $fields_page = $session->getPage();
-
- // Select the form listing the individual field elements.
- $field_form = $fields_page->find('css', 'form[action="/admin/structure/types/manage/article/display"]');
- $field_form->selectFieldOption("fields[field_$field][type]", 'Google Map from one-line address');
+ // To visiting the settings form we must first visitng the page
+ // listing all its fields.
+ $this->drupalGet('admin/structure/types/manage/simple_gmap_stress_test/display');
- // Wait for ajax request to complete - by watching as the selector
- // becomes disabled and then re-enabled.
- $selector_hidden = $assert_session->waitForElementVisible('css', "select[name=\"fields[field_$field][type]\"]:disabled");
- $this->assertNOtNull($selector_hidden);
- $selector_visible = $assert_session->waitForElementVisible('css', "select[name=\"fields[field_$field][type]\"]:not([disabled])");
- $this->assertNOtNull($selector_visible);
- }
-
- // Hit the form's save button.
- $updated_page = $session->getPage();
-
- $updated_form = $updated_page->find('css', 'form[action="/admin/structure/types/manage/article/display"]');
-
- $updated_form->find('css', 'input[value="Save"]')->click();
-
- // Wait for save to complete.
- $message_visible = $assert_session->waitForElementVisible('css', 'div:contains("Your settings have been saved.")');
- $this->assertNotNull($message_visible);
-
- // Verify initially flag link is on the page.
- $display_page = $session->getPage();
-
- // Find the table row containing the field1 entry.
- $field1_row = $display_page->find('css', "#field-$field1");
+ // Find the table row containing the blank field.
+ $fields_page = $session->getPage();
+ $fields_form = $fields_page->find('css', 'form[action="/admin/structure/types/manage/simple_gmap_stress_test/display"]');
+ $blank_row = $fields_form->find('css', "#field-blank");
// Click on the row's edit button (styled with a gear icon).
- $field1_row->find('css', 'input[alt="Edit"]')->click();
-
- // Wait for the settings form associated with field1 to appear
- // with a update button.
- $update_visible1 = $assert_session->waitForElementVisible('css', 'form input[value="Update"]');
- $this->assertNotNull($update_visible1);
-
- $field1_edit_form = $session->getPage();
- $field1_edit_form->checkField('Include embedded dynamic map');
- $field1_edit_form->checkField('Include embedded static map');
- // Checking the 'static map" options causes the API field associated with
- // field1 to appear.
- $visible_key1 = $assert_session->waitForElementVisible('css', 'label:contains("Google Maps API key")');
- $this->assertNotNull($visible_key1);
-
- $field1_edit_form2 = $session->getPage();
- $field1_edit_form2->fillField('Google Maps API key', $this->apiKey);
- $field1_edit_form2->checkField('Include link to map');
- $field1_edit_form2->checkField('Include original address text');
- $field1_edit_form2->find('css', 'input[value="Update"]')->click();
+ $blank_row->find('css', 'input[alt="Edit"]')->click();
+
+ // Wait for the settings form associated with the 'blank' field to appear
+ // by waiting for the update button.
+ $update_visible = $assert_session->waitForElementVisible('css', 'form input[value="Update"]');
+ $this->assertNotNull($update_visible);
+
+ $edit_form = $session->getPage();
+ $edit_form->checkField('Include embedded dynamic map');
+ $edit_form->checkField('Include embedded static map');
+
+ // Checking the 'static map" options causes the API key field to appear.
+ $visible_key = $assert_session->waitForElementVisible('css', 'label:contains("Google Maps API key")');
+ $this->assertNotNull($visible_key);
+
+ $edit_form2 = $session->getPage();
+ $edit_form2->fillField('Google Maps API key', $this->apiKey);
+ $edit_form2->fillField('Link text', 'use_address');
+ $edit_form2->fillField('Zoom level', '5');
+ $edit_form2->selectFieldOption('Map type', 'Satellite');
+ $edit_form2->fillField('Language', 'xyz');
+ $edit_form2->checkField('Include link to map');
+ $edit_form2->checkField('Include original address text');
+ $edit_form2->find('css', 'input[value="Update"]')->click();
// As the update button completes the edit "gears" icon associated with
- // field1 will reappear.
- $visible_gears1 = $assert_session->waitForElementVisible('css', "#field-$field1 input[alt=\"Edit\"]");
+ // the 'blank' will reappear.
+ $visible_gears1 = $assert_session->waitForElementVisible('css', "#field-blank input[alt=\"Edit\"]");
$this->assertNotNull($visible_gears1);
// Re-examine the field row containing field1.
$display_page_updated = $session->getPage();
- $field1_row_updated = $display_page_updated->find('css', "#field-$field1");
+ $field_row_updated = $display_page_updated->find('css', "#field-blank");
// Make assertions about the summary column.
- $this->assertTrue($field1_row_updated->has('css', 'div:contains("Map link: View larger map")'));
- $this->assertTrue($field1_row_updated->has('css', 'div:contains("Zoom Level: 14")'));
- $this->assertTrue($field1_row_updated->has('css', 'div:contains("Language: en")'));
- $this->assertTrue($field1_row_updated->has('css', 'div:contains("Map Type: Map")'));
- $this->assertTrue($field1_row_updated->has('css', 'div:contains("Dynamic map")'));
- $this->assertTrue($field1_row_updated->has('css', 'div:contains("Static map")'));
- $this->assertTrue($field1_row_updated->has('css', 'div:contains("Original text displayed")'));
-
- // Shift focus to second field.
- // Find the table row containing the field2 entry.
- $field2_row = $display_page->find('css', "#field-$field2");
-
- // Click on the row's edit button (styled with a gear icon).
- $field2_row->find('css', 'input[alt="Edit"]')->click();
-
- // Wait for the settings form associated with field2 to appear
- // with a update button.
- $update_visible2 = $assert_session->waitForElementVisible('css', 'form input[value="Update"]');
- $this->assertNotNull($update_visible2);
-
- $field2_edit_form = $session->getPage();
- // Set options on the field2.
- $field2_edit_form->checkField('Include embedded dynamic map');
- $field2_edit_form->checkField('Include embedded static map');
- // Checking the 'static map" options causes the API field to appear.
- $visible_key2 = $assert_session->waitForElementVisible('css', 'label:contains("Google Maps API key")');
- $this->assertNotNull($visible_key2);
-
- $field2_edit_form2 = $session->getPage();
- $field2_edit_form2->fillField('Google Maps API key', $this->apiKey);
- $field2_edit_form2->checkField('Include link to map');
- $field2_edit_form2->fillField('Link text', 'use_address');
- $field2_edit_form2->fillField('Zoom level', '5');
- $field2_edit_form2->selectFieldOption('Map type', 'Satellite');
- $field2_edit_form2->fillField('Language', 'page');
-
- // Trigger the form to be processsed.
- $field2_edit_form2->find('css', 'input[value="Update"]')->click();
-
- // As the update button completes the edit "gears" icon associated with
- // field 2 will reappear.
- $visible_gear2 = $assert_session->waitForElementVisible('css', "#field-$field2 input[alt=\"Edit\"]");
- $this->assertNotNull($visible_gear2);
-
- // Re-examine the field row containing field2.
- $field_list_page_updated = $session->getPage();
- $field2_row_updated = $field_list_page_updated->find('css', "#field-$field2");
-
- // Make assertions about the summary column.
- $this->assertTrue($field2_row_updated->has('css', 'div:contains("Map link: use_address")'));
- $this->assertTrue($field2_row_updated->has('css', 'div:contains("Zoom Level: 5")'));
- $this->assertTrue($field2_row_updated->has('css', 'div:contains("Language: page")'));
- $this->assertTrue($field2_row_updated->has('css', 'div:contains("Map Type: Satellite")'));
-
- // Shift focus to third field.
- $field3_row = $field_list_page_updated->find('css', "#field-$field3");
-
- // Click on the row's edit button (styled with a gear icon).
- $field3_row->find('css', 'input[alt="Edit"]')->click();
-
- // Wait for the settings form to appear with a update button.
- $assert_session->waitForElementVisible('css', 'form input[value="Update"]');
-
- $field3_edit_form = $session->getPage();
- $field3_edit_form->checkField('Include link to map');
- $field3_edit_form->checkField('Include embedded static map');
- // Checking the 'static map" options causes the API field to appear.
- $visible_key3 = $assert_session->waitForElementVisible('css', 'label:contains("Google Maps API key")');
- $this->assertNotEmpty($visible_key3);
- $field3_edit_form2 = $session->getPage();
- $field3_edit_form2->fillField('Google Maps API key', $this->apiKey);
- $field3_edit_form2->checkField('Include original address text');
+ $this->assertTrue($field_row_updated->has('css', 'div:contains("Dynamic map")'));
+ $this->assertTrue($field_row_updated->has('css', 'div:contains("Static map")'));
+ $this->assertTrue($field_row_updated->has('css', 'div:contains("Map link: use_address")'));
+ $this->assertTrue($field_row_updated->has('css', 'div:contains("Map Type: Satellite")'));
+ $this->assertTrue($field_row_updated->has('css', 'div:contains("Zoom Level: 5")'));
+ $this->assertTrue($field_row_updated->has('css', 'div:contains("Language: xyz")'));
+ $this->assertTrue($field_row_updated->has('css', 'div:contains("Original text displayed")'));
+ }
- // Save all the settings.
- $field3_edit_form2->find('css', 'input[value="Save"]')->click();
+ /**
+ * Inspect the formatter output.
+ *
+ * Find one good example and two troublesome senarios.
+ *
+ * Troublesome senarious :-
+ * A complex character set.
+ * A XSS attack.
+ */
+ public function testFormatterOutput() {
+ $address1 = 'Eiffel Tower';
+ $address2 = "Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K";
+ $address2entities = "Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K";
+ $address3 = ' Empire State Building';
- // Create an article and populate three addresses.
- $this->drupalGet('node/add/article');
- $add_article_page = $session->getPage();
- $add_article_page->fillField('Title', 'Map test');
- $add_article_page->fillField($field1, $address1);
- $add_article_page->fillField($field2, $address2);
- $add_article_page->fillField($field3, $address3);
- $add_article_page->find('css', 'input[value="Save"]')->click();
+ $assert_session = $this->assertSession();
- // Wait for a message div to appear indicating that the save was successful.
- $article_message = $assert_session->waitForElementVisible('css', 'div.messages');
- $this->assertNotNull($article_message);
- $assert_session->pageTextContains('has been created.');
+ // Get the node edit form.
+ $this->drupalGet('node/' . $this->node->id());
$this->pass('Open the previous link. In the first field, verify: (1) Both the static and dynamic maps are displayed. (2) The link to the larger map is included, with text "View larger map". (3) If you click the map link, the larger map is shown and "Eiffel Tower" appears in the address box. (4) The text "Eiffel Tower" appears below the maps and link.');
$this->pass("In the second field, verify: (1) Both the static and dynamic maps are displayed. (2) They should be zoomed way out to the regional level, rather than street level. (3) They should be satellite images rather than street maps. (4) The link to the larger map is included, but the link text is \"Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K\". (5) Verify that the map link has &hl=en in it (so it picked up the page language). (6) If you click the map link, the larger map is shown and \"Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K\" appears in the address box. (7) The text \"Place de l'Université-du-Québec, boulevard Charest Est, Québec, QC G1K\" appears below the maps and link.");
$this->pass("The third field is a XSS test. Verify that the script tags are shown rather than being processed by the browser. Maps will likely show the entire world as it is not a valid address. There should not be a JavaScript alert box shown.");
- $article_view_page = $session->getPage();
+ $session = $this->getSession();
+ $article = $session->getPage();
+ $this->createScreenshot('/Users/martin/page.jpg');
- // $assert_session->linkExists('View larger map');
- // Looking for this link isn't working, with or without the
- // entities. Will need to be a manual test.
- $this->assertTrue($article_view_page->has('css', "p:contains($address1)"));
- $this->assertTrue($article_view_page->has('css', "p:contains($address2entities)"));
- $address3_htmlentities = htmlentities($address3);
- $this->assertTrue($article_view_page->has('css', "p:contains($address3_htmlentities)"));
- $this->assertTrue($article_view_page->has('xpath', '//img[contains(@src, "google.com/maps")]'));
+ $assert_session->linkExists('View larger map');
+ $this->assertTrue($article->has('css', "p:contains($address1)"));
+ $this->assertTrue($article->has('css', "p:contains($address2entities)"));
+ $address3_htmlentities = htmlentities($address3);
+ $this->assertTrue($article->has('css', "p:contains($address3_htmlentities)"));
+ $this->assertTrue($article->has('xpath', '//img[contains(@src, "google.com/maps")]'));
}
}