Comments (14)
I found that we do support HTTPS by using http2
flag.
Can you try adding http2: true
to your config, and sslKey
and sslCert
if needed.
// @web/test-runner-core/src/config/TestRunnerCoreConfig.ts
export interface TestRunnerCoreConfig {
// ...
http2?: boolean;
sslKey?: string;
sslCert?: string;
// ...
}
This is documented only in WDS though:
https://modern-web.dev/docs/dev-server/cli-and-configuration/
And not in WTR:
https://modern-web.dev/docs/test-runner/cli-and-configuration/
from web.
Ok I confirm this is working, I only report that the addresses printed on console are still using http
and if you set the open
to true
it opens the http
url resulting to a 404. If I manually fix http --> https it works BTW. I think may be worth adding this to docs too
from web.
Ok I think part of #2540 is also related to this, when http2 is enabled and playwright browsers are lunched the url is wrong there too:
test/browser/test.js:
❌ page.goto: net::ERR_EMPTY_RESPONSE at http://localhost:8001/?wtr-session-id=uqh67wN1nTY5Ieug0bLwQ
=========================== logs ===========================
navigating to "http://localhost:8001/?wtr-session-id=uqh67wN1nTY5Ieug0bLwQ", waiting until "load"
============================================================ (failed on Chromium)
page.goto: net::ERR_EMPTY_RESPONSE at http://localhost:8001/?wtr-session-id=uqh67wN1nTY5Ieug0bLwQ
=========================== logs ===========================
navigating to "http://localhost:8001/?wtr-session-id=uqh67wN1nTY5Ieug0bLwQ", waiting until "load"
============================================================
at PlaywrightLauncherPage.runSession (/home/daniel/GitProjects/MQTT.js/node_modules/@web/test-runner-playwright/dist/PlaywrightLauncherPage.js:26:35)
at async PlaywrightLauncher.startSession (/home/daniel/GitProjects/MQTT.js/node_modules/@web/test-runner-playwright/dist/PlaywrightLauncher.js:45:9)
If I disalble http2 error goes away but still not working because of https errors
from web.
Can you please make a smallest possible reproduction of this issue?
from web.
Just checkout this: mqttjs/MQTT.js#1722
uncomment this lines: https://github.com/mqttjs/MQTT.js/pull/1722/files#diff-7bfdd444e5650854e7536869ef3973956e89fbfc8562197c7c13f99cfb3047bfR41-R43
Then run:
npm install
npx wtr
from web.
By smallest possible reproduction
I mean smth that contains minimum code that is required to show the error, e.g. minimal config and 1 test file with 1 test, not the whole project.
from web.
Btw, auto-open which doesn't respect http2
flag should definitely be fixed. I'm wondering more about the other error you are running into.
from web.
I will create a small repo to reproduce this, in the meanwhile if you want you can try doing what i described in my comment (would save me effort in creating a repro of the issue).
In general seems like http2
flah is completely ignored code wise when building the url, so you see the url wrong everywhere: in console, open, playwright goTo page and so on....
from web.
Here is the smallest possible repro: https://github.com/robertsLando/wtr-bug-test
from web.
Makes sense indeed, thanks for your time analysing this and providing this repro. I saw code that is handling the flag http2
for the URL construction, so I assumed it was working fine, but apparently not in all contexts and not for all features. So looks like it needs more work for WTR. I'd say you probably know enough now to make a fix PR, so give it a shot if you have time.
from web.
Ok so seems the missing piece was this setting:
protocol: 'https:',
When this is set everything else is ok. Not sure if this is expected BTW...
from web.
@robertsLando is http2
still needed then?
I feel like some docs is missing to explain all this. Would be good to work on this improvement, so I'll keep this issue open.
from web.
still needed then
Yeah seems without that something else is broken, I see in some places it uses http2
to build the url and others use protocol
from web.
I'm missing some of the built-in certificate options, specifically .pfx
and .passphrase
as I'm using pfx certificate instead of pem.
It would be nice if you could expose these as well.
More details:
https://nodejs.org/docs/v8.6.0/api/http2.html#http2_http2_createsecureserver_options_onrequesthandler
https://nodejs.org/docs/v8.6.0/api/tls.html#tls_tls_createsecurecontext_options
from web.
Related Issues (20)
- ZION GENERALS
- `testsFinishTimeout` does not print browser logs
- Concurrent tests don't call `requestAnimationFrame` consistently with Puppeteer HOT 2
- browserContext.newPage: Target closed (failed on Webkit) on macOS with M1
- [rollup-plugin-copy] `exports` should be optional
- [test-runner] Support per-test progress instead of per-file
- TypeError: Failed to fetch dynamically imported module: http://localhost:8000/...
- [rollup-plugin-copy][rollup-plugin-import-meta-assets]: type declarations defined in `exports` are not present in the published package
- Could not resolve import '@/utils/string' HOT 1
- Organize monorepo better HOT 8
- [@web/test-runner-visual-regression] Node is detached from document
- [@web/test-runner-playwright] browserType.launch: Executable doesn't exist HOT 1
- [dev-server] Loading library with large number of files freezes Chrome HOT 1
- Issues Implementing @web-test-runner in Docker Environment
- Dooplay theme
- Storybook higher than 7.5.3 does not export globals in @storybook/preview/globals
- Running fails with "cannot find module"
- test-runner-core always emits ansi codes to clear progress bars, even if there aren't progress bars
- Error: ENOENT: no such file or directory, stat '/test-mocks/prism.js'
- [rollup-plugin-html] No clearly documented / easy way to ignore modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web.