pychrome icon indicating copy to clipboard operation
pychrome copied to clipboard

Add built-in chrome service capabilities

Open iiLaurens opened this issue 7 years ago • 1 comments

I propose a new version in which PyChrome automatically initiates a chrome service. This takes the effort away from the end user to manually start the Chrome application. The chrome service will simply launch a chrome process on the background and automatically connects. The PyChrome user can simply control this chrome instance as usual.

By default, a headless chrome instance will be started. At every start, a new chrome user is created in order to start with a clean slate and make testing reproducible as cookies are not stored permanently.

I have added context managers that gracefully cleans up the chrome service if the Browser instance is removed. It is also possible to start a Browser using a with statement. I also added a couple of tests and changed the existing tests to use the automatic chrome service.

iiLaurens avatar Jun 02 '18 10:06 iiLaurens

Codecov Report

Merging #27 into master will decrease coverage by 3.62%. The diff coverage is 86.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #27      +/-   ##
==========================================
- Coverage   93.36%   89.74%   -3.63%     
==========================================
  Files           4        6       +2     
  Lines         211      351     +140     
  Branches       21       36      +15     
==========================================
+ Hits          197      315     +118     
- Misses          7       19      +12     
- Partials        7       17      +10
Impacted Files Coverage Δ
pychrome/browser.py 90.19% <81.81%> (-7.37%) :arrow_down:
pychrome/tempdir.py 84.61% <84.61%> (ø)
pychrome/service.py 87.17% <87.17%> (ø)
pychrome/tab.py 90.78% <0%> (-0.66%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3265932...30953f0. Read the comment docs.

codecov[bot] avatar Jun 02 '18 10:06 codecov[bot]