Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
BC-5863 - remove tiptap (#446)
Browse files Browse the repository at this point in the history
* Adjust contentField selector

* Add pause param to waitAndSetValue

* Configure pause after set content
  • Loading branch information
christian-darsow authored Dec 6, 2023
1 parent 3d08afb commit 63fc3c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions page-objects/pages/NWSAddEditNewsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions runtime/helpers/waitHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 63fc3c8

Please sign in to comment.