# 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. 【python小练】0011题

    第 0011 题: 敏感词文本文件 filtered_words.txt,里面的内容为以下内容,当用户输入敏感词语时,则打印出 Freedom,否则打印出 Human Rights. #word.tx ...

  2. ES6 快速开始

    Refs 现代框架 Vue React 都使用到了 ES6 (包括D3js) [常量] // ES5 中常量的写法 Object.defineProperty(window, "PI2&qu ...

  3. 【bzoj 3779】重组病毒

    Description 黑客们通过对已有的病毒反编译,将许多不同的病毒重组,并重新编译出了新型的重组病毒.这种病毒的繁殖和变异能力极强.为了阻止这种病毒传播,某安全机构策划了一次实验,来研究这种病毒. ...

  4. linux 测试 get 请求 跳过SSL证书验证

    Linux 下测试 get 请求: curl : curl "http://www.qq.com" # 标准输出页面内容 curl -i "http://www.qq.c ...

  5. Linux top 命令详解

    Top  top 查看资源占用 top -p pid# 查看某个进程PID 的内存占用: PID:进程的ID USER:进程所有者 PR:进程的优先级别,越小越优先被执行 NInice:值 VIRT: ...

  6. 【译】第四篇 SQL Server安全权限

    本篇文章是SQL Server安全系列的第四篇,详细内容请参考原文. 权限授予主体访问对象,以执行某些操作.SQL Server有大量你可以授予给主体的权限,你甚至可以拒绝或回收权限.这听起来有点复杂 ...

  7. GB GBRT XgBoost

    https://blog.csdn.net/github_38414650/article/details/76061893 https://www.cnblogs.com/wxquare/p/554 ...

  8. 2017-2018-2 20165234 实验二 《Java面向对象程序设计》实验报告

    一.实验报告封面 课程:Java程序设计  班级:1652班  姓名:刘津甫  学号:20165234 指导教师:娄嘉鹏  实验日期:2018年4月13日 实验时间:15:35 - 17:15  实验 ...

  9. 第三节,CNN案例-mnist手写数字识别

    卷积:神经网络不再是对每个像素做处理,而是对一小块区域的处理,这种做法加强了图像信息的连续性,使得神经网络看到的是一个图像,而非一个点,同时也加深了神经网络对图像的理解,卷积神经网络有一个批量过滤器, ...

  10. Linux 如何通过命令查看一个文件的某几行(中间几行或最后几行)

    linux 如何显示一个文件的某几行(中间几行) [一]从第3000行开始,显示1000行.即显示3000~3999行 cat filename | tail -n +3000 | head -n 1 ...