To assert the page title, I do not want to do a hard check but rather a soft one, something like a string pattern match on the page title. For this, here is an excerpt of my code which unfortunately is not working:
wait = WebDriverWait(self.driver, 15)
wait.until(lambda driver:self.driver.title.lower().startswith('Checkout'))
self.assertIn("Checkout", self.driver.title)
This is the exact title of the page: Checkout - HarXYZ
Can someone please point out where I am making a mistake? Is there any other way of asserting the page title through string pattern match?