Skip to content

Commit 5b85c32

Browse files
committed
Attempt to remove Firefox profile when using Marionette
1 parent 803c43a commit 5b85c32

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

py/selenium/webdriver/firefox/webdriver.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ def quit(self):
9999
self.service.stop()
100100
else:
101101
self.binary.kill()
102-
try:
103-
shutil.rmtree(self.profile.path)
104-
if self.profile.tempfolder is not None:
105-
shutil.rmtree(self.profile.tempfolder)
106-
except Exception as e:
107-
print(str(e))
102+
try:
103+
shutil.rmtree(self.profile.path)
104+
if self.profile.tempfolder is not None:
105+
shutil.rmtree(self.profile.tempfolder)
106+
except Exception as e:
107+
print(str(e))
108108

109109
@property
110110
def firefox_profile(self):

py/test/selenium/webdriver/firefox/mn_profile_tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
import os
19+
1820
import pytest
1921
from selenium import webdriver
2022
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
@@ -47,3 +49,9 @@ def profile():
4749

4850
def test_profile_is_used(driver):
4951
assert 'about:' == driver.current_url
52+
53+
54+
def test_profile_is_deleted(driver, profile):
55+
assert os.path.exists(profile.path)
56+
driver.quit()
57+
assert not os.path.exists(profile.path)

0 commit comments

Comments
 (0)