Skip to content

Commit

Permalink
[241114] modify base_test to env에 따라 크롬 옵션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sc303030 committed Nov 14, 2024
1 parent ef658bb commit 9886520
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions web/base_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import unittest
from selenium import webdriver
from dotenv import load_dotenv
import os

load_dotenv()


class BaseTest(unittest.TestCase):
Expand All @@ -11,6 +15,13 @@ def setUp(self):
options.add_experimental_option("detach", True)
options.add_argument("--start-maximized")

env = os.getenv("ENV")
if env == "production":
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--user-data-dir=/tmp/selenium/user-data-dir")

self.driver = webdriver.Chrome(options=options)
self.driver.start_client()
self.driver.implicitly_wait(self.IMPLICIT_WAIT_TIME)
Expand Down

0 comments on commit 9886520

Please sign in to comment.