# Author:zhang
# -*- coding:utf-8 -*-
"""https://workyun.com/ 云端工作
"""
import unittest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
import time
class LoginCase(unittest.TestCase):
def setUp(self):
"前置条件"
self.driver=webdriver.Chrome()
self.driver.maximize_window() #最大化 def driverxpath(self,xpath): #定义方法去查看页面元素是否粗在
for i in range(30):
try:
element = self.driver.find_element_by_xpath(xpath)
if element.is_displayed():
return self.driver.find_element_by_xpath(xpath)
break
except:pass
time.sleep(1)
else:
print("time-out") def login(self,name,passwd): #定义登录的方法
"登录"
self.driver.get("http://www.effevo.com ")
self.driver.implicitly_wait(5)
self.driver.find_element_by_class_name("login-in").click()
self.driver.find_element_by_id("passname").send_keys(name)
self.driver.find_element_by_id("password").send_keys(passwd)
self.driver.find_element_by_class_name("ee-btn-ok").click() #登录参数化 def zeng(self,tuanname,hao):
"增加团队"
self.driverxpath(".//*[@id='leftNav']/div[2]/div[1]/ul/li/a/i").click()
time.sleep(5)
self.driverxpath("html/body/div[4]/div/div[2]/div/input").send_keys(tuanname) #团队名称
self.driverxpath("html/body/div[4]/div/div[3]/button[1]").click()
# 选择用户 self.driver.find_element_by_xpath("html/body/div[4]/div/div[2]/div/div[2]/div/div/div/div/div[1]/div/div/ul/li[1]/a").click()
self.driverxpath("html/body/div[4]/div/div[2]/div/div[2]/div/div/div/div/div[1]/div/input").send_keys(hao) #手机号码
self.driverxpath("html/body/div[4]/div/div[2]/div/div[2]/div/div/div/div/div[1]/div/div/button").click() #选择管理员
time.sleep(3)
self.driverxpath("html/body/div[4]/div/div[2]/div/div[2]/div/div/div/div/div[1]/div/div/ul/li[1]/a").click()
time.sleep(3)
self.driverxpath("/html/body/div[4]/div/div[3]/button[1]").click()
time.sleep(10) def tianjia(self,tihao):
"添加成员"
# self.driver.implicitly_wait(30)
# self.driver.find_element_by_xpath(".//*[@id='mCSB_1_container']/li[2]/a/div[1]").click()
self.driver.implicitly_wait(35)
self.driverxpath(".//*[@id='team-index']/div/ul/li[2]/span").click()
self.driver.find_element_by_css_selector(".user-new-text").click()
self.driver.find_element_by_css_selector(".user-invite-input.ng-pristine.ng-valid").send_keys(tihao)
self.driverxpath("html/body/div[4]/div/div[2]/div/div[2]/div/div/div/div/div[1]/div/div/button").click()
time.sleep(5)
self.driverxpath("html/body/div[4]/div/div[2]/div/div[2]/div/div/div/div/div[1]/div/div/ul/li[3]/a").click()
self.driverxpath("html/body/div[4]/div/div[3]/button[1]").click() #保存新增的用户 def delte(self,mima):
"删除端对"
self.driver.refresh() #刷新页面
time.sleep(20) #显示等待
self.driverxpath(".//*[@id='mCSB_1_container']/li[2]/a/div[1]").click() #点击下左侧的团队名
time.sleep(20)
self.driverxpath(".//*[@id='team-index']/div/ul/li[3]/span").click() #设置按钮
self.driverxpath(".//*[@id='team-index']/ui-view/div/p[10]/button").click()
self.driverxpath(".//*[@id='re-verify-password-modal']/div/div/div[2]/input").send_keys(mima)
self.driverxpath(".//*[@id='re-verify-password-modal']/div/div/div[3]/div/button[2]").click()
time.sleep(5)
# def test_login(self):
# "这个是正常的e"
# self.login("75236@qq.com","x1400184")
# time.sleep(5)
# s=self.driver.title
# self.assertIn(u"列表",s)
# self.driver.implicitly_wait(10) # def test_zeng(self):
# #增加团队
# self.login("75286@qq.com","x1460184")
# time.sleep(5)
# self.zeng("ceshi","140184@qq.com")
# #self.assertEqual()
# #s=self.driver.find_element_by_link_text(".//*[@id='mCSB_1_container']/li[2]/a/div[1]"). #怎样进行验证 def xiangmu(self,projectname,description):
"在团队下面添加项目"
self.driver.refresh() #刷新页面
time.sleep(20)
self.driverxpath(".//*[@id='mCSB_1_container']/li[2]/a/div[1]").click() #点击团队名称
self.driverxpath(".//*[@id='team-project-overview']/div[5]/div").click() #点击创建项目
self.driverxpath(".//*[@id='project-edit-modal']/div/div/div[2]/div[2]/input").send_keys(projectname) #项目名
self.driverxpath(".//*[@id='project-edit-modal']/div/div/div[2]/div[3]/textarea").send_keys(description) #项目描述
self.driverxpath(".//*[@id='project-edit-modal']/div/div/div[3]/div/span[2]").click() #保存项目 def renwu(self,renwuname):
self.driver.refresh() #刷新页面
time.sleep(3)
self.driver.refresh()
time.sleep(20)
self.driverxpath(".//*[@id='mCSB_1_container']/li[2]/a/div[1]").click() #点击团队名称
self.driverxpath(".//*[@id='team-project-overview']/div[2]/div/table/tbody/tr/td[1]").click() #点击项目
#self.driver.switch_to(".//*[@id='mCSB_2_container']")
# WebDriverWait(self.driver,20).until(lambda x:x.find_element__by_xpath(".//*[@id='mCSB_2_container']/div[2]/input")).click
self.driverxpath(".//*[@id='mCSB_2_container']/div[2]/input").click
# self.driver.find_element_by_xpath(".//*[@id='mCSB_2_container']/div[2]/input").click() #点击任务名
#//*[@id='mCSB_2_container']/div[2]/input
#WebDriverWait(self.driver, 20).until(lambda x: x.find_element_by_xpath(".//*[@id='mCSB_2_container']/div[2]/input"))
self.driverxpath(".//*[@id='mCSB_2_container']/div[2]/input").send_keys(renwuname)
self.driver.switch_to.default_content() def test_dele(self):
#删除团队
self.login("397986@qq.com","01660184")
time.sleep(5)
self.zeng("rrrr","1660184@qq.com")
self.tianjia("zzq14184@163.com")
time.sleep(5)
self.xiangmu("xinu","beautiful")
self.renwu("renwuming") def tearDown(self):
"后置条件"
time.sleep(5)
# self.driver.quit() if __name__=='__main__':
unittest.main() #执行用例

yun的更多相关文章

  1. 指示灯组与3个复位按钮的介绍Arduino Yun快速入门教程

    指示灯组与3个复位按钮的介绍Arduino Yun快速入门教程 1.4.2  指示灯组 指示灯组的放大图如图1.5所示. 图1.5  指示灯组 各个指示灯对应的功能如下: q  RX:对应于0号端口, ...

  2. Use Node.js DDP Client on Arduino Yun to Access Meteor Server

    Use Node.js DDP Client on Arduino Yun to Access Meteor Server 概述 在Arduino Yun上安装 Node.js, 并測试与 Meteo ...

  3. ArduinoYun教程之配置Arduino Yun环境

    ArduinoYun教程之配置Arduino Yun环境 配置Arduino Yun 不管你使用前面介绍的哪种方式连接Arduino Yun.如今都能够配置你的Arduino Yun了.首先须要的是使 ...

  4. ArduinoYun教程之OpenWrt-Yun与CLI配置Arduino Yun

    ArduinoYun教程之OpenWrt-Yun与CLI配置Arduino Yun OpenWrt-Yun OpenWrt-Yun是基于OpenWrt的一个Linux发行版.有所耳闻的读者应该听说他是 ...

  5. ArduinoYun教程之通过网络为Arduino Yun编程

    ArduinoYun教程之通过网络为Arduino Yun编程 Arduino Yun的软件部分 通过第一章的介绍后读者就明白了Arduino Yun除了是一个类似其他Arduino的单片机之外,它的 ...

  6. 入手Arduino Yun,配合Blynk搞一波事情

    前言 原创文章,转载引用务必注明链接. 最近在闲鱼上与别人用RPi2尸体+好的BBB换了个Arduino Yun,等了几天赶在节前收到了.出奇的轻巧,产地台湾,官方正品做工就是精细~采用5v Micr ...

  7. Arduino Yun高速新手教程(大学霸内部资料)

    Arduino Yun高速新手教程(大学霸内部资料) 本资料为国内第一本Arduino Yun教程.具体解说Arduino Yun的基本结构.开发环境.系统配置.并着力解说关键功能--Bridge.最 ...

  8. linux下配置yun源

    备份原yum源   /etc/yum.repos.d/centos一base.repo 下载yum源       wagt 源网址/源名称/etc/yum.repos.d/原yum名

  9. Homebrew -- Mac软件管家(套件管理yun……)

    也许是之前使用linux系统的时候总是习惯使用wget 在mac中只有curl,有点略显不习惯 于是乎某天在搜索mac开发者的时候发现了Homebrew这个东西 ok,是那么句话--惰性是人的天性 有 ...

  10. Linux yun命令使用报错:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:

    原文参考:https://www.cnblogs.com/caiji/p/7891923.html 使用yum更新perl源,报错 问题出现原因: yum包管理是使用python2.x写的,将pyth ...

随机推荐

  1. 在Linux上安装Git

    Git是一个开源的分布式版本控制系统,可以有效.高速的处理从很小到非常大的项目版本管理.而国外的GitHub和国内的Coding都是项目的托管平台.但是在使用Git工具的时候,第一步要学会如何安装gi ...

  2. 二十七、Linux 进程与信号---进程组和组长进程

    27.1 进程组 27.1.1 进程组介绍 进程组为一个或多个进程的集合 进程组可以接受同一终端的各种信号,同一个信号发送进程组等于发送给组中的所有进程 每个进程组有唯一的进程组 ID 进程组的消亡要 ...

  3. c++ virtual 记录

    虚继承: http://zh.wikipedia.org/wiki/%E8%99%9A%E7%BB%A7%E6%89%BF 解决了菱形继承问题 cB cC 继承cA    cD继承cB,cC    c ...

  4. kvm 搭建

    一,准备环境   物理机 虚拟机 操作系统 CentOS 6.8 x64 CentOS 6.8 x64 CPU/内存 10核超线程x2/64G 2核/4G 外网IP -- 内网IP eth1_192. ...

  5. CDH5.12安装检查Inspector failed on the following hosts...

    1 安装检查报错 2 原因是因为自己的文件没有全部同步过去 hadoop003文件下面缺少了cm文件夹的内容 3 cp过去 scp -r cm root@hadoop003:/var/www/html ...

  6. python之第三方模块安装

    1. 直接打开cmd窗口运行 pip install xxx   #可联网情况下使用,联网下载 xxx表示要安装的模块名称 pip问题及解决方法: 1. 配置环境变量,将如下两个路径都加到系统path ...

  7. 【数据表格】datatable+SpringMVC+Spring Data JPA

    初步实现 $("#userTable").dataTable({ "processing": true, "serverSide": tru ...

  8. spark教程

    某大神总结的spark教程, 地址 http://litaotao.github.io/introduction-to-spark?s=inner

  9. 调试 - Visual Studio调试

    Visual Studio - 调试 异常处理机制 windows预定义了一系列的异常错误码,每种程序异常都有一个对应的错误码,windows系统将这些类似键值对关系的数据存储在异常处理表中(称为SE ...

  10. Open-Drain与Push-Pull【转】

    转自:https://www.cnblogs.com/zhangpengshou/p/3643546.html GPIO的功能,简单说就是可以根据自己的需要去配置为输入或输出.(General Pur ...