Project

General

Profile

Download (1.57 KB) Statistics
| Branch: | Tag: | Revision:

haketilo / test / haketilo_test / test_integration.py @ fd9f2fc4

1
# SPDX-License-Identifier: CC0-1.0
2

    
3
"""
4
Haketilo integration tests
5
"""
6

    
7
# This file is part of Haketilo
8
#
9
# Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
10
#
11
# This program is free software: you can redistribute it and/or modify
12
# it under the terms of the CC0 1.0 Universal License as published by
13
# the Creative Commons Corporation.
14
#
15
# This program is distributed in the hope that it will be useful,
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
# CC0 1.0 Universal License for more details.
19

    
20
import pytest
21

    
22
from .extension_crafting import get_extension_base_url
23

    
24
@pytest.mark.usefixtures('haketilo')
25
def test_integration(driver):
26
    """
27
    Verify that the entire extension functions properly. Also verify bunlded
28
    default settings get loaded properly.
29
    """
30
    base_url = get_extension_base_url(driver)
31
    driver.get(base_url + 'html/settings.html')
32

    
33
    for tab_head_id, item_text in [
34
            ('resources_head', 'Haketilo demonstrational script'),
35
            ('mappings_head',  'Haketilo demonstrational message'),
36
    ]:
37
        driver.find_element_by_id(tab_head_id).click()
38
        lst = driver.find_element_by_css_selector('.active_tab .item_list')
39
        assert lst.is_displayed()
40
        assert item_text in lst.text
41

    
42
    driver.find_element_by_id('repos_head').click()
43
    lst = driver.find_element_by_css_selector('.active_tab .text_entries')
44
    assert 'https://hydrilla.koszko.org/api_v1' in lst.text
45

    
46
    # TODO: do some more tests, including popup interaction and repository
47
    # querying
(10-10/11)