Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
fa57f12e
Commit
fa57f12e
authored
Oct 06, 2021
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_ui_test_core: Add typeReact to type in field managed by reactJS
parent
175298cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.js
...Item/portal_skins/erp5_ui_test_core/user-extensions.js.js
+15
-0
No files found.
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/user-extensions.js.js
View file @
fa57f12e
...
...
@@ -94,6 +94,20 @@ Selenium.prototype.doSetFile = function(locator, url_filename_mimetype) {
}));
};
/**
* If used to type and active the onChange event in react forms.
* @param {string} locator the selenium locator
* @param {string} text the text to type in the field
*/
Selenium
.
prototype
.
doTypeReact
=
function
(
locator
,
newText
)
{
var
input
=
this
.
page
().
findElement
(
locator
);
var
nativeInputValueSetter
=
Object
.
getOwnPropertyDescriptor
(
window
.
HTMLInputElement
.
prototype
,
"
value
"
).
set
;
nativeInputValueSetter
.
call
(
input
,
newText
);
var
ev2
=
new
Event
(
'
input
'
,
{
bubbles
:
true
});
input
.
dispatchEvent
(
ev2
);
};
/**
* Checks the element referenced by `locator` is a float equals to `text`.
...
...
@@ -137,6 +151,7 @@ Selenium.prototype.assertPortalStatusMessage = function(text) {
Assert
.
matches
(
text
,
actualValue
);
};
/*
* Get the location of the current page. This function is missing in
* Selenium 0.8 or later.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment