Skip to content

Commit

Permalink
Develop (#77)
Browse files Browse the repository at this point in the history
### To be filled by the PR creator:

* A brief description of the changes made - 

* Do we have clean latest run report (Docker or Browserstack) attached
with this PR?
  * [ ] Yes
  * [ ] No (Please explain why)

* Does the PR contain changes to any core file?
  * [ ] Yes (Needs approval from at least 1 people)
  * [ ] No

* Is it
  * [ ] New Testcase
  * [ ] Fix


### To be filled by the PR reviewer:

* [ ] Verify the attached run report passed in GitHub Actions (Docker or
Browserstack run)

* General
    * [ ] Use the best strategy to locate the elements
    * [ ] Comments wherever the code is not readable by itself
    * [ ] Use of the right data structure for the use case
    * [ ] Reuse logic/functionality as much as possible
    * [ ] Cleanup of any test data that is generated by the tests
    * [ ] No static waits
  • Loading branch information
Tauqir Sarwar authored Mar 29, 2024
2 parents 6e52ac1 + 5c19f2a commit c609ab5
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android App Workflow
name: BS - Android App Tests

env:
TAGS: "android_mobile_tests"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: API Workflow
name: API Tests

env:
TAGS: "api"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_android_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Android Tests Workflow
name: Docker - Android App Tests

env:
TAGS: "android_mobile_tests"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_ios_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker IOS Tests Workflow
name: Docker - IOS App Tests

env:
TAGS: "ios_mobile_tests"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_ui_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Web UI Tests
name: Docker - Web UI Tests

env:
TAGS: web_tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: IOS Tests Workflow
name: BS - IOS App Tests

env:
TAGS: "ios_mobile_test"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ui_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Web UI Tests
name: BS - Web UI Tests

env:
TAGS: web_tests
Expand Down Expand Up @@ -43,6 +43,7 @@ on:
- chrome
- firefox
- edge
- safari
os:
description: 'Operating system (window or mac)'
required: true
Expand Down
3 changes: 3 additions & 0 deletions frontend/test_project/features/web/login_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion frontend/test_project/locators/Web_locators.json
Original file line number Diff line number Diff line change
Expand Up @@ -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']",
Expand Down
21 changes: 21 additions & 0 deletions main/frontend/common/step_definitions/attribute_assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<soft_assert>.*)' )?The element '(?P<locator_path>.*)' is clickable"))
@when(parsers.re("(With soft assertion '(?P<soft_assert>.*)' )?The element '(?P<locator_path>.*)' is clickable"))
@then(parsers.re("(With soft assertion '(?P<soft_assert>.*)' )?The element '(?P<locator_path>.*)' 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<soft_assert>.*)' )?There is no element '(?P<locator_path>.*)' on the page"))
@given(parsers.re("(With soft assertion '(?P<soft_assert>.*)' )?The element '(?P<locator_path>.*)' is not displayed"))
Expand Down

0 comments on commit c609ab5

Please sign in to comment.