Skip to content

Commit 80d454c

Browse files
Added Radiobuttons.spec.js
1 parent 43fac0c commit 80d454c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/Buttons/Radiobuttons.spec.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { test, expect } = require('@playwright/test');
2+
3+
test('Verify Radio Buttons', async ({ page }) => {
4+
// Navigate to the radio buttons page
5+
await page.goto('https://qa-practice.netlify.app/radiobuttons');
6+
7+
// Locate the Radio Buttons
8+
const radioButton1 = page.locator('#radio-button1');
9+
const radioButton2 = page.locator('#radio-button2');
10+
const radioButton3 = page.locator('#radio-button3');
11+
const radioButton4Disabled = page.locator('#radio-button4');
12+
13+
// Click on Radio Buttons and verify they are selected
14+
await radioButton1.click();
15+
await expect(radioButton1).toBeChecked();
16+
17+
await radioButton2.click();
18+
await expect(radioButton2).toBeChecked();
19+
20+
await radioButton3.click();
21+
await expect(radioButton3).toBeChecked();
22+
23+
// Verify the disabled radio button
24+
await expect(radioButton4Disabled).toBeDisabled();
25+
});

0 commit comments

Comments
 (0)