Skip to content

Commit

Permalink
Add test for checking image caption
Browse files Browse the repository at this point in the history
  • Loading branch information
jescalada committed Sep 4, 2024
1 parent db5ad0e commit 01bd5a6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/e2e/ImagesExplorer/ImagesExplorer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,35 @@ test.describe('Images Explorer', () => {
expect(page.url()).toBe(IMAGES_PAGE);
});

test('Check if image caption is present', async ({ page }) => {
// Select the latest experiment
const experimentsIcon = page.locator('.icon-arrow-down');
await experimentsIcon.click();

const experiment = page.locator(
'.ExperimentSelectionPopover__contentContainer__experimentsListContainer__experimentList > :last-child',
);
await experiment.click();

// Close the experiment selection popover
await page.mouse.click(0, 0);

// Select the available image name and search
const imagesIcon = page.locator('.icon-plus');
await imagesIcon.click();
const option = page.locator('.SelectForm__option');
await option.click();
const searchIcon = page.locator('.icon-search');
await searchIcon.click();

await page.waitForSelector('.Table');
const mediaSet = page.locator('.MediaSet');
const imageBoxWithCaption = mediaSet.locator('.ImageBox .Text', {
hasText: 'example image caption',
});

expect(await imageBoxWithCaption.count()).toBeGreaterThan(0);
});

test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
Expand Down

0 comments on commit 01bd5a6

Please sign in to comment.