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
- g++ 업데이트
- 1697
- grafana dashboard
- 백준
- c++ 정규식
- influxdb 설치
- subporcess path
- snmp
- gcc 업데이트
- c3 second
- c3 step graph
- selinux port 등록
- c3 초
- regex_search
- 정규식 컴파일
- 정규식 활용
- python os
- c3 축 가리기
- python popen
- python subprocess
- 정규식 문자열 출력
- gcc regex
- InfluxDB
- CentOS7
- semanage
- c3 축 없애기
- centos pyhon 설치
- linux시간으로 변경
- snmp test
- telegraf
Archives
- Today
- Total
리셋 되지 말자
docker django selenium 테스트 본문
https://github.com/marcgibbons/django-selenium-docker/blob/master/app/tests.py
marcgibbons/django-selenium-docker
Example of Django Selenium testing w/ Docker. Contribute to marcgibbons/django-selenium-docker development by creating an account on GitHub.
github.com
A Simple Recipe for Django Development In Docker (Bonus: Testing with Selenium)
Docker brings a host of advantages to software development, but I like it for two reasons: it decouples your code from the host operating…
medium.com
- 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