-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestOneScript
More file actions
46 lines (35 loc) 路 2.67 KB
/
Copy pathtestOneScript
File metadata and controls
46 lines (35 loc) 路 2.67 KB
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
41
42
43
44
45
46
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
link = 'https://only.digital/projects#brief'
class TestOnly:
@pytest.fixture
def driver(self):
self.driver = webdriver.Chrome()
self.driver.get(link)
yield self.driver
self.driver.quit()
def testOneOnly(self, driver):
driver.find_element(By.CSS_SELECTOR,'[placeholder="袠屑褟*"]').send_keys('袗谢械泻褋械泄')
driver.find_element(By.CSS_SELECTOR,'[placeholder="E-mail*"]').send_keys('j78@gmail.com')
driver.find_element(By.NAME,'phone').send_keys('9223035566') #薪械 锌芯谢褍褔懈谢芯褋褜 胁锌懈褋邪褌褜 胁 锌芯谢械 薪芯屑械褉 褌械谢械褎芯薪邪
driver.find_element(By.CSS_SELECTOR,'[placeholder="袣芯屑锌邪薪懈褟"]').send_keys('协胁褉懈泻邪')
checkboxOne = driver.find_element(By.XPATH,"//*[contains(text(), '小邪泄褌')]").click()
#械褋褌褜 械褖械 褌邪泻芯泄 胁邪褉懈邪薪褌, 薪芯 薪械 褍胁械褉械薪, 褔褌芯 褉邪斜芯褌邪械褌 (褌械褋褌 褋 薪懈屑 薪械 锌邪写邪械褌)
'''checkbox = driver.find_elements(By.CSS_SELECTOR,('input [type="checkbox"]'))
for i in checkbox:
if not i.is_selected:
i.click()'''
textarea = driver.find_element(By.NAME,'description').is_enabled() #褝谢械屑械薪褌 邪泻褌懈胁械薪, 薪芯 泻谢懈泻薪褍褌褜 薪邪 薪械谐芯 懈谢懈 胁锌懈褋邪褌褜 胁 薪械谐芯 薪械 锌芯谢褍褔懈谢芯褋褜 (*)
documents = driver.find_element(By.CLASS_NAME,'sc-80120d97-1 hdZhjZ').is_enabled() #蟹写械褋褜 褌械褋褌 锌邪写邪械褌 (*)
#薪邪褕械谢 褋锌芯褋芯斜 胁褉褍褔薪褍褞 锌褉芯泻谢懈泻懈胁邪褌褜 褉邪写懈芯斜邪褌褌芯薪褘 (褔械褉械蟹 褑懈泻谢 褌械褋褌 锌邪写邪械褌)
budgetRadioOne = driver.find_element(By.XPATH,"//*[contains(text(), '袦械薪械械 2 屑谢薪')]").click()
recommendationRadioOne = driver.find_element(By.XPATH,"//*[contains(text(), '小芯褑褋械褌懈')]").click()
#蟹写械褋褜 褌械褋褌 锌邪写邪械褌, 泻谢懈泻薪褍褌褜 薪邪 泻邪锌褔褍 薪械 锌芯谢褍褔懈谢芯褋褜 (锌芯泻邪), 懈薪褌械褉械褋薪芯:) (*)
captchaGoogle = WebDriverWait(driver,10).until(EC.element_to_be_clickable(((By.CSS_SELECTOR,'#recaptcha-anchor')))).is_enabled()
#泻薪芯锌泻邪 薪械邪泻褌懈胁薪邪, 褌泻 薪械 锌芯谢褍褔懈谢芯褋褜 泻谢懈泻薪褍褌褜 薪邪 泻邪锌褔褍 胁褘褕械 + 薪芯屑械褉 褌械谢械褎芯薪邪 薪械 蟹邪锌芯谢薪械薪 (芯斜褟蟹邪褌械谢褜薪芯械 锌芯谢械) (*)
confirmationButton = driver.find_element(By.CLASS_NAME,'sc-de2cbdbd-1 cMflFB').is_enabled()
#time.sleep(10)