Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE Selenium test: Updates to search #2267

Merged
merged 18 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playwright/tests/rex-test/rex.behaviorspec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,4 +673,4 @@ test('C543225 canonicals for old editions point to the latest edition', async ({
await Toc.pageClick(241)
// THEN: Canonical page points to latest edition of the original content
expect(await bookPage.canonical()).toBe('https://openstax.org/books/principles-economics-3e/pages/d-the-expenditure-output-model')
})
})
3 changes: 3 additions & 0 deletions pytest-selenium/pages/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def open(self):
self.driver.add_cookie({"name": "nudge_study_guides_counter", "value": "1"})
self.driver.add_cookie({"name": "nudge_study_guides_page_counter", "value": "1"})
self.driver.add_cookie({"name": "nudge_study_guides_date", "value": current_date})
self.driver.add_cookie({"name": "content-warning-545", "value": "true"})
self.driver.add_cookie({"name": "content-warning-548", "value": "true"})
self.driver.add_cookie({"name": "content-warning-549", "value": "true"})
self.driver.add_cookie({"name": "ANALYTICS_OPT_OUT", "value": "1"})
return self

Expand Down
8 changes: 4 additions & 4 deletions pytest-selenium/regions/my_highlights.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ def remove_tag(self) -> MyHighlights:
class Highlights(Region):
"""The modal body containing the filtered list of highlights."""

_chapter_locator = (By.XPATH, "//div[@data-testid='chapter-title']")
_section_locator = (By.XPATH, "//div[@data-testid='section-title']")
_chapter_locator = (By.XPATH, "//h2[@data-testid='chapter-title']")
_section_locator = (By.XPATH, "//h3[@data-testid='section-title']")
_no_results_message_locator = (By.CSS_SELECTOR, "[class*=GeneralTextWrapper]")
_highlight_locator = (By.CSS_SELECTOR, "[class*=HighlightOuterWrapper]")
_empty_state_nudge_locator = (By.CSS_SELECTOR, "[class*=MyHighlightsWrapper]")
Expand Down Expand Up @@ -1041,11 +1041,11 @@ class Section(ChapterData):
"""A chapter section with highlights."""

_number_locator = (
By.CSS_SELECTOR, "div:first-child .os-number")
By.CSS_SELECTOR, "h3:first-child .os-number")
_highlight_locator = (
By.XPATH, "./following-sibling::div//div[@data-highlight-id]")
_title_locator = (
By.CSS_SELECTOR, "div:first-child .os-text")
By.CSS_SELECTOR, "h3:first-child .os-text")

@property
def highlights(self) -> List[Highlight]:
Expand Down
22 changes: 17 additions & 5 deletions pytest-selenium/utils/books.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"biology-2e": {
"default_page": "1-introduction",
"search_term": "evolution theory",
"chapter_search_results_total": 341,
"chapter_search_results_total": 344,
"rkt_search_results_total": 0
},
"biology-ap-courses": {
Expand Down Expand Up @@ -140,7 +140,7 @@
"calculus-volume-3": {
"default_page": "1-introduction",
"search_term": "zero vector",
"chapter_search_results_total": 9,
"chapter_search_results_total": 10,
"rkt_search_results_total": 1
},
"college-success": {
Expand Down Expand Up @@ -416,7 +416,7 @@
"introductory-statistics-2e": {
"default_page": "1-introduction",
"search_term": "Student's t-Distribution",
"chapter_search_results_total": 43,
"chapter_search_results_total": 45,
"rkt_search_results_total": 2
},
"introductory-business-statistics-2e": {
Expand Down Expand Up @@ -459,7 +459,7 @@
"default_page": "1-introduction",
"search_term": "population health",
"chapter_search_results_total": 3689,
"rkt_search_results_total": 11
"rkt_search_results_total": 12
},
"nutrition": {
"default_page": "1-introduction",
Expand All @@ -471,7 +471,19 @@
"default_page": "1-introduction",
"search_term": "mental health",
"chapter_search_results_total": 2674,
"rkt_search_results_total": 4
"rkt_search_results_total": 5
},
"maternal-newborn-nursing": {
"default_page": "1-introduction",
"search_term": "newborn babies",
"chapter_search_results_total": 446,
"rkt_search_results_total": 0
},
"clinical-nursing-skills": {
"default_page": "1-introduction",
"search_term": "clinical nursing skills",
"chapter_search_results_total": 118,
"rkt_search_results_total": 1
}
}

Loading