Skip to content

Commit

Permalink
Trying out to click inside the search field of the Mtype
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayima Okeeva committed Dec 11, 2024
1 parent f56bc14 commit f9e8fa2
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 44 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/selenium-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ jobs:
$SLACK_WEBHOOK_URL_PASS
# Step 8: Slack notification on failure
- name: Notify Slack on Failure
if: failure()
env:
SLACK_WEBHOOK_URL_FAIL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }}
run: |
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\":x: Test pipeline failed in *${{ github.repository }}*. Branch: *${{ github.ref_name }}*. Check the logs for details.\", \"username\":\"GitHub Actions\", \"icon_emoji\":\":warning:\"}" \
$SLACK_WEBHOOK_URL_FAIL
# - name: Notify Slack on Failure
# if: failure()
# env:
# SLACK_WEBHOOK_URL_FAIL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }}
# run: |
# curl -X POST -H 'Content-type: application/json' \
# --data "{\"text\":\":x: Test pipeline failed in *${{ github.repository }}*. Branch: *${{ github.ref_name }}*. Check the logs for details.\", \"username\":\"GitHub Actions\", \"icon_emoji\":\":warning:\"}" \
# $SLACK_WEBHOOK_URL_FAIL
1 change: 1 addition & 0 deletions locators/explore_morphology_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ExploreMorphologyPageLocators:
"before:!content-none ant-table-cell-ellipsis' and "
"@title='L5_TPC:A']")
FILTER_MTYPE_SEARCH = (By.XPATH, "//div[@class='ant-select-selection-overflow']")
ANT_SELECT_SELECTOR = (By.XPATH, "(//div[@class='ant-select-selector'])[2]")
FILTER_MTYPE_TEXT_INPUT = (By.XPATH, "(//input[@class='ant-select-selection-search-input'])[2]")
FILTER_PANEL = (By.XPATH, "//div[@data-testid='listing-view-filter-panel']")
FIRST_ROW = (By.XPATH, "//tbody[@class='ant-table-tbody']/tr[2]")
Expand Down
3 changes: 3 additions & 0 deletions pages/explore_morphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,6 @@ def is_filter_panel_closed(self):

def lv_filter_search(self):
return self.find_element(ExploreMorphologyPageLocators.LV_FILTER_SEARCH)

def ant_selector(self):
return self.find_element(ExploreMorphologyPageLocators.ANT_SELECT_SELECTOR)
74 changes: 38 additions & 36 deletions tests/test_morphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,41 @@ def test_explore_morphology(self, setup, login, logger):
morphology_tab = explore_morphology.find_morphology_tab()
logger.info("Morphology tab is displayed")

# column_locators = [
# ExploreMorphologyPageLocators.LV_PREVIEW,
# ExploreMorphologyPageLocators.LV_BRAIN_REGION,
# ExploreMorphologyPageLocators.LV_MTYPE,
# ExploreMorphologyPageLocators.LV_NAME,
# ExploreMorphologyPageLocators.LV_SPECIES,
# ]
# column_headers = explore_morphology.find_column_headers(column_locators)
#
# for header in column_headers:
# assert header.is_displayed(), f"Column header {header} is not displayed."
# logger.info("Morphology column headers are displayed.")
#
# thumbnail_img = explore_morphology.verify_all_thumbnails_displayed()
# logger.info("Morphology thumbnail is displayed.")
#
# for thumbnail in thumbnail_img:
# assert thumbnail['is_displayed'], f"Thumbnail {thumbnail['element']} is not displayed!"
# logger.info(f"Thumbnail {thumbnail['element']} is displayed.")
#
# results = explore_morphology.find_results()
# logger.info("Total number of results for morphology tab is displayed.")
#
# original_data = explore_morphology.get_table_data()
# logger.info("Fetch table data before sorting")
#
# br_sort_arrow = explore_morphology.find_br_sort_arrow()
# br_sort_arrow.click()
# logger.info("Click the column sort arrow.")
#
# explore_morphology.wait_for_page_ready(timeout=15)
# logger.info("Wait for the sorting action to complete.")
# sorted_data = explore_morphology.get_table_data()
# assert original_data != sorted_data, "Table data did not change after sorting."
# logger.info("Asserting that the table data was sorted.")
column_locators = [
ExploreMorphologyPageLocators.LV_PREVIEW,
ExploreMorphologyPageLocators.LV_BRAIN_REGION,
ExploreMorphologyPageLocators.LV_MTYPE,
ExploreMorphologyPageLocators.LV_NAME,
ExploreMorphologyPageLocators.LV_SPECIES,
]
column_headers = explore_morphology.find_column_headers(column_locators)

for header in column_headers:
assert header.is_displayed(), f"Column header {header} is not displayed."
logger.info("Morphology column headers are displayed.")

thumbnail_img = explore_morphology.verify_all_thumbnails_displayed()
logger.info("Morphology thumbnail is displayed.")

for thumbnail in thumbnail_img:
assert thumbnail['is_displayed'], f"Thumbnail {thumbnail['element']} is not displayed!"
logger.info(f"Thumbnail {thumbnail['element']} is displayed.")

results = explore_morphology.find_results()
logger.info("Total number of results for morphology tab is displayed.")

original_data = explore_morphology.get_table_data()
logger.info("Fetch table data before sorting")

br_sort_arrow = explore_morphology.find_br_sort_arrow()
br_sort_arrow.click()
logger.info("Click the column sort arrow.")

explore_morphology.wait_for_page_ready(timeout=15)
logger.info("Wait for the sorting action to complete.")
sorted_data = explore_morphology.get_table_data()
assert original_data != sorted_data, "Table data did not change after sorting."
logger.info("Asserting that the table data was sorted.")

morphology_filter = explore_morphology.morphology_filter()
morphology_filter.click()
Expand Down Expand Up @@ -86,7 +86,9 @@ def test_explore_morphology(self, setup, login, logger):
filter_mtype_text_input.send_keys(Keys.ENTER)
logger.info("L5_TPC:A is typed in the search field.")
explore_morphology.wait_for_page_ready(timeout=15)
lv_filter_search_field = explore_morphology.lv_filter_search()
ant_selector = explore_morphology.ant_selector()
ant_selector.click()
logger.info("CLICKED ON ANT SELECTOR")
logger.info("Found filter search field")
lv_filter_apply_btn = explore_morphology.lv_filter_apply(timeout=10)
assert lv_filter_apply_btn, f"The APPLY button is not found"
Expand Down

0 comments on commit f9e8fa2

Please sign in to comment.