<commit_before>import pytest

from pages.home import HomePage


# homepage tests
@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_masthead_displayed(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.is_masthead_displayed


@pytest.mark.smoke
@pytest.mark.nondestructive
def test_hacks_blog(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.hacks_items_length == 5
    assert_valid_url(page.hacks_url, follow_redirects=True)


@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_callouts(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    # three of them?
    assert page.callout_items_length == 3
    # in a row
    callout_container = page.callout_container
    assert callout_container.is_expected_stacking()
    # valid links?
    callout_links = page.callout_link_list
    for link in callout_links:
        this_link = link.get_attribute('href')
        assert_valid_url(this_link, follow_redirects=True)
# header tests
@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_header_displays(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.Header.is_displayed
    assert page.Header.is_menu_displayed


@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_header_platform_submenu(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.header.is_platform_submenu_trigger_displayed
    assert not page.header.is_platform_submenu_displayed
    page.header.show_platform_submenu()
    assert page.header.is_platform_submenu_displayed


@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_header_signin(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    # click on sign in widget
    page.header.trigger_signin()
    # assert it's fowarded to github<commit_msg>Bug 1314708: Add missing include<commit_after>import pytest

from pages.home import HomePage
from utils.urls import assert_valid_url

# homepage tests
@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_masthead_displayed(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.is_masthead_displayed


@pytest.mark.smoke
@pytest.mark.nondestructive
def test_hacks_blog(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.hacks_items_length == 5
    assert_valid_url(page.hacks_url, follow_redirects=True)


@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_callouts(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    # three of them?
    assert page.callout_items_length == 3
    # in a row
    callout_container = page.callout_container
    assert callout_container.is_expected_stacking()
    # valid links?
    callout_links = page.callout_link_list
    for link in callout_links:
        this_link = link.get_attribute('href')
        assert_valid_url(this_link, follow_redirects=True)


# header tests
@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_header_displays(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.Header.is_displayed
    assert page.Header.is_menu_displayed


@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_header_platform_submenu(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    assert page.header.is_platform_submenu_trigger_displayed
    assert not page.header.is_platform_submenu_displayed
    page.header.show_platform_submenu()
    assert page.header.is_platform_submenu_displayed


@pytest.mark.smoke
@pytest.mark.nodata
@pytest.mark.nondestructive
def test_header_signin(base_url, selenium):
    page = HomePage(selenium, base_url).open()
    # click on sign in widget
    page.header.trigger_signin()
    # assert it's fowarded to github
{'fraction_non_alphanumeric': 0.0907258064516129, 'fraction_numerical': 0.002772177419354839, 'mean_word_length': 4.932735426008969, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5903496', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1409, 'n_words': 243}