Skip to content

Commit 68981ce

Browse files
committed
verify disabled radio scenario
1 parent 77d871e commit 68981ce

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

wdio-test/features/radio-features/radio.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ Feature: Letcode Radio Page
4545
When I click radio page
4646
And I check and print which option is selected
4747

48+
Examples:
49+
| |
50+
| |
51+
52+
@regression @radio
53+
Scenario Outline: As a user, I can verify that last option is disabled
54+
55+
Given I am on letcode workspace page
56+
When I click radio page
57+
And I verify that last radio option is disabled
58+
4859
Examples:
4960
| |
5061
| |

wdio-test/page-objects/radio-pages/radio.page.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class RadioPage extends Page {
88
get radioNoBugOption(){ return $(`//input[@id='nobug']`) };
99
get radioBugOption(){ return $(`//input[@id='bug']`) };
1010
get fooBarOptions(){ return $$(`//input[@name='foobar']`) };
11+
get disabledOptions(){ return $$(`//input[@id='maybe']`) };
1112

1213
//1. select one radio option
1314
async selectFirstRadio(){
@@ -72,6 +73,11 @@ class RadioPage extends Page {
7273
}
7374
}
7475

76+
async verifyRadioDisabled(){
77+
const elmDisabledOptions = await this.disabledOptions;
78+
await expect(elmDisabledOptions).toBeDisabled();
79+
}
80+
7581
}
7682

7783
export default new RadioPage();

wdio-test/step-definitions/radio-steps/radio.step.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ When(/^I confirm that both option of the third radio automation challenge is sel
3636
await RadioPage.verifyRadioBug();
3737
});
3838

39+
//4. verify which option is selected
3940
When(/^I check and print which option is selected$/, async () => {
4041
await RadioPage.printSelectedOption();
4142
});
43+
44+
//5. verify last radio option is disabled
45+
When(/^I verify that last radio option is disabled$/, async () => {
46+
await RadioPage.verifyRadioDisabled();
47+
});

0 commit comments

Comments
 (0)