wordpress: tests: Fix writing title for new post in newer versions

Newer versions of wordpress after Bullseye seem to have a different HTML
structure for the title element. Make the functional tests work for the new
structure as well as the old one.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2022-06-06 12:17:25 -07:00
parent 90cef6e95c
commit 4e5835f92a
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -137,7 +137,11 @@ def _write_post(browser, title):
if browser.find_by_css('.edit-post-welcome-guide'):
browser.find_by_css('.components-modal__header button')[0].click()
browser.find_by_id('post-title-0').fill(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)
browser.find_by_css('.editor-post-publish-button__button')[0].click()
functional.eventually(browser.find_by_css, ['.editor-post-publish-button'])
browser.find_by_css('.editor-post-publish-button')[0].click()