-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_mytests.py
40 lines (36 loc) · 1.39 KB
/
test_mytests.py
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
32
33
34
35
36
37
38
39
40
# Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
class TestMytests():
def setup_method(self, method):
self.driver = webdriver.Chrome()
self.vars = {}
def teardown_method(self, method):
self.driver.quit()
def test_mytests(self):
# Test name: my_tests
# Step # | name | target | value
# 1 | open | / |
self.driver.get("http://localhost:8000/")
# 2 | setWindowSize | 1440x824 |
self.driver.set_window_size(1440, 824)
# 3 | click | id=id_text |
self.driver.find_element(By.ID, "id_text").click()
# 4 | type | id=id_text | hello
self.driver.find_element(By.ID, "id_text").send_keys("hello")
# 5 | click | css=body |
self.driver.find_element(By.CSS_SELECTOR, "body").click()
# 6 | click | name=submit |
self.driver.find_element(By.NAME, "submit").click()
# 7 | click | linkText=Home |
self.driver.find_element(By.LINK_TEXT, "Home").click()
# 8 | click | css=body |
self.driver.find_element(By.CSS_SELECTOR, "body").click()