diff --git a/protected/views/layouts/main.php b/protected/views/layouts/main.php
index 17b14ce9b0..22a81a0445 100644
--- a/protected/views/layouts/main.php
+++ b/protected/views/layouts/main.php
@@ -38,7 +38,7 @@
renderPartial('//shared/_matomo') ?>
-
+
renderPartial('//shared/_header');
?>
diff --git a/protected/views/shared/_printToggle.php b/protected/views/shared/_printToggle.php
new file mode 100644
index 0000000000..e184e3f555
--- /dev/null
+++ b/protected/views/shared/_printToggle.php
@@ -0,0 +1,52 @@
+ element, and updates the
+ * button’s label accordingly. Pressing the button flips the state, modifies
+ * the URL via `history.replaceState`, and reapplies the class without
+ * reloading the page.
+ *
+ * Usage (Yii 1.1):
+ * renderPartial('shared/_printToggle'); ?>
+ *
+ * Requirements:
+ * - Pages should provide CSS rules that target `body.print`.
+ */
+?>
+
+
diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php
index 8e1d14f9e6..51a689c622 100644
--- a/tests/_support/AcceptanceTester.php
+++ b/tests/_support/AcceptanceTester.php
@@ -451,4 +451,22 @@ public function iCannotSeeTheOptionSelectedFor($value, $id)
{
$this->dontSeeOptionIsSelected("#dataset-form select[id='$id']", $value);
}
+
+ /**
+ * @Then I should see header and footer
+ */
+ public function iShouldSeeHeaderAndFooter()
+ {
+ $this->seeElement('header');
+ $this->seeElement('footer');
+ }
+
+ /**
+ * @Then I should not see header and footer
+ */
+ public function iShouldNotSeeHeaderAndFooter()
+ {
+ $this->dontSeeElement('header');
+ $this->dontSeeElement('footer');
+ }
}
diff --git a/tests/acceptance/DatasetView.feature b/tests/acceptance/DatasetView.feature
index 7498a3aa5e..4b3ecfdc52 100644
--- a/tests/acceptance/DatasetView.feature
+++ b/tests/acceptance/DatasetView.feature
@@ -267,3 +267,55 @@ Feature: a user visit the dataset page
Given I have not signed in
When I am on "/dataset/100142"
Then I should see "Read the pre-print publication(s):"
+
+ @issue-152 @ok
+ Scenario: Show print view toggle button and switch to print view
+ Given I have not signed in
+ When I am on "/dataset/100006"
+ And I press the button "Print view"
+ Then I should be on "/dataset/100006?print=true"
+ And I should see "Web view"
+ And I should see "Currently in print view"
+ And I should not see header and footer
+
+ @issue-152 @ok
+ Scenario: Show print view without header or footer
+ Given I have not signed in
+ When I am on "/dataset/100006?print=true"
+ Then I should see "Web view"
+ And I should see "Currently in print view"
+ And I should not see header and footer
+
+ @issue-152 @ok
+ Scenario: Show full list of samples and files in print view
+ Given I have not signed in
+ When I am on "/dataset/100035?print=true"
+ And I follow "Show all 301 results"
+ And I wait "2" seconds
+ Then I should be on "/dataset/100035?print=true&full=true"
+ And I should see "Show less results"
+
+ @issue-152 @ok
+ Scenario: Hide full list of samples and files in print view
+ Given I have not signed in
+ When I am on "/dataset/100035?print=true&full=true"
+ And I follow "Show less results"
+ And I wait "2" seconds
+ Then I should be on "/dataset/100035?print=true"
+ And I should see "Show all 301 results"
+
+ @issue-152 @ok
+ Scenario: Show full list of samples and files from direct navigation
+ Given I have not signed in
+ When I am on "/dataset/100035?print=true&full=true"
+ Then I should see "Show less results"
+
+ @issue-152 @ok
+ Scenario: From print view return to web view
+ Given I have not signed in
+ When I am on "/dataset/100006?print=true"
+ And I press the button "Web view"
+ Then I should be on "/dataset/100006"
+ And I should see "Print view"
+ And I should see "Currently in web view"
+ And I should see header and footer
\ No newline at end of file