--- tests/gui/make_livecd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/gui/make_livecd.sh b/tests/gui/make_livecd.sh index f242a1c..0709a11 100755 --- a/tests/gui/make_livecd.sh +++ b/tests/gui/make_livecd.sh @@ -54,9 +54,9 @@ REPO="$3" # (1) Remove the first two / partitions we inherit. # (2) Remove rawhide as a repo because it's already the installation source. # (3) Don't remove /boot/initramfs*. Do what now? -ksflatten anaconda-autogui-testing.ks | sed -e '|part /.*--size=3.*|,+1 d' \ - -e '/repo --name="rawhide"/ d' \ - -e '/^# save a little/,+1 d' > livecd.ks +ksflatten -c anaconda-autogui-testing.ks | sed -e '|part /.*--size=3.*|,+1 d' \ + -e '/repo --name="rawhide"/ d' \ + -e '/^# save a little/,+1 d' > livecd.ks
# Add a repo location for the updated anaconda RPMs. echo -e "\nrepo --name=updated-anaconda --baseurl=${REPO}\n" >> livecd.ks
"make check" runs from the tests/ directory, which means it's not going to find the outside/ directory, nor is anything in the test itself going to find the files it's looking for. Thus, attempt to cd into the gui/ directory first. --- tests/gui/runtest.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/tests/gui/runtest.sh b/tests/gui/runtest.sh index c4a4a60..87f2ee7 100755 --- a/tests/gui/runtest.sh +++ b/tests/gui/runtest.sh @@ -18,6 +18,15 @@ # # Red Hat Author(s): Chris Lumens clumens@redhat.com
+function doit() { + nosetests -s \ + -v \ + --nologcapture \ + --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \ + --tc=liveImage:"$1" $2 \ + outside +} + # We require the test_config plugin for nose, which is not currently packaged # but is installable via pip. if [ -z "$(nosetests -p | grep test_config)" ]; then @@ -55,9 +64,13 @@ else EXTRA="" fi
-nosetests -s \ - -v \ - --nologcapture \ - --tc=resultsdir:$(mktemp -d --tmpdir=/var/tmp autogui-results-XXXXXX) \ - --tc=liveImage:"${LIVECD}" ${EXTRA} \ - outside +# If we're being called from "make check", we will be outside the gui test directory. +# Unfortunately, everything is written assuming that's where we will be. So cd there. +if [ -d gui ]; then + ( cd gui && doit "${LIVECD}" ${EXTRA} ) +elif [ -d outside ]; then + doit "${LIVECD}" ${EXTRA} +else + echo "Could not find test contents" + exit 3 +fi
--- tests/gui/inside/__init__.py | 4 ++-- tests/gui/inside/date_time.py | 14 +++++++------- tests/gui/inside/keyboard.py | 24 ++++++++++++------------ tests/gui/inside/network.py | 4 ++-- tests/gui/inside/progress.py | 6 +++--- tests/gui/inside/rootpassword.py | 6 +++--- tests/gui/inside/storage.py | 14 +++++++------- tests/gui/inside/summary.py | 2 +- tests/gui/inside/user.py | 10 +++++----- tests/gui/inside/welcome.py | 4 ++-- 10 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/tests/gui/inside/__init__.py b/tests/gui/inside/__init__.py index 3628a26..cf4cf90 100644 --- a/tests/gui/inside/__init__.py +++ b/tests/gui/inside/__init__.py @@ -156,7 +156,7 @@ class UITestCase(unittest.TestCase): """Verify that a button with the given name exists and is sensitive, and then click it. """ - b = self.find(name, "button") + b = self.find(name, "push button") self.assertIsNotNone(b, msg="%s button not found" % name) self.assertTrue(b.sensitive, msg="%s button should be sensitive" % name) b.click() @@ -175,7 +175,7 @@ class UITestCase(unittest.TestCase): are off the summary hub, that's the default. If we are not back on the hub, the current test case will be failed. """ - button = self.find("Done", "button") + button = self.find("_Done", "push button") self.assertIsNotNone(button, msg="Done button not found") button.click() doDelay(5) diff --git a/tests/gui/inside/date_time.py b/tests/gui/inside/date_time.py index 3b4a6ff..b7cc72e 100644 --- a/tests/gui/inside/date_time.py +++ b/tests/gui/inside/date_time.py @@ -20,28 +20,28 @@ from . import UITestCase class LiveCDDateTimeTestCase(UITestCase): def check_region_city(self): # FIXME: This encodes default information. - entry = self.find("Region", "textentry") + entry = self.find("Region", "text") self.assertIsNotNone(entry, "Region entry does not exist") self.assertEqual(entry.text, "Americas", msg="Region should be set to default")
- entry = self.find("City", "textentry") + entry = self.find("City", "text") self.assertIsNotNone(entry, "City entry does not exist") self.assertEqual(entry.text, "New York", msg="City should be set to default")
def check_ntp(self): # NTP should be enabled given that we started up with networking. # FIXME: This encodes default information. - button = self.find("Use Network Time", "button") + button = self.find("Use Network Time", "toggle button") self.assertIsNotNone(button, msg="Use Network Time button not found") self.assertTrue(button.checked, msg="NTP should be enabled")
- button = self.find("Configure NTP", "button") + button = self.find("Configure NTP", "push button") self.assertIsNotNone(button, msg="Configure NTP button not found") self.assertTrue(button.sensitive, msg="Configure NTP button should be sensitive")
- button = self.find("Set Date & Time", "button") - self.assertIsNotNone(button, msg="Set Date & Time button not found") - self.assertFalse(button.sensitive, msg="Date & Time region should not be sensitive") + area = self.find("Set Date & Time") + self.assertIsNotNone(area, msg="Set Date & Time not found") + self.assertFalse(area.sensitive, msg="Date & Time region should not be sensitive")
def _run(self): # First, we need to click on the network spoke selector. diff --git a/tests/gui/inside/keyboard.py b/tests/gui/inside/keyboard.py index a3a7a6b..b57773b 100644 --- a/tests/gui/inside/keyboard.py +++ b/tests/gui/inside/keyboard.py @@ -25,7 +25,7 @@ class BasicKeyboardTestCase(UITestCase):
def check_options_dialog(self): # Click the options button. - self.click_button("Layout Options") + self.click_button("Options") self.check_dialog_displayed("Layout Options") self.click_button("Cancel")
@@ -37,30 +37,30 @@ class BasicKeyboardTestCase(UITestCase): self.assertEqual(len(self._get_enabled_layouts(view)), 1, msg="An unexpected number of keyboard layouts are enabled")
def check_layout_buttons_initial(self): - button = self.find("Add layout", "button") + button = self.find("Add layout", "push button") self.assertIsNotNone(button, msg="Add layout button not found") self.assertTrue(button.sensitive, msg="Add layout button should be sensitive")
# When no layouts are selected in the view, none of these buttons mean anything. - button = self.find("Remove layout", "button") + button = self.find("Remove layout", "push button") self.assertIsNotNone(button, msg="Remove layout button not found") self.assertFalse(button.sensitive, msg="Remove layout button should not be sensitive")
- button = self.find("Move selected layout up", "button") + button = self.find("Move selected layout up", "push button") self.assertIsNotNone(button, msg="Move layout up button not found") self.assertFalse(button.sensitive, msg="Move layout up button should not be sensitive")
- button = self.find("Move selected layout down", "button") + button = self.find("Move selected layout down", "push button") self.assertIsNotNone(button, msg="Move layout down button not found") self.assertFalse(button.sensitive, msg="Move layout down button should not be sensitive")
- button = self.find("Preview layout", "button") + button = self.find("Preview layout", "push button") self.assertIsNotNone(button, msg="Preview layout button not found") self.assertFalse(button.sensitive, msg="Preview layout button should not be sensitive")
def check_add_layout_dialog(self): self.click_button("Add layout") - self.check_dialog_displayed("Add layout") + self.check_dialog_displayed("Add Layout") self.click_button("Cancel")
def check_layout_buttons_after_click(self): @@ -71,26 +71,26 @@ class BasicKeyboardTestCase(UITestCase): self.assertIsNotNone(view, msg="Selected Layouts view not found") view.children[1].click()
- button = self.find("Add layout", "button") + button = self.find("Add layout", "push button") self.assertIsNotNone(button, msg="Add layout button not found") self.assertTrue(button.sensitive, msg="Add layout button should be sensitive")
- button = self.find("Remove layout", "button") + button = self.find("Remove layout", "push button") self.assertIsNotNone(button, msg="Remove layout button not found") self.assertTrue(button.sensitive, msg="Remove layout button should be sensitive")
# These two should still not be sensitive - we've only got one layout. # We ensured that with check_num_layouts. # FIXME: This encodes default information. - button = self.find("Move selected layout up", "button") + button = self.find("Move selected layout up", "push button") self.assertIsNotNone(button, msg="Move layout up button not found") self.assertFalse(button.sensitive, msg="Move layout up button should not be sensitive")
- button = self.find("Move selected layout down", "button") + button = self.find("Move selected layout down", "push button") self.assertIsNotNone(button, msg="Move layout down button not found") self.assertFalse(button.sensitive, msg="Move layout down button should not be sensitive")
- button = self.find("Preview layout", "button") + button = self.find("Preview layout", "push button") self.assertIsNotNone(button, msg="Preview layout button not found") self.assertTrue(button.sensitive, msg="Preview layout button should be sensitive")
diff --git a/tests/gui/inside/network.py b/tests/gui/inside/network.py index 2112c94..6398230 100644 --- a/tests/gui/inside/network.py +++ b/tests/gui/inside/network.py @@ -20,7 +20,7 @@ from . import UITestCase class LiveCDNetworkTestCase(UITestCase): def check_hostname_entry(self): # Only the live install hint and hostname box should be visible. - self.assertTrue(self.ana.childLabelled("Please use the live desktop environment's tools for customizing your network configuration. You can set the hostname here.").showing) + self.assertTrue(self.find("Please use the live desktop environment's tools for customizing your network configuration. You can set the hostname here.").showing)
box = self.find("Network Config Box") self.assertIsNotNone(box, "Network Config box not found") @@ -30,7 +30,7 @@ class LiveCDNetworkTestCase(UITestCase): self.assertIsNotNone(box, "More Network Config box not found") self.assertFalse(box.showing, msg="More Network Config box should not be displayed")
- entry = self.find("Hostname", "textentry") + entry = self.find("Hostname", "text") self.assertIsNotNone(entry , "Hostname entry not found") self.assertTrue(entry.showing, msg="Hostname entry should be displayed")
diff --git a/tests/gui/inside/progress.py b/tests/gui/inside/progress.py index f640865..5d9976b 100644 --- a/tests/gui/inside/progress.py +++ b/tests/gui/inside/progress.py @@ -23,7 +23,7 @@ from . import UITestCase
class LiveCDProgressTestCase(UITestCase): def check_begin_installation_button(self): - button = self.find("Begin Installation", "button") + button = self.find("Begin Installation", "push button") self.assertIsNotNone(button, msg="Begin Installation button does not exist") self.assertTrue(button.sensitive, msg="Begin Installation button should be sensitive")
@@ -85,7 +85,7 @@ class LiveCDProgressTestCase(UITestCase): # If we got here, installation completed successfully. Since we've not # done a password or created a user yet, we still have to do that. The # finish configuration button should still be insensitive. - button = self.find("Finish configuration", "button") + button = self.find("Finish configuration", "push button") self.assertIsNotNone(button, msg="Finish configuration button not found") self.assertFalse(button.sensitive, msg="Finish Configuration button should not be sensitive")
@@ -112,7 +112,7 @@ class LiveCDFinishTestCase(UITestCase): signal.alarm(5*60)
while True: - button = self.find("Quit", "button") + button = self.find("Quit", "push button") if button: signal.alarm(0) break diff --git a/tests/gui/inside/rootpassword.py b/tests/gui/inside/rootpassword.py index d982ab7..c703e8a 100644 --- a/tests/gui/inside/rootpassword.py +++ b/tests/gui/inside/rootpassword.py @@ -24,7 +24,7 @@ class BasicRootPasswordTestCase(UITestCase): # The warning bar starts off telling us there's no password set. self.check_warning_bar("The password is empty")
- entry = self.find("Password", "textentry") + entry = self.find("Password", "text") self.assertIsNotNone(entry, msg="Password entry should be displayed") entry.grabFocus() entry.text = "asdfasdf" @@ -35,7 +35,7 @@ class BasicRootPasswordTestCase(UITestCase): self.check_warning_bar("it does not contain enough DIFFERENT characters")
# Let's confirm that terrible password. - entry = self.find("Confirm Password", "textentry") + entry = self.find("Confirm Password", "text") self.assertIsNotNone(entry, msg="Confirm password should be displayed") entry.grabFocus() entry.text = "asdfasdf" @@ -48,7 +48,7 @@ class BasicRootPasswordTestCase(UITestCase): def check_click_done(self): # Press the Done button once, which won't take us anywhere but will change the # warning label at the bottom. - self.click_button("Done") + self.click_button("_Done") self.check_warning_bar("Press Done again")
# Pressing Done again should take us back to the progress hub. diff --git a/tests/gui/inside/storage.py b/tests/gui/inside/storage.py index b8733a5..28768dd 100644 --- a/tests/gui/inside/storage.py +++ b/tests/gui/inside/storage.py @@ -59,15 +59,15 @@ class BasicStorageTestCase(UITestCase): pass
def check_storage_options(self): - button = self.find("Automatically configure partitioning.", "button") + button = self.find("Automatically configure partitioning.", "radio button") self.assertIsNotNone(button, msg="Autopart button not found") self.assertTrue(button.checked, msg="Autopart should be selected")
- button = self.find("I would like to make additional space available.", "button") + button = self.find("I would like to make additional space available.", "check box") self.assertIsNotNone(button, msg="Reclaim button not found") self.assertFalse(button.checked, msg="Reclaim button should not be selected")
- button = self.find("Encrypt my data.", "button") + button = self.find("Encrypt my data.", "check box") self.assertIsNotNone(button, msg="Encrypt button not found") self.assertFalse(button.checked, msg="Encrypt button should not be selected")
@@ -81,16 +81,16 @@ class BasicStorageTestCase(UITestCase): # Given that we attach a second disk to the system (for storing the test # suite and results), anaconda will not select disks by default. Thus, # the storage options panel should currently be insensitive. - button = self.find("Storage Options", "button") - self.assertIsNotNone(button, "Storage Options button not found") - self.assertFalse(button.sensitive, msg="Storage options should be insensitive") + area = self.find("Storage Options") + self.assertIsNotNone(area, "Storage Options not found") + self.assertFalse(area.sensitive, msg="Storage options should be insensitive")
# Select disk overviews. In the basic case, this means uninitialized # disks that we're going to do autopart on. self.check_select_disks()
# And now with disks selected, the storage options should be sensitive. - self.assertTrue(button.sensitive, msg="Storage options should be sensitive") + self.assertTrue(area.sensitive, msg="Storage options should be sensitive")
self.check_shopping_cart() self.check_storage_options() diff --git a/tests/gui/inside/summary.py b/tests/gui/inside/summary.py index 98988cf..46c25ab 100644 --- a/tests/gui/inside/summary.py +++ b/tests/gui/inside/summary.py @@ -36,7 +36,7 @@ class LiveCDSummaryTestCase(UITestCase): self.click_button("No")
def check_begin_installation_button(self): - button = self.find("Begin Installation", "button") + button = self.find("Begin Installation", "push button") self.assertIsNotNone(button, msg="Begin Installation button not found") self.assertTrue(button.showing, msg="Begin Installation button should be displayed") self.assertFalse(button.sensitive, msg="Begin Installation button should not be sensitive") diff --git a/tests/gui/inside/user.py b/tests/gui/inside/user.py index 70f2744..137ed90 100644 --- a/tests/gui/inside/user.py +++ b/tests/gui/inside/user.py @@ -19,13 +19,13 @@ from . import UITestCase
class BasicUserTestCase(UITestCase): def check_enter_name(self): - entry = self.find("Full Name", "textentry") + entry = self.find("Full Name", "text") self.assertIsNotNone(entry, msg="Full name entry not found") entry.grabFocus() entry.text = "Bobby Good User"
# We base the username on the full name entered - entry = self.find("Username", "textentry") + entry = self.find("Username", "text") self.assertIsNotNone(entry, msg="Username entry not found") self.assertEqual(entry.text, "buser", msg="Generated username does not match expectation")
@@ -33,7 +33,7 @@ class BasicUserTestCase(UITestCase): # The warning bar starts off telling us there's no password set. self.check_warning_bar("The password is empty")
- entry = self.find("Password", "textentry") + entry = self.find("Password", "text") self.assertIsNotNone(entry, msg="Password entry should be displayed") entry.grabFocus() entry.text = "asdfasdf" @@ -43,7 +43,7 @@ class BasicUserTestCase(UITestCase): self.check_warning_bar("it does not contain enough DIFFERENT characters")
# Let's confirm that terrible password. - entry = self.find("Confirm Password", "textentry") + entry = self.find("Confirm Password", "text") self.assertIsNotNone(entry, msg="Confirm password should be displayed") entry.grabFocus() entry.text = "asdfasdf" @@ -55,7 +55,7 @@ class BasicUserTestCase(UITestCase): def check_click_done(self): # Press the Done button once, which won't take us anywhere but will change the # warning label at the bottom. - self.click_button("Done") + self.click_button("_Done") self.check_warning_bar("Press Done again")
# Pressing Done again should take us back to the progress hub. diff --git a/tests/gui/inside/welcome.py b/tests/gui/inside/welcome.py index 70134f0..86dae38 100644 --- a/tests/gui/inside/welcome.py +++ b/tests/gui/inside/welcome.py @@ -44,12 +44,12 @@ class BasicWelcomeTestCase(UITestCase): # msg="Default locale (%s) is not selected")
def check_quit_button(self): - self.click_button("Quit") + self.click_button("_Quit") self.check_dialog_displayed("Quit") self.click_button("No")
def check_continue_button(self): - self.click_button("Continue") + self.click_button("_Continue") self.check_dialog_displayed("Beta Warn") self.click_button("I accept my fate.")
These all look good.
On Wed, 2014-05-28 at 16:54 -0400, Chris Lumens wrote:
tests/gui/make_livecd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/gui/make_livecd.sh b/tests/gui/make_livecd.sh index f242a1c..0709a11 100755 --- a/tests/gui/make_livecd.sh +++ b/tests/gui/make_livecd.sh @@ -54,9 +54,9 @@ REPO="$3" # (1) Remove the first two / partitions we inherit. # (2) Remove rawhide as a repo because it's already the installation source. # (3) Don't remove /boot/initramfs*. Do what now? -ksflatten anaconda-autogui-testing.ks | sed -e '|part /.*--size=3.*|,+1 d' \
-e '/repo --name="rawhide"/ d' \
-e '/^# save a little/,+1 d' > livecd.ks
+ksflatten -c anaconda-autogui-testing.ks | sed -e '|part /.*--size=3.*|,+1 d' \
-e '/repo --name="rawhide"/ d' \
-e '/^# save a little/,+1 d' > livecd.ks
# Add a repo location for the updated anaconda RPMs. echo -e "\nrepo --name=updated-anaconda --baseurl=${REPO}\n" >> livecd.ks
I think some note about why this change is necessary would be nice in the commit message.
anaconda-patches@lists.fedorahosted.org