From 2dd8eb2505cf99021c4c20602f1a0812d3e7ca03 Mon Sep 17 00:00:00 2001
From: Vincent Massaro <vincent.massaro@yale.edu>
Date: Mon, 2 Jun 2014 14:37:54 -0500
Subject: [PATCH] add Stickyheader feature

Signed-off-by: Vincent Massaro <vincent.massaro@yale.edu>
---
 core/tests/Drupal/features/Stickyheader.feature         | 10 ++++++++++
 core/tests/Drupal/features/bootstrap/FeatureContext.php | 10 ++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 core/tests/Drupal/features/Stickyheader.feature

diff --git a/core/tests/Drupal/features/Stickyheader.feature b/core/tests/Drupal/features/Stickyheader.feature
new file mode 100644
index 0000000..d9f5574
--- /dev/null
+++ b/core/tests/Drupal/features/Stickyheader.feature
@@ -0,0 +1,10 @@
+Feature: Stickyheader
+  The sticky header provides a table header when scrolling.
+
+  @api @javascript
+  Scenario: Sticky header is in the right place when scrolling
+    Given I am logged in as a user with the "administrator" role
+    And I am on "/admin/people/permissions"
+    And I scroll to the bottom of the page
+    # Clean up.
+    And I click "Manage"
diff --git a/core/tests/Drupal/features/bootstrap/FeatureContext.php b/core/tests/Drupal/features/bootstrap/FeatureContext.php
index 6b8a2fe..1922f4b 100644
--- a/core/tests/Drupal/features/bootstrap/FeatureContext.php
+++ b/core/tests/Drupal/features/bootstrap/FeatureContext.php
@@ -21,4 +21,14 @@ public function iClickTheElementWithCssSelector($css_selector) {
     }
     $element->click();
   }
+
+  /**
+   * @todo window scroll event does not seem to be firing.
+   * @Then /^I scroll to the bottom of the page$/
+   */
+  public function iScrollToTheBottomOfThePage() {
+    $this->getSession()->wait(5000,
+      "window.scrollTo(0,document.body.scrollHeight);"
+    );
+  }
 }
-- 
1.9.1

