Initial commit
This commit is contained in:
81
rpa_vision_v3/tests/unit/test_ui_detector.py
Normal file
81
rpa_vision_v3/tests/unit/test_ui_detector.py
Normal file
@@ -0,0 +1,81 @@
|
||||
|
||||
-v'])e__, 'in([__fil pytest.maain__':
|
||||
me__ == '__m
|
||||
|
||||
if __na600
|
||||
<= height'] ox[' + bbbox['y']sert b as
|
||||
<= 800'] bbox['width + bbox['x'] assert 0
|
||||
> ['height'] bbox assert > 0
|
||||
dth'] x['wit bboasser
|
||||
'] >= 0box['yssert b a >= 0
|
||||
x['x'] bbossert a t.bbox
|
||||
lemenbbox = e nts:
|
||||
nt in elemeeme for el
|
||||
|
||||
image)ts(_elemenctetector.detelf.dlements = se
|
||||
e00)ge(800, 6te_test_imaelf.crea s image =""
|
||||
s."ident valxes soounding bo les b que """Test (self):
|
||||
ditylinding_box_va test_bouef
|
||||
d"
|
||||
ut of boundsfidence} olement.con{efidence on f"C \
|
||||
= 1.0, nce <onfident.c eleme0 <=0. assert ements:
|
||||
elelement in for
|
||||
(image)
|
||||
elementsetect_ector.delf.det = sements el)
|
||||
ge(est_imaelf.create_t = simage"
|
||||
" et 1."e 0entrnce est confiae la"Test qu "" self):
|
||||
ounds(onfidence_bef test_c d
|
||||
nk']
|
||||
eckbox', 'li'ch', t_inpututton', 'texype in ['bt element_t asser
|
||||
n réelledétectio lors de la fiéeera vériopriété stte pr# Ce ):
|
||||
ions.items(d_combinatin valioles d_re, valiypelement_tfor s
|
||||
ces règlespecte ecteur re le détr quefie # Véri
|
||||
|
||||
} '],
|
||||
ernal_linkion', 'extgatvi'na [k': 'lin e'],
|
||||
t', 'toggl['form_inpueckbox': 'chd'],
|
||||
sword_fielield', 'pasarch_fsenput', ' ['form_it_input': 'tex '],
|
||||
ionondary_act 'sec'submit',cel', ', 'canction'primary_aton': [ 'but ns = {
|
||||
ombinatiod_c valie
|
||||
de cohérencègles finir les r # Dé
|
||||
"""types.s et ôlence entre rreCohéerty 13: "Prop "" elf):
|
||||
sistency(sone_c_typty_roleest_properef t
|
||||
d0
|
||||
ts) >= enlen(elemassert e
|
||||
age blanch ime surut être vid # Pet)
|
||||
ts, lisance(elemensert isinst as
|
||||
ge)
|
||||
ments(imat_eler.detectoec self.detements = el()
|
||||
age_test_imcreateself.= image e."""
|
||||
mage simpl sur it détection"Tes ""):
|
||||
e_image(selfplect_on_simtest_detdef
|
||||
|
||||
elements')detect_ector, 'self.det hasattr(assert e
|
||||
Non is not.detectorlfrt se asse "
|
||||
""eur.ctteon du désatiiali init"Test ""
|
||||
elf):lization(stor_initiaest_detec def t
|
||||
hite')
|
||||
or='wight), colhe, idthB', (ww('RGrn Image.ne retu""
|
||||
".est de tgeimar une ""Crée "=600):
|
||||
=800, heightidthge(self, wate_test_imacre def
|
||||
tor()
|
||||
tecector = UIDe self.det "
|
||||
ue test.""aqchant av """Setup f):
|
||||
ethod(selup_mef set
|
||||
|
||||
d"ctor.""teur UIDe po"Tests"":
|
||||
tUIDetectores Tclass
|
||||
|
||||
|
||||
tectorIDemport U_detector in.uiore.detectioion_v3.cispa_vfrom rport Image
|
||||
L imm PIs np
|
||||
fropy at nummpor
|
||||
itest
|
||||
import py
|
||||
"""
|
||||
3.3equirementses: Rlidat- Va
|
||||
s typesrtain ce'àgnés quassieuvent être ôles ne pains r- Certs Per Type
|
||||
enest Role Uniqu: UIElemen
|
||||
Property 13 testing.
|
||||
ty-based properector avecetr UIDaires pous unit"
|
||||
Test""
|
||||
Reference in New Issue
Block a user