Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translation cmd #1909

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions atest/acceptance/entry_point.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
*** Settings ***
Library Process


*** Test Cases ***
Entry Point Version
${process} = Run Process
... python -m SeleniumLibrary.entry --version
... shell=True
... cwd=${EXECDIR}/src
Log ${process.stdout}
Log ${process.stderr}
Should Be Equal As Integers ${process.rc} 0
Should Be Empty ${process.stderr}
Should Contain ${process.stdout} Used Python is:
Should Contain ${process.stdout} Installed selenium version is:

Entry Point Translation
${process} = Run Process
... python -m SeleniumLibrary.entry translation ${OUTPUT_DIR}/translation.json
... shell=True
... cwd=${EXECDIR}/src
Log ${process.stdout}
Log ${process.stderr}
Should Be Equal As Integers ${process.rc} 0
Should Be Empty ${process.stderr}
Should Be Equal ${process.stdout} Translation file created in ${OUTPUT_DIR}/translation.json
${process} = Run Process
... python -m SeleniumLibrary.entry translation --compare ${OUTPUT_DIR}/translation.json
... shell=True
... cwd=${EXECDIR}/src
Log ${process.stdout}
Log ${process.stderr}
Should Be Equal As Integers ${process.rc} 0
Should Be Empty ${process.stderr}
Should Be Equal ${process.stdout} Translation is valid, no updated needed.
4 changes: 2 additions & 2 deletions src/SeleniumLibrary/entry/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def cli():
required=True,
)
@click.option(
"--plugin",
"--plugins",
help="Same as plugins argument in the library import.",
default=None,
type=str,
Expand Down Expand Up @@ -97,7 +97,7 @@ def translation(
print("Translation is valid, no updated needed.")
else:
with filename.open("w") as file:
json.dump(translation, file, indent=4)
json.dump(lib_translation, file, indent=4)
print(f"Translation file created in {filename.absolute()}")


Expand Down
2 changes: 1 addition & 1 deletion src/SeleniumLibrary/entry/get_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_version():
)
return (
f"\nUsed Python is: {sys.executable}\n\tVersion: {python_version}\n"
f'Robot Framework version: "{get_rf_version()}\n"'
f'Robot Framework version: "{get_rf_version()}"\n'
f"Installed SeleniumLibrary version is: {get_library_version()}\n"
f"Installed selenium version is: {__version__}\n"
)
1 change: 0 additions & 1 deletion utest/test/translation/test_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

@pytest.fixture()
def sl() -> SeleniumLibrary:
d = Path(__file__).parent.parent.absolute()
sys.path.append(str(Path(__file__).parent.parent.absolute()))
return SeleniumLibrary(language="FI")

Expand Down