Skip to content

Commit e63614a

Browse files
authored
Merge branch 'develop' into fix/508-secondary-color-contrast
2 parents 198161d + 597f593 commit e63614a

File tree

17 files changed

+538
-121
lines changed

17 files changed

+538
-121
lines changed

.env.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ MYSQL_PASSWORD=wordpress
88
WP_VERSION=5.6
99
WP_DB_USER=wordpress
1010
WP_DB_PASSWORD=wordpress
11+
12+
# PHP
13+
PHP_VERSION=php7.4-apache

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,26 @@ jobs:
102102
- sudo chown -R travis:travis tests node_modules # ensure coverage folder can be created
103103
- npm run test:e2e:coveralls
104104

105+
- name: E2E tests with Docker (7.3, WordPress 5.2)
106+
php: "7.3"
107+
env: NODE_ENV=teste2e PHP_VERSION=php7.3-apache WP_VERSION=5.2
108+
before_install:
109+
- unset PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
110+
- nvm install
111+
- nvm use
112+
- set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
113+
before_script:
114+
- sudo service mysql stop
115+
- echo "Running E2E tests"
116+
script:
117+
- npm run env:start
118+
- docker-compose exec wordpress bash -c "chown -R www-data:www-data /var/www/html/wp-content/" # ensure WP folders have correct permissions
119+
- docker-compose exec mysql bash -c "chown -R mysql:mysql /var/lib/mysql"
120+
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password --admin_email=admin@example.com --skip-email --url=http://localhost:8088
121+
- npm run wp -- wp plugin activate material-design
122+
- sudo chown -R travis:travis tests node_modules
123+
- npm run test:e2e
124+
105125
- name: JS unit tests (7.4, WordPress latest, with code coverage)
106126
php: "7.4"
107127
env: COVERALLS_REPO_TOKEN=$CR_TOKEN

assets/importer/demo-content.xml

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

assets/src/block-editor/blocks/image-list/components/gallery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ const Gallery = ( {
150150
}
151151

152152
return (
153+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
153154
<li
154155
key={ i }
155156
className="mdc-image-list__item"
156157
style={ itemStyles }
157-
role="presentation"
158158
onClick={ () => onSelect( image.id ) }
159159
onKeyDown={ event => onKeyDown( event, image.id ) }
160160
>

bin/local-dev/wordpress/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
# limitations under the License.
1414

1515
ARG WP_VERSION
16+
ARG PHP_VERSION
1617

17-
FROM wordpress:${WP_VERSION}-php7.4-apache
18+
FROM wordpress:${WP_VERSION}-${PHP_VERSION}
1819

1920
ENV NODE_VERSION 10.18.1
2021
ENV YARN_VERSION 1.21.1

bin/start.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
17-
source .env
1816
source ./bin/includes.sh
1917

2018
printf "Starting up containers ..."

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ services:
3535
context: ./bin/local-dev/wordpress
3636
args:
3737
WP_VERSION: ${WP_VERSION}
38+
PHP_VERSION: ${PHP_VERSION}
3839
depends_on:
3940
- mysql
4041
ports:

package-lock.json

Lines changed: 17 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/e2e/config/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function observeConsoleLogging() {
130130
async function removeBeforeunloadEvents() {
131131
await page.setRequestInterception( true );
132132
await page.on( 'request', async request => {
133-
if ( request.url().includes( 'dist/editor.js' ) ) {
133+
if ( request.url().match( /dist\/editor(\.min)?\.js/ ) ) {
134134
fetch( request.url() )
135135
.then( response => response.text() )
136136
.then( response => {

tests/e2e/specs/block-editor/blocks/list/list.spec.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
*/
2020
import { createNewPost, ensureSidebarOpened } from '@wordpress/e2e-test-utils';
2121

22+
/**
23+
* Internal dependencies
24+
*/
2225
import { insertBlockByKeyword, selectBlockByName } from '../../../../utils';
2326

2427
describe( 'blocks: material/list', () => {
@@ -141,26 +144,26 @@ describe( 'blocks: material/list', () => {
141144
expect( await page.$$( '.mdc-list-item' ) ).toHaveLength( 1 );
142145

143146
await primary.click();
144-
await page.keyboard.type( 'List Item 1' );
145-
await primary.press( 'Enter' );
146-
await page.keyboard.type( 'List Item 2' );
147-
await primary.press( 'Enter' );
148-
await page.keyboard.type( 'List Item 3' );
147+
await page.keyboard.type( 'List Item 1', { delay: 50 } );
148+
await primary.press( 'Enter', { delay: 50 } );
149+
await page.keyboard.type( 'List Item 2', { delay: 50 } );
150+
await primary.press( 'Enter', { delay: 50 } );
151+
await page.keyboard.type( 'List Item 3', { delay: 50 } );
149152

150153
expect( await page.$$( '.mdc-list-item' ) ).toHaveLength( 3 );
151154

152155
let items = await page.$$( '.mdc-list-item__primary-text' );
153156

154157
await items[ 1 ].click();
155-
await primary.press( 'Home' );
156-
await primary.press( 'Backspace' );
158+
await primary.press( 'Home', { delay: 50 } );
159+
await primary.press( 'Backspace', { delay: 50 } );
157160

158161
expect( await page.$$( '.mdc-list-item' ) ).toHaveLength( 2 );
159162
expect(
160163
await page.evaluate( el => el.innerText.trim(), primary )
161164
).toStrictEqual( 'List Item 1List Item 2' );
162165

163-
await page.keyboard.press( 'Enter' );
166+
await page.keyboard.press( 'Enter', { delay: 50 } );
164167

165168
items = await page.$$( '.mdc-list-item__primary-text' );
166169
expect( await page.$$( '.mdc-list-item' ) ).toHaveLength( 3 );
@@ -190,9 +193,9 @@ describe( 'blocks: material/list', () => {
190193
); // wait until all the list items are updated.
191194

192195
await primary.click();
193-
await page.keyboard.type( 'List Item 1' );
194-
await primary.press( 'Enter' );
195-
await page.keyboard.type( 'Secondary Text 1' );
196+
await page.keyboard.type( 'List Item 1', { delay: 50 } );
197+
await primary.press( 'Enter', { delay: 50 } );
198+
await page.keyboard.type( 'Secondary Text 1', { delay: 50 } );
196199

197200
const [ secondary ] = await page.$$( '.mdc-list-item__secondary-text' );
198201

@@ -203,14 +206,14 @@ describe( 'blocks: material/list', () => {
203206
await page.evaluate( el => el.innerText.trim(), secondary )
204207
).toStrictEqual( 'Secondary Text 1' );
205208

206-
await primary.press( 'Home' );
207-
await primary.press( 'Backspace' );
209+
await primary.press( 'Home', { delay: 50 } );
210+
await primary.press( 'Backspace', { delay: 50 } );
208211

209212
expect(
210213
await page.evaluate( el => el.innerText.trim(), primary )
211214
).toStrictEqual( 'List Item 1Secondary Text 1' );
212215

213-
await primary.press( 'Enter' );
216+
await primary.press( 'Enter', { delay: 50 } );
214217

215218
expect(
216219
await page.evaluate( el => el.innerText.trim(), primary )
@@ -235,23 +238,23 @@ describe( 'blocks: material/list', () => {
235238
); // wait until all the list items are updated.
236239

237240
await primary.click();
238-
await page.keyboard.type( 'List Item 1' );
239-
await primary.press( 'Enter' );
240-
await page.keyboard.type( 'Secondary Text 1' );
241-
await primary.press( 'Enter' );
241+
await page.keyboard.type( 'List Item 1', { delay: 50 } );
242+
await primary.press( 'Enter', { delay: 50 } );
243+
await page.keyboard.type( 'Secondary Text 1', { delay: 50 } );
244+
await primary.press( 'Enter', { delay: 50 } );
242245

243-
await page.keyboard.type( 'List Item 2' );
244-
await primary.press( 'Enter' );
245-
await page.keyboard.type( 'Secondary Text 2' );
246+
await page.keyboard.type( 'List Item 2', { delay: 50 } );
247+
await primary.press( 'Enter', { delay: 50 } );
248+
await page.keyboard.type( 'Secondary Text 2', { delay: 50 } );
246249

247250
expect( await page.$$( '.mdc-list-item' ) ).toHaveLength( 2 );
248251

249252
let items = await page.$$( '.mdc-list-item__primary-text' );
250253
let secondaryItems = await page.$$( '.mdc-list-item__secondary-text' );
251254

252255
await items[ 1 ].click();
253-
await primary.press( 'Home' );
254-
await primary.press( 'Backspace' );
256+
await primary.press( 'Home', { delay: 50 } );
257+
await primary.press( 'Backspace', { delay: 50 } );
255258

256259
expect( await page.$$( '.mdc-list-item' ) ).toHaveLength( 1 );
257260
expect(
@@ -261,7 +264,7 @@ describe( 'blocks: material/list', () => {
261264
await page.evaluate( el => el.innerText.trim(), secondaryItems[ 0 ] )
262265
).toStrictEqual( 'Secondary Text 1List Item 2 Secondary Text 2' );
263266

264-
await primary.press( 'Enter' );
267+
await primary.press( 'Enter', { delay: 50 } );
265268

266269
expect( await page.$$( '.mdc-list-item' ) ).toHaveLength( 2 );
267270

0 commit comments

Comments
 (0)