Skip to content

Inconsistency between WDIO and Playwright with reload and onbeforeunload event #2381

Open

Description

@viper3400

What happened?

I have a page that should warn the user that they will loose changes when reloading a page in browser. I use the window.onbeforeunload event.

In my test automation spec I

  • navigate to this page,
  • then do a reload,
  • then navigate to another page.

What did you expect to happen?

This works with WebdriverIO implementation but not with Playwright. The second navigate is not executed. I would have expected that the dialog is ignored in Playwright and the navigate would be exeucted: https://playwright.dev/docs/dialogs#introduction

At least, I would expect a consistent behaviour in both automation tools.

I haven't checked yet if this is a just a Serenity/JS issue or could be reproduced in vanilla Playwright, as well.

Node.js version

20.12.2

Execution environment

MacOs, WDIO, Playwright

How to reproduce the bug.

https://github.com/viper3400/serenity-js/commit/5cf2d2468912cc027dec338dd115bf4caca9ff0f

Serenity/JS version

Serenity/JS 3.23.0

Activity

  1. changed the title [-]Inconsitency between WDIO and Playwright with reload and onbeforeunload event[/-] [+]Inconsistency between WDIO and Playwright with reload and onbeforeunload event[/+] on May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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