# -*- coding:utf-8 -*-
# 作者：齐振鋆
# 日期：2022/11/10
# 描述:
import logging

from unit.public.UI.BasePage import BasePage

log = logging.getLogger(__name__)


class IframeElement(BasePage):
    def to_main_iframe(self):
        log.info("进入主iframe")
        iframe = "//div[@class='awsui-tab-content-item awsui-tab-this']//iframe[@class='metro-main-frame']"
        self.to_frame(iframe)

    def to_edit_iframe(self):
        log.info("进入编辑iframe")
        iframe = "(//iframe[contains(@name, 'awsui-dialog-iframe')])[1]"
        self.to_frame(iframe)

    def to_bar_iframe(self, name='扫码'):
        log.info("进入扫码iframe")
        iframe = "//div[@aria-label='{}']//iframe".format(name)
        self.to_frame(iframe)

    def to_transfer_out_iframe(self):
        log.info("进入调拨出库整单红冲iframe")
        iframe = "//div[@aria-label='调拨出库单台账']//iframe"
        self.to_frame(iframe)