????λ?????????? >> ??????????
Appium????????????
???????????? ???????[ 2016/12/9 16:27:23 ] ????????????????? Appium ??????????
??????????????????
# -*- coding: utf-8 -*-
import Image
def make_regalur_image(img?? size=(256?? 256)):
return img.resize(size).convert('RGB')
def split_image(img?? part_size=(64?? 64)):
w?? h = img.size
pw?? ph = part_size
assert w % pw == h % ph == 0
return [img.crop((i?? j?? i + pw?? j + ph)).copy()
for i in xrange(0?? w?? pw)
for j in xrange(0?? h?? ph)]
def hist_similar(lh?? rh):
assert len(lh) == len(rh)
return sum(1 - (0 if l == r else float(abs(l - r)) / max(l?? r)) for l?? r in zip(lh?? rh)) / len(lh)
def calc_similar(li?? ri):
# return hist_similar(li.histogram()?? ri.histogram())
return sum(hist_similar(l.histogram()?? r.histogram()) for l?? r in zip(split_image(li)?? split_image(ri))) / 16.0
def calc_similar_by_path(lf?? rf):
li?? ri = make_regalur_image(Image.open(lf))?? make_regalur_image(Image.open(rf))
return calc_similar(li?? ri)
def make_doc_data(lf?? rf):
li?? ri = make_regalur_image(Image.open(lf))?? make_regalur_image(Image.open(rf))
li.save(lf + '_regalur.png')
ri.save(rf + '_regalur.png')
fd = open('stat.csv'?? 'w')
fd.write(' '.join(l + '??' + r for l?? r in zip(map(str?? li.histogram())?? map(str?? ri.histogram()))))
# print >>fd?? ' '
# fd.write('??'.join(map(str?? ri.histogram())))
fd.close()
import ImageDraw
li = li.convert('RGB')
draw = ImageDraw.Draw(li)
for i in xrange(0?? 256?? 64):
draw.line((0?? i?? 256?? i)?? fill='#ff0000')
draw.line((i?? 0?? i?? 256)?? fill='#ff0000')
li.save(lf + '_lines.png')
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Appium ??????????Appium iOS 10 ??????Appium+Python????????????????Appium??????????Appium????????й?BugAppium+nodeJS??????????дAppium ????????????????Appium Test Case-Python?Appium?????????λ????appium??ν????ζ?????apk?????????Appium??????????????appium???????????????Appium?в???api????÷???Appium??????Appium+Python??????в???demo?????Appium???????

???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44