示例#1
0
 def test_is_element_not_displayed(self, google_page, field_type):
     field = self.ELEMENTS[field_type]
     if field == 'web_element':
         try:
             field = s(f'#{self.FIELD_ID}')
         except NoSuchElementException:
             field = None
     assert not is_element_displayed(field, 0.5)
示例#2
0
 def set_supplier(self, supplier, quick=True):
     # for now, supplier is supplier name. In future, it be dict with enhanced data
     self.__supplier_input.should(be.clickable).type(supplier)
     target = by.xpath(self.__supplier_dropdown_target.format(supplier))
     if is_element_displayed(target):
         s(target).should(be.match.element_has_text(supplier)).click()
     else:
         self.__create_new_supplier(supplier, quick)
示例#3
0
 def test_is_element_displayed(self, remonline_start_page, field_type):
     field = self.ELEMENTS[field_type]
     if field == 'web_element':
         field = s(f'#{self.FIELD_ID}')
     assert is_element_displayed(field, timeout=4)
示例#4
0
 def close_supplier_card(self):
     if is_element_displayed(self.__supplier_passport_dialog):
         self.__supplier_passport_close_button.should(be.clickable).click()
     self.__supplier_passport_dialog.should(be.not_.visible)
     return True
 def close_document_by_button(self):
     if is_element_displayed(self.__document_view_dialog):
         self.__document_close_button.should(be.visible).click()
     self.__document_view_dialog.should(be.not_.visible)
     return True
 def close_refund_dialog(self):
     if is_element_displayed(self._create_refund_dialog):
         self.__close_refund_dialog_button.should(be.clickable).click()
     self._create_refund_dialog.should(be.not_.visible)
     return True
 def close_document_by_mask(self):
     if is_element_displayed(self.__document_view_dialog):
         self.__dialog_mask_active.should(be.visible).click()
     self.__document_view_dialog.should(be.not_.visible)
     return True
示例#8
0
 def _open_create_posting_dialog(self):
     if not is_element_displayed(self.__create_new_posting_dialog, 0.1):
         self.__create_new_posting_button.should(be.clickable).click()
         self.__create_new_posting_dialog.should(be.visible)