File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -749,12 +749,10 @@ class Puppeteer extends Helper {
749
749
// await el.focus();
750
750
const tag = await el . getProperty ( 'tagName' ) . then ( el => el . jsonValue ( ) ) ;
751
751
const editable = await el . getProperty ( 'contenteditable' ) . then ( el => el . jsonValue ( ) ) ;
752
-
753
- if ( tag === 'TEXTAREA' || editable ) {
754
- await this . _evaluateHandeInContext ( el => el . innerHTML = '' , el ) ;
755
- }
756
- if ( tag === 'INPUT' ) {
752
+ if ( tag === 'INPUT' || tag === 'TEXTAREA' ) {
757
753
await this . _evaluateHandeInContext ( el => el . value = '' , el ) ;
754
+ } else if ( editable ) {
755
+ await this . _evaluateHandeInContext ( el => el . innerHTML = '' , el ) ;
758
756
}
759
757
await el . type ( value , { delay : 10 } ) ;
760
758
return this . _waitForAction ( ) ;
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ module.exports = function (suite) {
64
64
Object . keys ( deps ) . forEach ( ( key ) => {
65
65
test . inject [ key ] = deps [ key ] ;
66
66
} ) ;
67
- }
67
+ } ;
68
68
test . file = file ;
69
69
test . async = true ;
70
70
test . timeout ( 0 ) ;
Original file line number Diff line number Diff line change @@ -319,6 +319,14 @@ module.exports.tests = function () {
319
319
return assert . equal ( formContents ( 'description' ) , 'Nothing special' ) ;
320
320
} ) ;
321
321
322
+ it ( 'should fill textarea by overwritting the existing value' , function * ( ) {
323
+ yield I . amOnPage ( '/form/textarea' ) ;
324
+ yield I . fillField ( 'Description' , 'Nothing special' ) ;
325
+ yield I . fillField ( 'Description' , 'Some other text' ) ;
326
+ yield I . click ( 'Submit' ) ;
327
+ return assert . equal ( formContents ( 'description' ) , 'Some other text' ) ;
328
+ } ) ;
329
+
322
330
it ( 'should append field value' , function * ( ) {
323
331
yield I . amOnPage ( '/form/field' ) ;
324
332
yield I . appendField ( 'Name' , '_AND_NEW' ) ;
You can’t perform that action at this time.
0 commit comments