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

Is there any way to run Dawn without Chrome? #24

Closed
MVEMCJSUNPE opened this issue Nov 9, 2020 · 4 comments · Fixed by #52
Closed

Is there any way to run Dawn without Chrome? #24

MVEMCJSUNPE opened this issue Nov 9, 2020 · 4 comments · Fixed by #52
Labels
Needs Investigation This item needs to be investigated further

Comments

@MVEMCJSUNPE
Copy link

MVEMCJSUNPE commented Nov 9, 2020

Summary

It seems that Dawn needs Chrome to work. However, even with chrome, it doesn't seem to work.

Steps To Reproduce The Bug

I have chrome installed (on Windows), and I try to run the example ts file in the README, app_test.ts:

deno test --allow-run app_test.ts

I get failures for both, even though one should pass (ignore my horribly misconfigured prompt):
app_test_fail

According to the first test, it should pass, but it doesn't. If we look at the stack trace, we find three relevant files: app_test.ts, dawn.ts, and headless_browser.ts. Since headless_browser.ts is the relevant file closest to the top of the stack, it is most likely that the error is there. If we take a look at headless_browser.ts:
https://github.com/drashland/dawn/blob/833b6a1d118868289d03129bb9e3cf898f75dd74/src/headless_browser.ts#L101-L108

So it appears that Deno is executing "start chrome", but for some reason, it can't find it? However, I have chrome, and 'start chrome' seems to work when I run it from the command prompt:
start_chrome

Expected Behavior

I expect dawn to run app_test.ts with the first test passing and the second test failing.

Suggested Solution(s)

My best hypothesis is that Deno doesn't inherit the PATH from Command Prompt. I still think it would be really cool to let Dawn run without requiring Chrome.

@ebebbington
Copy link
Member

Hey @MVEMCJSUNPE, See #20, #19 and the warning in the README.md, Dawn/Cinco (we're renaming this repo to Sinco actually) is still a WIP and doesn't actually work - the code i've added in the v1 PR does work, it's just there's an issue with WebSockets that's preventing the tests from working

@ebebbington
Copy link
Member

Though firefox would be another option, good shout 👍

@ebebbington
Copy link
Member

ebebbington commented Feb 14, 2021

This is ssomething. we should implement, but it seems there's just a lack of documentation on how to connect to a headless firefox instance

But specific to this issue, i have been reading up on it, and so far i've found:

How to create a headless browser instance

$ /Applications/Firefox.app/Contents/MacOS/firefox --headless --start-debugger-server 9293

For windows, there's only one dash

How to connect to the process

Still unsure. Severe lack of documentation

How to send commands and run actions

No information.

@ebebbington ebebbington added the Needs Investigation This item needs to be investigated further label Feb 14, 2021
@ebebbington
Copy link
Member

There's literally no information anywhere, and most posts are just like this: https://stackoverflow.com/questions/47874959/firefox-remote-debugging-using-websocket, a perfect question with no answer

ebebbington pushed a commit that referenced this issue Feb 15, 2021
ebebbington pushed a commit that referenced this issue Feb 21, 2021
ebebbington added a commit that referenced this issue Apr 9, 2021
ebebbington added a commit that referenced this issue Apr 9, 2021
* [#45-add-firefox-support] Do some minor refactoring

* [#24-add-firefox-support] Abstract chrome browser so sinco can support multiple browsers

* [#24-add-firefox-client] add WIP firefox impl

* [#24-add-firefox-ssupport] Rename chrome client unit test file

* [#24-add-firefox-support] Support paths for linux and windows

* [#24-add-firefox-support] try standardise with chrome api

* [#24-add-firefox-support] Make imrpovements; add docblocks; add todos

* [#24-add-firefox-support] Add eval method and a bunch of debugging stuff

* [#24-add-firefox-support] Add type method

* [#24-add-firefox-support] Add getInputValue method

* [#24-add-firefox-support] add click method

* [#24-add-firefox-support] Add goto method

* [#24-add-firefox-support] add assertUrlIs method

* [#24-add-firefox-support] Add assertSee method

* [#24-add-firefox-support] Add tests for firefox clicking and asserting

* [#24-add-firefox-support] Use text encoder instead of buffer

* [#24-add-firefox-support] fix docker tests

* [#24-add-firefox-support] fix not running on windows

* Fix os issues in test ci for firefox support (#53)

* [#24-add-firefox-support] Add firefix into docker container for tests

* [#24-addd-firefox-support] Finish integration tests for firefox

* [#24-add-firefox-support] add unit tests for firefox

* [#24-add-firefox-support] fix docker step in ci

* #24-add-firefox-support] Fix firefox not closing for windows

* [#24-add-firefox-support] Fix all edge cases (#54)

* deno lint

* [#24-add-firefox-support] add example to help other people

* deno fmt

* [#24-add-firefox-support] remove dead code

* [#24-ad-firefox-support] Cleanup

* [#24-add-firefox-support] Remove param for waitForPageChange method in firefox (#55)

* remove wait for anchor change method (#56)

* [#24-add-firefox-support] Improve logic for method that gets packets (#57)

* [#24-add-firefox-support] Add a common method to use to create any client from

* [#24-add-firefox-support] add more unit tests

* deno fmt

* [#24-add-firefox-support] Remove debug statements

* [#24-add-firefox-support] Remove hack for chrome to close ws client

* [#24-add-firefox-support] Readd add to chrome client to fix ci

* [#24-add-firefox-support] Remove old commented out code from test dockerfile

* [#24-add-firefox-support] Possible fix for failing ubuntu ci

* [#24-add-firefox-support] Fix tests failing in ci

* deno fmt

* Add internal docs on unsolicated events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This item needs to be investigated further
Development

Successfully merging a pull request may close this issue.

2 participants