@@ -54,7 +54,7 @@ it('should fill textarea with label', async ({page}) => {
5454
5555it ( 'should throw on unsupported inputs' , async ( { page, server} ) => {
5656 await page . goto ( server . PREFIX + '/input/textarea.html' ) ;
57- for ( const type of [ 'color ' , 'file' ] ) {
57+ for ( const type of [ 'button ' , 'checkbox' , ' file' , 'image' , 'radio' , 'range' , 'reset' , 'submit '] ) {
5858 await page . $eval ( 'input' , ( input , type ) => input . setAttribute ( 'type' , type ) , type ) ;
5959 let error = null ;
6060 await page . fill ( 'input' , '' ) . catch ( e => error = e ) ;
@@ -64,7 +64,7 @@ it('should throw on unsupported inputs', async ({page, server}) => {
6464
6565it ( 'should fill different input types' , async ( { page, server} ) => {
6666 await page . goto ( server . PREFIX + '/input/textarea.html' ) ;
67- for ( const type of [ 'password' , 'search' , 'tel' , 'text' , 'url' ] ) {
67+ for ( const type of [ 'password' , 'search' , 'tel' , 'text' , 'url' , 'invalid-type' ] ) {
6868 await page . $eval ( 'input' , ( input , type ) => input . setAttribute ( 'type' , type ) , type ) ;
6969 await page . fill ( 'input' , 'text ' + type ) ;
7070 expect ( await page . evaluate ( ( ) => window [ 'result' ] ) ) . toBe ( 'text ' + type ) ;
@@ -79,7 +79,7 @@ it('should fill date input after clicking', async ({page, server}) => {
7979} ) ;
8080
8181it ( 'should throw on incorrect date' , ( test , { browserName } ) => {
82- test . skip ( browserName === 'webkit' ) ;
82+ test . skip ( browserName === 'webkit' , 'WebKit does not support date inputs' ) ;
8383} , async ( { page} ) => {
8484 await page . setContent ( '<input type=date>' ) ;
8585 const error = await page . fill ( 'input' , '2020-13-05' ) . catch ( e => e ) ;
@@ -92,8 +92,36 @@ it('should fill time input', async ({page}) => {
9292 expect ( await page . $eval ( 'input' , input => input . value ) ) . toBe ( '13:15' ) ;
9393} ) ;
9494
95+ it ( 'should fill month input' , async ( { page} ) => {
96+ await page . setContent ( '<input type=month>' ) ;
97+ await page . fill ( 'input' , '2020-07' ) ;
98+ expect ( await page . $eval ( 'input' , input => input . value ) ) . toBe ( '2020-07' ) ;
99+ } ) ;
100+
101+ it ( 'should throw on incorrect month' , ( test , { browserName } ) => {
102+ test . skip ( browserName !== 'chromium' , 'Only Chromium supports month inputs' ) ;
103+ } , async ( { page} ) => {
104+ await page . setContent ( '<input type=month>' ) ;
105+ const error = await page . fill ( 'input' , '2020-13' ) . catch ( e => e ) ;
106+ expect ( error . message ) . toContain ( 'Malformed value' ) ;
107+ } ) ;
108+
109+ it ( 'should fill week input' , async ( { page} ) => {
110+ await page . setContent ( '<input type=week>' ) ;
111+ await page . fill ( 'input' , '2020-W50' ) ;
112+ expect ( await page . $eval ( 'input' , input => input . value ) ) . toBe ( '2020-W50' ) ;
113+ } ) ;
114+
115+ it ( 'should throw on incorrect week' , ( test , { browserName } ) => {
116+ test . skip ( browserName !== 'chromium' , 'Only Chromium supports week inputs' ) ;
117+ } , async ( { page} ) => {
118+ await page . setContent ( '<input type=week>' ) ;
119+ const error = await page . fill ( 'input' , '2020-123' ) . catch ( e => e ) ;
120+ expect ( error . message ) . toContain ( 'Malformed value' ) ;
121+ } ) ;
122+
95123it ( 'should throw on incorrect time' , ( test , { browserName } ) => {
96- test . skip ( browserName === 'webkit' ) ;
124+ test . skip ( browserName === 'webkit' , 'WebKit does not support time inputs' ) ;
97125} , async ( { page} ) => {
98126 await page . setContent ( '<input type=time>' ) ;
99127 const error = await page . fill ( 'input' , '25:05' ) . catch ( e => e ) ;
@@ -107,7 +135,7 @@ it('should fill datetime-local input', async ({page, server}) => {
107135} ) ;
108136
109137it ( 'should throw on incorrect datetime-local' , ( test , { browserName } ) => {
110- test . skip ( browserName === 'webkit' || browserName === 'firefox ') ;
138+ test . skip ( browserName !== 'chromium' , 'Only Chromium supports datetime-local inputs ') ;
111139} , async ( { page, server} ) => {
112140 await page . setContent ( '<input type=datetime-local>' ) ;
113141 const error = await page . fill ( 'input' , 'abc' ) . catch ( e => e ) ;
0 commit comments