Update docker-compose file & setup running e2e tests on Travis CI

This commit is contained in:
Julia Amosova 2019-11-26 20:34:00 +00:00
parent b1738068a4
commit a7e582b1bb
5 changed files with 12 additions and 21 deletions

View File

@ -5,6 +5,8 @@ dist: xenial
services:
- xvfb
- mysql
- docker
- docker-compose
sudo: false
@ -32,14 +34,10 @@ matrix:
- name: "Coding standard check"
php: 7.2
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1
- name: "e2e tests"
php: 7.2
env: WP_VERSION=latest WP_MULTISITE=0 RUN_E2E=1
addons:
chrome: beta
apt:
packages:
- nginx
- name: "E2E tests"
env: RUN_E2E=1
script:
- docker-compose up -d
- name: "Unit tests code coverage"
php: 7.3
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1

View File

@ -1,15 +1,15 @@
version: '3.1'
version: '3.7'
services:
db:
image: mysql:5.7
image: mariadb:10.4
restart: on-failure
environment:
MYSQL_DATABASE: testdb
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_RANDOM_ROOT_PASSWORD: '1'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes:
- db:/var/lib/mysql

View File

@ -1,11 +1,4 @@
#!/usr/bin/env bash
if [[ ${RUN_E2E} == 1 ]]; then
WP_SITE_URL="http://localhost:8080"
# Set base url to that of e2e test suite.
export BASE_URL="$WP_SITE_URL"
# Run the tests
npm test
npm run test:e2e
fi

View File

@ -1,5 +1,5 @@
{
"url": "http://example.com",
"url": "http://example.com/",
"users": {
"admin": {
"username": "",

View File

@ -71,7 +71,7 @@ describe( 'Store owner can go through store Setup Wizard', () => {
await page.$eval( '#wc_tracker_submit', elem => elem.click() );
// Wait for the Payment section to load
await page.waitForNavigation();
await page.waitForNavigation( { waitUntil: 'networkidle0' } );
} );
it( 'Can fill out Payment details', async () => {