Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- linux시간으로 변경
- c3 초
- influxdb 설치
- subporcess path
- python subprocess
- python popen
- c++ 정규식
- telegraf
- python os
- 백준
- c3 step graph
- 정규식 컴파일
- selinux port 등록
- centos pyhon 설치
- 1697
- c3 축 가리기
- snmp
- semanage
- 정규식 문자열 출력
- gcc regex
- g++ 업데이트
- grafana dashboard
- regex_search
- snmp test
- c3 축 없애기
- c3 second
- 정규식 활용
- CentOS7
- gcc 업데이트
- InfluxDB
Archives
- Today
- Total
리셋 되지 말자
docker django selenium 테스트 본문
https://github.com/marcgibbons/django-selenium-docker/blob/master/app/tests.py
- tests.py
import socket
from urllib.parse import urlparse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import TestCase, override_settings, tag
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# Create your tests here.
class BaseTestCase(TestCase):
"""
Provides base test class which connects to the Docker
container running selenium.
"""
def setUp(self):
self.host = socket.gethostbyname(socket.gethostname())
print(self.host)
self.selenium = webdriver.Remote(
command_executor='http://172.17.0.2:4444/wd/hub',
desired_capabilities=DesiredCapabilities.CHROME,
)
self.selenium.implicitly_wait(5)
def tearDown(self):
self.selenium.quit()
def test1(self):
self.selenium.get('http://172.17.0.2:4444/wd/hub')
print(self.selenium.current_url)
print(self.selenium.title)
print()
self.selenium.get('http://192.168.0.53:8000')
print(self.selenium.current_url)
print(self.selenium.title)
print(self.selenium.page_source)
self.assertEqual(1+1 , 2, msg='Equal')
어... 어떻게 하는거지...?
'TDD' 카테고리의 다른 글
docker django selenium 테스트 - 2 (1) | 2021.07.21 |
---|---|
[Selenium] webdriver.dispose() .close() .quit() 차이 (0) | 2021.06.22 |
[TDD with selenium] Django Selenium test 학습 (0) | 2021.06.16 |
TDD 테스트 종류 (0) | 2021.05.17 |
[TDD with Python] - 2 (0) | 2021.05.17 |
Comments