Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#7055): Expand on image with double click #7308

Merged
merged 13 commits into from
Jan 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move test to 'Example Imagery in Flexible layout'
  • Loading branch information
marcelo-earth committed Dec 20, 2023
commit f0a25e53a2315102d8e8fc0abf71f90c503c32b0
59 changes: 30 additions & 29 deletions e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,36 @@ test.describe('Example Imagery in Display Layout', () => {

test.describe('Example Imagery in Flexible layout', () => {
let flexibleLayout;
test.describe('Example Imagery in Flexible layout', () => {
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });

flexibleLayout = await createDomainObjectWithDefaults(page, { type: 'Flexible Layout' });

// Create Example Imagery inside the Flexible Layout
await createDomainObjectWithDefaults(page, {
type: 'Example Imagery',
parent: flexibleLayout.uuid
});

// Navigate back to Flexible Layout
await page.goto(flexibleLayout.url);
});

test('Can double-click on the image to view large image', async ({ page }) => {
// Double-click on the image to open large view
const imageElement = await page.waitForSelector('.image-wrapper');
await imageElement.dblclick();

// Check if the large view is visible
await page.waitForSelector('.c-imagery__main-image__bg', { state: 'visible' });

// Close the large view
await page.getByLabel('Close').click();
});
});

// let flexibleLayout;
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });

Expand Down Expand Up @@ -556,35 +586,6 @@ test.describe('Example Imagery in Time Strip', () => {
await page.goto(timeStripObject.url);
});

test.describe('Example Imagery in Flexible layout', () => {
let flexibleLayout;
test.beforeEach(async ({ page }) => {
await page.goto('./', { waitUntil: 'domcontentloaded' });

flexibleLayout = await createDomainObjectWithDefaults(page, { type: 'Flexible Layout' });

// Create Example Imagery inside the Flexible Layout
await createDomainObjectWithDefaults(page, {
type: 'Example Imagery',
parent: flexibleLayout.uuid
});

// Navigate back to Flexible Layout
await page.goto(flexibleLayout.url);
});

test('Can double-click on the image to view large image', async ({ page }) => {
// Double-click on the image to open large view
await page.locator('.image-wrapper').dblclick();

// Check if the large view is visible
await page.waitForSelector('.c-imagery__main-image__bg', { state: 'visible' });

// Close the large view
await page.locator('[aria-label="Close"]').click();
});
});

test('Clicking a thumbnail loads the image in large view', async ({ page, browserName }) => {
test.info().annotations.push({
type: 'issue',
Expand Down
Loading