We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 151cc55 commit dd2e513Copy full SHA for dd2e513
tests/Btn actions/ShowHideElement.spec.js
@@ -0,0 +1,18 @@
1
+const { test, expect } = require('@playwright/test');
2
+
3
+test('Validate Hide Element functionality', async ({ page }) => {
4
+ const targetUrl = 'https://qa-practice.netlify.app/show-hide-element';
5
+ const hiddenTextSelector = '#hiddenText';
6
+ const btnToHide = '#showHideBtn';
7
8
+ // Navigate to the page and validate initial state
9
+ await page.goto(targetUrl);
10
+ const hiddenText = page.locator(hiddenTextSelector);
11
12
+ await expect(hiddenText).toBeVisible();
13
+ await expect(hiddenText).toHaveText('This text will be hidden');
14
15
+ // Click on the Hide button and verify the element is hidden
16
+ await page.locator(btnToHide).click();
17
+ await expect(hiddenText).toBeHidden();
18
+});
0 commit comments