diff --git a/.github/workflows/android_workflow.yml b/.github/workflows/android_workflow.yml index b85b8c0e..387fdede 100644 --- a/.github/workflows/android_workflow.yml +++ b/.github/workflows/android_workflow.yml @@ -1,4 +1,4 @@ -name: Android App Workflow +name: BS - Android App Tests env: TAGS: "android_mobile_tests" diff --git a/.github/workflows/api_workflow.yml b/.github/workflows/api_workflow.yml index bbcc8cc6..4e0a2616 100644 --- a/.github/workflows/api_workflow.yml +++ b/.github/workflows/api_workflow.yml @@ -1,4 +1,4 @@ -name: API Workflow +name: API Tests env: TAGS: "api" diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 8b523491..d5a6fc06 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -1,4 +1,4 @@ -name: Docker Android Tests Workflow +name: Docker - Android App Tests env: TAGS: "android_mobile_tests" diff --git a/.github/workflows/docker_ios_workflow.yml b/.github/workflows/docker_ios_workflow.yml index 21096536..5b56b9d2 100644 --- a/.github/workflows/docker_ios_workflow.yml +++ b/.github/workflows/docker_ios_workflow.yml @@ -1,4 +1,4 @@ -name: Docker IOS Tests Workflow +name: Docker - IOS App Tests env: TAGS: "ios_mobile_tests" diff --git a/.github/workflows/docker_ui_workflow.yml b/.github/workflows/docker_ui_workflow.yml index 47326b54..8a6f3c59 100644 --- a/.github/workflows/docker_ui_workflow.yml +++ b/.github/workflows/docker_ui_workflow.yml @@ -1,4 +1,4 @@ -name: Docker Web UI Tests +name: Docker - Web UI Tests env: TAGS: web_tests diff --git a/.github/workflows/ios_workflow.yml b/.github/workflows/ios_workflow.yml index 74f2b2c7..52e3dc76 100644 --- a/.github/workflows/ios_workflow.yml +++ b/.github/workflows/ios_workflow.yml @@ -1,4 +1,4 @@ -name: IOS Tests Workflow +name: BS - IOS App Tests env: TAGS: "ios_mobile_test" diff --git a/.github/workflows/ui_workflow.yml b/.github/workflows/ui_workflow.yml index 520eabe4..41793aa8 100644 --- a/.github/workflows/ui_workflow.yml +++ b/.github/workflows/ui_workflow.yml @@ -1,4 +1,4 @@ -name: Web UI Tests +name: BS - Web UI Tests env: TAGS: web_tests @@ -43,6 +43,7 @@ on: - chrome - firefox - edge + - safari os: description: 'Operating system (window or mac)' required: true diff --git a/frontend/test_project/features/web/login_tests.feature b/frontend/test_project/features/web/login_tests.feature index 9dd546ef..3ae51237 100644 --- a/frontend/test_project/features/web/login_tests.feature +++ b/frontend/test_project/features/web/login_tests.feature @@ -136,6 +136,9 @@ Feature: OrangeHRM Login and Modus QA blog And I click item 'Careers' for element 'Modus_Site > header_link' And The title is 'Modus Create - Careers | Digital Transformation Consultants' And The element 'Modus_Site > Careers > dropdown_area' is displayed + And The element 'Modus_Site > Careers > job_container' is displayed + And I move to element 'Modus_Site > Careers > dropdown_area' + And The element 'Modus_Site > Careers > job_container' is clickable And I select the option 'Global' by value for element 'Modus_Site > Careers > dropdown_filter' And I click item 'Android Engineer' for element 'Modus_Site > Careers > job_title' Then The page url contains '4325051003' \ No newline at end of file diff --git a/frontend/test_project/locators/Web_locators.json b/frontend/test_project/locators/Web_locators.json index b2af278c..9965d9a0 100644 --- a/frontend/test_project/locators/Web_locators.json +++ b/frontend/test_project/locators/Web_locators.json @@ -36,9 +36,10 @@ "sub_popup_close": "//button[@class='leadinModal-close']", "modus_logo": "//a[@itemprop='url']//div[@class='modus-logo modus-logo-spin']", "Careers": { - "dropdown_area": "//div[@class='filterSeach']", + "dropdown_area": "//p[contains(text(),'Top 25 Companies in the Greater D.C. Area for Diversity')]", "dropdown_filter": "//label[text()='Offices']/select", "main_iframe": "//iframe[@id='grnhse_iframe']", + "job_container": "//h2[@class='job-title']", "job_title": "//h2[@class='job-title']/a[contains(text(),'{}')]", "first_name": "//input[@id='first_name']", "last_name": "//input[@id='last_name']", diff --git a/main/frontend/common/step_definitions/attribute_assertion.py b/main/frontend/common/step_definitions/attribute_assertion.py index 839362cd..8645541e 100644 --- a/main/frontend/common/step_definitions/attribute_assertion.py +++ b/main/frontend/common/step_definitions/attribute_assertion.py @@ -130,6 +130,27 @@ def element_displayed(selenium_generics: SeleniumGenerics, locators: Locators, s locators.parse_and_get(locator_path, selenium_generics)), f"Element {locator_path} is not visible." +@given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is clickable")) +@when(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is clickable")) +@then(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is clickable")) +def element_displayed(selenium_generics: SeleniumGenerics, locators: Locators, soft_assert: str, locator_path): + if MOBILE_SUFFIX in locator_path: + with context_manager(selenium_generics): + if soft_assert is not None and soft_assert.lower() == 'true': + with check: + assert selenium_generics.is_element_clickable(locators.parse_and_get(locator_path, selenium_generics)), f"Element {locator_path} is not clickable." + else: + assert selenium_generics.is_element_clickable( + locators.parse_and_get(locator_path, selenium_generics)), f"Element {locator_path} is not clickable." + else: + if soft_assert is not None and soft_assert.lower() == 'true': + with check: + assert selenium_generics.is_element_clickable(locators.parse_and_get(locator_path, selenium_generics)), f"Element {locator_path} is not clickable." + else: + assert selenium_generics.is_element_clickable( + locators.parse_and_get(locator_path, selenium_generics)), f"Element {locator_path} is not clickable." + + # WEB & MOBILE contexts Predefined Step @given(parsers.re("(With soft assertion '(?P.*)' )?There is no element '(?P.*)' on the page")) @given(parsers.re("(With soft assertion '(?P.*)' )?The element '(?P.*)' is not displayed"))