diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /remote/test/puppeteer/test/src/elementhandle.spec.ts | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'remote/test/puppeteer/test/src/elementhandle.spec.ts')
-rw-r--r-- | remote/test/puppeteer/test/src/elementhandle.spec.ts | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/remote/test/puppeteer/test/src/elementhandle.spec.ts b/remote/test/puppeteer/test/src/elementhandle.spec.ts index 9aaf914224..e0f1e41878 100644 --- a/remote/test/puppeteer/test/src/elementhandle.spec.ts +++ b/remote/test/puppeteer/test/src/elementhandle.spec.ts @@ -34,18 +34,14 @@ describe('ElementHandle specs', function () { expect(box).toEqual({x: 100, y: 50, width: 50, height: 50}); }); it('should handle nested frames', async () => { - const {page, server, isChrome} = await getTestState(); + const {page, server} = await getTestState(); await page.setViewport({width: 500, height: 500}); await page.goto(server.PREFIX + '/frames/nested-frames.html'); const nestedFrame = page.frames()[1]!.childFrames()[1]!; using elementHandle = (await nestedFrame.$('div'))!; const box = await elementHandle.boundingBox(); - if (isChrome) { - expect(box).toEqual({x: 28, y: 182, width: 264, height: 18}); - } else { - expect(box).toEqual({x: 28, y: 182, width: 254, height: 18}); - } + expect(box).toEqual({x: 28, y: 182, width: 300, height: 18}); }); it('should return null for invisible elements', async () => { const {page} = await getTestState(); @@ -472,10 +468,8 @@ describe('ElementHandle specs', function () { }) ).toStrictEqual('bar1'); }); - }); - describe('Element.waitForXPath', () => { - it('should wait correctly with waitForXPath on an element', async () => { + it('should wait correctly with waitForSelector and xpath on an element', async () => { const {page} = await getTestState(); // Set the page content after the waitFor has been started. await page.setContent( @@ -490,20 +484,18 @@ describe('ElementHandle specs', function () { </div>` ); - using el1 = (await page.waitForSelector( + using elById = (await page.waitForSelector( '#el1' )) as ElementHandle<HTMLDivElement>; - for (const path of ['//div', './/div']) { - using e = (await el1.waitForXPath( - path - )) as ElementHandle<HTMLDivElement>; - expect( - await e.evaluate(el => { - return el.id; - }) - ).toStrictEqual('el2'); - } + using elByXpath = (await elById.waitForSelector( + 'xpath/.//div' + )) as ElementHandle<HTMLDivElement>; + expect( + await elByXpath.evaluate(el => { + return el.id; + }) + ).toStrictEqual('el2'); }); }); |