elements / accordion & tabs

Advanced element

Accordion & Tabs

Collapsible accordion panels with ARIA state assertions, and tabbed interfaces for multi-panel views.

Collapsible accordion

#accordion
Manual testing involves human testers executing test cases step-by-step without automated tools to discover defects, usability flaws, and exploratory findings.
Automation testing utilizes specialized frameworks (like Selenium, Playwright, Cypress) to execute repetitive regression tests quickly, reliably, and continuously in CI/CD.
Stable locators (like unique element IDs or data-testid tags) prevent brittle automated test suites by isolating tests from superficial CSS or DOM structural changes.
container
#accordion
buttons
acc-btn-1..3
panels
acc-panel-1..3
expected
Clicking an item expands its panel, closes siblings, and toggles aria-expanded.
Code snippets
Python (Selenium)
btn1 = driver.find_element(By.ID, "acc-btn-1")
btn1.click()
assert btn1.get_attribute("aria-expanded") == "true"
panel1 = driver.find_element(By.ID, "acc-panel-1")
assert panel1.is_displayed()
assert "Manual testing" in panel1.text
TypeScript (Playwright)
await page.click('#acc-btn-1');
expect(await page.getAttribute('#acc-btn-1', 'aria-expanded')).toBe('true');
await expect(page.locator('#acc-panel-1')).toBeVisible();
expect(await page.textContent('#acc-panel-1')).toContain('Manual testing');

Tabbed navigation

#tab-list

Project BugMukti v2.0

Total 18 practice benches loaded across UI, form, and table verification modules.

  • Smoke Tests (Passing: 12/12)
  • Regression Suite (Passing: 85/85)
  • Cross-browser Matrix (Chrome, Firefox, Safari)

Bug #104: Character limit glitch on legacy mobile browser

Bug #105: Deprecated timeout wait condition in script v1

tabs
tab-btn-1..3
panels
tab-panel-1..3
expected
Only the selected tab has class 'active' and aria-selected='true'; active panel displayed.
Code snippets
Python (Selenium)
driver.find_element(By.ID, "tab-btn-2").click()
assert "active" in driver.find_element(By.ID, "tab-btn-2").get_attribute("class")
assert driver.find_element(By.ID, "tab-panel-2").is_displayed()
assert not driver.find_element(By.ID, "tab-panel-1").is_displayed()
TypeScript (Playwright)
await page.click('#tab-btn-2');
expect(await page.getAttribute('#tab-btn-2', 'class')).toContain('active');
await expect(page.locator('#tab-panel-2')).toBeVisible();
await expect(page.locator('#tab-panel-1')).toBeHidden();