Created
December 16, 2024 00:11
-
-
Save jnbdz/a861872c248c4a79ae6f4110bd6c55f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//await expect(page.locator("#box-tabs")).toBeInViewport(); | |
// Check if specific tabs are present and visible | |
/*const heryTab = page.locator('#box-tabs-hery-file-link'); | |
const cacheTab = page.locator('#box-tabs-cache-link'); | |
const uploadTab = page.locator('#box-tabs-eql-link'); | |
await expect(heryTab).toBeVisible(); | |
await expect(cacheTab).toBeVisible(); | |
await expect(uploadTab).toBeVisible(); | |
// Optionally verify the text content of each tab | |
await expect(heryTab).toHaveText('HERY file'); | |
await expect(cacheTab).toHaveText('Cache'); | |
await expect(uploadTab).toHaveText('Upload');*/ | |
// Locators for tabs | |
/*const heryTab = page.locator('#box-tabs-hery-file-link'); | |
const cacheTab = page.locator('#box-tabs-cache-link'); | |
const uploadTab = page.locator('#box-tabs-eql-link'); | |
// Locators for tab contents | |
const heryContent = page.locator('.pf-v6-l-split__item', { hasText: 'HERY file content' }); | |
const cacheContent = page.locator('.pf-v6-l-split__item', { hasText: 'Cache content' }); | |
const uploadContent = page.locator('.pf-v6-l-split__item', { hasText: 'Upload content' });*/ | |
// Click HERY tab and verify its content is visible | |
/*await heryTab.click(); | |
await expect(heryContent).toBeVisible(); | |
await expect(cacheContent).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Cache tab and verify its content is visible | |
await cacheTab.click(); | |
await expect(cacheContent).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Upload tab and verify its content is visible | |
await uploadTab.click(); | |
await expect(uploadContent).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(cacheContent).not.toBeVisible();*/ | |
// Locators for tabs | |
/*const heryTab = page.locator('#box-tabs-hery-file-link'); | |
const cacheTab = page.locator('#box-tabs-cache-link'); | |
const uploadTab = page.locator('#box-tabs-eql-link'); | |
// Locators for tab contents by class binding | |
const heryContent = page.locator('.pf-v6-l-split__item', { has: page.locator("[activeTab='hery']") }); | |
const cacheContent = page.locator('.pf-v6-l-split__item', { has: page.locator("[activeTab='cache']") }); | |
const uploadContent = page.locator('.pf-v6-l-split__item', { has: page.locator("[activeTab='upload']") }); | |
// Click HERY tab and verify its content is visible | |
await heryTab.click(); | |
await expect(heryContent).toBeVisible(); | |
await expect(cacheContent).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Cache tab and verify its content is visible | |
await cacheTab.click(); | |
await expect(cacheContent).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Upload tab and verify its content is visible | |
await uploadTab.click(); | |
await expect(uploadContent).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(cacheContent).not.toBeVisible();*/ | |
// Locators for tabs | |
/*const heryTab = page.locator('#box-tabs-hery-file-link'); | |
const cacheTab = page.locator('#box-tabs-cache-link'); | |
const uploadTab = page.locator('#box-tabs-eql-link'); | |
// Locators for tab contents and side menus using unique IDs | |
const heryContent = page.locator('#tab-content-hery'); | |
const herySideMenu = page.locator('#tab-right-side-menu-hery'); | |
const cacheContent = page.locator('#tab-content-cache'); | |
const cacheSideMenu = page.locator('#tab-right-side-menu-cache'); | |
const uploadContent = page.locator('#tab-content-upload'); | |
// Ensure tabs are visible | |
await expect(heryTab).toBeVisible(); | |
await expect(cacheTab).toBeVisible(); | |
await expect(uploadTab).toBeVisible(); | |
// Optionally verify the text content of each tab | |
await expect(heryTab).toHaveText('HERY file'); | |
await expect(cacheTab).toHaveText('Cache'); | |
await expect(uploadTab).toHaveText('Upload'); | |
// Click HERY tab and verify its content and side menu are visible | |
await heryTab.click(); | |
await expect(heryContent).toBeVisible(); | |
await expect(herySideMenu).toBeVisible(); | |
await expect(cacheContent).not.toBeVisible(); | |
await expect(cacheSideMenu).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Cache tab and verify its content and side menu are visible | |
await cacheTab.click(); | |
await expect(cacheContent).toBeVisible(); | |
await expect(cacheSideMenu).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(herySideMenu).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Upload tab and verify its content is visible (no side menu expected for Upload tab) | |
await uploadTab.click(); | |
await expect(uploadContent).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(herySideMenu).not.toBeVisible(); | |
await expect(cacheContent).not.toBeVisible(); | |
await expect(cacheSideMenu).not.toBeVisible();*/ | |
// Locators for tabs | |
/*const heryTab = page.locator('#box-tabs-hery-file-link'); | |
const cacheTab = page.locator('#box-tabs-cache-link'); | |
const uploadTab = page.locator('#box-tabs-eql-link'); | |
// Locators for tab contents and side menus using unique IDs | |
const heryContent = page.locator('#tab-content-hery'); | |
const herySideMenu = page.locator('#tab-right-side-menu-hery'); | |
const cacheContent = page.locator('#tab-content-cache'); | |
const cacheSideMenu = page.locator('#tab-right-side-menu-cache'); | |
const uploadContent = page.locator('#tab-content-upload'); | |
// Ensure tabs are visible | |
await expect(heryTab).toBeVisible(); | |
await expect(cacheTab).toBeVisible(); | |
await expect(uploadTab).toBeVisible(); | |
// Optionally verify the text content of each tab | |
await expect(heryTab).toHaveText('HERY file'); | |
await expect(cacheTab).toHaveText('Cache'); | |
await expect(uploadTab).toHaveText('Upload'); | |
// Click HERY tab and verify its content and side menu are visible | |
await heryTab.click(); | |
// Wait for the side menu and content to be visible | |
await page.waitForSelector('#tab-right-side-menu-hery', { state: 'visible' }); | |
await expect(heryContent).toBeVisible(); | |
await expect(herySideMenu).toBeVisible(); | |
await expect(cacheContent).not.toBeVisible(); | |
await expect(cacheSideMenu).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Cache tab and verify its content and side menu are visible | |
await cacheTab.click(); | |
// Wait for the side menu and content to be visible | |
await page.waitForSelector('#tab-right-side-menu-cache', { state: 'visible' }); | |
await expect(cacheContent).toBeVisible(); | |
await expect(cacheSideMenu).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(herySideMenu).not.toBeVisible(); | |
await expect(uploadContent).not.toBeVisible(); | |
// Click Upload tab and verify its content is visible (no side menu expected for Upload tab) | |
await uploadTab.click(); | |
// Wait for the content to be visible | |
await page.waitForSelector('#tab-content-upload', { state: 'visible' }); | |
await expect(uploadContent).toBeVisible(); | |
await expect(heryContent).not.toBeVisible(); | |
await expect(herySideMenu).not.toBeVisible(); | |
await expect(cacheContent).not.toBeVisible(); | |
await expect(cacheSideMenu).not.toBeVisible();*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment