Skip to content

Commit beff337

Browse files
committed
iframe waitForText null
1 parent 5ea8744 commit beff337

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/QAN/filters_test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ Scenario(
198198
queryAnalyticsPage.filters.selectContainFilter(serviceName);
199199
queryAnalyticsPage.data.waitForNewItemsCount(count);
200200
queryAnalyticsPage.filters.selectFilterInGroup(db2, section);
201-
await within(queryAnalyticsPage.data.root, () => {
202-
I.waitForText('No queries available for this combination of filters', 30);
203-
});
201+
I.waitForText('No queries available for this combination of filters', 30);
204202
},
205203
).retry(2);
206204

tests/helper/hooks.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const { event, container } = require('codeceptjs');
55
function getSelector(locator) {
66
let selector = locator;
77

8+
if (!locator) return null;
9+
810
if (typeof locator === 'object') {
911
if (locator.xpath) {
1012
selector = `xpath=${locator.xpath}`;
@@ -139,7 +141,7 @@ module.exports = function pmmGrafanaIframeHook() {
139141
applyContextOverride(helper, 'grabTextFrom', async (locator) => helper.context.locator(getSelector(locator)).first().textContent());
140142
applyContextOverride(helper, 'grabTextFromAll', async (locator) => helper.context.locator(getSelector(locator)).allTextContents());
141143
applyContextOverride(helper, 'waitForText', async (text, seconds = null, context = null) => {
142-
await helper.context.locator(getSelector(context)).filter({ hasText: text }).first().waitFor({
144+
await helper.context.locator(getSelector(context) || 'body').filter({ hasText: text }).first().waitFor({
143145
state: 'visible',
144146
timeout: seconds ? seconds * 1000 : helper.options.waitForTimeout,
145147
});

0 commit comments

Comments
 (0)