<commit_before>import pytest

from selene import factory
from selene.browsers import Browser
from selene.tools import get_driver, set_driver
from tests.acceptance.helpers.helper import get_test_driver


@pytest.mark.parametrize("browser_name", ["firefox",
                                          "chrome"])
def test_factory_can_start_browser_by_name(browser_name):
    driver = factory._start_driver(browser_name)
    assert driver.name == browser_name
    assert driver.get_window_size() == {'height': 819, 'width': 1440}


@pytest.mark.parametrize("browser_name", ["firefox",
                                          "chrome"])
def test_factory_can_create_browser(browser_name):
    factory.ensure_driver_started(browser_name)
    assert get_driver().name == browser_name


def test_can_set_browser_directly():
    driver = get_test_driver()
    set_driver(driver)
    factory.ensure_driver_started(Browser.CHROME)
    assert get_driver().name == Browser.CHROME
    get_driver().quit()
    driver.quit()<commit_msg>driver maximize test added<commit_after>import tkinter

import pytest

from selene import factory
from selene.browsers import Browser
from selene.tools import get_driver, set_driver
from tests.acceptance.helpers.helper import get_test_driver


@pytest.mark.parametrize("browser_name", ["firefox",
                                          "chrome"])
def test_factory_can_start_browser_by_name(browser_name):
    root = tkinter.Tk()
    screen_width = root.winfo_screenwidth()
    screen_height = root.winfo_screenheight()

    driver = factory._start_driver(browser_name)
    assert driver.name == browser_name
    assert driver.get_window_size() == {'height': screen_height, 'width': screen_width}


@pytest.mark.parametrize("browser_name", ["firefox",
                                          "chrome"])
def test_factory_can_create_browser(browser_name):
    factory.ensure_driver_started(browser_name)
    assert get_driver().name == browser_name


def test_can_set_browser_directly():
    driver = get_test_driver()
    set_driver(driver)
    factory.ensure_driver_started(Browser.CHROME)
    assert get_driver().name == Browser.CHROME
    get_driver().quit()
    driver.quit()
{'fraction_non_alphanumeric': 0.09627611262488647, 'fraction_numerical': 0.003178928247048138, 'mean_word_length': 3.7683982683982684, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1447329', 'n_tokens_mistral': 664, 'n_tokens_neox': 646, 'n_words': 120}