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
e95629af
Commit
e95629af
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
c4c568e0
Changes
1
Hide 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 @
e95629af
...
...
@@ -92,6 +92,20 @@ Selenium.prototype.doSetFile = function(locator, url_and_filename) {
}));
};
/**
* 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`.
...
...
@@ -135,6 +149,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