-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create E2E action * Setup PHP and Node * Ensure frontend process doesn't hang * Don't use docker compose in exec scripts * Add sleep for DB to accept connections * Add working directory to setup tests step * Use Allow root wp cli * Setup chrome * Fix chrome version step syntax * Chrome/ChromeDriver is already installed on action * Add chrome driver args for GH Actions * e2e Click preview link and determine if correct preview page is fetched * Revert preview link href assertion removal * Wait for previewlinks.js to modify button href before checking preview link
- Loading branch information
1 parent
81d6162
commit 7d75c11
Showing
4 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: E2E Test Plugin | ||
on: pull_request | ||
jobs: | ||
e2e_test_plugin: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
- name: Setup Frontend | ||
working-directory: examples/next/getting-started | ||
run: | | ||
npm install | ||
NEXT_PUBLIC_WORDPRESS_URL=http://localhost:8080 WP_HEADLESS_SECRET=00000000-0000-0000-0000-000000000001 npm run dev & | ||
- name: Composer install | ||
working-directory: plugins/faustwp | ||
run: composer install | ||
- name: Setup Containers | ||
working-directory: plugins/faustwp | ||
run: docker-compose up -d | ||
- name: Sleep 15 seconds | ||
run: sleep 15 | ||
- name: Install WP GraphQL | ||
working-directory: plugins/faustwp | ||
run: | | ||
docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp plugin install wp-graphql --activate --allow-root | ||
- name: Setup testing data | ||
working-directory: plugins/faustwp | ||
run: | | ||
docker exec --workdir=/var/www/html/wp-content/plugins/faustwp $(docker-compose ps -q wordpress) wp db export tests/_data/dump.sql --allow-root | ||
- name: Copy env file | ||
working-directory: plugins/faustwp | ||
run: cp .env.testing.example .env.testing | ||
- name: Run test | ||
working-directory: plugins/faustwp | ||
run: vendor/bin/codecept run acceptance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,9 @@ | ||
WP_ROOT_FOLDER=/var/www/html | ||
|
||
# Use the following for mysql socket connections | ||
# TEST_SITE_DB_DSN=mysql:unix_socket=/path/to/unit/mysql.sock;dbname=local | ||
|
||
TEST_SITE_DB_DSN=mysql:host=127.0.0.1:33066;dbname=wordpress | ||
TEST_SITE_DB_HOST=127.0.0.1:33066 | ||
TEST_SITE_DB_NAME=wordpress | ||
TEST_SITE_DB_USER=root | ||
TEST_SITE_DB_PASSWORD=wordpress | ||
TEST_SITE_TABLE_PREFIX=wp_ | ||
TEST_SITE_ADMIN_USERNAME=admin | ||
TEST_SITE_ADMIN_PASSWORD=password | ||
TEST_SITE_WP_ADMIN_PATH=/wp-admin | ||
|
||
TEST_DB_HOST=127.0.0.1:3306 | ||
TEST_DB_NAME=wordpress | ||
TEST_DB_USER=root | ||
TEST_DB_PASSWORD=wordpress | ||
TEST_TABLE_PREFIX=wp_ | ||
TEST_SITE_WP_URL=http://localhost:8080 | ||
TEST_SITE_WP_DOMAIN=localhost:8080 | ||
[email protected] | ||
|
||
HEADLESS_SITE_URL=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters