test: Add two pixel tests

This commit is contained in:
Marius Vollmer 2021-04-27 11:07:24 +03:00
parent 222f588056
commit 01de9c25c4
2 changed files with 7 additions and 2 deletions

View file

@ -20,16 +20,19 @@ class TestApplication(testlib.MachineCase):
b = self.browser
m = self.machine
hostname = "starterbox"
self.write_file("/etc/hostname", hostname)
self.login_and_go("/starter-kit")
# verify expected heading
b.wait_text(".pf-c-card__title", "Starter Kit")
# verify expected host name
hostname = m.execute("hostname").strip()
b.wait_in_text(".pf-c-alert__title", "Running on " + hostname)
b.assert_pixels(".pf-c-card__body", "hostname")
# change current hostname
self.write_file("/etc/hostname", "new-" + hostname)
m.write("/etc/hostname", "new-" + hostname)
# verify new hostname name
b.wait_in_text(".pf-c-alert__title", "Running on new-" + hostname)
@ -60,6 +63,7 @@ class TestApplication(testlib.MachineCase):
b.enter_page("/starter-kit")
# page label (from js) should be translated
b.wait_in_text(".pf-c-alert__title", "Läuft auf")
b.assert_pixels(".pf-c-card__body", "gastgebername")
if __name__ == '__main__':