Skip to content

Commit b5d81a0

Browse files
author
DavertMik
committed
improved selectOption tests
1 parent 4edbd3d commit b5d81a0

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

test/helper/Playwright_test.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -502,20 +502,6 @@ describe('Playwright', function () {
502502
assert.equal(formContents('age'), 'adult')
503503
})
504504

505-
it('should select option using css locator', async () => {
506-
await I.amOnPage('/form/select')
507-
await I.selectOption({ css: '#age' }, '13-21')
508-
await I.click('Submit')
509-
assert.equal(formContents('age'), 'teenage')
510-
})
511-
512-
it('should select option using JSON string css locator', async () => {
513-
await I.amOnPage('/form/select')
514-
await I.selectOption('{"css": "#age"}', '21-60')
515-
await I.click('Submit')
516-
assert.equal(formContents('age'), 'adult')
517-
})
518-
519505
it('should select option using role locator', async () => {
520506
await I.amOnPage('/form/select')
521507
// Select elements have role="combobox" in accessibility tree

test/helper/webapi.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,15 @@ export function tests() {
525525
})
526526
})
527527

528+
describe('#selectOption with JSON string locator', () => {
529+
it('should select option using JSON string css locator', async () => {
530+
await I.amOnPage('/form/select')
531+
await I.selectOption('{"css": "#age"}', '21-60')
532+
await I.click('Submit')
533+
assert.equal(formContents('age'), 'adult')
534+
})
535+
})
536+
528537
describe('#executeScript', () => {
529538
it('should execute synchronous script', async () => {
530539
await I.amOnPage('/')

0 commit comments

Comments
 (0)