# 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. luogu P4148 简单题

    传送门 这题真简单,直接把\(CDQ\)给ban掉了 其实数据范围比较小可以直接二维树状数组,我们看数据范围,发现点的个数比N还小,可以考虑用一些奇怪的数据结构 说的就是你,\(KD tree\) \ ...

  2. TensorFlow从入门到理解(六):可视化梯度下降

    运行代码: import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.m ...

  3. javascript 的类式继承(构造函数)

    <script type="text/javascript"> //类式继承(构造函数) var father = function(){ this.age = 52; ...

  4. python(三)@staticmethod和@classmethod使用和区别

    转载自[1] 一般要用某个类的方法,先要实例这个类. 但是可以通过@staticmethod和@classmethod,直接用“类.方法()”来调用这个方法. 而 @staticmethod和@cla ...

  5. Out of range value for column ""

    今天同事在初始化数据时,在初始手机号遇到如下报错:  我实体类的字段如下: @Column @Comment("购车人手机号") @ColDefine(type = ColType ...

  6. Eclipse使用solrJ 7.7.0连接solr步骤

    先写一个测试类: package com.taotao.rest.solrj; import org.apache.solr.client.solrj.SolrClient; import org.a ...

  7. 20165221 2017-2018-2《Java程序设计》课程总结

    20165221 2017-2018-2<Java程序设计>课程总结 一.作业连接汇总 每周作业链接 预备作业一: 20165221我期望的师生关系 预备作业二: 20165221学习基础 ...

  8. 【转】Python数据类型之“文本序列(Text Sequence)”

    [转]Python数据类型之“文本序列(Text Sequence)” Python中的文本序列类型 Python中的文本数据由str对象或字符串进行处理. 1.字符串 字符串是Unicode码值的不 ...

  9. 【转】Python 3的pathlib模块:驯服文件系统

    [转]Python 3的pathlib模块:驯服文件系统 https://python.freelycode.com/contribution/detail/1248 Python部落(python. ...

  10. Linux 下的dd命令使用详解(摘录)【转】

    转自:https://www.cnblogs.com/jikexianfeng/p/6103500.html 一.dd命令的解释 dd:用指定大小的块拷贝一个文件,并在拷贝的同时进行指定的转换. 注意 ...