Skip to content

Commit

Permalink
fix additionalEditorFeaturesModals (oppia#19609)
Browse files Browse the repository at this point in the history
* try fix flakes

* fix comments

* address PR comments
  • Loading branch information
nikitaevg authored Feb 1, 2024
1 parent ac81d84 commit ab62ea9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/tests/webdriverio_utils/ExplorationEditorMainTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ var ExplorationEditorMainTab = function() {
this.expectContentToMatch = async function(richTextInstructions) {
await waitFor.visibilityOf(
stateContentDisplay, 'State content display not showing up');
// Wait for any text to be present to reduce flakes.
await waitFor.nonEmptyText('State content display', stateContentDisplay);
await forms.expectRichText(stateContentDisplay).toMatch(
richTextInstructions);
};
Expand Down
16 changes: 16 additions & 0 deletions core/tests/webdriverio_utils/waitFor.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,21 @@ var clientSideRedirection = async function(
await waitForCallerSpecifiedConditions();
};

var nonEmptyText = async function(elementName, element) {
await visibilityOf(
element, `${elementName} is not visible for getText()`);
await browser.waitUntil(
async function() {
return await element.getText();
}, {
timeout: DEFAULT_WAIT_TIME_MSECS,
timeoutMsg: `Text in ${elementName} is empty!\n` +
new Error().stack + '\n'
}
);
};


exports.DEFAULT_WAIT_TIME_MSECS = DEFAULT_WAIT_TIME_MSECS;
exports.alertToBePresent = alertToBePresent;
exports.urlToBe = urlToBe;
Expand All @@ -302,3 +317,4 @@ exports.newTabToBeCreated = newTabToBeCreated;
exports.urlRedirection = urlRedirection;
exports.numberOfElementsToBe = numberOfElementsToBe;
exports.clientSideRedirection = clientSideRedirection;
exports.nonEmptyText = nonEmptyText;

0 comments on commit ab62ea9

Please sign in to comment.