Assert that text does not exist in SeleniumBase

Question:

I am using SeleniumBase to test a website. My text removes an React element by clicking on the cross, and after I would like to verify that some text that was previously in the element doesn’t exist any longer.

Below is the code to click to remove the element, and assert that some text appears on the page. I would like to know if there is a way to do something like self.assert_not_text("some text") instead.

        self.click_xpath(
            f"""//*[@class='ant-select-selection-item-content' and text()='{common_issue}']/
            ../*[@class='ant-select-selection-item-remove']"""
        )
        self.assert_text("Some text")
Asked By: Johnathan

||

Answers:

The documentation for seleniumBase suggests:

self.assert_text_not_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)

Details available here:
https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md

Answered By: RichEdwards