-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-all.py
More file actions
54 lines (48 loc) · 2.48 KB
/
test-all.py
File metadata and controls
54 lines (48 loc) · 2.48 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
47
48
49
50
51
52
53
# Not yet functional!
# 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 TestTestall():
def setup_method(self, method):
self.driver = webdriver.Chrome()
self.vars = {}
def teardown_method(self, method):
self.driver.quit()
def test_testall(self):
self.driver.get("http://localhost:5173")
self.driver.find_element(By.LINK_TEXT, "Login").click()
# wait for username field to appear on the login page
WebDriverWait(self.driver, 15).until(expected_conditions.visibility_of_element_located((By.ID, "username")))
self.driver.find_element(By.ID, "username").click()
self.driver.find_element(By.ID, "username").send_keys("test")
self.driver.find_element(By.ID, "password").send_keys("test")
self.driver.find_element(By.CSS_SELECTOR, ".m-4").click()
self.driver.find_element(By.CSS_SELECTOR, ".flex:nth-child(1) > .w-12").click()
self.driver.find_element(By.LINK_TEXT, "GraphNote").click()
element = self.driver.find_element(By.LINK_TEXT, "GraphNote")
actions = ActionChains(self.driver)
actions.move_to_element(element).perform()
self.driver.find_element(By.CSS_SELECTOR, ".col-start-8 .flex .w-full:nth-child(1) a").click()
self.driver.find_element(By.CSS_SELECTOR, ".text-xs:nth-child(2)").click()
element = self.driver.find_element(By.CSS_SELECTOR, ".text-xs:nth-child(2)")
actions = ActionChains(self.driver)
actions.move_to_element(element).perform()
self.driver.find_element(By.CSS_SELECTOR, ".border").click()
self.driver.find_element(By.CSS_SELECTOR, ".border").send_keys("HI")
self.driver.find_element(By.CSS_SELECTOR, ".px-3").click()
element = self.driver.find_element(By.CSS_SELECTOR, ".px-3")
actions = ActionChains(self.driver)
actions.move_to_element(element).perform()
self.driver.find_element(By.CSS_SELECTOR, ".inline-flex").click()
self.driver.find_element(By.CSS_SELECTOR, ".text-xs:nth-child(2)").click()
self.driver.find_element(By.CSS_SELECTOR, ".px-2").click()
self.driver.find_element(By.CSS_SELECTOR, ".h-8").click()
self.driver.find_element(By.CSS_SELECTOR, ".px-3").click()