def testShouldCheckAddonLabel(self, mozwebqa):
        #This test is to check the labels of an add-on on the dashboard
        #Create page objects
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboardpage_obj = DashboardPage(mozwebqa)
        addonpage_obj = AddonEditorPage(mozwebqa)

        loginpage_obj.login()

        #Create an addon. Then go to dashboard and assert that the label is 'initial'.
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_addon_btn()
        addon_name = addonpage_obj.addon_name

        homepage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.is_the_current_page)
        Assert.true(dashboardpage_obj.addon(addon_name).is_displayed, "Addon %s not found" % addon_name)

        #Click on the edit button of the addon.Then create a copy of that addon and assert that the label is 'copy'
        dashboardpage_obj.addon(addon_name).click_edit()
        addonpage_obj.click_copy()
        copy_addon_name = addonpage_obj.addon_name

        try:
            Assert.not_equal(addon_name, copy_addon_name)
        except:
            print 'A copy of the addon could not be created'
        homepage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.addon(copy_addon_name).is_displayed, "Addon %s not found" % copy_addon_name)

        dashboardpage_obj.delete_test_data()
    def testShouldCheckLibDelete(self, testsetup):

        homepage_obj = home_page.HomePage(testsetup)
        loginpage_obj = login_page.LoginPage(testsetup)
        dashboardpage_obj = dashboard_page.DashboardPage(testsetup)
        libpage_obj = lib_editor_page.LibraryEditorPage(testsetup)
        username = ""
        password = ""
        
        homepage_obj.go_to_home_page()

        homepage_obj.click_create_lib_btn()
        loginpage_obj.login(username, password)
        lib_name = libpage_obj.get_lib_name()
        print lib_name
        homepage_obj.click_myaccount()
        dashboardpage_obj.go_to_public_libs_page()
        top_lib_name = dashboardpage_obj.get_top_lib_name()
        print top_lib_name

        dashboardpage_obj.click_lib_delete()
        dashboardpage_obj.confirm_delete()
        top_lib_name_after_delete = dashboardpage_obj.get_top_lib_name()
        Assert.not_equal(top_lib_name, top_lib_name_after_delete)
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_lib_btn()
        new_lib_name = libpage_obj.get_lib_name()
        print new_lib_name
        Assert.equal(new_lib_name, lib_name)
 def testShouldCheckLibraryLabel(self, testsetup):
     #This test is to check the labels of a library on the dashboard
     #Create page objects
     homepage_obj = home_page.HomePage(testsetup)
     loginpage_obj = login_page.LoginPage(testsetup)
     dashboardpage_obj = dashboard_page.DashboardPage(testsetup)
     libpage_obj = lib_editor_page.LibraryEditorPage(testsetup)
     username = ""
     password = ""
     
     #Create a library. Then go to dashoard and assert that the label is 'initial'. 
     homepage_obj.go_to_home_page()
     homepage_obj.click_create_lib_btn()
     loginpage_obj.login(username, password)
     lib_name = libpage_obj.get_lib_name()
     text_lib = lib_name
     homepage_obj.click_myaccount()
     Assert.equal("Dashboard - Add-on Builder", dashboardpage_obj.get_page_title())
     label_name = dashboardpage_obj.get_lib_label_name()
     Assert.true("initial" in label_name.text)
     
     #Click on the edit button of the library.Then create a copy of that library and assert that the label is 'copy'
     dashboardpage_obj.navigate_to_lib_editor()
     libpage_obj.click_copy_btn()
     copy_lib_name = libpage_obj.get_lib_name()
     text_copy_lib = copy_lib_name
     try:
         Assert.not_equal(text_lib, text_copy_lib)
     except:
         print 'A copy of the addon could not be created'
     homepage_obj.click_myaccount()
     label_name = dashboardpage_obj.get_lib_label_name()
     Assert.true("copy" in label_name.text)
    def testShouldCheckAddonDelete(self, testsetup):
        homepage_obj = home_page.HomePage(testsetup)
        loginpage_obj = login_page.LoginPage(testsetup)
        dashboardpage_obj = dashboard_page.DashboardPage(testsetup)
        addonpage_obj = addon_editor_page.AddonEditorPage(testsetup)
        username = ""
        password = ""

        homepage_obj.go_to_home_page()
        homepage_obj.click_create_addon_btn()
        loginpage_obj.login(username, password)
        #Get the name of the addon on the editor page.
        addon_name = addonpage_obj.get_addon_name()

        #Go the the dashboard and delete the addon that you just created. Then check that the addon at the top of the list is not the same as the one you just deleted.
        homepage_obj.click_myaccount()
        top_addon_name = dashboardpage_obj.get_top_addon_name()
        dashboardpage_obj.click_addon_delete()
        dashboardpage_obj.confirm_delete()
        top_addon_name_after_delete = dashboardpage_obj.get_top_addon_name()
        Assert.not_equal(top_addon_name, top_addon_name_after_delete)
        
        #Go to homepage and create a new addon and check that its name is the same as the one that was just deleted.
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_addon_btn()
        new_addon_name = addonpage_obj.get_addon_name()
        print new_addon_name
        Assert.equal(new_addon_name, addon_name)
 def test_that_top_changers_data_is_available(self, mozwebqa):
     '''
     https://www.pivotaltracker.com/story/show/18059119
     '''
     csp = CrashStatsHomePage(mozwebqa)
     cstc = csp.header.select_report('Top Changers')
     Assert.not_equal('Top changers currently unavailable', cstc.page_heading)
    def test_hide_email_checkbox_works(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login("browserID")

        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.header.is_user_logged_in)

        view_profile_page = home_page.header.click_view_profile()
        initial_state = view_profile_page.is_email_field_present

        edit_profile_page = home_page.header.click_edit_profile()
        edit_profile_page.change_hide_email_state()
        edit_profile_page.click_update_account()

        view_profile_page = home_page.header.click_view_profile()
        final_state = view_profile_page.is_email_field_present

        try:
            Assert.not_equal(initial_state, final_state, 'The initial and final states are the same. The profile change failed.')
            if final_state is True:
                credentials = mozwebqa.credentials['default']
                Assert.equal(credentials['email'], view_profile_page.email_value, 'Actual value is not equal with the expected one.')

        except Exception as exception:
            Assert.fail(exception.msg)

        finally:
            if initial_state != final_state:
                edit_profile_page = home_page.header.click_edit_profile()
                edit_profile_page.change_hide_email_state()
                edit_profile_page.click_update_account()
                view_profile_page = home_page.header.click_view_profile()

            Assert.equal(view_profile_page.is_email_field_present, initial_state, 'Could not restore profile to initial state.')
    def test_that_purchases_an_app_without_pre_auth_and_requests_a_refund(self, mozwebqa):
        """Litmus 58166"""
        user = MockUser()
        home_page = Home(mozwebqa)

        home_page.go_to_homepage()
        home_page.create_new_user(user)
        home_page.login(user)

        Assert.true(home_page.is_the_current_page)

        search_page = home_page.header.search(self._app_name)
        Assert.true(search_page.is_the_current_page)

        Assert.not_equal("FREE", search_page.results[0].price)
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_app_available_for_purchase)

        pre_aproval_region = details_page.click_purchase()

        paypal_frame = pre_aproval_region.click_one_time_payment()

        paypal_popup = paypal_frame.login_to_paypal()
        Assert.true(paypal_popup.is_user_logged_into_paypal)

        try:
            # From this point on we have payed for the app so we have to request a refund
            paypal_popup.click_pay()
            paypal_popup.close_paypal_popup()

            Assert.true(details_page.is_app_installing)
        except Exception as exception:
            Assert.fail(exception)
        finally:
            self.request_refund_procedure(mozwebqa, self._app_name)
    def testShouldCheckLibraryLabel(self, mozwebqa):
        #This test is to check the labels of a library on the dashboard
        #Create page objects
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboardpage_obj = DashboardPage(mozwebqa)
        libpage_obj = LibraryEditorPage(mozwebqa)

        loginpage_obj.login()

        #Create a library. Then go to dashboard and assert that the label is present.
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_lib_btn()
        library_name = libpage_obj.library_name

        libpage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.is_the_current_page)
        Assert.true(dashboardpage_obj.library(library_name).is_displayed, "Library %s not found" % library_name)

        #Click on the edit button of the library.Then create a copy of that library and assert that the label is 'copy'
        dashboardpage_obj.library(library_name).click_edit()
        libpage_obj.click_copy()
        copy_library_name = libpage_obj.library_name

        try:
            Assert.not_equal(library_name, copy_library_name)
        except:
            print 'A copy of the library could not be created'
        libpage_obj.header.click_dashboard()

        Assert.true(dashboardpage_obj.library(copy_library_name).is_displayed, "Library %s not found" % copy_library_name)
        
        dashboardpage_obj.delete_test_data()
    def test_that_checks_changing_language(self, mozwebqa):

        if mozwebqa.base_url == 'https://marketplace-dev.allizom.org' or mozwebqa.base_url == 'https://marketplace.allizom.org':
            pytest.skip("We currently don't have the option for changing the language in Fireplace")

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.login()

        profile_page = home_page.header.click_edit_account_settings()

        language = 'fr'

        before_lang_change = [profile_page.get_url_current_page(),
                            profile_page.page_title,
                            profile_page.account_settings_header_text,
                            profile_page.display_name_field_text,
                            profile_page.language_field_text,
                            profile_page.region_field_text,
                            profile_page.header.search_field_placeholder,
                            profile_page.save_button_text]

        profile_page.edit_language(language)
        profile_page.save_changes()

        after_lang_change = [profile_page.get_url_current_page(),
                            profile_page.page_title,
                            profile_page.account_settings_header_text,
                            profile_page.display_name_field_text,
                            profile_page.language_field_text,
                            profile_page.region_field_text,
                            profile_page.header.search_field_placeholder,
                            profile_page.save_button_text]

        Assert.not_equal(before_lang_change, after_lang_change)
    def test_NumberFormatException_forInputString(self, mozwebqa):
        """
        Regression Test for bz786963
        """
        home_page = Home(mozwebqa)
        sysapi = ApiTasks(mozwebqa)
        
        new_org_name = "manifest-%s" % home_page.random_string()
        sysapi.create_org(new_org_name)
        
        home_page.login()

        home_page.header.click_switcher()
        home_page.header.filter_org_in_switcher(new_org_name)
        home_page.header.click_filtered_result(new_org_name)

        cm = ContentManagementTab(mozwebqa)
        home_page.tabs.click_tab("content_management_tab")

        if home_page.project == "katello" or home_page.project == "cfse":
            cm.click_content_providers()
            cm.select_redhat_content_provider()

        cm.enter_manifest(os.path.realpath(self._bz786963_manifest))
        Assert.true(home_page.is_successful)
        Assert.not_equal(cm.get_content_table_text, "No subscriptions have been imported.")
    def test_start_from_suspend(
            self,
            load_vm_details,
            provider,
            vm_name,
            verify_vm_suspended,
            mgmt_sys_api_clients):
        '''Test power_on operation on a suspended vm.

        Verify vm transitions to running. ''' 

        vm_details = load_vm_details
        vm_details.wait_for_vm_state_change('suspended', 10)
        last_boot_time = vm_details.last_boot_time
        state_chg_time = vm_details.last_pwr_state_change
        vm_details.power_button.power_on()
        vm_details.wait_for_vm_state_change('on', 15)
        Assert.equal(vm_details.power_state, 'on', "power state incorrect" )
        self._wait_for_last_boot_timestamp_refresh(
                vm_details,
                last_boot_time,
                timeout_in_minutes=3)
        Assert.not_equal(vm_details.last_boot_time, last_boot_time,
                "last boot time updated")
        Assert.not_equal(vm_details.last_pwr_state_change, state_chg_time,
                "last state chg time failed to update")
        Assert.true(mgmt_sys_api_clients[provider].is_vm_running(vm_name),
                "vm not running")
 def test_suspend(
         self,
         provider,
         vm_name,
         verify_vm_running,
         mgmt_sys_api_clients,
         register_event,
         load_vm_details):
     """ Test suspend operation from a vm details page.  Verify vm
     transitions to suspended. """
     vm_details = load_vm_details
     vm_details.wait_for_vm_state_change('on', 10)
     state_chg_time = vm_details.last_pwr_state_change
     register_event(get_sys_type(provider), "vm", vm_name, ["vm_suspend_req", "vm_suspend"])
     vm_details.power_button.suspend()
     try:
         vm_details.wait_for_vm_state_change('suspended', 10)
     except TimedOutError:
         logger.warning('working around bz977489 by clicking the refresh button')
         vm_details.config_button.refresh_relationships()
         vm_details.wait_for_vm_state_change('suspended', 5)
     Assert.equal(vm_details.power_state, 'suspended',
             "power state incorrect")
     Assert.not_equal(vm_details.last_pwr_state_change, state_chg_time,
             "last state chg time failed to update")
     Assert.true(mgmt_sys_api_clients[provider].is_vm_suspended(vm_name),
             "vm not suspended")
    def test_load_new_manifest_into_same_org_wo_force(self, mozwebqa):
        '''
        Scenario 5: Load updated (new) manifest into org where a manifest already exists.
        Result: Pass
        '''
        sysapi = ApiTasks(mozwebqa)
        home_page = Home(mozwebqa)
        
        new_org_name = "manifest-%s" % home_page.random_string()
        sysapi.create_org(new_org_name)
        
        home_page.login()

        home_page.header.click_switcher()
        home_page.header.filter_org_in_switcher(new_org_name)
        home_page.header.click_filtered_result(new_org_name)

        cm = ContentManagementTab(mozwebqa)
        home_page.tabs.click_tab("content_management_tab")

        if home_page.project == "katello" or home_page.project == "cfse":
            cm.click_content_providers()
            cm.select_redhat_content_provider()

        cm.enter_manifest(os.path.realpath(self._scenario5_o1_m1_manifest))
        cm.enter_manifest(os.path.realpath(self._scenario5_o1_m2_manifest))
        
        Assert.true(home_page.is_successful)
        Assert.not_equal(cm.get_content_table_text, "No subscriptions have been imported.")
    def testShouldCheckLibDeactivateAndActivate(self, testsetup):
        homepage_obj = home_page.HomePage(testsetup)
        loginpage_obj = login_page.LoginPage(testsetup)
        dashboardpage_obj = dashboard_page.DashboardPage(testsetup)
        privatepage_obj = dashboard_private_page.DashboardPrivatePage(testsetup)
        username = "******"
        password = ""
        
        homepage_obj.go_to_home_page()
        homepage_obj.click_signin()
        loginpage_obj.login(username, password)
        Assert.equal("Dashboard - Add-on Builder", dashboardpage_obj.get_page_title())
        
        #Get the name of the library present at the top of the library list on dashboard.
        #This will be used to compare whether the library is removed from the top of list after making it private
        lib_name = dashboardpage_obj.get_top_lib_name()
        
        #Click on the private button to make it private and then check that the library is not in the list anymore
        dashboardpage_obj.click_lib_mkprivate_btn()
        new_top_lib_name = dashboardpage_obj.get_top_lib_name()
        Assert.not_equal(lib_name, new_top_lib_name)
        dashboardpage_obj.go_to_private_libs_page()

        #Go to the private libraries page and check that the library that you just made private is present there.
        #Click on public to make it public and check on the dashboard that the library is present there.
        priv_lib_name = privatepage_obj.get_top_lib_name()
        #text_priv_addon = priv_addon_name.text
        #print text_priv_addon
        Assert.equal(lib_name, priv_lib_name)
        privatepage_obj.click_lib_mkpublic_btn()
        new_priv_top_lib_name = privatepage_obj.get_top_lib_name()
        Assert.not_equal(priv_lib_name, new_priv_top_lib_name)
        privatepage_obj.go_to_dashboard()
        top_lib = dashboardpage_obj.get_top_lib_name()
        Assert.equal(priv_lib_name, top_lib)
    def test_that_purchases_an_app_without_pre_auth_and_requests_a_refund(self, mozwebqa):
        """Litmus 58166"""
        home_page = Home(mozwebqa)

        home_page.go_to_homepage()
        home_page.login()

        Assert.true(home_page.is_the_current_page)

        search_page = home_page.header.search(self._app_name)
        Assert.true(search_page.is_the_current_page)

        Assert.not_equal("FREE", search_page.results[0].price)
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_app_available_for_purchase)

        pre_approval_region = details_page.click_purchase()

        paypal_frame = pre_approval_region.click_one_time_payment()

        paypal_popup = paypal_frame.login_to_paypal()
        Assert.true(paypal_popup.is_user_logged_into_paypal)

        try:
            # From this point on we have payed for the app so we have to request a refund
            paypal_popup.click_pay()
            paypal_popup.close_paypal_popup()

            Assert.true(details_page.is_app_installing)
        except Exception as exception:
            Assert.fail(exception)
        finally:
            self.request_refund_procedure(mozwebqa, self._app_name)
Example #16
0
def test_phantom_login(mozwebqa):
    """https://bugzilla.redhat.com/show_bug.cgi?id=996284"""
    login_pg = LoginPage(mozwebqa)
    login_pg.go_to_login_page()
    next_pg = login_pg.login_and_send_window_size()
    Assert.not_equal(next_pg.get_context_current_page(), '/',
        "Phantom Login - Got redirected back to the login page after logging in")
    def test_that_checks_changing_language_on_home_page(self, mozwebqa):
        """Test for https://www.pivotaltracker.com/story/show/33702365"""

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        before_lang_change = [home_page.get_url_current_page(),
                            home_page.page_title,
                            home_page.featured_section_title_text,
                            home_page.most_popular_section_title_text,
                            home_page.categories.title,
                            home_page.header.search_field_placeholder,
                            home_page.footer.select_lang_label_text]

        home_page.footer.switch_to_another_language('ru')

        after_lang_change = [home_page.get_url_current_page(),
                            home_page.page_title,
                            home_page.featured_section_title_text,
                            home_page.most_popular_section_title_text,
                            home_page.categories.title,
                            home_page.header.search_field_placeholder,
                            home_page.footer.select_lang_label_text]

        Assert.not_equal(before_lang_change, after_lang_change)
    def test_that_checks_changing_language(self, mozwebqa):
        """Test for https://www.pivotaltracker.com/story/show/33702365"""

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.login()

        profile_page = home_page.header.click_account_settings()

        language = 'fr'

        before_lang_change = [profile_page.get_url_current_page(),
                            profile_page.page_title,
                            profile_page.account_settings_header_text,
                            profile_page.header.search_field_placeholder,
                            profile_page.save_button_text]

        profile_page.edit_language(language)

        after_lang_change = [profile_page.get_url_current_page(),
                            profile_page.page_title,
                            profile_page.account_settings_header_text,
                            profile_page.header.search_field_placeholder,
                            profile_page.save_button_text]

        Assert.not_equal(before_lang_change, after_lang_change)
    def test_that_deletes_app(self, mozwebqa):
        mock_app = MockApplication()  # generate mock app
        mock_app.name = 'API %s' % mock_app.name

        # init API client
        mk_api = MarketplaceAPI.get_client(mozwebqa.base_url,
                                           mozwebqa.credentials)

        mk_api.submit_app(mock_app)  # submit app

        app_status = mk_api.app_status(mock_app)  # get app data from API

        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="******")

        my_apps = dev_home.header.click_my_submissions()

        app_name = app_status['name']

        self._delete_app(mozwebqa, app_name)

        Assert.true(my_apps.is_notification_visible)
        Assert.true(my_apps.is_notification_successful, my_apps.notification_message)
        Assert.equal("App deleted.", my_apps.notification_message)

        for i in range(1, my_apps.paginator.total_page_number + 1):
            for app in my_apps.submitted_apps:
                Assert.not_equal(app.name, app_name)
            if my_apps.paginator.is_paginator_present:
                if not my_apps.paginator.is_first_page_disabled:
                    my_apps.paginator.click_next_page()
 def testShouldCheckAddonLabel(self, testsetup):
     #This test is to check the labels of an add-on on the dashboard
     #Create page objects
     homepage_obj = home_page.HomePage(testsetup)
     loginpage_obj = login_page.LoginPage(testsetup)
     dashboardpage_obj = dashboard_page.DashboardPage(testsetup)
     addonpage_obj = addon_editor_page.AddonEditorPage(testsetup)
     username = ""
     password = ""
     
     #Create an addon. Then go to dashoard and assert that the label is 'initial'. 
     homepage_obj.go_to_home_page()
     homepage_obj.click_create_addon_btn()
     loginpage_obj.login(username, password)
     addon_name = addonpage_obj.get_addon_name()
     text_addon = addon_name
     homepage_obj.click_myaccount()
     Assert.equal("Dashboard - Add-on Builder", dashboardpage_obj.get_page_title())
     label_name = dashboardpage_obj.get_addon_label_name()
     Assert.true("selenium-test1" in label_name.text)
     
     #Click on the edit button of the addon.Then create a copy of that addon and assert that the label is 'copy'
     dashboardpage_obj.navigate_to_addon_editor()
     addonpage_obj.click_copy_btn()
     copy_addon_name = addonpage_obj.get_addon_name()
     text_copy_addon = copy_addon_name
     try:
         Assert.not_equal(text_addon, text_copy_addon)
     except:
         print 'A copy of the addon could not be created'
     homepage_obj.click_myaccount()
     label_name = dashboardpage_obj.get_addon_label_name()
     Assert.true("copy" in label_name.text)
    def test_that_user_can_purchase_an_app(self, mozwebqa):

        if '-dev' not in mozwebqa.base_url:
            pytest.skip("Payments can only be tested on dev.")

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        acct = self.create_new_user(mozwebqa)
        home_page.header.click_sign_in()
        home_page.login(acct)
        Assert.true(home_page.is_the_current_page)
        home_page.set_region('us')

        details_page = home_page.header.search_and_click_on_app(self._app_name)
        Assert.not_equal('Free', details_page.price_text)
        Assert.true('paid' in details_page.app_status)

        payment = details_page.click_install_button()
        payment.create_pin(self.PIN)
        payment.wait_for_buy_app_section_displayed()
        Assert.equal(self._app_name, payment.app_name)

        payment.click_buy_button()
        # We are not able to interact with the doorhanger that appears to install the app
        # using Selenium
        # We can check for the `purchased` attribute on the price button though
        details_page.wait_for_app_purchased()
Example #22
0
    def test_archive_shift_should_succeed(self):
        home_page = HomePage(self.driver).open_home_page()
        WebDriverWait(self.driver, 60).until(
            EC.text_to_be_present_in_element(home_page.header._einloggen_text,
                                             "Einloggen"))
        account_page = home_page.header.login(USER, PASSWORD)
        sleep(5)
        if "Einloggen" in home_page.header.get_page_source():
            account_page = home_page.header.login(USER, PASSWORD)
        account_page.open_George_Bar_Grill_restaurant()
        restaurant_settings_page = account_page.open_restaurant_settings()
        restaurant_settings_page.open_shift_tab()
        restaurant_settings_page.get_first_shift_internal_name()
        restaurant_settings_page.archive_first_shift()
        sleep(3)

        Assert.not_equal(
            restaurant_settings_page._first_shift_internal_name,
            restaurant_settings_page.get_text(
                restaurant_settings_page._first_shift_internal_name_field))
        restaurant_settings_page.expand_archived_shifts()
        Assert.equal(
            restaurant_settings_page._first_shift_internal_name,
            restaurant_settings_page.get_text(
                restaurant_settings_page.
                _first_archived_shift_internal_name_field))
        restaurant_settings_page.unachive_shift()

        WebDriverWait(self.driver, 15).until(
            EC.text_to_be_present_in_element(
                restaurant_settings_page._first_shift_internal_name_field,
                restaurant_settings_page._first_shift_internal_name))
        Assert.true(
            self.is_element_present("//table[2]/tbody/tr/td[2]") == False)
    def test_that_checks_changing_language_on_home_page(self, mozwebqa):
        """Test for https://www.pivotaltracker.com/story/show/33702365"""

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        before_lang_change = [
            home_page.get_url_current_page(), home_page.page_title,
            home_page.featured_section_title_text,
            home_page.most_popular_section_title_text,
            home_page.categories.title,
            home_page.header.search_field_placeholder,
            home_page.footer.select_lang_label_text
        ]

        home_page.footer.switch_to_another_language('ru')

        after_lang_change = [
            home_page.get_url_current_page(), home_page.page_title,
            home_page.featured_section_title_text,
            home_page.most_popular_section_title_text,
            home_page.categories.title,
            home_page.header.search_field_placeholder,
            home_page.footer.select_lang_label_text
        ]

        Assert.not_equal(before_lang_change, after_lang_change)
    def test_start_from_suspend(
            self,
            provider,
            vm_name,
            verify_vm_suspended,
            mgmt_sys_api_clients,
            register_event,
            load_vm_details):
        """Test power_on operation on a suspended vm.

        Verify vm transitions to running."""

        vm_details = load_vm_details
        vm_details.config_button.refresh_relationships()
        vm_details.wait_for_vm_state_change('suspended', 10)
        last_boot_time = vm_details.last_boot_time
        state_chg_time = vm_details.last_pwr_state_change
        register_event(get_sys_type(provider), "vm", vm_name, ["vm_power_on_req", "vm_power_on"])
        vm_details.power_button.power_on()
        vm_details.wait_for_vm_state_change('on', 15)
        Assert.equal(vm_details.power_state, 'on', "power state incorrect")
        self._wait_for_last_boot_timestamp_refresh(
            vm_details,
            last_boot_time,
            timeout_in_minutes=5)
        Assert.not_equal(vm_details.last_boot_time, last_boot_time,
                "last boot time updated")
        Assert.not_equal(vm_details.last_pwr_state_change, state_chg_time,
                "last state chg time failed to update")
        Assert.true(mgmt_sys_api_clients[provider].is_vm_running(vm_name),
                "vm not running")
    def test_that_pinning_filter_on_product_sets_defaults_in_new_product_version(self, mozwebqa_logged_in):
        product = self.create_product(mozwebqa_logged_in)

        from pages.manage_versions_page import MozTrapManageVersionsPage
        manage_versions_pg = MozTrapManageVersionsPage(mozwebqa_logged_in)
        manage_versions_pg.go_to_manage_versions_page()
        filter_item = manage_versions_pg.filter_form.filter_by(lookup='product', value=product['name'])

        #check that filter is not orange before it's pinned
        Assert.not_equal(
            filter_item.get_filter_color(),
            PINNED_FILTER_COLOR,
            u'filter is orange before it was pinned')

        filter_item.pin_filter()

        #check that filter is orange after it's been pinned
        Assert.equal(
            filter_item.get_filter_color(),
            PINNED_FILTER_COLOR,
            u'pinned filter\'s color is not orange')

        create_version_pg = manage_versions_pg.click_create_version_button()

        Assert.equal(
            create_version_pg.product_name_value,
            product['name'],
            u'default product is incorrect')
    def test_that_cancelling_an_app_icon_update_does_not_update_the_icon(self, mozwebqa):
        """Upload a new app icon, then cancel and ensure that the new icon is not used.

        Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50479
        """
        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="******")
        my_apps = dev_home.header.click_my_apps()
        app_listing = my_apps.first_free_app
        before_icon_src = app_listing.icon_preview_src

        # bring up the media form for the first free app
        media = app_listing.click_edit_media()
        icon_64_src = media.icon_preview_64_image_src
        icon_32_src = media.icon_preview_32_image_src

        # upload a new icon
        media.icon_upload(self._get_resource_path('img.jpg'))

        # check that the preview is updated
        Assert.not_equal(icon_64_src, media.icon_preview_64_image_src,
            'The 64x64 icon should have changed, but it did not.')
        Assert.not_equal(icon_32_src, media.icon_preview_32_image_src,
            'The 32x32 icon should have changed, but it did not.')

        # cancel the changes
        app_listing = media.click_cancel()

        # check that the icon preview has been updated
        Assert.equal(before_icon_src, app_listing.icon_preview_src,
            'The app icon preview should not have changed, but it did.')
    def test_that_carousel_works(self, mozwebqa):
        """
        Test for Litmus 15071.
        https://litmus.mozilla.org/show_test.cgi?id=15071
        """
        discovery_pane = DiscoveryPane(mozwebqa, self.basepath(mozwebqa))
        slider2 = ''

        #checking > button works and slides change
        for i in range(0, len(discovery_pane.sliders)):
            slider1 = discovery_pane.sliders[i].header_name
            Assert.not_equal(slider1, slider2)
            Assert.greater(discovery_pane.sliders[i].opacity_value_for_next,
                           0.3)
            discovery_pane.sliders[i].click_next()
            slider2 = slider1

        #checking < button works and slides change
        for i in range(0, len(discovery_pane.sliders)):
            slider1 = discovery_pane.sliders[i].header_name
            Assert.not_equal(slider1, slider2)
            Assert.greater(
                discovery_pane.sliders[i].opacity_value_for_previous, 0.3)
            discovery_pane.sliders[i].click_previous()
            slider2 = slider1
 def test_vm_power_on(
         self,
         load_vm_details,
         provider,
         vm_name,
         verify_vm_stopped,
         mgmt_sys_api_clients):
     """Test power on operation from a vm details page.  Verify vm
     transitions to running."""
     vm_details = load_vm_details
     vm_details.wait_for_vm_state_change('off', 12)
     last_boot_time = vm_details.last_boot_time
     state_chg_time = vm_details.last_pwr_state_change
     vm_details.power_button.power_on()
     vm_details.wait_for_vm_state_change('on', 12)
     Assert.equal(vm_details.power_state, 'on', "power state incorrect")
     self._wait_for_last_boot_timestamp_refresh(
         vm_details,
         last_boot_time,
         timeout_in_minutes=5)
     Assert.not_equal(vm_details.last_boot_time, last_boot_time,
             "last boot time failed to update")
     Assert.not_equal(vm_details.last_pwr_state_change, state_chg_time,
             "last state chg time failed to update")
     Assert.true(mgmt_sys_api_clients[provider].is_vm_running(vm_name),
             "vm not running")
    def test_load_manifest(self, mozwebqa):
        '''
        Scenario 1: Import Manifest (M1) from Distributor (D1) input Org1
        Result: Pass
        '''
        sysapi = ApiTasks(mozwebqa)
        home_page = Home(mozwebqa)
        
        new_org_name = "manifest%s" % home_page.random_string()
        sysapi.create_org(new_org_name)
        
        home_page.login()

        home_page.header.click_switcher()
        home_page.header.filter_org_in_switcher(new_org_name)
        home_page.header.click_filtered_result(new_org_name)

        cm = ContentManagementTab(mozwebqa)
        home_page.tabs.click_tab("content_management_tab")
        
        if home_page.project == "katello" or home_page.project == "cfse":
            cm.click_content_providers()
            cm.select_redhat_content_provider()
 
        cm.enter_manifest(os.path.realpath(self._org1_m1_manifest))
        Assert.true(home_page.is_successful)
        Assert.not_equal(cm.get_content_table_text, "No subscriptions have been imported.")
Example #30
0
 def test_that_top_changers_data_is_available(self, mozwebqa):
     """
     https://www.pivotaltracker.com/story/show/18059119
     """
     csp = CrashStatsHomePage(mozwebqa)
     cstc = csp.header.select_report('Top Changers')
     Assert.not_equal('Top changers currently unavailable',
                      cstc.page_heading)
Example #31
0
def test_phantom_login(mozwebqa):
    """https://bugzilla.redhat.com/show_bug.cgi?id=996284"""
    login_pg = LoginPage(mozwebqa)
    login_pg.go_to_login_page()
    next_pg = login_pg.login_and_send_window_size()
    Assert.not_equal(
        next_pg.get_context_current_page(), '/',
        "Phantom Login - Got redirected back to the login page after logging in"
    )
Example #32
0
 def test_accordion(self, infra_vms_pg):
     Assert.true(infra_vms_pg.is_the_current_page)
     Assert.equal(len(infra_vms_pg.accordion.accordion_items), 3,
             "Should be 3 accordion items")
     infra_vms_pg.accordion.accordion_items[1].click()
     name = infra_vms_pg.accordion.accordion_items[1].name
     Assert.equal(name, "VMs", "Name should be 'VMs'")
     infra_vms_pg.accordion.accordion_items[2].click()
     name = infra_vms_pg.accordion.accordion_items[2].name
     Assert.not_equal(name, "VMs", "Name should NOT be 'VMs'")
    def test_that_lowest_version_topcrashers_do_not_return_errors(self, mozwebqa):
        csp = CrashStatsHomePage(mozwebqa)
        lowest_version_index = len(csp.header.version_select_text) - 1
        csp.header.select_version_by_index(lowest_version_index)
        cstc = csp.header.select_report('Top Crashers')
        cstc.click_filter_days_by('14')
        Assert.not_equal('Unable to load data System error, please retry in a few minutes', cstc.page_heading)

        cstc.click_filter_by('Plugin')
        Assert.not_equal(self, 'Unable to load data System error, please retry in a few minutes', cstc.page_heading)
    def test_that_complete_themes_categories_are_not_extensions_categories(self, mozwebqa):
        home_page = Home(mozwebqa)
        complete_themes_page = home_page.header.click_complete_themes()
        complete_themes_categories = complete_themes_page.get_all_categories

        home_page.header.site_navigation_menu("Extensions").click()
        extensions_categories = complete_themes_page.get_all_categories

        Assert.not_equal(len(complete_themes_categories), len(extensions_categories))
        Assert.equal(list(set(complete_themes_categories) & set(extensions_categories)), [])
Example #35
0
 def test_accordion(self, infra_vms_pg):
     Assert.true(infra_vms_pg.is_the_current_page)
     Assert.equal(len(infra_vms_pg.accordion.accordion_items), 3,
                  "Should be 3 accordion items")
     infra_vms_pg.accordion.accordion_items[1].click()
     name = infra_vms_pg.accordion.accordion_items[1].name
     Assert.equal(name, "VMs", "Name should be 'VMs'")
     infra_vms_pg.accordion.accordion_items[2].click()
     name = infra_vms_pg.accordion.accordion_items[2].name
     Assert.not_equal(name, "VMs", "Name should NOT be 'VMs'")
Example #36
0
    def test_that_complete_themes_categories_are_not_extensions_categories(self, mozwebqa):
        """Test for Litmus 15343."""
        home_page = Home(mozwebqa)
        complete_themes_page = home_page.header.click_complete_themes()
        complete_themes_categories = complete_themes_page.get_all_categories

        home_page.header.site_navigation_menu("Extensions").click()
        extensions_categories = complete_themes_page.get_all_categories

        Assert.not_equal(len(complete_themes_categories), len(extensions_categories))
        Assert.equal(list(set(complete_themes_categories) & set(extensions_categories)), [])
 def check_pinned_filter(self, filter_item, is_pinned):
     pinned_filter_color = u'#DFB081'
     if is_pinned:
         # check that filter is orange after it's been pinned
         Assert.equal(filter_item.get_filter_color(), pinned_filter_color,
                      u'pinned filter\'s color is not orange')
     else:
         # check that filter is not orange before it's pinned
         Assert.not_equal(filter_item.get_filter_color(),
                          pinned_filter_color,
                          u'filter is orange before it was pinned')
 def test_that_non_us_user_can_set_get_involved_date(self, mozwebqa, vouched_user):
     home_page = Home(mozwebqa)
     home_page.login(vouched_user['email'], vouched_user['password'])
     edit_page = home_page.go_to_localized_edit_profile_page("es")
     selected_date = edit_page.month + edit_page.year
     edit_page.select_random_month()
     edit_page.select_random_year()
     profile_page = edit_page.click_update_button()
     Assert.equal(profile_page.profile_message, "Tu perfil")
     edit_page = profile_page.header.click_edit_profile_menu_item()
     Assert.not_equal(selected_date, edit_page.month + edit_page.year, "The date is not changed")
 def test_that_lowest_version_topcrashers_do_not_return_errors(self, mozwebqa):
     """
     https://bugzilla.mozilla.org/show_bug.cgi?id=655506
     """
     csp = CrashStatsHomePage(mozwebqa)
     csp.header.select_version('3.5.13')
     cstc = csp.header.select_report('Top Crashers')
     cstc.click_filter_days('14')
     Assert.not_equal('Unable to load data System error, please retry in a few minutes', cstc.page_heading)
     cstc.click_filter_plugin()
     Assert.not_equal(self, 'Unable to load data System error, please retry in a few minutes', cstc.page_heading)
Example #40
0
    def test_that_themes_categories_are_not_extensions_categories(self, mozwebqa):
        """Test for Litmus 15343."""
        home_page = Home(mozwebqa)
        themes_page = home_page.header.site_navigation_menu("Themes").click()
        themes_categories = themes_page.get_all_categories

        home_page.header.site_navigation_menu("Extensions").click()
        extensions_categories = themes_page.get_all_categories

        Assert.not_equal(len(themes_categories), len(extensions_categories))
        Assert.equal(list(set(themes_categories) & set(extensions_categories)), [])
 def test_2open_site(self):
     """Test check if I can load page in app"""
     self.ts.click_and_wait(self.url_bar.address_field)
     Assert.true(self.ts.is_element_visible(self.url_bar._cancel))
     Assert.true(
         self.ts.is_element_visible(self.main_page._keyboard_locator))
     url_replace_text = self.url_bar.address_field_text.text
     self.url_bar.address_field_text.send_keys(self.test_url)
     self.ts.click_and_wait(self.main_page.go_button)
     url_text = self.url_bar.address_field_text.text
     self.ts.click_and_wait(self.bottom_bar.bookmarks_icon)
     Assert.not_equal(url_text, url_replace_text, 'Site is not loaded')
Example #42
0
    def test_that_searching_with_substrings_returns_results(self, mozwebqa):
        """
        Test for Litmus 9561.
        https://litmus.mozilla.org/show_test.cgi?id=9561
        """
        home_page = Home(mozwebqa)
        search_page = home_page.header.search_for('fox')

        Assert.false(search_page.is_no_results_present, 'No results were found')

        results_text_summary = search_page.number_of_results_text
        Assert.not_equal(u'0 matching results', results_text_summary)

        Assert.true(int(results_text_summary.split()[0]) > 1)
    def test_feedback_can_be_filtered_by_all_products_and_versions(
            self, mozwebqa):
        """This testcase covers # 13602 & 13603 & 15149 in Litmus.

        1. Verify that at least three firefox versions exist
        2. Verify that filtering by version returns results
        3. Verify that the state of the filters are correct after being applied
        4. Verify product and version values in the URL

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()
        products = feedback_pg.product_filter.products
        Assert.greater(len(products), 1)
        for product in products:
            if product != '':
                feedback_pg.product_filter.select_product(product)
                versions = feedback_pg.product_filter.versions
                [Assert.not_equal(version, "") for version in versions]
                Assert.greater(len(versions), 2)
                for version in versions:
                    feedback_pg.product_filter.select_version(version)
                    Assert.equal(feedback_pg.product_filter.selected_product,
                                 product)
                    Assert.equal(feedback_pg.product_filter.selected_version,
                                 version)
                    Assert.equal(feedback_pg.product_from_url, product)
                    Assert.equal(feedback_pg.version_from_url, version)
                    Assert.greater(len(feedback_pg.messages), 0)
                    feedback_pg.product_filter.unselect_version(version)
                feedback_pg.product_filter.unselect_product(product)
Example #44
0
 def test_vm_power_off(self, load_vm_details, provider, vm_name,
                       verify_vm_running, mgmt_sys_api_clients):
     """Test power off operation from a vm details page. Verify vm
     transitions to stopped."""
     vm_details = load_vm_details
     vm_details.wait_for_vm_state_change('on', 12)
     last_boot_time = vm_details.last_boot_time
     state_chg_time = vm_details.last_pwr_state_change
     vm_details.power_button.power_off()
     vm_details.wait_for_vm_state_change('off', 12)
     Assert.equal(vm_details.power_state, 'off', "power state incorrect")
     Assert.equal(vm_details.last_boot_time, last_boot_time,
                  "last boot time not updated")
     Assert.not_equal(vm_details.last_pwr_state_change, state_chg_time,
                      "last state chg time failed to update")
     Assert.true(mgmt_sys_api_clients[provider].is_vm_stopped(vm_name),
                 "vm running")
 def test_that_lowest_version_topcrashers_do_not_return_errors(
         self, mozwebqa):
     """
     https://bugzilla.mozilla.org/show_bug.cgi?id=655506
     """
     csp = CrashStatsHomePage(mozwebqa)
     csp.header.select_version('3.5.13')
     cstc = csp.header.select_report('Top Crashers')
     cstc.click_filter_days('14')
     Assert.not_equal(
         'Unable to load data System error, please retry in a few minutes',
         cstc.page_heading)
     cstc.click_filter_plugin()
     Assert.not_equal(
         self,
         'Unable to load data System error, please retry in a few minutes',
         cstc.page_heading)
Example #46
0
    def test_hide_email_checkbox_works(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()

        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.header.is_user_logged_in)

        view_profile_page = home_page.header.click_view_profile()
        initial_state = view_profile_page.is_email_field_present

        edit_profile_page = home_page.header.click_edit_profile()
        edit_profile_page.change_hide_email_state()
        edit_profile_page.click_update_account()

        view_profile_page = home_page.header.click_view_profile()
        final_state = view_profile_page.is_email_field_present

        Assert.not_equal(initial_state, final_state, 'The initial and final states are the same. The profile change failed.')
Example #47
0
    def test_that_deletes_app(self, mozwebqa_devhub_logged_in, free_app):

        edit_listing = self._go_to_edit_listing_page(mozwebqa_devhub_logged_in, free_app)
        app_status_page = edit_listing.left_nav_menu.click_status()
        delete_popup = app_status_page.click_delete_app()
        my_apps = delete_popup.delete_app()
        # Set the id of the app to 0 so the global teardown won't try to delete it
        free_app['id'] = 0

        Assert.true(my_apps.is_notification_visible)
        Assert.true(my_apps.is_notification_successful, my_apps.notification_message)
        Assert.equal("App deleted.", my_apps.notification_message)

        for i in range(1, my_apps.paginator.total_page_number + 1):
            for app in my_apps.submitted_apps:
                Assert.not_equal(app.name, free_app.name)
            if my_apps.paginator.is_paginator_present:
                if not my_apps.paginator.is_first_page_disabled:
                    my_apps.paginator.click_next_page()
    def test_that_carousel_works(self, mozwebqa):
        discovery_pane = DiscoveryPane(mozwebqa, self.basepath(mozwebqa))

        # ensure the first panel is visible
        current_panel = discovery_pane.carousel_panels[1]
        Assert.true(current_panel.is_visible)
        first_heading = current_panel.heading

        # switch to the second panel
        discovery_pane.show_next_carousel_panel()
        current_panel = discovery_pane.carousel_panels[2]
        Assert.not_equal(current_panel.heading, first_heading)
        Assert.true(current_panel.is_visible)

        # switch back to the first panel
        discovery_pane.show_previous_carousel_panel()
        current_panel = discovery_pane.carousel_panels[1]
        Assert.equal(current_panel.heading, first_heading)
        Assert.true(current_panel.is_visible)
Example #49
0
 def test_vm_power_on(self, load_vm_details, provider, vm_name,
                      verify_vm_stopped, mgmt_sys_api_clients):
     """Test power on operation from a vm details page.  Verify vm
     transitions to running."""
     vm_details = load_vm_details
     vm_details.wait_for_vm_state_change('off', 12)
     last_boot_time = vm_details.last_boot_time
     state_chg_time = vm_details.last_pwr_state_change
     vm_details.power_button.power_on()
     vm_details.wait_for_vm_state_change('on', 12)
     Assert.equal(vm_details.power_state, 'on', "power state incorrect")
     self._wait_for_last_boot_timestamp_refresh(vm_details,
                                                last_boot_time,
                                                timeout_in_minutes=5)
     Assert.not_equal(vm_details.last_boot_time, last_boot_time,
                      "last boot time failed to update")
     Assert.not_equal(vm_details.last_pwr_state_change, state_chg_time,
                      "last state chg time failed to update")
     Assert.true(mgmt_sys_api_clients[provider].is_vm_running(vm_name),
                 "vm not running")
    def test_that_deletes_app(self, mozwebqa):
        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="******")

        my_apps = dev_home.header.click_my_apps()

        first_free_app = my_apps.first_free_app
        app_name = first_free_app.name

        self._delete_app(mozwebqa, app_name)

        Assert.true(my_apps.is_notification_visibile)
        Assert.true(my_apps.is_notification_succesful, my_apps.notification_message)
        Assert.equal("App deleted.", my_apps.notification_message)

        for i in range(1, my_apps.paginator.total_page_number):
            for app in my_apps.submitted_apps:
                Assert.not_equal(app.name, app_name)
            my_apps.paginator.click_next_page()
Example #51
0
    def test_that_non_us_user_can_set_get_involved_date(
            self, base_url, selenium, vouched_user):
        home_page = Home(base_url, selenium)
        home_page.login(vouched_user['email'], vouched_user['password'])
        settings = home_page.go_to_localized_settings_page("es")
        contributions = settings.you_and_mozilla.contributions
        selected_date = contributions.month + contributions.year
        contributions.select_random_month()
        contributions.select_random_year()
        contributions.click_update()

        profile_page = home_page.header.click_view_profile_menu_item()

        Assert.equal(profile_page.profile_message, "Tu perfil")
        settings = home_page.go_to_localized_settings_page("es")
        contributions = settings.you_and_mozilla.contributions

        Assert.not_equal(selected_date,
                         contributions.month + contributions.year,
                         "The date is not changed")
def test_refresh_pxe_server(infra_pxe_pg, pxe_server, pxe_image_names):
    '''Refresh pxe server
    '''
    infra_pxe_pg.accordion_region.accordion_by_name("PXE Servers").click()
    children_count = len(
        infra_pxe_pg.accordion_region.current_content.children)
    Assert.true(children_count > 0, "There is no PXE server")
    infra_pxe_pg.accordion_region.current_content.find_node_by_name(
        pxe_server['name']).click()
    #This needs to be here. We must wait for page to refresh
    time.sleep(2)
    infra_pxe_pg.center_buttons.configuration_button.click()
    infra_pxe_pg.click_on_refresh()
    infra_pxe_pg.handle_popup()
    flash_message = 'PXE Server "%s": synchronize_advertised_images_queue successfully initiated' % pxe_server[
        'name']
    Assert.equal(infra_pxe_pg.flash.message, flash_message,
                 FLASH_MESSAGE_NOT_MATCHED)

    pxe_image_names_from_page = -1

    for i in range(1, 8):
        try:
            #To refresh the page
            infra_pxe_pg.accordion_region.current_content.find_node_by_name(
                pxe_server['name']).click()
            #This needs to be here
            time.sleep(2)
            pxe_image_names_from_page = infra_pxe_pg.pxe_image_names()
        except NoSuchElementException:
            print("Waiting.... %s" % i)
            pass
        else:
            break

    Assert.not_equal(pxe_image_names_from_page, -1,
                     "Could not assert for expected names.")

    for name in pxe_image_names:
        Assert.true(name in pxe_image_names_from_page,
                    "This image has not been found: '%s'" % name)
Example #53
0
    def test_hide_email_checkbox_works(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login("browserID")

        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.header.is_user_logged_in)

        view_profile_page = home_page.header.click_view_profile()
        initial_state = view_profile_page.is_email_field_present

        edit_profile_page = home_page.header.click_edit_profile()
        edit_profile_page.change_hide_email_state()
        edit_profile_page.click_update_account()

        view_profile_page = home_page.header.click_view_profile()
        final_state = view_profile_page.is_email_field_present

        try:
            Assert.not_equal(
                initial_state, final_state,
                'The initial and final states are the same. The profile change failed.'
            )
            if final_state is True:
                credentials = mozwebqa.credentials['default']
                Assert.equal(
                    credentials['email'], view_profile_page.email_value,
                    'Actual value is not equal with the expected one.')

        except Exception as exception:
            Assert.fail(exception.msg)

        finally:
            if initial_state != final_state:
                edit_profile_page = home_page.header.click_edit_profile()
                edit_profile_page.change_hide_email_state()
                edit_profile_page.click_update_account()
                view_profile_page = home_page.header.click_view_profile()

            Assert.equal(view_profile_page.is_email_field_present,
                         initial_state,
                         'Could not restore profile to initial state.')
Example #54
0
    def test_email_settings(self, mozwebqa):
        home_page = Home(mozwebqa)

        Assert.false(home_page.is_user_loggedin)
        home_page.login()
        Assert.true(home_page.is_user_loggedin)

        settings_page = home_page.header.click_settings()
        report_inital_state = settings_page.is_report_checked
        events_inital_state = settings_page.is_events_checked

        settings_page.click_report_checkbox()
        settings_page.click_events_checkbox()

        dashboard_page = settings_page.click_save()
        Assert.true(dashboard_page.is_success_message_visible)

        settings_page = home_page.header.click_settings()

        Assert.not_equal(report_inital_state, settings_page.is_report_checked)
        Assert.not_equal(events_inital_state, settings_page.is_events_checked)
    def test_that_checks_changing_language(self, mozwebqa):
        """Test for https://www.pivotaltracker.com/story/show/33702365"""

        if mozwebqa.base_url == 'https://marketplace-dev.allizom.org' or mozwebqa.base_url == 'https://marketplace.allizom.org':
            pytest.skip(
                "We currently don't have the option for changing the language in Fireplace"
            )

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.login()

        profile_page = home_page.header.click_edit_account_settings()

        language = 'fr'

        before_lang_change = [
            profile_page.get_url_current_page(), profile_page.page_title,
            profile_page.account_settings_header_text,
            profile_page.display_name_field_text,
            profile_page.language_field_text, profile_page.region_field_text,
            profile_page.header.search_field_placeholder,
            profile_page.save_button_text
        ]

        profile_page.edit_language(language)
        profile_page.save_changes()

        after_lang_change = [
            profile_page.get_url_current_page(), profile_page.page_title,
            profile_page.account_settings_header_text,
            profile_page.display_name_field_text,
            profile_page.language_field_text, profile_page.region_field_text,
            profile_page.header.search_field_placeholder,
            profile_page.save_button_text
        ]

        Assert.not_equal(before_lang_change, after_lang_change)
Example #56
0
def test_ssh_client_copies(ssh_client):
    ssh_client_kwargs = {
        'username': generate_random_string(),
        'password': generate_random_string(),
        'hostname': generate_random_string(),
    }

    # Make sure the ssh copy mechanism works
    ssh_client_copy = ssh_client(**ssh_client_kwargs)
    orig_kwargs = ssh_client._connect_kwargs
    copy_kwargs = ssh_client_copy._connect_kwargs
    Assert.not_equal(orig_kwargs['username'], copy_kwargs['username'])
    Assert.not_equal(orig_kwargs['password'], copy_kwargs['password'])
    Assert.not_equal(orig_kwargs['hostname'], copy_kwargs['hostname'])

    # And also make sure the ssh copy only updates new kwargs
    ssh_client_copy = ssh_client(hostname=generate_random_string())
    copy_kwargs = ssh_client_copy._connect_kwargs
    Assert.equal(orig_kwargs['username'], copy_kwargs['username'])
    Assert.equal(orig_kwargs['password'], copy_kwargs['password'])
    Assert.not_equal(orig_kwargs['hostname'], copy_kwargs['hostname'])
    def test_search_decoding(self, testsetup):
        sel                   = testsetup.selenium
        search_page_obj       = search_page.SearchPage(testsetup)

        search_term = "%3D"
        search_page_obj.go_to_search_page()
        search_page_obj.do_search_on_search_box(search_term)
        not_found = True
        counter = 0
        while not_found and counter < 3:
            if not(search_page_obj.is_search_available()):
                search_page_obj.refresh()
                counter = counter + 1
            else:
                not_found = False
        Assert.not_equal("=", sel.get_value(search_page_obj.search_box))
        Assert.equal(search_term, sel.get_value(search_page_obj.search_box))

        search_term = "%25D"
        search_page_obj.go_to_search_page()
        search_page_obj.do_search_on_search_box(search_term)
        not_found = True
        counter = 0
        while not_found and counter < 3:
            if not(search_page_obj.is_search_available()):
                search_page_obj.refresh()
                counter = counter + 1
            else:
                not_found = False
        Assert.not_equal("=", sel.get_value(search_page_obj.search_box))
        Assert.equal(search_term, sel.get_value(search_page_obj.search_box))

        search_term = "&lsquo"
        search_page_obj.go_to_search_page()
        search_page_obj.do_search_on_search_box(search_term)
        not_found = True
        counter = 0
        while not_found and counter < 3:
            if not(search_page_obj.is_search_available()):
                search_page_obj.refresh()
                counter = counter + 1
            else:
                not_found = False
        Assert.not_equal("'", sel.get_value(search_page_obj.search_box))
        Assert.equal(search_term, sel.get_value(search_page_obj.search_box))
Example #58
0
    def test_feedback_can_be_filtered_by_mobile_versions(self, mozwebqa):
        """This testcase covers # 13602 & 13604 in Litmus.

        1. Verify that at least three mobile versions exist
        2. Verify that filtering by version returns results
        3. Verify that the state of the filters are correct after being applied
        4. Verify product and version values in the URL

        """
        feedback_pg = FeedbackPage(mozwebqa)

        product = "mobile"
        feedback_pg.go_to_feedback_page()
        feedback_pg.product_filter.select_product(product)
        versions = feedback_pg.product_filter.versions
        [Assert.not_equal(version, "") for version in versions]
        Assert.greater(len(versions), 3)
        for version in [versions[2], versions[-1]]:
            print "Checking %s version '%s'." % (product, version)
            feedback_pg.product_filter.select_version(version)
            Assert.equal(feedback_pg.product_filter.selected_product, product)
            Assert.equal(feedback_pg.product_filter.selected_version, version)
            Assert.equal(feedback_pg.product_from_url, product)
            Assert.equal(feedback_pg.version_from_url, version)
Example #59
0
    def test_sites_can_be_filtered_by_firefox_versions(self, mozwebqa):
        """This testcase covers # 15043 & 15045 in Litmus.

        1. Verify that at least three firefox versions exist
        2. Verify that filtering by version returns results
        3. Verify that the state of the filters are correct after being applied
        4. Verify product and version values in the URL

        """
        sites_pg = SitesPage(mozwebqa)

        product = "firefox"
        sites_pg.go_to_sites_page()
        sites_pg.product_filter.select_product(product)
        versions = sites_pg.product_filter.versions
        [Assert.not_equal(version, "") for version in versions]
        Assert.greater(len(versions), 2)
        for version in [versions[1], versions[-1]]:
            print "Checking %s version '%s'." % (product, version)
            sites_pg.product_filter.select_version(version)
            Assert.equal(sites_pg.product_filter.selected_product, product)
            Assert.equal(sites_pg.product_filter.selected_version, version)
            Assert.equal(sites_pg.product_from_url, product)
            Assert.equal(sites_pg.version_from_url, version)
        acct = self.create_new_user(mozwebqa)
        home_page.login(acct)

        profile_page = home_page.header.click_edit_account_settings()

        language = 'fr'

        before_lang_change = [profile_page.get_url_current_page(),
                            profile_page.page_title,
                            profile_page.account_settings_header_text,
                            profile_page.display_name_field_text,
                            profile_page.language_field_text,
                            profile_page.region_field_text,
                            profile_page.header.search_field_placeholder,
                            profile_page.save_button_text]

        profile_page.edit_language(language)
        profile_page.save_changes()

        after_lang_change = [profile_page.get_url_current_page(),
                            profile_page.page_title,
                            profile_page.account_settings_header_text,
                            profile_page.display_name_field_text,
                            profile_page.language_field_text,
                            profile_page.region_field_text,
                            profile_page.header.search_field_placeholder,
                            profile_page.save_button_text]

        Assert.not_equal(before_lang_change, after_lang_change)