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

Control Chrome cookies through CDP #5297

Merged
merged 171 commits into from
Oct 21, 2019
Merged
Changes from 1 commit
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
1b28a34
try connecting to chrome remote interface
bahmutov Jul 1, 2019
8b74d1e
linting
bahmutov Jul 1, 2019
ea24c39
print CRI targets for better debugging
bahmutov Jul 1, 2019
3e78b8f
linting
bahmutov Jul 1, 2019
fb8c0ff
load empty tab first when connecting to CRI
bahmutov Jul 1, 2019
7ba253f
first load blank page, then navigate
bahmutov Jul 1, 2019
ec06d65
Page.navigate is working
bahmutov Jul 3, 2019
3c76042
Merge branch 'develop' into add-cri-4608
bahmutov Jul 16, 2019
ff02745
linting
bahmutov Jul 16, 2019
ab11757
remove title
bahmutov Jul 16, 2019
3f7df04
add mocha banner
bahmutov Jul 16, 2019
b8fc8cf
more banners
bahmutov Jul 16, 2019
9bc5333
update some server unit tests
bahmutov Jul 16, 2019
b999dfc
update integration test
bahmutov Jul 16, 2019
054f589
document how to run single driver spec file
bahmutov Jul 17, 2019
1cab130
set the focus back on the page before navigating from blank chrome tab
bahmutov Jul 17, 2019
b842f23
update server unit test
bahmutov Jul 17, 2019
05bb2c4
Merge branch 'develop' into add-cri-4608
bahmutov Jul 18, 2019
6d20ab5
do not store Chrome remote interface reference for now
bahmutov Jul 18, 2019
4aaeb5f
record video of the Chrome tab using screencast API
bahmutov Jul 18, 2019
a7ec58c
use dynamic port to connect to Chrome remote interface
bahmutov Jul 23, 2019
4899902
update unit tests
bahmutov Jul 23, 2019
a09be50
merged latest add-cri-4608
bahmutov Jul 23, 2019
901272e
refactoring
bahmutov Jul 24, 2019
97e0f0d
wrap chrome remote interface in our interface, limit access to send
bahmutov Jul 24, 2019
f6250c5
Merge branch 'develop' into add-cri-4608
bahmutov Jul 30, 2019
0e1ff8b
resolved merge
bahmutov Jul 30, 2019
34dc56c
fix reference
bahmutov Jul 30, 2019
78e42e2
passing run unit spec
bahmutov Jul 30, 2019
bb51a0d
stub canary search for CI to pass
bahmutov Jul 30, 2019
59fb1b4
add build step to packages/server
bahmutov Jul 30, 2019
ed46cf6
update chrome spec
bahmutov Jul 30, 2019
eaf0aa3
do not build js on install for server
bahmutov Jul 30, 2019
8a2e24e
updated spec snapshots
bahmutov Jul 30, 2019
11805c9
update 6_visit_spec snapshot
bahmutov Jul 30, 2019
6cf87c1
update snapshot for 6_web_security_spec
bahmutov Jul 30, 2019
4594fba
update snapshot for 3_plugins_spec
bahmutov Jul 30, 2019
35aeb61
update snapshot for 3_user_agent_spec
bahmutov Jul 30, 2019
bbf6d4f
update snapshot for 5_stdout_spec
bahmutov Jul 30, 2019
77144e0
update snapshot for 2_browser_path_spec
bahmutov Jul 30, 2019
14676c4
Merge branch 'develop' into add-cri-4608
brian-mann Aug 1, 2019
b00f753
do not git ignore js files, add note why
bahmutov Aug 2, 2019
519fef3
Merge branch 'develop' into add-cri-4608
bahmutov Aug 12, 2019
d39f113
merged latest develop code into this branch
bahmutov Sep 10, 2019
5f5d4b0
update several snapshots with video on Chrome
bahmutov Sep 10, 2019
36a69a3
Merge branch 'develop' into add-cri-4608
bahmutov Sep 10, 2019
787c236
update visit performance snapshot
bahmutov Sep 10, 2019
53ac190
add chrome-remote-interface dependency
bahmutov Sep 11, 2019
6a7ec4f
Merge branch 'develop' into add-cri-4608
bahmutov Sep 26, 2019
c2a5839
Merge branch 'develop' into add-cri-4608
brian-mann Sep 29, 2019
7a56d43
cleanup coffeescript conversion to JS, fix some type errors, make par…
brian-mann Sep 29, 2019
96b56d6
fix failing tests
brian-mann Sep 29, 2019
0a258c0
Merge branch 'develop' into add-cri-4608
jennifer-shehane Oct 1, 2019
5f6b9a7
Fix snapshot - now we do record in Chrome, so warning message is no l…
jennifer-shehane Oct 1, 2019
506589b
remove chrome warnings about not recording from snapshot
jennifer-shehane Oct 1, 2019
e3a93c7
Remove performance tests from 6_visit_spec snapshot
flotwig Oct 2, 2019
629da2e
Remove error from snapshot
flotwig Oct 2, 2019
12195bc
Add newline back to cy_visit_performance_spec snapshot
flotwig Oct 2, 2019
9f2760e
Merge branch 'develop' into add-cri-4608
flotwig Oct 4, 2019
13465a0
Use CDP to control Chrome cookies + screenshot
flotwig Oct 4, 2019
a649094
Add devtools types
flotwig Oct 4, 2019
2c6fa64
Cleanup
flotwig Oct 4, 2019
eabe088
Cleanup
flotwig Oct 4, 2019
57d58a1
Add guards for minimum CDP version
flotwig Oct 7, 2019
08fa1bd
Fix failing tests
flotwig Oct 7, 2019
84bb97d
Split cdp_automation_spec out of electron_spec
flotwig Oct 7, 2019
4d15e35
Move takeScreenshot to cri-client
flotwig Oct 7, 2019
66d28ae
Navigate to about:blank
flotwig Oct 7, 2019
7216585
Merge branch 'develop' into add-cri-4608
bahmutov Oct 7, 2019
1100b5a
look for blank page url
bahmutov Oct 7, 2019
9755bc6
add note about avoiding Prettier
bahmutov Oct 7, 2019
cbe32b8
disable prettier a little more
bahmutov Oct 7, 2019
06d3f81
call chrome remote interface close after each spec
bahmutov Oct 7, 2019
15ecc5c
return promise when starting screencast
bahmutov Oct 7, 2019
af4b072
update failing unit tests, add cri client close test
bahmutov Oct 8, 2019
1c35680
update integration test
bahmutov Oct 8, 2019
17e0421
Add verbose debug statements to cri-client
flotwig Oct 8, 2019
2285b95
Merge branch 'add-cri-4608' of github.com:cypress-io/cypress into add…
flotwig Oct 8, 2019
5f56b63
Use connect.createRetryingSocket for CDP connection
flotwig Oct 8, 2019
fef98de
record video from chrome browsers
bahmutov Oct 8, 2019
d0794c1
add method for validating browser family
bahmutov Oct 8, 2019
22b2d62
update e2e spec snapshot
bahmutov Oct 8, 2019
87716ff
update 4_request_spec snapshot
bahmutov Oct 8, 2019
896eb6a
update snapshot for spec 1_commands_outside_of_test_spec
bahmutov Oct 8, 2019
edb1e7d
update snapshot for 3_plugins_spec
bahmutov Oct 8, 2019
0530c8e
update snapshot for spec 3_user_agent_spec
bahmutov Oct 8, 2019
70bdc7d
try: Always log video capturing errors
flotwig Oct 8, 2019
0ef525b
update snapshot for 2_browser_path_spec
bahmutov Oct 8, 2019
07024b9
update snapshot for 2_cookies_spec
bahmutov Oct 8, 2019
cdacbd0
better browser family test
bahmutov Oct 8, 2019
c1b00e9
update snapshot for 5_stdout_spec
bahmutov Oct 8, 2019
7a66da4
update snapshot for 5_subdomain_spec
bahmutov Oct 8, 2019
ddb168d
Add protocol_spec tests
flotwig Oct 8, 2019
dd0b727
do not capture video during performance test
bahmutov Oct 8, 2019
9c64847
Add test for VIDEO_POST_PROCESSING_FAILED warning
flotwig Oct 8, 2019
f3117ba
Add basic cookie validation in cy.setCookie
flotwig Oct 9, 2019
c95131c
Update cdp_automation to throw on Network.setCookie failure code
flotwig Oct 9, 2019
1b5b18d
Merge remote-tracking branch 'origin/add-cri-4608' into issue-5142
flotwig Oct 9, 2019
0110ee9
Update tests :tada:
flotwig Oct 9, 2019
92ba561
Update snapshot
flotwig Oct 9, 2019
ec0100b
Fix test
flotwig Oct 9, 2019
80d70c6
Merge branch 'develop' into add-cri-4608
bahmutov Oct 9, 2019
7557829
Remove redundant logs, cleanup
flotwig Oct 9, 2019
d04cfca
Add cri-client_spec, fix some small bugs, improve errors
flotwig Oct 9, 2019
d8a02dc
Update dep
flotwig Oct 9, 2019
9eb37c1
use client.on to register screencast callback
bahmutov Oct 9, 2019
5769d26
use isCookieName
flotwig Oct 9, 2019
c24d70c
Merge remote-tracking branch 'origin/add-cri-4608' into issue-5142
flotwig Oct 9, 2019
6da2a34
strict-cookie-parser@3.1.0
flotwig Oct 9, 2019
a8e6266
cleanup prettier, extract some functions, switch to browser.family
brian-mann Oct 10, 2019
92c50d8
moar cleanup and fixes
brian-mann Oct 10, 2019
0632635
add logging to the cri-client so we can see every message sent + rece…
brian-mann Oct 10, 2019
0e0013b
bump bluebird to 3.7.0 for .tapCatch addition
brian-mann Oct 10, 2019
e741d1d
Fix unit tests
flotwig Oct 10, 2019
0bdf678
WIP: update e2e test to ensure that duration of the video matches wha…
brian-mann Oct 10, 2019
ed25ffa
Test duration of recorded video
flotwig Oct 10, 2019
6fa7492
Run 6_video_compression in chrome + electron
flotwig Oct 10, 2019
324e7eb
Cleanup
flotwig Oct 10, 2019
3783a49
finish ffmpeg duration verification
brian-mann Oct 10, 2019
c8c3891
Merge branch 'develop' into add-cri-4608
flotwig Oct 11, 2019
5df252d
Update 8_reporters_spec snapshot
flotwig Oct 11, 2019
d50de00
Merge branch 'add-cri-4608' into issue-5142
flotwig Oct 11, 2019
3595ca7
Fix cri-client test
flotwig Oct 11, 2019
dcb2a48
Update CRI close logic to monkey-patch browser.kill
flotwig Oct 11, 2019
4d04eb8
add isBrowserFamily back
flotwig Oct 11, 2019
279f16e
Merge branch 'add-cri-4608' into issue-5142
flotwig Oct 11, 2019
1003598
Merge branch 'develop' into add-cri-4608
flotwig Oct 11, 2019
0631585
make it possible for remote-debugging-port to get overridden
flotwig Oct 11, 2019
bda0e4f
Make CDP timeout 5s; add unit, e2e tests for CDP failure; add user-fr…
flotwig Oct 11, 2019
63d2474
Update tests
flotwig Oct 11, 2019
4e6bd31
Use CYPRESS_REMOTE_DEBUGGING_PORT to set CDP port; update CDP error m…
flotwig Oct 11, 2019
0bd899b
Merge branch 'add-cri-4608' into issue-5142
flotwig Oct 11, 2019
764cfbc
Merge remote-tracking branch 'origin/develop' into issue-5142
flotwig Oct 12, 2019
291960e
Change new Buffer to Buffer.from
flotwig Oct 15, 2019
1aabc59
Apply name validation on all cookie commands
flotwig Oct 15, 2019
7fd44a2
Just throw on Chrome start if the CDP version is < 1.3
flotwig Oct 15, 2019
8c984f5
Merge remote-tracking branch 'origin/develop' into issue-5142
flotwig Oct 15, 2019
08f6101
Fix cypress_spec
flotwig Oct 15, 2019
a1b86d9
Use CDP to set resolution + scale factor in Chrome e2e
flotwig Oct 17, 2019
92a8ca5
Revert "Use CDP to set resolution + scale factor in Chrome e2e"
flotwig Oct 17, 2019
22c5e78
use CYPRESS_FORCE_BROWSER_SCALE to force standard resolution
flotwig Oct 17, 2019
15c3d58
Merge remote-tracking branch 'origin/develop' into issue-5142
flotwig Oct 17, 2019
2329397
don't do --window-size --kiosk
flotwig Oct 17, 2019
6abac67
Use CDP to set resolution + scale factor in Chrome e2e
flotwig Oct 17, 2019
a258cf6
Revert "use CYPRESS_FORCE_BROWSER_SCALE to force standard resolution"
flotwig Oct 17, 2019
7015bb2
Use Page.captureScreenshot for Electron + Chrome, reduce logic
flotwig Oct 17, 2019
5b567ce
Use before() task to force device metrics in Chrome
flotwig Oct 17, 2019
5908a4f
Fix protocol_spec
flotwig Oct 17, 2019
4613ee1
Update 7_record_spec to allow for before() hook
flotwig Oct 17, 2019
263df65
Update 6_task_spec snapshot
flotwig Oct 17, 2019
d029046
Appease eslint
flotwig Oct 17, 2019
14b5737
Update hooks in 5_spec_isolation snapshot
flotwig Oct 17, 2019
8318c79
Merge branch 'develop' into issue-5142
flotwig Oct 17, 2019
25dd349
Merge branch 'develop' into issue-5142
flotwig Oct 17, 2019
4e7a06f
Merge branch 'develop' into issue-5142
flotwig Oct 18, 2019
3eda7d6
some general promisification and cleanup
brian-mann Oct 21, 2019
33228d2
feedback on pluginsfile
flotwig Oct 21, 2019
b2825a6
cdp_automation feedback
flotwig Oct 21, 2019
a4b8167
chrome.coff feedback
flotwig Oct 21, 2019
b2323e0
feedback
flotwig Oct 21, 2019
240eea0
run e2e tests on port 4466, ensure no e2e test ever runs on 5566 to p…
brian-mann Oct 21, 2019
81fe8db
accept new 'remote:debugger:protocol' automation command to control d…
brian-mann Oct 21, 2019
d2eb391
update web security e2e to run on electron + chrome
brian-mann Oct 21, 2019
8d4538f
Merge remote-tracking branch 'origin/issue-5142' into issue-5142
brian-mann Oct 21, 2019
acc9cb6
run web security tests in electorn, disable context isolation
brian-mann Oct 21, 2019
f8b5d57
pass disable-site-isolation-trials to Electron so webSecurity works
flotwig Oct 21, 2019
d6eb10d
Fix errors in e2e tests caused by extra log item
flotwig Oct 21, 2019
6f33036
fix cri-client unit tests
flotwig Oct 21, 2019
3dbee58
Merge branch 'develop' into issue-5142
flotwig Oct 21, 2019
be31f86
fancy arrows in log message
flotwig Oct 21, 2019
1609b6f
Merge branch 'issue-5142' of github.com:cypress-io/cypress into issue…
flotwig Oct 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update unit tests
bahmutov committed Jul 23, 2019
commit 489990240fd6430a5c3261328ed0caa97bd5afc4
7 changes: 5 additions & 2 deletions packages/server/test/unit/browsers/chrome_spec.coffee
Original file line number Diff line number Diff line change
@@ -28,12 +28,15 @@ describe "lib/browsers/chrome", ->
sinon.stub(utils, "launch")
sinon.stub(utils, "getProfileDir").returns("/profile/dir")
sinon.stub(utils, "ensureCleanCache").resolves("/profile/dir/CypressCache")
# port for Chrome remote interface communication
sinon.stub(utils, "getPort").resolves(50505)

it "focuses on the page and calls CRI Page.visit", ->
chrome.open("chrome", "http://", {}, {})
.then =>
expect(@criClient.Page.bringToFront).to.have.been.calledOnce
expect(@criClient.Page.navigate).to.have.been.calledOnce
expect(utils.getPort).to.have.been.calledOnce # to get remote interface port

it "is noop without before:browser:launch", ->
plugins.has.returns(false)
@@ -72,7 +75,7 @@ describe "lib/browsers/chrome", ->
"--load-extension=/foo/bar/baz.js,/path/to/ext,#{pathToTheme}"
"--user-data-dir=/profile/dir"
"--disk-cache-dir=/profile/dir/CypressCache",
"--remote-debugging-port=9222"
"--remote-debugging-port=50505"
])

it "normalizes multiple extensions from plugins", ->
@@ -95,7 +98,7 @@ describe "lib/browsers/chrome", ->
"--load-extension=/foo/bar/baz.js,/quux.js,/path/to/ext,#{pathToTheme}"
"--user-data-dir=/profile/dir"
"--disk-cache-dir=/profile/dir/CypressCache",
"--remote-debugging-port=9222"
"--remote-debugging-port=50505"
])

it "cleans up an unclean browser profile exit status", ->