Skip to content

Commit

Permalink
safari test case fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tauqirsarwar1 committed Mar 29, 2024
1 parent e33b05b commit 5c19f2a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
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 5c19f2a

Please sign in to comment.