Skip to content

Empty log folders are not deleted after a successful test run #2010

@SzilvasiPeter

Description

@SzilvasiPeter

After a successful test run, SeleniumBase creates two empty logging folders: the archived_logs and the latest_logs folder. The empty log folders are bothering me since they do not contain anything and I have to delete the folders manually at every successful test run.

Reproduction

Installing dependency:

pip install seleniumbase

Creating a test case in the test_basic.py script file:

"""Add an item to a shopping cart. Verify. Remove item. Verify."""
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__)


class MyTestClass(BaseCase):
    def test_basics(self):
        self.open("https://www.saucedemo.com")
        self.type("#user-name", "standard_user")
        self.type("#password", "secret_sauce\n")
        self.assert_element("div.inventory_list")
        self.assert_exact_text("Products", "span.title")
        self.click('button[name*="backpack"]')
        self.click("#shopping_cart_container a")
        self.assert_exact_text("Your Cart", "span.title")
        self.assert_text("Backpack", "div.cart_item")
        self.click('button:contains("Remove")')  # HTML innerText
        self.assert_text_not_visible("Backpack", "div.cart_item")
        self.js_click("a#logout_sidebar_link")
        self.assert_element("div#login_button_container")

Execute the test script:

python test_basic.py

Find the empty folders:

find . -type d -empty

The command output is the following:

./.venv/Include
./archived_logs
./latest_logs

Machine information

Here is the version information for SeleniumBase, Python, and the information about the operating system.

sbase --version && python --version && uname -srvmo
seleniumbase 4.17.7

Python 3.10.11
MINGW64_NT-10.0-19045 3.3.6-bec3d608-341.x86_64 2023-02-22 08:29 UTC x86_64 Msys

It would be nice if the empty log folders will be purged automatically.

Metadata

Metadata

Assignees

Labels

bugUh oh... Something needs to be fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions