├── .gitignore ├── features ├── __init__.py ├── pages │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-34.pyc │ │ ├── base_page.cpython-34.pyc │ │ ├── home_page.cpython-34.pyc │ │ ├── search_bar.cpython-34.pyc │ │ └── searching_page.cpython-34.pyc │ ├── home_page.py │ ├── search_bar.py │ ├── searching_page.py │ └── base_page.py ├── steps │ ├── __init__.py │ ├── home_page_steps.py │ └── searching_page_steps.py ├── test_scenarios │ ├── __init__.py │ ├── searching_page.feature │ └── home_page.feature ├── __init__.pyc ├── __pycache__ │ └── __init__.cpython-34.pyc └── environment.py ├── myfile.json ├── project_video_link └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /features/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /features/pages/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /features/steps/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /features/test_scenarios/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "location":{ 3 | "url": "https://www.trivago.ie" 4 | } 5 | } -------------------------------------------------------------------------------- /features/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crki76/Python-Behave-sample-project/HEAD/features/__init__.pyc -------------------------------------------------------------------------------- /project_video_link: -------------------------------------------------------------------------------- 1 | To see the project output on vide, please download: 2 | 3 | https://app.box.com/s/h6xdpx7w0rb3lb1wokzlf3ppughxsa5j 4 | -------------------------------------------------------------------------------- /features/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crki76/Python-Behave-sample-project/HEAD/features/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /features/pages/__pycache__/__init__.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crki76/Python-Behave-sample-project/HEAD/features/pages/__pycache__/__init__.cpython-34.pyc -------------------------------------------------------------------------------- /features/pages/__pycache__/base_page.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crki76/Python-Behave-sample-project/HEAD/features/pages/__pycache__/base_page.cpython-34.pyc -------------------------------------------------------------------------------- /features/pages/__pycache__/home_page.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crki76/Python-Behave-sample-project/HEAD/features/pages/__pycache__/home_page.cpython-34.pyc -------------------------------------------------------------------------------- /features/pages/__pycache__/search_bar.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crki76/Python-Behave-sample-project/HEAD/features/pages/__pycache__/search_bar.cpython-34.pyc -------------------------------------------------------------------------------- /features/pages/__pycache__/searching_page.cpython-34.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crki76/Python-Behave-sample-project/HEAD/features/pages/__pycache__/searching_page.cpython-34.pyc -------------------------------------------------------------------------------- /features/pages/home_page.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.common.by import By 2 | 3 | from features.pages.base_page import BasePage 4 | 5 | 6 | class HomePage(BasePage): 7 | 8 | project_url = "https://www.trivago.ie/" 9 | 10 | local_directories = { 11 | 12 | "slogan": ( 13 | By.CLASS_NAME, 'hero__title'), 14 | "filter_on_search_page": ( 15 | By.ID, 'js_filterlist') 16 | 17 | } -------------------------------------------------------------------------------- /features/pages/search_bar.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.common.by import By 2 | 3 | from features.pages.base_page import BasePage 4 | 5 | 6 | class SearchBar(BasePage): 7 | 8 | local_directories = { 9 | "searching_bar": ( 10 | By.ID, 'horus-querytext'), 11 | "searching_button": ( 12 | By.CLASS_NAME, 'horus-btn-search'), 13 | 14 | 15 | } 16 | 17 | def insert_text_to_search_bar(self, text): 18 | self.browser.find_element(*self.local_directories["searching_bar"]).send_keys(text) -------------------------------------------------------------------------------- /features/pages/searching_page.py: -------------------------------------------------------------------------------- 1 | from selenium.webdriver.common.by import By 2 | 3 | from features.pages.base_page import BasePage 4 | 5 | 6 | class SearchingPage(BasePage): 7 | 8 | local_directories = { 9 | "searching_filter": ( 10 | By.ID, 'js_filterlist'), 11 | "option_wife": ( 12 | By.CSS_SELECTOR, "button[title='Free WiFi'] .fl-group__btn"), 13 | "option_spa": ( 14 | By.CSS_SELECTOR, "button[title='Spa'] .fl-group__btn"), 15 | "searching_area": (By.CLASS_NAME, 'name__copytext') 16 | 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /features/test_scenarios/searching_page.feature: -------------------------------------------------------------------------------- 1 | Feature: Acting in Searching page as required 2 | 3 | Scenario Outline: User inserts searching text to the searching engine and expects to be succeed 4 | Given I am redirected on home page 5 | When I insert to search bar 6 | Then I click on searching_button in search bar 7 | And I ensure that is in 8 | And I click on