-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prepare for react-lite → React switch #9938
Conversation
These are all @mareklibra 's changes, and I approve them. I can't formally do it here, as it's nominally my PR. I manually tested terminal (including resizing), selectors, the ReactDOM.render affected pages etc., and it all works just fine. |
test/verify/check-ovirt
Outdated
@@ -83,6 +83,19 @@ class TestOVirtMachines(MachineCase): | |||
self.hack_for_missing_vdsm() | |||
self.pass_install_dialog() | |||
|
|||
# mimics pressing keys | |||
def _setVal(self, selector, value): |
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.
We should use Browser.set_input_text
for this.
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.
Done, and I added a separate commit to robustify set_input_text()
like Marek did in the _setVal
helper function.
test/common/testlib.py
Outdated
@@ -239,6 +239,7 @@ def set_input_text(self, selector, val): | |||
self.set_val(selector, "") | |||
self.focus(selector) | |||
self.key_press(val) | |||
b.wait_val(selector, val) |
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.
self.wait_val
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.
Argh, fixed.
Wait until the element that received the typed string really has the intended value. This avoids race conditions with slower keyboard event handlers.
Needed for upgrade from react-lite to React 16.4 - React is more strict regarding component nesting. - Checkboxes can't be set via testlib's `set_checked()` but via i.e. clicking (`input.checked` attribute is not working) - Tests mimic key presses to set value of `<input>` instead of directly setting property
Defined in `propTypes` but not used.
Method was depracated in React 0.14, so already removed now. https://reactjs.org/blog/2015/10/07/react-v0.14.html#dom-node-refs
Moved from `react` to `react-dom` package.
Moved from `react` to `react-dom` package. Closes cockpit-project#9938
Two storage test failures on ubuntu-1604: https://fedorapeople.org/groups/cockpit/logs/pull-9938-20180831-235353-9c47b50d-verify-ubuntu-1604/log.html#201 Retrying for comparison. |
Actually @mvollmer already approved up there, just wanted the |
This picks a bunch of commits from PR #9263 which are safe and fine for react-lite as well, and removes some conflicts to current master. Let's land this separately so that it's easier to eventually get in the complete switch.