Navigate to filegarden.com
This commit is contained in:
parent
2efa292117
commit
4ff0f60ca4
|
@ -5,10 +5,12 @@ from selenium import webdriver
|
||||||
def initialize_webdriver():
|
def initialize_webdriver():
|
||||||
return webdriver.Firefox()
|
return webdriver.Firefox()
|
||||||
|
|
||||||
|
def navigate_to_filegarden(browser):
|
||||||
|
browser.get("https://filegarden.com")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
driver = initialize_webdriver()
|
browser = initialize_webdriver()
|
||||||
# Open browser
|
navigate_to_filegarden(browser)
|
||||||
# Navigate to filegarden
|
|
||||||
# Go To Your Garden
|
# Go To Your Garden
|
||||||
# Log in (email)
|
# Log in (email)
|
||||||
# Go To Your Garden
|
# Go To Your Garden
|
||||||
|
|
|
@ -12,11 +12,21 @@ class TestJardin(unittest.TestCase):
|
||||||
|
|
||||||
mockFirefox.assert_called_once()
|
mockFirefox.assert_called_once()
|
||||||
|
|
||||||
|
@patch("selenium.webdriver.Firefox")
|
||||||
|
def test_navigate_to_filegarden(self, mockFirefox):
|
||||||
|
jardin.navigate_to_filegarden(mockFirefox)
|
||||||
|
|
||||||
|
mockFirefox.get.assert_called_once_with("https://filegarden.com")
|
||||||
|
|
||||||
@patch("jardin.initialize_webdriver")
|
@patch("jardin.initialize_webdriver")
|
||||||
def test_main_calls_initialize_webdriver(self, mockInitializeWebdriver):
|
@patch("jardin.navigate_to_filegarden")
|
||||||
|
def test_main_calls_methods_in_correct_order(self,
|
||||||
|
mockInitializeWebdriver,
|
||||||
|
mockNavigateToFilegarden):
|
||||||
jardin.main()
|
jardin.main()
|
||||||
|
|
||||||
mockInitializeWebdriver.assert_called_once()
|
mockInitializeWebdriver.assert_called_once()
|
||||||
|
mockNavigateToFilegarden.assert_called_once()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue