Skip to content

Commit

Permalink
fix: add options to fix test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RawanMostafa08 committed Oct 20, 2024
1 parent ee6b988 commit bd079c4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions SecretNote/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ def is_element_present_by_css(driver, css):

class EndToEndTests(StaticLiveServerTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
def setUp(cls):
options = Options()
options.add_argument("--headless")
options.headless = True
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--disable-gpu")

cls.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
cls.driver.implicitly_wait(10)

Expand All @@ -43,7 +46,6 @@ def tearDownClass(cls):
def setUp(self):
self.username = f"testinguser_{''.join(random.choices(string.ascii_lowercase,k=8))}"
self.password = "strong_password"
self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))

def signup(self,username,password1,password2):
self.driver.get(f"{self.live_server_url}/accounts/signup")
Expand Down

0 comments on commit bd079c4

Please sign in to comment.