-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestBasicAuth.py
More file actions
30 lines (23 loc) · 810 Bytes
/
Copy pathtestBasicAuth.py
File metadata and controls
30 lines (23 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest
from selenium import webdriver
from WebDriverTheInternet import PageElements as p
from WebDriverTheInternet import config
from WebDriverTheInternet.WebDriverTheInternet_functions import TheInternet
class testBasicAuth(unittest.TestCase, TheInternet):
def setUp(self):
self.driver = webdriver.Firefox(executable_path="/usr/local/bin/geckodriver")
def testBasicAuth(self):
#Arrange
user = "admin"
password = "admin"
url = p.URLS['Basic Auth']
expected_element = p.SUCCESS_AUTH_TEXT
# #Act
self.BasicAuth(user, password, url)
# #Assert
result = self.found(expected_element)
assert result is True
def tearDown(self):
self.driver.close()
if __name__ == '__main__':
unittest.main()