diff --git a/muk_web_preview/__manifest__.py b/muk_web_preview/__manifest__.py
index 095971d..99a09d1 100644
--- a/muk_web_preview/__manifest__.py
+++ b/muk_web_preview/__manifest__.py
@@ -45,6 +45,7 @@
"template/assets.xml",
],
"demo": [
+ "demo/preview_demo.xml",
],
"qweb": [
"static/src/xml/*.xml",
diff --git a/muk_web_preview/demo/data/sample.pdf b/muk_web_preview/demo/data/sample.pdf
new file mode 100644
index 0000000..99d31ce
Binary files /dev/null and b/muk_web_preview/demo/data/sample.pdf differ
diff --git a/muk_web_preview/demo/preview_demo.xml b/muk_web_preview/demo/preview_demo.xml
new file mode 100644
index 0000000..b98a727
--- /dev/null
+++ b/muk_web_preview/demo/preview_demo.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+ sample.pdf
+ sample.pdf
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_preview/static/test/test.js b/muk_web_preview/static/test/test.js
new file mode 100644
index 0000000..7e6c17b
--- /dev/null
+++ b/muk_web_preview/static/test/test.js
@@ -0,0 +1,51 @@
+odoo.define('muk_web_preview.tour', function (require) {
+'use strict';
+
+var core = require("web.core");
+var tour = require("web_tour.tour");
+var base = require("web_editor.base");
+
+var _t = core._t;
+
+var name = 'preview';
+
+var options = {
+ test: true,
+ url: '/web',
+ wait_for: base.ready()
+}
+
+var setps = [
+ {
+ trigger: 'a.oe_menu_toggler[data-menu-xmlid="base.menu_administration"]',
+ run: 'click',
+ },{
+ trigger: 'a.oe_menu_toggler[data-menu-xmlid="base.next_id_9"]',
+ run: 'click',
+ },{
+ trigger: 'a.oe_menu_leaf[data-menu-xmlid="base.menu_action_attachment"]',
+ run: 'click',
+ },{
+ trigger: 'input.o_searchview_input',
+ extra_trigger: 'div.o_main_content > div.o_control_panel li.active:contains("Attachment")',
+ run: 'text sample.pdf',
+ },{
+ trigger: 'ul.o_searchview_autocomplete li a',
+ extra_trigger: 'div.o_main_content > div.o_control_panel li.active:contains("Attachment")',
+ run: 'click',
+ },{
+ trigger: 'td.o_data_cell:contains("sample.pdf")',
+ extra_trigger: 'div.o_main_content > div.o_control_panel li.active:contains("Attachment")',
+ run: 'click',
+ },{
+ trigger: 'button.o_binary_preview',
+ run: 'click',
+ },{
+ trigger: 'div.preview-body iframe',
+ run: function (actions) {},
+ }
+];
+
+tour.register(name, options, setps);
+
+});
\ No newline at end of file
diff --git a/muk_web_preview/template/assets.xml b/muk_web_preview/template/assets.xml
index 805aedf..cae12e7 100644
--- a/muk_web_preview/template/assets.xml
+++ b/muk_web_preview/template/assets.xml
@@ -31,4 +31,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_preview/tests/__init__.py b/muk_web_preview/tests/__init__.py
new file mode 100644
index 0000000..9e1dd22
--- /dev/null
+++ b/muk_web_preview/tests/__init__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+
+###################################################################################
+#
+# Copyright (C) 2017 MuK IT GmbH
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+###################################################################################
+
+from . import test_preview
+
diff --git a/muk_web_preview/tests/test_preview.py b/muk_web_preview/tests/test_preview.py
new file mode 100644
index 0000000..de50375
--- /dev/null
+++ b/muk_web_preview/tests/test_preview.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+
+###################################################################################
+#
+# Copyright (C) 2017 MuK IT GmbH
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+###################################################################################
+
+import os
+import base64
+import logging
+import unittest
+
+from odoo import _
+from odoo.tests import common
+
+class PreviewTestCase(common.HttpCase):
+
+ at_install = False
+ post_install = True
+
+ def setUp(self):
+ super(PreviewTestCase, self).setUp()
+
+ def tearDown(self):
+ super(PreviewTestCase, self).tearDown()
+
+ def test_preview(self):
+ self.phantom_js("/web",
+ "odoo.__DEBUG__.services['web_tour.tour'].run('preview')",
+ "odoo.__DEBUG__.services['web_tour.tour'].tours.preview.ready",
+ login="admin")
+
\ No newline at end of file