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

"If your website invokes a native dialog on startup" documentation doesn't work for local tests #8378

Closed
DanKaplanSES opened this issue Feb 15, 2025 · 2 comments
Labels
STATE: Need clarification An issue lacks information for further research. TYPE: bug The described behavior is considered as wrong (bug).

Comments

@DanKaplanSES
Copy link

DanKaplanSES commented Feb 15, 2025

What is your Scenario?

I'm writing this as a bug because the documentation is incorrect. This page says:

If your website invokes a native dialog on startup, start the test from a different page (for example: about:blank). Initialize a handler and use the t.navigateTo method to open your website.

Important
Use an absolute path/URL to navigate away from the about:blank page.

Starting at an absolute file path won't work if you are testing locally because you will get an error when attempt to navigate away from about:blank:

What is the Current behavior?

hammerhead.js:43848 Not allowed to load local resource:

I'm using testcafe-hammerhead version 31.7.5.

What is the Expected behavior?

Rewrite the "Use an absolute path/URL to navigate away from the about:blank page" documentation to be unambiguous. Here are some examples:

  1. Use an absolute URL path to navigate away from the about:blank page
  2. Use an absolute URL with a URL protocol to navigate away from the about:blank page

What is the public URL of the test page? (attach your complete example)

about:blank

What is your TestCafe test code?

import { resolve } from 'path';
...
  await t.setNativeDialogHandler((type, text) => {
    throw new Error(text);
  });
  await t
    .navigateTo(`file:///` + resolve(`dist/index.html`))

Your complete configuration file

{
  "browsers": ["chrome"],
  "reporter": {
    "name": "spec-time"
  },
  "screenshots": {
    "takeOnFails": true,
    "fullPage": true
  },
  "concurrency": 1,
  "clientScripts": [
    {
      "path": "testcafe-client-scripts/jquery-3.7.1.min.js"
    },
    {
      "path": "testcafe-client-scripts/scriptContent.js"
    }
  ]
}

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

n/a

TestCafe version

3.7.1

Node.js version

v22.13.0

Command-line arguments

testcafe 'end-to-end-tests/**.test.js'

Browser name(s) and version(s)

Chrome

Platform(s) and version(s)

Windows 10

Other

No response

@DanKaplanSES DanKaplanSES added the TYPE: bug The described behavior is considered as wrong (bug). label Feb 15, 2025
@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 15, 2025
@Bayheck
Copy link
Collaborator

Bayheck commented Feb 19, 2025

Hello,

I did not manage to reproduce the described behavior.

Could you please create a reproducible minimal example?

@Bayheck Bayheck added STATE: Need clarification An issue lacks information for further research. and removed STATE: Need response An issue that requires a response or attention from the team. labels Feb 19, 2025
Copy link

github-actions bot commented Mar 1, 2025

This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone.

@github-actions github-actions bot closed this as completed Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATE: Need clarification An issue lacks information for further research. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants