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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
ea1d2742
Commit
ea1d2742
authored
Oct 06, 2021
by
Cédric Le Ninivin
Committed by
Titouan Soulard
Nov 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_ui_test_core: Add typeReact to type in field managed by reactJS
parent
485583a3
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 @
ea1d2742
...
...
@@ -95,6 +95,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`.
...
...
@@ -138,6 +152,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