Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.1 kB
3
Indexable
# 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 TestDefaultSuite():
  def setup_method(self, method):
    self.driver = webdriver.Remote(command_executor='http://localhost:4444/wd/hub', options=webdriver.ChromeOptions())
    self.vars = {}
  
  def teardown_method(self, method):
    self.driver.quit()
  
  def test_menuclick(self):
    self.driver.get("https://my.web.com/resources/")
    self.driver.set_window_size(1920, 1053)
    self.driver.find_element(By.CSS_SELECTOR, "#\\#kt_aside_menu > .menu-item:nth-child(2) .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, "#\\#kt_aside_menu > .menu-item:nth-child(4) .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, "#\\#kt_aside_menu > .menu-item:nth-child(5) .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, ".menu-accordion > .menu-link > .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, ".show > .menu-item .menu-title").click()
  
  def test_docs(self):
    self.driver.get("https://my.web.com/resources/")
    self.driver.set_window_size(1920, 1053)
    self.driver.find_element(By.LINK_TEXT, "Documentation").click()
    self.driver.find_element(By.CSS_SELECTOR, ".menu-item:nth-child(7) > .menu-link > .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, ".menu-item:nth-child(8) > .menu-link > .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, ".menu-item:nth-child(10) > .menu-link > .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, ".show > .menu-item:nth-child(2) .menu-title").click()
    self.driver.find_element(By.CSS_SELECTOR, ".btn-label").click()