|
|
|
@ -56,22 +56,22 @@ module Pages |
|
|
|
|
def model_viewer_visible(visible) |
|
|
|
|
# Ensure the canvas is present |
|
|
|
|
canvas_selector = '.op-ifc-viewer--model-canvas' |
|
|
|
|
expect(page).to (visible ? have_selector(canvas_selector, wait: 10) : have_no_selector(canvas_selector, wait: 10)) |
|
|
|
|
expect(page).to(visible ? have_selector(canvas_selector, wait: 10) : have_no_selector(canvas_selector, wait: 10)) |
|
|
|
|
# Ensure Xeokit is initialized. Only then the toolbar is generated. |
|
|
|
|
toolbar_selector = '.xeokit-toolbar' |
|
|
|
|
expect(page).to (visible ? have_selector(toolbar_selector, wait: 10) : have_no_selector(toolbar_selector, wait: 10)) |
|
|
|
|
expect(page).to(visible ? have_selector(toolbar_selector, wait: 10) : have_no_selector(toolbar_selector, wait: 10)) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def model_viewer_shows_a_toolbar(visible) |
|
|
|
|
selector = '.xeokit-btn' |
|
|
|
|
|
|
|
|
|
if visible |
|
|
|
|
within ('[data-qa-selector="op-ifc-viewer--toolbar"]') do |
|
|
|
|
within('[data-qa-selector="op-ifc-viewer--toolbar-container"]') do |
|
|
|
|
expect(page).to have_selector(selector, count: 9) |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
expect(page).to have_no_selector(selector) |
|
|
|
|
expect(page).to have_no_selector('[data-qa-selector="op-ifc-viewer--toolbar"]') |
|
|
|
|
expect(page).to have_no_selector('[data-qa-selector="op-ifc-viewer--toolbar-container"]') |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|