diff --git a/page-objects/pages/NWSAddEditNewsPage.js b/page-objects/pages/NWSAddEditNewsPage.js index 997a2656..3e9afe55 100644 --- a/page-objects/pages/NWSAddEditNewsPage.js +++ b/page-objects/pages/NWSAddEditNewsPage.js @@ -6,7 +6,7 @@ const waitHelpers = require('../../runtime/helpers/waitHelpers'); const submitNewsBtn = '[data-testid="btn_news_submit"]'; const addNewsBtn = "[data-testid='create-news-btn']"; const titleField = 'input.h1'; -const contentField = '.editor [contenteditable="true"]'; +const contentField = '.ck-editor [contenteditable="true"]'; const dateTimeSelector = '[data-testid="news_date"] input' async function goToNewNews () { @@ -20,7 +20,7 @@ async function setNewsTitle (newsTitle) { async function setNewsContent (newsContent) { await elementHelpers.click(contentField); - await waitHelpers.waitAndSetValue(contentField, newsContent); + await waitHelpers.waitAndSetValue(contentField, newsContent, 1000); } async function setNewsPublishDate (newsDate) { diff --git a/runtime/helpers/waitHelpers.js b/runtime/helpers/waitHelpers.js index f5237c86..329cc787 100644 --- a/runtime/helpers/waitHelpers.js +++ b/runtime/helpers/waitHelpers.js @@ -233,13 +233,13 @@ async function waitUntilScriptResultIsTrue(script, timeoutMsg, timeout = pageLoa ); } -async function waitAndSetValue(selectorOrElement, value, timeout = setValueTimeout) { +async function waitAndSetValue(selectorOrElement, value, pause = 200) { await waitUntilElementIsVisible(selectorOrElement); const element = await waitUntilElementIsEnabled(selectorOrElement); await element.clearValue(); await element.click(); driver.keys(value); - await driver.pause(200); + await driver.pause(pause); } async function waitUntilElementAttributeEquals(