Skip to content

Commit

Permalink
окружение от 1004
Browse files Browse the repository at this point in the history
  • Loading branch information
thaidem committed Apr 10, 2019
1 parent e4a15dc commit 570cdec
Show file tree
Hide file tree
Showing 10 changed files with 390 additions and 20 deletions.
5 changes: 4 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions .idea/python_traning.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

212 changes: 195 additions & 17 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added __pycache__/eye_test.cpython-37-PYTEST.pyc
Binary file not shown.
Binary file added __pycache__/test_add_group.cpython-37-PYTEST.pyc
Binary file not shown.
Binary file not shown.
Binary file added __pycache__/test_app_g1004.cpython-37-PYTEST.pyc
Binary file not shown.
Binary file added __pycache__/test_chrom.cpython-37-PYTEST.pyc
Binary file not shown.
20 changes: 20 additions & 0 deletions eye_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from selenium import webdriver

driver = webdriver.Firefox()
driver.get(
'<a class="vglnk" href="http://www.igame.com/eye-test/" rel="nofollow"><span>http</span><span>://</span><span>www</span><span>.</span><span>igame</span><span>.</span><span>com</span><span>/</span><span>eye</span><span>-</span><span>test</span><span>/</span></a>')
# Игра находится во фрейме, поэтому переключаемся на фрейм
driver.switch_to_frame(driver.find_element_by_tag_name('iframe'))

# Разворачиваем окно, нам ведь еще скрины делать
driver.maximize_window()

# Начинаем выигрывать. Результат 50 нас вполне устроит
for i in range(50):
elem = driver.find_element_by_class_name('thechosenone')
elem.click()

# Делаем скриншот результата
driver.save_screenshot('eyetest.png')

driver.close()
Loading

0 comments on commit 570cdec

Please sign in to comment.