Skip to content

Commit

Permalink
devops: WPBrowser upgraded to v4.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kidunot89 committed May 17, 2024
1 parent 6e37231 commit 5811db6
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 91 deletions.
4 changes: 4 additions & 0 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ fi
echo "Setting pretty permalinks..."
wp rewrite structure '/%year%/%monthnum%/%postname%/' --allow-root

zone_id=$(wp wc shipping_zone create --name="Local" --order=1 --user=admin --porcelain --allow-root)
wp wc shipping_zone_method create "$zone_id" --method_id=flat_rate --order=1 --enabled=true --settings='{"cost":"10"}' --user=admin --allow-root
wp wc shipping_zone_method create "$zone_id" --method_id=free_shipping --order=2 --enabled=true --settings='{"requires":"min_amount","min_amount":"50"}' --user=admin --allow-root

echo "Prepare for app database dump..."
if [ ! -d "${PROJECT_DIR}/local/db" ]; then
mkdir "${PROJECT_DIR}/local/db"
Expand Down
61 changes: 2 additions & 59 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,62 +32,5 @@ extensions:
- "lucatume\\WPBrowser\\Command\\GenerateWPAjax"
- "lucatume\\WPBrowser\\Command\\GenerateWPCanonical"
- "lucatume\\WPBrowser\\Command\\GenerateWPXMLRPC"
modules:
config:
\Tests\WPGraphQL\Codeception\Module\WPGraphQL:
endpoint: '%WORDPRESS_URL%/graphql'
auth_header: 'Basic %TEST_SITE_ADMIN_APP_PASSWORD%'
\lucatume\WPBrowser\Module\WPCLI:
path: '%WP_ROOT_FOLDER%'
throw: true
\lucatume\WPBrowser\Module\WPDb:
dsn: 'mysql:host=%DB_HOST%;dbname=%DB_NAME%'
user: '%DB_USER%'
password: '%DB_PASSWORD%'
dump: 'local/db/app_db.sql'
populate: true
cleanup: true
waitlock: 10
url: '%WORDPRESS_URL%'
urlReplacement: true
tablePrefix: '%WP_TABLE_PREFIX%'
\lucatume\WPBrowser\Module\WPBrowser:
url: '%WORDPRESS_URL%'
wpRootFolder: '%WP_CORE_DIR%'
adminUsername: '%ADMIN_USERNAME%'
adminPassword: '%ADMIN_PASSWORD%'
adminPath: '/wp-admin'
\lucatume\WPBrowser\Module\REST:
depends: WPBrowser
url: '%WORDPRESS_URL%'
cookies: false
\lucatume\WPBrowser\Module\WPFilesystem:
wpRootFolder: '%WP_CORE_DIR%'
plugins: '/wp-content/plugins'
mu-plugins: '/wp-content/mu-plugins'
themes: '/wp-content/themes'
uploads: '/wp-content/uploads'
\lucatume\WPBrowser\Module\WPLoader:
skipInstall: true
wpRootFolder: '%WP_CORE_DIR%'
dbName: '%DB_NAME%'
dbHost: '%DB_HOST%'
dbUser: '%DB_USER%'
dbPassword: '%DB_PASSWORD%'
tablePrefix: '%WP_TABLE_PREFIX%'
domain: '%WORDPRESS_DOMAIN%'
adminEmail: '%ADMIN_EMAIL%'
title: 'WooGraphQL Tests'
plugins:
- woocommerce/woocommerce.php
- woocommerce-gateway-stripe/woocommerce-gateway-stripe.php
- wp-graphql/wp-graphql.php
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
activatePlugins:
- woocommerce/woocommerce.php
- woocommerce-gateway-stripe/woocommerce-gateway-stripe.php
- wp-graphql/wp-graphql.php
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
configFile: 'tests/_data/config.php'


56 changes: 28 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 62 additions & 3 deletions tests/acceptance.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,66 @@ modules:
enabled:
- Asserts
- REST
- WPBrowser
- WPDb
- WPLoader
- \lucatume\WPBrowser\Module\WPCLI
- \lucatume\WPBrowser\Module\WPBrowser
- \lucatume\WPBrowser\Module\WPDb
- \lucatume\WPBrowser\Module\WPLoader
- \Tests\WPGraphQL\Codeception\Module\QueryAsserts
- \Tests\WPGraphQL\Codeception\Module\WPGraphQL
- \Helper\GraphQLE2E
config:
\Tests\WPGraphQL\Codeception\Module\WPGraphQL:
endpoint: '%WORDPRESS_URL%/graphql'
\lucatume\WPBrowser\Module\WPCLI:
path: '%WP_ROOT_FOLDER%'
throw: true
\lucatume\WPBrowser\Module\WPDb:
dsn: 'mysql:host=%DB_HOST%;dbname=%DB_NAME%'
user: '%DB_USER%'
password: '%DB_PASSWORD%'
dump: 'local/db/app_db.sql'
populate: true
cleanup: true
waitlock: 10
url: '%WORDPRESS_URL%'
urlReplacement: true
tablePrefix: '%WP_TABLE_PREFIX%'
\lucatume\WPBrowser\Module\WPBrowser:
url: '%WORDPRESS_URL%'
wpRootFolder: '%WP_CORE_DIR%'
adminUsername: '%ADMIN_USERNAME%'
adminPassword: '%ADMIN_PASSWORD%'
adminPath: '/wp-admin'
\lucatume\WPBrowser\Module\REST:
depends: WPBrowser
url: '%WORDPRESS_URL%'
cookies: false
\lucatume\WPBrowser\Module\WPFilesystem:
wpRootFolder: '%WP_CORE_DIR%'
plugins: '/wp-content/plugins'
mu-plugins: '/wp-content/mu-plugins'
themes: '/wp-content/themes'
uploads: '/wp-content/uploads'
\lucatume\WPBrowser\Module\WPLoader:
loadOnly: true
wpRootFolder: '%WP_ROOT_FOLDER%'
dbName: '%DB_NAME%'
dbHost: '%DB_HOST%'
dbUser: '%DB_USER%'
dbPassword: '%DB_PASSWORD%'
tablePrefix: '%WP_TABLE_PREFIX%'
domain: '%WORDPRESS_DOMAIN%'
adminEmail: '%ADMIN_EMAIL%'
title: 'WooGraphQL Tests'
plugins:
- woocommerce/woocommerce.php
- woocommerce-gateway-stripe/woocommerce-gateway-stripe.php
- wp-graphql/wp-graphql.php
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
activatePlugins:
- woocommerce/woocommerce.php
- woocommerce-gateway-stripe/woocommerce-gateway-stripe.php
- wp-graphql/wp-graphql.php
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
32 changes: 32 additions & 0 deletions tests/functional.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,38 @@ modules:
- \Tests\WPGraphQL\Codeception\Module\WPGraphQL
- \Helper\GraphQLE2E
config:
\Tests\WPGraphQL\Codeception\Module\WPGraphQL:
endpoint: '%WORDPRESS_URL%/graphql'
\lucatume\WPBrowser\Module\WPCLI:
path: '%WP_ROOT_FOLDER%'
throw: true
\lucatume\WPBrowser\Module\WPDb:
dsn: 'mysql:host=%DB_HOST%;dbname=%DB_NAME%'
user: '%DB_USER%'
password: '%DB_PASSWORD%'
dump: 'local/db/app_db.sql'
populate: true
cleanup: true
waitlock: 10
url: '%WORDPRESS_URL%'
urlReplacement: true
tablePrefix: '%WP_TABLE_PREFIX%'
\lucatume\WPBrowser\Module\WPBrowser:
url: '%WORDPRESS_URL%'
wpRootFolder: '%WP_CORE_DIR%'
adminUsername: '%ADMIN_USERNAME%'
adminPassword: '%ADMIN_PASSWORD%'
adminPath: '/wp-admin'
\lucatume\WPBrowser\Module\REST:
depends: WPBrowser
url: '%WORDPRESS_URL%'
cookies: false
\lucatume\WPBrowser\Module\WPFilesystem:
wpRootFolder: '%WP_CORE_DIR%'
plugins: '/wp-content/plugins'
mu-plugins: '/wp-content/mu-plugins'
themes: '/wp-content/themes'
uploads: '/wp-content/uploads'
\lucatume\WPBrowser\Module\WPLoader:
loadOnly: true
wpRootFolder: '%WP_ROOT_FOLDER%'
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/QLSessionHandlerCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public function testCartMutationsWithInvalidCartSessionToken( FunctionalTester $
}

public function testCartSessionDataMutations( FunctionalTester $I, $scenario ) {
$scenario->skip( 'Test skipped until scenario can be created properly again.' );
//$scenario->skip( 'Test skipped until scenario can be created properly again.' );
/**
* Add item to the cart
*/
Expand Down
25 changes: 25 additions & 0 deletions tests/wpunit.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,29 @@ modules:
- WPDb
- WPBrowser
- WPFilesystem
config:
\lucatume\WPBrowser\Module\WPLoader:
skipInstall: true
wpRootFolder: '%WP_CORE_DIR%'
dbName: '%DB_NAME%'
dbHost: '%DB_HOST%'
dbUser: '%DB_USER%'
dbPassword: '%DB_PASSWORD%'
tablePrefix: '%WP_TABLE_PREFIX%'
domain: '%WORDPRESS_DOMAIN%'
adminEmail: '%ADMIN_EMAIL%'
title: 'WooGraphQL Tests'
plugins:
- woocommerce/woocommerce.php
- woocommerce-gateway-stripe/woocommerce-gateway-stripe.php
- wp-graphql/wp-graphql.php
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
activatePlugins:
- woocommerce/woocommerce.php
- woocommerce-gateway-stripe/woocommerce-gateway-stripe.php
- wp-graphql/wp-graphql.php
- wp-graphql-jwt-authentication/wp-graphql-jwt-authentication.php
- wp-graphql-woocommerce/wp-graphql-woocommerce.php
configFile: 'tests/_data/config.php'
bootstrap: bootstrap.php

0 comments on commit 5811db6

Please sign in to comment.