Skip to content

Commit

Permalink
Swap language buttons css class selector for xpath
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedie committed Oct 3, 2023
1 parent 54455cb commit 014e313
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
long_description=Path("README.md").read_text(encoding="utf-8"),
long_description_content_type="text/markdown",
url="https://github.com/sinedie/SRTranslator",
version="0.2.91",
version="0.2.92",
author="EAR",
author_email="[email protected]",
license="FREE",
Expand Down
8 changes: 4 additions & 4 deletions srtranslator/translators/deepl_scrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ def _closePopUp(self):
).click()

def _set_source_language(self, language: str) -> None:
self._set_language(language, "lmt__language_select--source")
self._set_language(language, "//*[@data-testid='translator-source-lang']")
self.src_lang = language

def _set_destination_language(self, language: str) -> None:
self._set_language(language, "lmt__language_select--target")
self._set_language(language, "//*[@data-testid='translator-target-lang']")
self.target_lang = language

def _set_language(self, language: str, dropdown_class: str) -> None:
def _set_language(self, language: str, xpath: str) -> None:
# Click the languages dropdown button
Button(self.driver, "CLASS_NAME", dropdown_class).click()
Button(self.driver, "XPATH", xpath).click()

# Get the language button to click based on is dl-test property or the text in the button
xpath_by_property = (
Expand Down

0 comments on commit 014e313

Please sign in to comment.