diff --git a/Dockerfile-dev b/Dockerfile-dev index 465abf5d..468ce882 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -12,13 +12,13 @@ SHELL ["/bin/bash", "-c"] WORKDIR /app # Install dependencies -COPY requirements.txt requirements-dev.txt /app/ +COPY requirements.txt requirements-test.txt requirements-dev.txt /app/ RUN < - Search' + try: + wait = WebDriverWait(self.driver, timeout=WAIT_TIMEOUT) + wait.until(lambda d: link_text in self.driver.title) + except TimeoutException: + assert link_text in self.driver.title, ( + f"Expected title for page {link_text} to have {link_text};" + f" was {self.driver.title}" + ) + self.assert_current_page_not_error() + + def assert_current_page_not_error(self): + assert not self.driver.title.startswith("Error"), f"Actual title was {self.driver.title}" + assert not self.driver.title.startswith( + "ProgrammingError" + ), f"Actual title was {self.driver.title}" + assert not self.driver.find_element(By.ID, "error-block").is_displayed() diff --git a/requirements-dev.txt b/requirements-dev.txt index 5301288b..adabc686 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,2 @@ --r requirements.txt -django-debug-toolbar -django-extensions -faker +-r requirements-test.txt pygraphviz -ruff diff --git a/requirements-test.txt b/requirements-test.txt index bfe3dc05..a5743332 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,3 +3,4 @@ django-debug-toolbar django-extensions faker ruff +selenium==4.25.0