You are here

public function GeolocationLeafletJavascriptTest::testLeafletMap in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/FunctionalJavascript/GeolocationLeafletJavascriptTest.php \Drupal\Tests\geolocation\FunctionalJavascript\GeolocationLeafletJavascriptTest::testLeafletMap()

Tests the CommonMap style.

File

tests/src/FunctionalJavascript/GeolocationLeafletJavascriptTest.php, line 113

Class

GeolocationLeafletJavascriptTest
Tests the leaflet JavaScript functionality.

Namespace

Drupal\Tests\geolocation\FunctionalJavascript

Code

public function testLeafletMap() {
  $this
    ->drupalGet('geolocation-leaflet-test');
  $this
    ->assertSession()
    ->elementExists('css', '.geolocation-map-container');
  $this
    ->assertSession()
    ->elementExists('css', '.geolocation-location');
  $result = $this
    ->assertSession()
    ->waitForElementVisible('css', 'img[title="Location 2"]');
  $this
    ->assertNotEmpty($result);
  $this
    ->getSession()
    ->getPage()
    ->find('css', 'img[title="Location 2"]')
    ->click();
  $this
    ->assertSession()
    ->elementExists('css', '.leaflet-popup-content');
}