# Path: src/main/python/taf/foundation/api/ui/web/browser.py
# class Browser(AUT):
#     def __init__(
#             self,
#             name='firefox',
#             identifier=None,
#             **kwargs
#     ):
#         super(Browser, self).__init__(
#             name, identifier, **kwargs
#         )
# 
#     @staticmethod
#     def launch(url='about:blank', **kwargs):
#         raise NotImplementedError(
#             'Web browser navigates to specific page'
#         )
# 
#     def maximize(self):
#         raise NotImplementedError(
#             'Maximize the current browser'
#         )
# 
#     def sync(self, timeout=30):
#         raise NotImplementedError(
#             'Synchronization until browser is fully loaded or timeout'
#         )
# 
#     def _create_instance(self, name, **kwargs):
#         raise NotImplementedError(
#             'Create web browser instance (type={})'.format(
#                 name
#             )
#         )


from taf.foundation.api.ui import UIElement
from .browser import Browser
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.



class Page(UIElement):
    def __init__(self, *elements, **conditions):
        super(Page, self).__init__(
            *elements, **conditions
        )

    @property
    def current(self):
        if self.parent and self.root:
            self._current = self

        return self._current

    def _resolve_parent(self, element=None):
        if element is None:
            if Browser.current:
                self._parent = Browser.current
            else:
                raise RuntimeError('Browser is required')
        else:

# Path: src/main/python/taf/foundation/api/ui/web/browser.py
# class Browser(AUT):
#     def __init__(
#             self,
#             name='firefox',
#             identifier=None,
#             **kwargs
#     ):
#         super(Browser, self).__init__(
#             name, identifier, **kwargs
#         )
# 
#     @staticmethod
#     def launch(url='about:blank', **kwargs):
#         raise NotImplementedError(
#             'Web browser navigates to specific page'
#         )
# 
#     def maximize(self):
#         raise NotImplementedError(
#             'Maximize the current browser'
#         )
# 
#     def sync(self, timeout=30):
#         raise NotImplementedError(
#             'Synchronization until browser is fully loaded or timeout'
#         )
# 
#     def _create_instance(self, name, **kwargs):
#         raise NotImplementedError(
#             'Create web browser instance (type={})'.format(
#                 name
#             )
#         )


# Path: src/main/python/taf/foundation/api/ui/web/page.py
from taf.foundation.api.ui import UIElement
from .browser import Browser

# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.



class Page(UIElement):
    def __init__(self, *elements, **conditions):
        super(Page, self).__init__(
            *elements, **conditions
        )

    @property
    def current(self):
        if self.parent and self.root:
            self._current = self

        return self._current

    def _resolve_parent(self, element=None):
        if element is None:
            if Browser.current:
                self._parent = Browser.current
            else:
                raise RuntimeError('Browser is required')
        else:

            if isinstance(element, Browser):