@markers.webview
@markers.smoke
@markers.test_case('C176238', 'C176239', 'C176240', 'C176245')
@markers.nondestructive
def test_navigation(webview_base_url, selenium):
    sim_ratio = 0.4
    home = Home(selenium, webview_base_url).open()
    book = home.featured_books.openstax_list[59]
    content = book.click_book_cover()
    header_nav = content.header_nav
    header_nav.click_contents_button()
    toc = content.table_of_contents
    num_pages = toc.number_of_pages
    assert (type(content) == Content)
    assert ((content.section_title == 'Introduction') or (similar(content.section_title, '📎 Inquiry Organizer') > sim_ratio))
    assert header_nav.progress_bar_fraction_is((2 / num_pages))
    content = content.header_nav.click_next_link()
    assert (type(content) == Content)
    assert (content.chapter_section == '1.2')
    assert header_nav.progress_bar_fraction_is((3 / num_pages))
    content = content.footer_nav.click_next_link()
    assert (type(content) == Content)
    assert (content.chapter_section == '1.3')
    assert header_nav.progress_bar_fraction_is((4 / num_pages))
    content = content.footer_nav.click_back_link()
    assert (type(content) == Content)
    assert (content.chapter_section == '1.2')
    assert header_nav.progress_bar_fraction_is((3 / num_pages))
    content = content.header_nav.click_back_link()
    assert header_nav.progress_bar_fraction_is((2 / num_pages))
@markers.webview
@markers.smoke
@markers.test_case('C176238', 'C176239', 'C176240', 'C176245')
@markers.nondestructive
def test_navigation(webview_base_url, selenium):
    sim_ratio = 0.4
    home = Home(selenium, webview_base_url).open()
    book = home.featured_books.openstax_list[59]
    content = book.click_book_cover()
    header_nav = content.header_nav
    header_nav.click_contents_button()
    toc = content.table_of_contents
    num_pages = toc.number_of_pages
    assert (type(content) == Content)
    assert ((content.section_title == 'Introduction') or (similar(content.section_title, '📎 Inquiry Organizer') > sim_ratio))
    assert header_nav.progress_bar_fraction_is((2 / num_pages))
    content = content.header_nav.click_next_link()
    assert (type(content) == Content)
    assert (content.chapter_section == '1.2')
    assert header_nav.progress_bar_fraction_is((3 / num_pages))
    content = content.footer_nav.click_next_link()
    assert (type(content) == Content)
    assert (content.chapter_section == '1.3')
    assert header_nav.progress_bar_fraction_is((4 / num_pages))
    content = content.footer_nav.click_back_link()
    assert (type(content) == Content)
    assert (content.chapter_section == '1.2')
    assert header_nav.progress_bar_fraction_is((3 / num_pages))
    content = content.header_nav.click_back_link()
    assert header_nav.progress_bar_fraction_is((2 / num_pages))