2015-03-23 11:36:12 +00:00
# Copyright (C) 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2017-01-09 02:09:07 +00:00
from . base import UITestCase
2015-03-23 11:36:12 +00:00
2017-01-09 02:09:07 +00:00
class NetworkTestCase ( UITestCase ) :
2015-05-30 11:20:59 +00:00
def check_hostname_entry ( self , spoke ) :
2015-03-23 11:36:12 +00:00
# Only the live install hint and hostname box should be visible.
2015-05-30 11:20:59 +00:00
self . assertTrue ( self . find ( " Please use the live desktop environment ' s tools for customizing your network configuration. You can set the host name here. " , node = spoke ) . showing )
2015-03-23 11:36:12 +00:00
2015-05-30 11:20:59 +00:00
box = self . find ( " Network Config Box " , node = spoke )
2015-03-23 11:36:12 +00:00
self . assertIsNotNone ( box , " Network Config box not found " )
self . assertFalse ( box . showing , msg = " Network Config box should not be displayed " )
2015-05-30 11:20:59 +00:00
box = self . find ( " More Network Config Box " , node = spoke )
2015-03-23 11:36:12 +00:00
self . assertIsNotNone ( box , " More Network Config box not found " )
self . assertFalse ( box . showing , msg = " More Network Config box should not be displayed " )
2015-05-30 11:20:59 +00:00
entry = self . find ( " Host Name " , " text " , node = spoke )
2015-03-23 11:36:12 +00:00
self . assertIsNotNone ( entry , " Hostname entry not found " )
self . assertTrue ( entry . showing , msg = " Hostname entry should be displayed " )
2017-01-09 02:09:07 +00:00
entry . grabFocus ( )
entry . text = " localhost "
2015-03-23 11:36:12 +00:00
def _run ( self ) :
# First, we need to click on the network spoke selector.
2015-05-30 11:20:59 +00:00
self . enter_spoke ( " NETWORK & HOST NAME " )
2015-03-23 11:36:12 +00:00
# Now verify we are on the right screen.
2015-05-30 11:20:59 +00:00
w = self . check_window_displayed ( " NETWORK & HOST NAME " )
2015-03-23 11:36:12 +00:00
# And now we can check everything else on the screen.
2015-05-30 11:20:59 +00:00
self . check_help_button ( w )
self . check_hostname_entry ( w )
2015-03-23 11:36:12 +00:00
# And then we click the Done button to go back to the hub, verifying
# that's where we ended up.
2015-05-30 11:20:59 +00:00
self . exit_spoke ( node = w )