jenkins selenium options
This commit is contained in:
parent
da1f5fe652
commit
3c9168f90e
@ -7,7 +7,8 @@ from selenium import webdriver
|
|||||||
class ClearBowlTest(unittest.TestCase):
|
class ClearBowlTest(unittest.TestCase):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.driver = webdriver.Chrome()
|
|
||||||
|
self.driver = self.set_chrome()
|
||||||
self.driver.implicitly_wait(15)
|
self.driver.implicitly_wait(15)
|
||||||
self.base_url = "https://clearbowl.herokuapp.com"
|
self.base_url = "https://clearbowl.herokuapp.com"
|
||||||
|
|
||||||
@ -21,6 +22,16 @@ class ClearBowlTest(unittest.TestCase):
|
|||||||
self.driver.find_element_by_xpath("//button[@class='ivu-btn ivu-btn-primary']").click()
|
self.driver.find_element_by_xpath("//button[@class='ivu-btn ivu-btn-primary']").click()
|
||||||
self.driver.find_element_by_xpath(f"//div[contains(text(),'Witaj, {email}')]")
|
self.driver.find_element_by_xpath(f"//div[contains(text(),'Witaj, {email}')]")
|
||||||
|
|
||||||
|
# options for running within Jenkins
|
||||||
|
@staticmethod
|
||||||
|
def set_chrome():
|
||||||
|
options = webdriver.ChromeOptions()
|
||||||
|
options.add_argument('--headless')
|
||||||
|
options.add_argument('--no-sandbox')
|
||||||
|
options.add_argument('--disable-dev-shm-usage')
|
||||||
|
|
||||||
|
return webdriver.Chrome(options=options)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.driver.quit()
|
self.driver.quit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user