<commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

from semiauto import TestCase


class TestPowerManagement(TestCase):

    def test_brightness_decrease(self):
        #initialize the screen brightness
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 1.0;""")
        self.instruct("About to decrease the screen "\
                      "brightness; please watch the screen and click OK")
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 0.1""")
        self.confirm("Did you notice decrease in brightness?")

    def test_brightness_increase(self):
        #initialize the screen brightness
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 0.1;""")
        self.instruct("About to increase the screen "\
                      "brightness; please watch the screen and click OK")
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 1.0;""")
        self.confirm("Did you notice increase in brightness?")<commit_msg>Bug 1010758 - Develop first Semi-auto test for Power Management API Implemented further review comments<commit_after># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

from semiauto import TestCase


class TestPowerManagement(TestCase):

    def test_brightness_decrease(self):
        #initialize the screen brightness
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 1.0;""")
        self.instruct("About to decrease the screen "
                      "brightness; please watch the screen and click OK")
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 0.1""")
        self.confirm("Did you notice decrease in brightness?")

    def test_brightness_increase(self):
        #initialize the screen brightness
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 0.1;""")
        self.instruct("About to increase the screen "
                      "brightness; please watch the screen and click OK")
        self.marionette.execute_script("""
            window.navigator.mozPower.screenBrightness = 1.0;""")
        self.confirm("Did you notice increase in brightness?")
{'fraction_non_alphanumeric': 0.09365558912386707, 'fraction_numerical': 0.011706948640483383, 'mean_word_length': 2.8558951965065504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6267399', 'n_tokens_mistral': 753, 'n_tokens_neox': 698, 'n_words': 218}