forked from publiclab/plots2
-
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.
wip: refine print template (publiclab#8337)
* refine print template * add tests
- Loading branch information
1 parent
42f3e07
commit cecb4d5
Showing
9 changed files
with
83 additions
and
13 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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require "application_system_test_case" | ||
|
||
class PrintTest < ApplicationSystemTestCase | ||
|
||
test "open print in new tab for note" do | ||
visit nodes(:one).path | ||
find('#menu-btn').click() | ||
find("#print-new").click() | ||
assert page.driver.browser.window_handles.size == 2 | ||
end | ||
|
||
test "open print in new tab for wiki" do | ||
visit nodes(:wiki_page).path | ||
find('#menu-btn').click() | ||
find("#print-new").click() | ||
assert page.driver.browser.window_handles.size == 2 | ||
end | ||
|
||
test "check different elements in print for note" do | ||
visit "/notes/print/#{nodes(:sunny_day_note).nid}" | ||
take_screenshot | ||
assert_selector('#content-window blockquote p', text: "But my knees were far too weak To stand in your arms Without falling to your feet") | ||
assert_selector('#content-window table', text: "col0 col1 col2 col3\ncell cell cell cell\ncell cell cell cell\ncell cell cell cell\ncell cell cell cell") | ||
assert_selector('#content-window code', text: "code goes here") | ||
assert_selector('#content-window iframe', visible: true) | ||
end | ||
|
||
end |