mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
wordpress: tests: functional: Fix tests on Trixie
- In versions of WordPress in Debian Trixie and up the editing widget is inside of an iframe instead of as a direct child of the main document. Elements inside these iframes can't be queried directly and one must be the 'context' of the iframe before querying elements inside. - Fix the failures by using the splinter API to query inside iframe. Tests: - Run functional tests on WordPress in stable and testing containers twice. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
56791df57e
commit
fc86f3e507
@ -143,7 +143,11 @@ def _write_post(browser, title):
|
||||
if browser.find_by_id('post-title-0'):
|
||||
browser.find_by_id('post-title-0').fill(title)
|
||||
else:
|
||||
browser.find_by_css('.editor-post-title').first.type(title)
|
||||
if browser.find_by_css('.editor-visual-editor.is-iframed'):
|
||||
with browser.get_iframe('editor-canvas') as iframe:
|
||||
iframe.find_by_css('.editor-post-title').first.type(title)
|
||||
else:
|
||||
browser.find_by_css('.editor-post-title').first.type(title)
|
||||
|
||||
browser.find_by_css('.editor-post-publish-button__button')[0].click()
|
||||
functional.eventually(browser.find_by_css, ['.editor-post-publish-button'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user