From ed1233d05f0ea12df0683dcbf38734aa69e39269 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 28 Jun 2019 11:33:13 +0000 Subject: [PATCH] Build/Test Tools: Fix the hello e2e test assertion. The previous assertion was always valid because we assumed it returned a single object, while in reality it was returning an array. Props hideokamoto. Fixes #47622. git-svn-id: https://develop.svn.wordpress.org/trunk@45575 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/e2e/specs/hello.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/hello.test.js b/tests/e2e/specs/hello.test.js index aba42d59f3c5..038957883be0 100644 --- a/tests/e2e/specs/hello.test.js +++ b/tests/e2e/specs/hello.test.js @@ -3,9 +3,9 @@ import { visitAdminPage } from '@wordpress/e2e-test-utils'; describe( 'Hello World', () => { it( 'Should load properly', async () => { await visitAdminPage( '/' ); - const title = await page.$x( + const nodes = await page.$x( '//h2[contains(text(), "Welcome to WordPress!")]' ); - expect( title ).not.toBeNull(); + expect( nodes.length ).not.toEqual( 0 ); } ); } );