diff --git a/examples/cdp_mode/raw_chatgpt.py b/examples/cdp_mode/raw_chatgpt.py index fd67456c972..76ba7c5775c 100644 --- a/examples/cdp_mode/raw_chatgpt.py +++ b/examples/cdp_mode/raw_chatgpt.py @@ -17,6 +17,7 @@ 'button[data-testid="stop-button"]', timeout=20 ) chat = sb.find_element('[data-message-author-role="assistant"] .markdown') - soup = sb.get_beautiful_soup(chat.get_html()).get_text("\n").strip() - print("*** Response from ChatGPT: ***\n%s" % soup.replace("\n:", ":")) + soup = sb.get_beautiful_soup(chat.get_html()).text.strip() + soup = soup.replace("\n\n\n", "\n\n") + print("*** Response from ChatGPT: ***\n%s" % soup) sb.sleep(3) diff --git a/examples/cdp_mode/raw_elal.py b/examples/cdp_mode/raw_elal.py index 81fe30cfc2d..e7b99432b07 100644 --- a/examples/cdp_mode/raw_elal.py +++ b/examples/cdp_mode/raw_elal.py @@ -5,13 +5,13 @@ sb.activate_cdp_mode(url) sb.sleep(2) sb.cdp.click('button[data-att="search"]') - sb.sleep(4) + sb.sleep(5) sb.cdp.click_if_visible("#onetrust-close-btn-container button") - sb.sleep(0.5) + sb.sleep(1) view_other_dates = 'button[aria-label*="viewOtherDates.cta"]' if sb.cdp.is_element_visible(view_other_dates): sb.cdp.click(view_other_dates) - sb.sleep(4.5) + sb.sleep(5) if sb.is_element_visible("flexible-search-calendar"): print("*** Flight Calendar for El Al (Boston to Tel Aviv): ***") print(sb.cdp.get_text("flexible-search-calendar")) @@ -29,7 +29,7 @@ sb.cdp.scroll_down(12) sb.sleep(1) sb.cdp.find_element_by_text(lowest_price).click() - sb.sleep(1) + sb.sleep(2) search_cell = 'button[aria-label*="Search.cell.buttonTitle"]' sb.cdp.scroll_into_view(search_cell) sb.sleep(1) diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index a678865f588..00256da934d 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "4.35.5" +__version__ = "4.35.6" diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 905d93ea126..488ad617ef4 100644 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -8070,10 +8070,6 @@ def assert_no_js_errors(self, exclude=[]): else: found = False message = entry["message"] - if message.count(" - Failed to load resource") == 1: - message = message.split( - " - Failed to load resource" - )[0] for substring in exclude: substring = str(substring) if ( @@ -8091,7 +8087,30 @@ def assert_no_js_errors(self, exclude=[]): u_c_t_e = " Uncaught TypeError: " if f_t_l_r in errors[n]["message"]: url = errors[n]["message"].split(f_t_l_r)[0] - errors[n] = {"Error 404 (broken link)": url} + if "status of 400" in errors[n]["message"]: + errors[n] = {"Error 400 (Bad Request)": url} + elif "status of 401" in errors[n]["message"]: + errors[n] = {"Error 401 (Unauthorized)": url} + elif "status of 402" in errors[n]["message"]: + errors[n] = {"Error 402 (Payment Required)": url} + elif "status of 403" in errors[n]["message"]: + errors[n] = {"Error 403 (Forbidden)": url} + elif "status of 404" in errors[n]["message"]: + errors[n] = {"Error 404 (Not Found)": url} + elif "status of 405" in errors[n]["message"]: + errors[n] = {"Error 405 (Method Not Allowed)": url} + elif "status of 406" in errors[n]["message"]: + errors[n] = {"Error 406 (Not Acceptable)": url} + elif "status of 407" in errors[n]["message"]: + errors[n] = {"Error 407 (Proxy Auth Required)": url} + elif "status of 408" in errors[n]["message"]: + errors[n] = {"Error 408 (Request Timeout)": url} + elif "status of 409" in errors[n]["message"]: + errors[n] = {"Error 409 (Conflict)": url} + elif "status of 410" in errors[n]["message"]: + errors[n] = {"Error 410 (Gone)": url} + else: + errors[n] = {"Failed to load resource": url} elif u_c_s_e in errors[n]["message"]: url = errors[n]["message"].split(u_c_s_e)[0] error = errors[n]["message"].split(u_c_s_e)[1]