Bug 1740753 - New CodeMiror component is hard to interact with in automation
Summary: New CodeMiror component is hard to interact with in automation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.11.0
Hardware: All
OS: All
low
low
Target Milestone: GA
: 5.11.9
Assignee: Martin Maroši
QA Contact: Jaroslav Henner
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-13 15:13 UTC by Angelina Vasileva
Modified: 2020-11-05 22:05 UTC (History)
6 users (show)

Fixed In Version: 5.11.9.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-05 22:04:52 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
simaishi: cfme-5.11.z+


Attachments (Terms of Use)
sending keys to textarea be like... (8.04 KB, image/png)
2019-08-13 15:13 UTC, Angelina Vasileva
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4967 0 None None None 2020-11-05 22:05:03 UTC

Description Angelina Vasileva 2019-08-13 15:13:58 UTC
Created attachment 1603429 [details]
sending keys to textarea be like...

Description of problem:
New 5.11 CodeMiror react component is hard to interact with in automation

Version-Release number of selected component (if applicable):
5.11.0.18.20190806180636_1dd6378

How reproducible:
Always

Steps to Reproduce:
1. Navigate to Services -> Catalogs -> Orchestration Templates -> Add a new Orchestration Template
2. Fill the "Content" field

Actual results:
First, I had to change the attribute to be able to interact with it, so I set "contentEditable", "true".

1. The content can be found using the locator "//pre[@class=' CodeMirror-line ']/span". However, if I send keys there, the "Add" button in the UI is always disabled.

2. The textarea can be found using the locator "//div[contains(@class,'miq-codemirror')]//textarea", then I need to delete "hidden" property. When I send keys there, the Add button becomes enabled. However, the text appears twice.

Expected results:
I would expect textarea to contain the actual typed text OR
a javascript way to interact with this component.

Additional info:
It worked js way in 5.10.

Comment 4 CFME Bot 2019-08-16 03:16:55 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/d7dec1ad1a7a780b15a43855063c735ac29522d1
commit d7dec1ad1a7a780b15a43855063c735ac29522d1
Author:     Martin Marosi <marvusm.mmi>
AuthorDate: Thu Aug 15 04:43:56 2019 -0400
Commit:     Martin Marosi <marvusm.mmi>
CommitDate: Thu Aug 15 04:43:56 2019 -0400

    Use react-codemirror onChange event instead of onBeforeChange.

    fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1740753

 app/javascript/components/code-editor/index.js | 30 +-
 app/javascript/spec/code-editor/__snapshots__/code-editor.spec.js.snap | 2 +
 app/javascript/spec/code-editor/code-editor.spec.js | 12 +-
 app/javascript/spec/orchestration-template/orchestration-template-form.spec.js | 4 +-
 4 files changed, 31 insertions(+), 17 deletions(-)

Comment 5 CFME Bot 2020-09-30 16:56:00 UTC
New commit detected on ManageIQ/manageiq-ui-classic/ivanchuk:

https://github.com/ManageIQ/manageiq-ui-classic/commit/65e652932510056e184c3b8f4ae20b4bbff6fe16
commit 65e652932510056e184c3b8f4ae20b4bbff6fe16
Author:     Harpreet Kataria <hkataria>
AuthorDate: Fri Aug 16 03:12:09 2019 +0000
Commit:     Satoe Imaishi <simaishi>
CommitDate: Wed Sep 30 16:48:54 2020 +0000

    Merge pull request #6030 from Hyperkid123/tweak-react-code-editor

    Use react-codemirror onChange event instead of onBeforeChange.

    (cherry picked from commit 471bc696f27562e8c560b18a973b17ce7f009975)

    https://bugzilla.redhat.com/show_bug.cgi?id=1740753

 app/javascript/components/code-editor/index.js | 30 +-
 app/javascript/spec/code-editor/__snapshots__/code-editor.spec.js.snap | 2 +
 app/javascript/spec/code-editor/code-editor.spec.js | 12 +-
 app/javascript/spec/orchestration-template/orchestration-template-form.spec.js | 4 +-
 4 files changed, 31 insertions(+), 17 deletions(-)

Comment 6 Jaroslav Henner 2020-10-22 13:46:43 UTC
This didn't help to run the tests as they were. The issue now was that the indentation got wrong. But in the end I found a way how to make the tests interact with the CodeMirror using setValue:

https://github.com/ManageIQ/integration_tests/pull/10337


It seems though nothing did break.

Comment 11 errata-xmlrpc 2020-11-05 22:04:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (CloudForms 5.0.9 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4967


Note You need to log in before you can comment on or make changes to this bug.