Skip to content

Commit eaf9a77

Browse files
authored
Update for PF5 and test EditorModal (SatelliteQE#1982)
1 parent fc7207f commit eaf9a77

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

airgun/views/common.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,22 @@ class TemplateEditor(View):
557557
ROOT = ".//div[@id='editor-container']"
558558
rendering_options = ItemsList(".//div[contains(@class,'navbar-editor')]/ul")
559559
import_template = Button(id='import-btn')
560-
fullscreen = Button(id='fullscreen-btn')
560+
fullscreen = Text(locator=".//button[@id='fullscreen-btn']")
561+
fullscreen_close = Text(
562+
locator="//button[@data-ouia-component-id='editor-modal-component-ModalBoxCloseButton']"
563+
)
564+
fullscreen_textarea = TextInput(locator="//div[@id='editor']/textarea")
561565
error = Text(".//div[@id='preview_error_toast']")
562566
editor = ACEEditor()
563567

568+
def fill(self, values):
569+
if values.pop('fullscreen', False):
570+
fullscreen_data = values.pop('editor')
571+
self.fullscreen.click()
572+
self.fullscreen_textarea.fill(fullscreen_data)
573+
self.fullscreen_close.click()
574+
super().fill(values)
575+
564576

565577
class SearchableViewMixin(WTMixin):
566578
"""Mixin which adds :class:`airgun.widgets.Search` widget and

airgun/views/partitiontable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
BaseLoggedInView,
1313
SatTab,
1414
SearchableViewMixinPF4,
15+
TemplateEditor,
1516
TemplateInputItem,
1617
)
1718
from airgun.widgets import (
18-
ACEEditor,
1919
ActionsDropdown,
2020
FilteredDropdown,
2121
MultiSelect,
@@ -58,7 +58,7 @@ class SnippetOption(View):
5858
class OSFamilyOption(View):
5959
os_family = FilteredDropdown(id='ptable_os_family')
6060

61-
template_editor = ACEEditor()
61+
template_editor = TemplateEditor()
6262
audit_comment = TextInput(id='ptable_audit_comment')
6363

6464
@View.nested

0 commit comments

Comments
 (0)