Skip to content

Commit 12ea3f2

Browse files
committed
verify radio bug scenario
1 parent 3cdfe72 commit 12ea3f2

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Feature: Letcode Radio Page
1111
Examples:
1212
| |
1313
| |
14-
14+
1515
@regression @radio
1616
Scenario Outline: As a user, I can verify that only one radio option can be selected
1717

@@ -22,6 +22,18 @@ Feature: Letcode Radio Page
2222
And I select the second radio of the second radio automation challenge
2323
And I confirm that the first radio is not selected
2424

25+
Examples:
26+
| |
27+
| |
28+
29+
@regression @radio
30+
Scenario Outline: As a user, I can verify that the radion options has a bug
31+
32+
Given I am on letcode workspace page
33+
When I click radio page
34+
And I select the both radio of the third radio automation challenge
35+
And I confirm that both option of the third radio automation challenge is selected
36+
2537
Examples:
2638
| |
2739
| |

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ class RadioPage extends Page {
55
get firstRadioOption(){ return $(`//input[@id='yes']`) };
66
get radioOneOption(){ return $(`//input[@id='one']`) };
77
get radioTwoOption(){ return $(`//input[@id='two']`) };
8+
get radioNoBugOption(){ return $(`//input[@id='nobug']`) };
9+
get radioBugOption(){ return $(`//input[@id='bug']`) };
810

911
//1. select one radio option
1012
async selectFirstRadio(){
@@ -43,6 +45,22 @@ class RadioPage extends Page {
4345
await expect(elmRadioOneOption).not.toBeSelected();
4446
}
4547

48+
//3. verify that radio options has bug
49+
async selectBothRadioBug(){
50+
const elmRadioNoBugOption = await this.radioNoBugOption;
51+
const elmRadioBugOption = await this.radioBugOption;
52+
await this.click(elmRadioNoBugOption);
53+
await this.click(elmRadioBugOption);
54+
}
55+
56+
async verifyRadioBug(){
57+
const elmRadioNoBugOption = await this.radioNoBugOption;
58+
const elmRadioBugOption = await this.radioBugOption;
59+
await expect(elmRadioNoBugOption).toBeSelected();
60+
await expect(elmRadioBugOption).toBeSelected();
61+
}
62+
63+
4664
}
4765

4866
export default new RadioPage();

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,13 @@ When(/^I select the second radio of the second radio automation challenge$/, asy
2626
When(/^I confirm that the first radio is not selected$/, async () => {
2727
await RadioPage.verifyRadioTwo();
2828
});
29+
30+
//3. verify that radio options has bug
31+
When(/^I select the both radio of the third radio automation challenge$/, async () => {
32+
await RadioPage.selectBothRadioBug();
33+
});
34+
35+
When(/^I confirm that both option of the third radio automation challenge is selected$/, async () => {
36+
await RadioPage.verifyRadioBug();
37+
});
38+

0 commit comments

Comments
 (0)