mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #905] pw.response seems not to work #321
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#321
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lapo-luchini on GitHub (May 27, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/905
Describe the bug
Examples from the wiki page seem not to work (yet?).
To Reproduce
pw.expect(pw.response.status).toBe(200);Expected Cannot read property 'value' of undefined to be 200Expected behavior
A successful test.
Screenshots

Desktop (please complete the following information):
(using extension to do the clal locally, since it's only accessible via a VPN)
@liyasthomas commented on GitHub (May 27, 2020):
@lapo-luchini can you share a reproducible endpoint/link?
I can't reproduce the issue at my end.
@lapo-luchini commented on GitHub (May 27, 2020):
I seem to be able to reproduce that with any RESP API really (thankfully, because my own is only accessible via private VPN) and even without variables / environments:
URL:
http://dummy.restapiexample.com/api/v1/employeesTest code:
Same result:

Application reports itself to be v.1.9.7, by the way.
@liyasthomas commented on GitHub (May 27, 2020):
The endpoint:
http://dummy.restapiexample.com/api/v1/employeeswon't work because it is served withhttpprotocol. I tried withhttpsbut it refused to connect.Postwoman being hosted in
httpsprotocol - browser will restrict all non-securehttprequests.To test non-https endpoints, please use Browser extension (link in readme) or Toggle Proxy mode on from settings > proxy.
And also, tests works fine - let me know whether the issue still persists.
@lapo-luchini commented on GitHub (May 27, 2020):
But I am using the browser extension, in fact.

And, watching the extension's background page, the request worked correctly too:
@liyasthomas commented on GitHub (May 28, 2020):
Can you check if there's any errors in console log?
@lapo-luchini commented on GitHub (May 28, 2020):
Yes there is, I tried debugging but the (internally beautified) code isn't clear to me.
(I tried with a local
git clone+npm run servebut then it's inhttpand doesn't happen)Do you have an
httpsdeploy with included SourceMaps?(I also tried deploying it in
httpson my own, but then it fails connecting to my Chrome extension)Console error:
Innermost line:
null !== F.a.currentUser && F.a.currentSettings[2].value && F.a.writeHistory(r)Third line:
return { type: "normal", arg: t.call(e, n) }@liyasthomas commented on GitHub (May 28, 2020):
Try clearing all app cache and uninstalling service worker from dev tools. Also are logged in with Google/GitHub?
@lapo-luchini commented on GitHub (May 29, 2020):
Cleaned app cache & unregistered worker: it works now!
I was logged in with GitHub, yes.
Now I logged again and it seems to be still working.