Skip to content

Commit

Permalink
Fix selects option in select field #130;
Browse files Browse the repository at this point in the history
fsd
  • Loading branch information
TasneemNatshah committed Mar 29, 2024
1 parent 79e67ff commit 79242a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: An example to select option from drop down list

Scenario: Check of selecting option from drop down list
Given I am on "/test--when--i-select-option-from-dropdownlist.html"
When I select "saab" from "#cars"
When I select "saab" from "cars"
When I press "Check select"
Then I should see "Option ( Saab ) has been selected successfully"

Expand Down
9 changes: 4 additions & 5 deletions tests/step-definitions/webship.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,10 @@ When(/^(I|we)* fill in the following:$/, function (pronoundCase, table) {
*/
When(/^(I|we)* select "([^"]*)?" from "([^"]*)?"$/, function (pronoundCase, option, dropdownlist) {

browser.element('css selector', "select[name=" + dropdownlist + "]", function (result) {
if (result.status === 0) {
return browser.click(dropdownlist + ' option[value=' + option + ']');
}
});
browser.waitForElementVisible('css selector', 'select[name="' + dropdownlist + '"]')
.click('select[name="' + dropdownlist + '"]')
.click('select[name="' + dropdownlist + '"]' + ' option[value=' + option + ']')
.click('select[name="' + dropdownlist + '"]');
});

/**
Expand Down

0 comments on commit 79242a5

Please sign in to comment.