-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fixes and completes install_addon() tests on firefox #1609
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
Conversation
test_install_addon_directory() was being called with an xpi file fixture instead of a directory fixture. I fixed this by making a new fixture for test_install_addon_directory() that points to the test extension directory. See details here below. I also added an additional test and fixture so that the tests take into account whether a path to an extension directory ends with a trailing slash. See details here below. This required renaming the existing addon_path fixture to avoid confusion among the three related fixtures: - addon_path_xpi renamed fixture gives a path to the xpi file (was addon_path) updated test_install_add() and test_unistall_addon() - addon_path_dir new fixture that gives a path to the extension directory, ending without a '/' updated test_install_unsigned_addon_directory() to use it - addon_path_dir_slash (new fixture, and test) new fixture that gives a path to the extension directory, ending with a '/' added new test: test_install_unsigned_addon_directory_slash() Note that I don't have the appropriate environment to run these tests before pushing them.
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
PR Description updated to latest commit (82f5998)
|
PR Review
✨ Review tool usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please sign the CLA?
Hi @diemol ,
I already signed it the day I opened the first PR. If open the CLA link, it shows the signed agreement. It may be something has issues with my having done the commit with a different user name or email address than those on my github account? But the commit and PR were sent directly from my gh account and I'm the same person. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jkbzh!
test_install_addon_directory() was being called with an xpi file fixture instead of a directory fixture. I fixed this by making a new fixture for test_install_addon_directory() that points to the test extension directory. See details here below. I also added an additional test and fixture so that the tests take into account whether a path to an extension directory ends with a trailing slash. See details here below. This required renaming the existing addon_path fixture to avoid confusion among the three related fixtures: - addon_path_xpi renamed fixture gives a path to the xpi file (was addon_path) updated test_install_add() and test_unistall_addon() - addon_path_dir new fixture that gives a path to the extension directory, ending without a '/' updated test_install_unsigned_addon_directory() to use it - addon_path_dir_slash (new fixture, and test) new fixture that gives a path to the extension directory, ending with a '/' added new test: test_install_unsigned_addon_directory_slash() Note that I don't have the appropriate environment to run these tests before pushing them. [deploy site] 14a74c9
User description
test_install_addon_directory() was being called with an xpi file fixture instead of a directory fixture.
I fixed this by making a new fixture for
test_install_addon_directory() that points to the test extension directory. See details here below.
I also added an additional test and fixture so that the tests take into account whether a path to an extension directory ends with a trailing slash. See details here below.
This required renaming the existing addon_path fixture to avoid confusion among the three related fixtures:
addon_path_xpi
renamed fixture gives a path to the xpi file (was addon_path)
updated test_install_addon() and test_unistall_addon()
addon_path_dir
new fixture that gives a path to the extension directory, ending without a '/'
updated test_install_unsigned_addon_directory() to use it
addon_path_dir_slash (new fixture, and test)
new fixture that gives a path to the extension directory, ending with a '/'
added new test: test_install_unsigned_addon_directory_slash()
Note that I don't have the appropriate environment to run these tests before pushing them.
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.
Description
test_install_unsigned_addon_directory() was using the same fixture for test_install_addon(), which ended duplicating
the test, but not testing what was intended. I fixed this by declaring a new fixture that points to the intended
extension directory.
I also added a new test to check that install_addon() handles correctly directory paths that end with a '/'. This is
a recent bug I found in the firefox's webdriver (issue and PR already submitted).
I added suffixes to the the three addon_path fixtures to be able to distinguish between them.
Motivation and Context
It fixes test_install_unsigned_addon_directory() which was using the wrong fixture.
It add a new test that allows to detect if install_addon() is handling correctly directory paths that end with a '/'.
Note that until a fix (my PR or some other one) is applied to firefox's webdrive, this test will fail.
Also note that I couldn't install the test environment on my box so these changes are proposed without having
been actually tested, hoping they work or that they can give hints to someone else on how to fix / improve
the install_addon() related tests.
Types of changes
Checklist
Type
enhancement, tests
Description
addon_path
fixture toaddon_path_xpi
and updated relevant tests to use this fixture.addon_path_dir
andaddon_path_dir_slash
, to differentiate between directory paths with and without a trailing slash.test_install_unsigned_addon_directory_slash
to specifically test addon installation from a directory path ending with a slash.test_install_unsigned_addon_directory
to include an assertion for verifying the injected content, ensuring the addon is installed correctly.Changes walkthrough
test_firefox.py
Enhance Firefox Addon Installation Tests and Add New Test for
Directory Paths Ending with Slash
examples/python/tests/browsers/test_firefox.py
test_install_addon
andtest_uninstall_addon
to use theaddon_path_xpi
fixture.test_install_unsigned_addon_directory
to use theaddon_path_dir
fixture and added an assertion to check the injectedcontent.
test_install_unsigned_addon_directory_slash
using theaddon_path_dir_slash
fixture to handle directory paths ending with aslash.
conftest.py
Update Fixtures for Firefox Addon Installation Tests
examples/python/tests/conftest.py
addon_path
fixture toaddon_path_xpi
to clarify its purpose.addon_path_dir
andaddon_path_dir_slash
for testingdirectory paths with and without a trailing slash.