Skip to content

Commit 4f47864

Browse files
committed
e2e: fix some popup tests
Probably points rendering has changed a bit
1 parent 7aa56c3 commit 4f47864

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

tests/end2end/playwright/popup.spec.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ test.describe('Popup Geometry',
462462
// Get default buffer with one point
463463
let buffer = await page.screenshot({clip:{x:425, y:325, width:100, height:100}});
464464
const defaultByteLength = buffer.byteLength;
465-
await expect(defaultByteLength).toBeGreaterThan(900); // 906
466-
await expect(defaultByteLength).toBeLessThan(1000) // 906
465+
expect(defaultByteLength).toBeGreaterThan(800); // 851
466+
expect(defaultByteLength).toBeLessThan(900) // 851
467467

468468
// Click on a point
469469
let getFeatureInfoPromise = project.waitForGetFeatureInfoRequest();
@@ -473,23 +473,21 @@ test.describe('Popup Geometry',
473473

474474
// The geometry is displayed
475475
buffer = await page.screenshot({clip:{x:425, y:325, width:100, height:100}});
476-
await expect(buffer.byteLength).not.toBe(defaultByteLength);
477-
await expect(buffer.byteLength).toBeGreaterThan(defaultByteLength);
476+
expect(buffer.byteLength).toBeGreaterThan(defaultByteLength);
478477

479478
// Close popup
480479
page.locator('#button-popupcontent').click();
481480
await page.waitForTimeout(50);
482481

483482
buffer = await page.screenshot({clip:{x:425, y:325, width:100, height:100}});
484-
await expect(buffer.byteLength).toBe(defaultByteLength);
483+
expect(buffer.byteLength).toBe(defaultByteLength);
485484

486485
// Open popup
487486
page.locator('#button-popupcontent').click();
488-
await page.waitForTimeout(50);
487+
await page.waitForTimeout(100);
489488

490489
buffer = await page.screenshot({clip:{x:425, y:325, width:100, height:100}});
491-
await expect(buffer.byteLength).not.toBe(defaultByteLength);
492-
await expect(buffer.byteLength).toBeGreaterThan(defaultByteLength);
490+
expect(buffer.byteLength).toBeGreaterThan(defaultByteLength);
493491
});
494492

495493
test('Show/hide the geometry on click on the map', async ({ page }) => {
@@ -499,8 +497,8 @@ test.describe('Popup Geometry',
499497
// Get default buffer with one point
500498
let buffer = await page.screenshot({clip:{x:425, y:325, width:100, height:100}});
501499
const defaultByteLength = buffer.byteLength;
502-
await expect(defaultByteLength).toBeGreaterThan(900); // 906
503-
await expect(defaultByteLength).toBeLessThan(1000) // 906
500+
expect(defaultByteLength).toBeGreaterThan(800); // 851
501+
expect(defaultByteLength).toBeLessThan(900) // 851
504502

505503
// Click on a point
506504
let getFeatureInfoPromise = project.waitForGetFeatureInfoRequest();
@@ -510,8 +508,7 @@ test.describe('Popup Geometry',
510508

511509
// The geometry is displayed
512510
buffer = await page.screenshot({clip:{x:425, y:325, width:100, height:100}});
513-
await expect(buffer.byteLength).not.toBe(defaultByteLength);
514-
await expect(buffer.byteLength).toBeGreaterThan(defaultByteLength);
511+
expect(buffer.byteLength).toBeGreaterThan(defaultByteLength);
515512

516513
// Not click on a point
517514
getFeatureInfoPromise = project.waitForGetFeatureInfoRequest();
@@ -522,7 +519,7 @@ test.describe('Popup Geometry',
522519

523520
// Nothing
524521
buffer = await page.screenshot({clip:{x:425, y:325, width:100, height:100}});
525-
await expect(buffer.byteLength).toBe(defaultByteLength);
522+
expect(buffer.byteLength).toBe(defaultByteLength);
526523
});
527524
});
528525

0 commit comments

Comments
 (0)