Vladimir Druzhinin fe724ef186 Test(pytest) start aut (#11482)
* test(pytest) The driver methods added. Wrappers for UI elements added.

#67

* test(pytest) Squishserver added

#68

* test(pytest) Attach/Detach AUT methods added

#69

* test(pytest) Main window handler added

#70

* test(pytest) Save screenshot on fail added

#71

* test(pytest) Wait for squishserver added

#71

* test(pytest) Setup Windows

#71

* Generate new keys (#11804)

* test(pytest) Image comparison methods added

#76

* test(pytest) Tesseract methods added

#77

* test(pytest) The Methods to search color on image added

#80

* test(onboarding) Test on generation new keys added

#75

* test(pytest) Handlers for OS Native File dialog added

#81

* test(Onboarding) Test on Profile image added

#83

* Allure and TestRail integration (#11806)

* test(Allure) Steps descriptions added

#72

* test(TestRail) Integration

#72
2023-08-04 20:27:03 +02:00

43 lines
946 B
Python

import logging
import allure
import driver
from gui.elements.base_object import BaseObject
_logger = logging.getLogger(__name__)
class NativeObject(BaseObject):
def __init__(self, name: str):
super().__init__(name)
@property
@allure.step('Get object {0}')
def object(self):
return driver.waitForObject(self.real_name)
@property
@allure.step('Get visible {0}')
def is_visible(self):
try:
driver.waitForObject(self.real_name, 1)
return True
except (AttributeError, LookupError, RuntimeError):
return False
@property
@allure.step('Get bounds {0}')
def bounds(self):
return driver.object.globalBounds(self.object)
@property
@allure.step('Get central coordinate {0}')
def center(self):
return self.bounds.center()
@allure.step('Click {0}')
def click(self):
driver.mouseClick(self.object)