1
# -*- coding: utf-8 -*-
3
# Copyright 2012 Canonical Ltd.
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 3, as published
7
# by the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12
# PURPOSE. See the GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License along
15
# with this program. If not, see <http://www.gnu.org/licenses/>.
17
"""Tear down actions for Ubuntu One sst tests."""
19
from sst.actions import *
20
from sst.actions import browser
22
import actions.header as header_actions
23
import actions.sso as sso_actions
27
if header_actions.is_logged_in():
28
_prevent_unsaved_data_confirmation()
29
header_actions.logout()
30
sso_actions.assert_logout()
32
def _prevent_unsaved_data_confirmation():
33
"""The browser might have unsaved data and ask for a confirmation before
34
logging out. This will prevent that dialog to appear.
37
browser.execute_script("window.onbeforeunload = function(e){};")