Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

[RFR] Fix CodeMirror filling. #10337

Merged
merged 3 commits into from
Oct 22, 2020
Merged

[RFR] Fix CodeMirror filling. #10337

merged 3 commits into from
Oct 22, 2020

Conversation

jarovo
Copy link
Contributor

@jarovo jarovo commented Oct 14, 2020

Purpose of intent

Some time ago, the CodeMirror component used for entering yaml templates started failing to get filled by selenium. There are currently two ON_QA bugs related to CodeMirror but even with them "fixed" I either did get indenting wrong (which is significant for yamls) or nothing else than parentheses { being input.

This PR set's the content of the CM using Javascript. Perhaps not ideal, but surely good enough to have the tests working.

PRT failures advocacy.

From first glance the errors on PRT are not related. The tests have not been executed for a while or were executed failing on the CodeMirror. I think most of them belong to @niyazRedhat. Niyaz, can you take a look?

{{ pytest: --use-sprout -s --sprout-group downstream-511z -sv 'cfme/tests/services/test_provision_stack.py' -v --use-provider 'complete' --long-running }}

@jarovo jarovo changed the title [WIPTEST] Fix CodeMirror filling. [RFR] Fix CodeMirror filling. Oct 15, 2020
Copy link
Member

@mshriver mshriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unblocked tests in PRT have a 50% pass rate (2/4) The two test failures do not look related to the codemirror filling.

Copy link
Contributor

@niyazRedhat niyazRedhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks for the PR

@tpapaioa
Copy link
Contributor

I think an easier way to avoid the auto-aligning of yaml content might be to select json in the radio button above the Content field. When that option is selected, no formatting is automatically applied to what you enter, so you can continue to use send_keys() instead of using javascript.

@jarovo
Copy link
Contributor Author

jarovo commented Oct 20, 2020

I think an easier way to avoid the auto-aligning of yaml content might be to select json in the radio button above the Content field. When that option is selected, no formatting is automatically applied to what you enter, so you can continue to use send_keys() instead of using javascript.

Well, perhaps not selecting json and filling the field with yaml does not have some other effect, it doesn't seem right to me. If it was the other way around -- filing with json while the field is yaml should work as yaml is supposed to be superset of json.

Figuring out the javascript way took me a while, but I think it is pretty straight-forward in the end.

@mshriver mshriver merged commit 1d92f44 into ManageIQ:master Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants