Skip to content

Commit 15b20c7

Browse files
Improve openAllBlockInserterCategories function; Fix intermittent failures in inner blocks allowed blocks test. (#14460)
1 parent 7748b8e commit 15b20c7

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

packages/e2e-test-utils/src/open-all-block-inserter-categories.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* Opens all block inserter categories.
33
*/
44
export async function openAllBlockInserterCategories() {
5-
const notOpenCategoryPanels = await page.$$(
6-
'.block-editor-inserter__results .components-panel__body:not(.is-opened)'
7-
);
8-
for ( const categoryPanel of notOpenCategoryPanels ) {
5+
const notOppenedCategorySelector = '.block-editor-inserter__results .components-panel__body:not(.is-opened)';
6+
let categoryPanel = await page.$( notOppenedCategorySelector );
7+
while ( categoryPanel !== null ) {
98
await categoryPanel.click();
9+
categoryPanel = await page.$( notOppenedCategorySelector );
1010
}
1111
}

packages/e2e-tests/specs/plugins/inner-blocks-allowed-blocks.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ import {
1111
openGlobalBlockInserter,
1212
} from '@wordpress/e2e-test-utils';
1313

14-
// Todo: Understand why this test causing intermitent fails on travis.
15-
// Error: ● Allowed Blocks Setting on InnerBlocks › allows all blocks if the allowed blocks setting was not set
16-
// Node is detached from document
17-
// at ElementHandle._scrollIntoViewIfNeeded (../../node_modules/puppeteer/lib/ElementHandle.js:75:13)
18-
// eslint-disable-next-line jest/no-disabled-tests
19-
describe.skip( 'Allowed Blocks Setting on InnerBlocks ', () => {
14+
describe( 'Allowed Blocks Setting on InnerBlocks ', () => {
2015
const paragraphSelector = '.block-editor-rich-text__editable.wp-block-paragraph';
2116
beforeAll( async () => {
2217
await activatePlugin( 'gutenberg-test-innerblocks-allowed-blocks' );

0 commit comments

Comments
 (0)