Skip to content

[BUG] Disconnect\Reconnect not working in firefox[when using jest-playwright-preset] #2846

@aishwaryadhage

Description

@aishwaryadhage

Context:

  • Playwright Version: [1.0.2]
  • Operating System: [Windows]
  • Node version: [10.16.0]
  • Browser: [Firefox]

Code Snippet

import { HTMLConstants } from "../Constants/HTMLConstants";
import { PageController } from "../Utils/PageController";
import { FeatureController} from "../Utils/FeatureController";
import { TestConfiguration} from "../Utils/TestConfiguration";
import { Utility } from "../Utils/Utility";
import { Frame } from "playwright";

const testSuite = "VRT for reconnect scenario";
describe(testSuite, () => {
    let iframeLCW: Frame;
    beforeAll(async () => {
        await page.goto(TestConfiguration.GetTestUrl());
iframeLCW = await PageController.GetIframe(page);
        await iframeLCW.waitForSelector(HTMLConstants.ChatButtonId);
        await iframeLCW.click(HTMLConstants.ChatButtonId);
    });

    afterAll(async () => {
        await page.close();
    });

    const spec1 = "it has disconnected baner";
    it(spec1, async () => {
        await iframeLCW.waitForSelector(HTMLConstants.SystemWelcomMessageSelector);
        await page.context().setOffline(true);
        await iframeLCW.waitForSelector(HTMLConstants.DisconnectedBannerSelector);
        const image = await page.screenshot();
        expect(image).toMatchImageSnapshot({
            customSnapshotIdentifier: Utility.SnapshotPath(testSuite, spec1)
        });
    });

    const spec2 = "it has reconnect banner";
    it(spec2, async () => {
        await page.context().setOffline(false);
        await iframeLCW.waitForSelector(HTMLConstants.ReconnectedBanerSelector);
        const image = await page.screenshot();
        expect(image).toMatchImageSnapshot({
            customSnapshotIdentifier: Utility.SnapshotPath(testSuite, spec2)
        });
    });
});

Describe the bug
This test is using jest-playwright-preset, this code makes use of iframe. In iframe if there is a reconnect disconnect scenario, a banner for the same shows up. When using firefox, the disconnect\reconnect banners do not appear. This works fine for chromium. We are facing this issue only for firefox.
Also, on firefox browsers, turning offline\online manualy works fine and shows the banners.

Please let me know if further details are required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions