@@ -43,89 +43,89 @@ test('JSON Schema validation', async ({ page, workflow }) => {
4343 const input = form . getByLabel ( 'Required string' , { exact : true } ) ;
4444 await input . fill ( 'foo' ) ;
4545 await input . fill ( '' ) ;
46- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 1 ) ;
46+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 1 ) ;
4747 await input . fill ( 'bar' ) ;
48- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
48+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
4949 // Check that export button is disabled when there are some pending changes
50- expect ( await page . getByRole ( 'button' , { name : / .* E x p o r t $ / } ) . isDisabled ( ) ) . toEqual ( true ) ;
50+ await expect ( page . getByRole ( 'button' , { name : / .* E x p o r t $ / } ) ) . toBeDisabled ( ) ;
5151 } ) ;
5252
5353 await test . step ( 'Fill optional string' , async ( ) => {
5454 const input = form . getByLabel ( 'Optional string' , { exact : true } ) ;
5555 await input . fill ( 'foo' ) ;
5656 await input . fill ( '' ) ;
57- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
57+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
5858 } ) ;
5959
6060 await test . step ( 'Select required option' , async ( ) => {
6161 await page . getByRole ( 'combobox' , { name : 'Required enum' } ) . selectOption ( 'option1' ) ;
62- await page . getByRole ( 'combobox' , { name : 'Required enum' } ) . selectOption ( 'null ' ) ;
63- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 1 ) ;
62+ await page . getByRole ( 'combobox' , { name : 'Required enum' } ) . selectOption ( '' ) ;
63+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 1 ) ;
6464 await page . getByRole ( 'combobox' , { name : 'Required enum' } ) . selectOption ( 'option1' ) ;
65- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
65+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
6666 } ) ;
6767
6868 await test . step ( 'Select optional option' , async ( ) => {
6969 await page . getByRole ( 'combobox' , { name : 'Optional enum' } ) . selectOption ( 'option1' ) ;
70- await page . getByRole ( 'combobox' , { name : 'Optional enum' } ) . selectOption ( 'null ' ) ;
71- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
70+ await page . getByRole ( 'combobox' , { name : 'Optional enum' } ) . selectOption ( '' ) ;
71+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
7272 } ) ;
7373
7474 await test . step ( 'Fill required integer with min and max' , async ( ) => {
7575 const input = form . getByLabel ( 'minMaxRequiredInt' , { exact : true } ) ;
7676 // Note: the only allowed characted in chrome is an "e" (for the scientific notation)
7777 await input . pressSequentially ( 'e' ) ;
78- expect ( form . getByText ( 'Should be a number' ) ) . toHaveCount ( 1 ) ;
78+ await expect ( form . getByText ( 'Should be a number' ) ) . toHaveCount ( 1 ) ;
7979 await input . fill ( '1' ) ;
80- expect ( form . getByText ( 'Should be greater or equal than 5' ) ) . toHaveCount ( 1 ) ;
80+ await expect ( form . getByText ( 'Should be greater or equal than 5' ) ) . toHaveCount ( 1 ) ;
8181 await input . fill ( '15' ) ;
82- expect ( form . getByText ( 'Should be lower or equal than 10' ) ) . toHaveCount ( 1 ) ;
82+ await expect ( form . getByText ( 'Should be lower or equal than 10' ) ) . toHaveCount ( 1 ) ;
8383 await input . fill ( '' ) ;
84- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 1 ) ;
84+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 1 ) ;
8585 await input . fill ( '8' ) ;
86- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
86+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
8787 } ) ;
8888
8989 await test . step ( 'Fill optional integer with min and max' , async ( ) => {
9090 const input = form . getByLabel ( 'minMaxOptionalInt' , { exact : true } ) ;
9191 // Note: the only allowed characted in chrome is an "e" (for the scientific notation)
9292 await input . pressSequentially ( 'e' ) ;
93- expect ( form . getByText ( 'Should be a number' ) ) . toHaveCount ( 1 ) ;
93+ await expect ( form . getByText ( 'Should be a number' ) ) . toHaveCount ( 1 ) ;
9494 await input . fill ( '-7' ) ;
95- expect ( form . getByText ( 'Should be greater or equal than 0' ) ) . toHaveCount ( 1 ) ;
95+ await expect ( form . getByText ( 'Should be greater or equal than 0' ) ) . toHaveCount ( 1 ) ;
9696 await input . fill ( '33' ) ;
97- expect ( form . getByText ( 'Should be lower or equal than 8' ) ) . toHaveCount ( 1 ) ;
97+ await expect ( form . getByText ( 'Should be lower or equal than 8' ) ) . toHaveCount ( 1 ) ;
9898 await input . fill ( '' ) ;
99- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
99+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
100100 } ) ;
101101
102102 await test . step ( 'Fill optional integer with exclusive min and max' , async ( ) => {
103103 const input = form . getByLabel ( 'exclusiveMinMaxOptionalInt' , { exact : true } ) ;
104104 // Note: the only allowed characted in chrome is an "e" (for the scientific notation)
105105 await input . pressSequentially ( 'e' ) ;
106- expect ( form . getByText ( 'Should be a number' ) ) . toHaveCount ( 1 ) ;
106+ await expect ( form . getByText ( 'Should be a number' ) ) . toHaveCount ( 1 ) ;
107107 await input . fill ( '2' ) ;
108- expect ( form . getByText ( 'Should be greater or equal than 4' ) ) . toHaveCount ( 1 ) ;
108+ await expect ( form . getByText ( 'Should be greater or equal than 4' ) ) . toHaveCount ( 1 ) ;
109109 await input . fill ( '99' ) ;
110- expect ( form . getByText ( 'Should be lower or equal than 41' ) ) . toHaveCount ( 1 ) ;
110+ await expect ( form . getByText ( 'Should be lower or equal than 41' ) ) . toHaveCount ( 1 ) ;
111111 await input . fill ( '' ) ;
112- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
112+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
113113 } ) ;
114114
115115 await test . step ( 'Required boolean' , async ( ) => {
116116 const booleanSwitch = form . getByRole ( 'switch' ) ;
117- expect ( await booleanSwitch . isChecked ( ) ) . toEqual ( false ) ;
117+ await expect ( booleanSwitch ) . not . toBeChecked ( ) ;
118118 await booleanSwitch . check ( ) ;
119- expect ( await booleanSwitch . isChecked ( ) ) . toEqual ( true ) ;
119+ await expect ( booleanSwitch ) . toBeChecked ( ) ;
120120 await booleanSwitch . uncheck ( ) ;
121- expect ( await booleanSwitch . isChecked ( ) ) . toEqual ( false ) ;
121+ await expect ( booleanSwitch ) . not . toBeChecked ( ) ;
122122 } ) ;
123123
124124 await test . step ( 'Required array with minItems and maxItems' , async ( ) => {
125125 const addBtn = form . getByRole ( 'button' , { name : 'Add argument to list' } ) . first ( ) ;
126126 await addBtn . click ( ) ;
127127 await addBtn . click ( ) ;
128- expect ( await addBtn . isDisabled ( ) ) . toEqual ( true ) ;
128+ await expect ( addBtn ) . toBeDisabled ( ) ;
129129 const block = form . locator ( '.property-block' , {
130130 has : page . getByText ( 'requiredArrayWithMinMaxItems' )
131131 } ) ;
@@ -145,7 +145,7 @@ test('JSON Schema validation', async ({ page, workflow }) => {
145145 await checkFirstArray ( block , [ 'a' , 'b' , 'd' , 'c' ] ) ;
146146 // Remove items
147147 await form . getByRole ( 'button' , { name : 'Remove' } ) . nth ( 3 ) . click ( ) ;
148- expect ( await addBtn . isDisabled ( ) ) . toEqual ( false ) ;
148+ await expect ( addBtn ) . not . toBeDisabled ( ) ;
149149 await form . getByRole ( 'button' , { name : 'Remove' } ) . nth ( 2 ) . click ( ) ;
150150 await checkFirstArray ( block , [ 'a' , 'b' ] ) ;
151151 } ) ;
@@ -156,7 +156,7 @@ test('JSON Schema validation', async ({ page, workflow }) => {
156156 */
157157 async function checkFirstArray ( block , expectedValues ) {
158158 for ( let i = 0 ; i < expectedValues . length ; i ++ ) {
159- expect ( await block . getByRole ( 'textbox' ) . nth ( i ) . inputValue ( ) ) . toEqual ( expectedValues [ i ] ) ;
159+ await expect ( block . getByRole ( 'textbox' ) . nth ( i ) ) . toHaveValue ( expectedValues [ i ] ) ;
160160 }
161161 }
162162
@@ -166,18 +166,18 @@ test('JSON Schema validation', async ({ page, workflow }) => {
166166 await addBtn . click ( ) ;
167167 await addBtn . click ( ) ;
168168 await addBtn . click ( ) ;
169- expect ( await addBtn . isDisabled ( ) ) . toEqual ( true ) ;
169+ await expect ( addBtn ) . toBeDisabled ( ) ;
170170 const block = form . locator ( '.property-block' , {
171171 has : page . getByText ( 'optionalArrayWithMinMaxItems' )
172172 } ) ;
173173 await block . getByRole ( 'textbox' ) . nth ( 0 ) . fill ( 'a' ) ;
174174 await block . getByRole ( 'textbox' ) . nth ( 1 ) . fill ( 'b' ) ;
175175 await block . getByRole ( 'textbox' ) . nth ( 2 ) . fill ( 'c' ) ;
176176 await form . getByRole ( 'button' , { name : 'Remove' } ) . nth ( 2 ) . click ( ) ;
177- expect ( await addBtn . isDisabled ( ) ) . toEqual ( false ) ;
177+ await expect ( addBtn ) . not . toBeDisabled ( ) ;
178178 await form . getByRole ( 'button' , { name : 'Remove' } ) . nth ( 1 ) . click ( ) ;
179179 await form . getByRole ( 'button' , { name : 'Remove' } ) . nth ( 0 ) . click ( ) ;
180- expect ( block . getByRole ( 'textbox' ) ) . toHaveCount ( 0 ) ;
180+ await expect ( block . getByRole ( 'textbox' ) ) . toHaveCount ( 0 ) ;
181181 } ) ;
182182
183183 await test . step ( 'Object with nested properties' , async ( ) => {
@@ -187,13 +187,13 @@ test('JSON Schema validation', async ({ page, workflow }) => {
187187 } ) ;
188188
189189 await test . step ( 'Attempt to save with missing required fields' , async ( ) => {
190- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
190+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 0 ) ;
191191 const stringInput = form . getByLabel ( 'Required string' , { exact : true } ) ;
192192 await stringInput . fill ( '' ) ;
193193 const intInput = form . getByLabel ( 'minMaxRequiredInt' , { exact : true } ) ;
194194 await intInput . fill ( '' ) ;
195195 await page . getByRole ( 'button' , { name : 'Save changes' } ) . click ( ) ;
196- expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 2 ) ;
196+ await expect ( form . getByText ( 'Field is required' ) ) . toHaveCount ( 2 ) ;
197197 } ) ;
198198
199199 await test . step ( 'Save values' , async ( ) => {
0 commit comments