diff --git a/frontend/tests/tests/user/test_application_label.js b/frontend/tests/tests/user/test_application_label.js
index f05c78724..f4b5667ac 100644
--- a/frontend/tests/tests/user/test_application_label.js
+++ b/frontend/tests/tests/user/test_application_label.js
@@ -42,7 +42,7 @@ QUnit.test("application name", function(assert) {
});
});
-QUnit.test("rendering stop button", function (assert) {
+QUnit.test("rendering quit button", function (assert) {
let done = assert.async();
assert.equal(
@@ -50,18 +50,18 @@ QUnit.test("rendering stop button", function (assert) {
model.appList[0].appData.image.ui_name
);
- // Test stop button disabled
+ // Test quit button disabled
assert.ok(
- appLabel.$el.querySelector('#stop-button').classList.contains('disabled-entry')
+ appLabel.$el.querySelector('#quit-button').classList.contains('disabled-entry')
);
// Select running application
model.selectedIndex = 1;
- // Test stop button enabled
+ // Test quit button enabled
Vue.nextTick(function() {
assert.notOk(
- appLabel.$el.querySelector('#stop-button').classList.contains('disabled-entry')
+ appLabel.$el.querySelector('#quit-button').classList.contains('disabled-entry')
);
done();
@@ -113,9 +113,9 @@ QUnit.test("rendering share button", function (assert) {
// Select running application
model.selectedIndex = 1;
- // Test share button disabled (Because clipboard save is not supported in test environment)
+ // Test share button enabled
Vue.nextTick(function() {
- assert.ok(
+ assert.notOk(
appLabel.$el.querySelector('#share-button').classList.contains('disabled-entry')
);
diff --git a/frontend/user/vue-components/ApplicationLabel.vue b/frontend/user/vue-components/ApplicationLabel.vue
index 592fa9718..35977e2d6 100644
--- a/frontend/user/vue-components/ApplicationLabel.vue
+++ b/frontend/user/vue-components/ApplicationLabel.vue
@@ -12,25 +12,25 @@
+
+
+
+
+
+
+
+
+
+
+ Are you sure you want to quit {{ currentApp.appData.image | appName }} ? (irreversible)
+
@@ -52,13 +78,11 @@
module.exports = Vue.extend({
data: function() {
- return { clipboardSupported: Clipboard.isSupported() };
+ return { shareDialog: {visible: false}, quitDialog: {visible: false} };
},
mounted: function() {
- if(this.clipboardSupported) {
- new Clipboard('#share-button');
- }
+ new Clipboard('#cp-clipboard-button');
},
computed: {
diff --git a/selenium_tests/UserDriverTest.py b/selenium_tests/UserDriverTest.py
index 23538d584..a2a594d3c 100644
--- a/selenium_tests/UserDriverTest.py
+++ b/selenium_tests/UserDriverTest.py
@@ -28,12 +28,13 @@ def open_application_settings(self):
"""
self.click_first_element_located(By.ID, "application-settings")
- def stop_application(self):
- """ Click on the stop button. It assumes that the application settings
- menu is opened and that the application is running. This will stop the
+ def quit_application(self):
+ """ Click on the quit button. It assumes that the application settings
+ menu is opened and that the application is running. This will quit the
currently selected application.
"""
- self.click_first_element_located(By.ID, "stop-button")
+ self.click_first_element_located(By.ID, "quit-button")
+ self.click_modal_footer_button("Ok")
def start_application(self):
""" Click on the start button. It assumes that the currently selected
@@ -62,17 +63,16 @@ def running_container(self, index=0):
application is stopped at the end.
"""
self.wait_until_application_list_loaded()
-
self.select_application(index)
self.start_application()
-
+ self.wait_until_application_running()
try:
yield
finally:
self.select_application(index)
self.wait_until_application_running()
self.open_application_settings()
- self.stop_application()
+ self.quit_application()
self.wait_until_application_stopped()
def tearDown(self):
diff --git a/selenium_tests/test_share_application.py b/selenium_tests/test_share_application.py
new file mode 100644
index 000000000..17218e441
--- /dev/null
+++ b/selenium_tests/test_share_application.py
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+from selenium_tests.UserDriverTest import UserDriverTest
+from selenium.webdriver.common.by import By
+from selenium.webdriver.common.keys import Keys
+
+
+class TestShareApplication(UserDriverTest):
+ def test_share_modal(self):
+ with self.running_container():
+ self.open_application_settings()
+
+ self.click_first_element_located(By.ID, "share-button")
+
+ self.click_modal_footer_button("Close")
+
+ def test_share_button(self):
+ with self.running_container():
+ self.open_application_settings()
+
+ self.click_first_element_located(By.ID, "share-button")
+
+ self.click_first_element_located(By.ID, "cp-clipboard-button")
+
+ # Now the share url should be in the clipboard
+ input_element = self.driver.find_element_by_id("shared-url")
+
+ # Clear the input element and paste what is in the clipboard in
+ # order to retrieve it (lacking better way to retrieve the clipboard
+ # value)
+ input_element.clear()
+ input_element.send_keys(Keys.CONTROL, 'v')
+ clipboard_value = input_element.get_attribute("value")
+
+ # Go to the shared url
+ self.driver.get(clipboard_value)
+ self.wait_until_presence_of_element_located(By.ID, "noVNC_screen")
+
+ # Go back to simphony-remote
+ self.driver.back()
+ self.wait_until_application_list_loaded()
diff --git a/selenium_tests/test_start_stop_container.py b/selenium_tests/test_start_stop_container.py
index b8e005206..4b5000636 100644
--- a/selenium_tests/test_start_stop_container.py
+++ b/selenium_tests/test_start_stop_container.py
@@ -12,7 +12,7 @@ def test_start_stop_container(self):
self.wait_until_application_running()
self.open_application_settings()
- self.stop_application()
+ self.quit_application()
self.wait_until_application_stopped()
def test_focus(self):