Skip to content

Commit

Permalink
Test: Fix test in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Jun 20, 2024
1 parent e466175 commit f52f735
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions atest/json_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@


def compare_translations(file: Path):
with Path(__file__).parent.parent.joinpath(
sl_translation = Path(__file__).parent.parent.joinpath(
"robotframework_seleniumlibrary_translation_fi", "translation.json"
).open("r") as file_object:
)
with sl_translation.open("r") as file_object:
expected_data = json.load(file_object)
expected_keywords = [kw["name"] for kw in expected_data.values()]
expected_keywords = [kw["name"].lower() for kw in expected_data.values()]
logger.info(f"expected_keywords: {expected_keywords}")
with file.open("r") as file_object:
data = json.load(file_object)
keywords = data["keywords"]
for keyword in keywords:
logger.info(keyword)
logger.info(keyword["name"])
name = keyword["name"]
name = name.replace(" ", "_").lower()
assert name in expected_keywords, f"name '{name}' not in {expected_keywords}"
2 changes: 1 addition & 1 deletion atest/translation.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Library json_lib.py

*** Test Cases ***
Translation Works With Translation
Avaa Selain https://github.com/MarketSquare/robotframework-seleniumlibrary-translation-fi chrome
Sulje Kaikki Selaimet

LibDoc Works With Translation
[Setup] Remove File ${CURDIR}/SL.json
Expand Down

0 comments on commit f52f735

Please sign in to comment.