#!/usr/bin/python3## Copyright (C) 2022 Red Hat, Inc.# SPDX-License-Identifier: LGPL-2.1-or-laterfrom anacondalib import INSTALLER_VM_MEMORY_MB, VirtInstallMachineCase, pixel_tests_ignorefrom installer import Installerfrom progress import Progressfrom storage import Storagefrom testlib import test_main # pylint: disable=import-errorfrom utils import get_pretty_nameclass TestInstallationProgress(VirtInstallMachineCase):provision = {"machine1": {"memory_mb": INSTALLER_VM_MEMORY_MB}}def testBasic(self):"""Description:Verify the installation progress pageExpected results:- The installation steps are displayed in the correct order- After reloading the page, the UI reconnects to the ongoing installation- The 'Successfully installed' message is displayed at the end of the installation- The 'Modify Storage' option is not available from the kebab menu"""b = self.browserm = self.machinei = Installer(b, self.machine)p = Progress(b)_s = Storage(b, self.machine) # noqa: F841i.open()i.reach(i.steps.REVIEW)i.begin_installation(needs_confirmation=False)with b.wait_timeout(300):b.wait_in_text("h2", "Installing")# Wait until payload step transition to "in progress" to verify reconnect. This particular step# was chosen because it should take longer than others to run - making it less prone to race# when reloadingpayload_status_selector = "p[data-ouia-component-id='anaconda-screen-progress-step-payload-phase']"with b.wait_timeout(100):b.wait_in_text(payload_status_selector, "In progress")# Reload the page while installation is running to verify reconnectb.reload()b.wait_visible(".pf-v6-c-progress-stepper")b.wait_in_text(payload_status_selector, "In progress")p.wait_done()b.wait_in_text("h2", "Successfully installed")b.wait_in_text(".pf-v6-c-empty-state", f"To begin using {get_pretty_name(m)}, reboot your system")# Reload the page on success to make sure reconnect also works hereb.reload()b.wait_in_text("h2", "Successfully installed")b.wait_in_text(".pf-v6-c-empty-state", f"To begin using {get_pretty_name(m)}, reboot your system")# Pixel test the complete progress stepb.assert_pixels("#app","installation-progress-complete",ignore=[*pixel_tests_ignore, "#anaconda-screen-progress-step-done-description"])self.handleReboot()if __name__ == '__main__':test_main()